/*
 * 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/contentwarehouse/v1/document_service_request.proto

package com.google.cloud.contentwarehouse.v1;

/**
 *
 *
 * <pre>
 * Request message for DocumentService.SearchDocuments.
 * </pre>
 *
 * Protobuf type {@code google.cloud.contentwarehouse.v1.SearchDocumentsRequest}
 */
public final class SearchDocumentsRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.SearchDocumentsRequest)
    SearchDocumentsRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use SearchDocumentsRequest.newBuilder() to construct.
  private SearchDocumentsRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private SearchDocumentsRequest() {
    parent_ = "";
    pageToken_ = "";
    orderBy_ = "";
    histogramQueries_ = java.util.Collections.emptyList();
    totalResultSize_ = 0;
  }

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

  @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.contentwarehouse.v1.DocumentServiceRequestProto
        .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsRequest_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto
        .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.class,
            com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.Builder.class);
  }

  /**
   *
   *
   * <pre>
   * The total number of matching documents.
   * </pre>
   *
   * Protobuf enum {@code google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize}
   */
  public enum TotalResultSize implements com.google.protobuf.ProtocolMessageEnum {
    /**
     *
     *
     * <pre>
     * Total number calculation will be skipped.
     * </pre>
     *
     * <code>TOTAL_RESULT_SIZE_UNSPECIFIED = 0;</code>
     */
    TOTAL_RESULT_SIZE_UNSPECIFIED(0),
    /**
     *
     *
     * <pre>
     * Estimate total number. The total result size will be accurated up to
     * 10,000. This option will add cost and latency to your request.
     * </pre>
     *
     * <code>ESTIMATED_SIZE = 1;</code>
     */
    ESTIMATED_SIZE(1),
    /**
     *
     *
     * <pre>
     * It may adversely impact performance. The limit is 1000,000.
     * </pre>
     *
     * <code>ACTUAL_SIZE = 2;</code>
     */
    ACTUAL_SIZE(2),
    UNRECOGNIZED(-1),
    ;

    /**
     *
     *
     * <pre>
     * Total number calculation will be skipped.
     * </pre>
     *
     * <code>TOTAL_RESULT_SIZE_UNSPECIFIED = 0;</code>
     */
    public static final int TOTAL_RESULT_SIZE_UNSPECIFIED_VALUE = 0;
    /**
     *
     *
     * <pre>
     * Estimate total number. The total result size will be accurated up to
     * 10,000. This option will add cost and latency to your request.
     * </pre>
     *
     * <code>ESTIMATED_SIZE = 1;</code>
     */
    public static final int ESTIMATED_SIZE_VALUE = 1;
    /**
     *
     *
     * <pre>
     * It may adversely impact performance. The limit is 1000,000.
     * </pre>
     *
     * <code>ACTUAL_SIZE = 2;</code>
     */
    public static final int ACTUAL_SIZE_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 TotalResultSize 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 TotalResultSize forNumber(int value) {
      switch (value) {
        case 0:
          return TOTAL_RESULT_SIZE_UNSPECIFIED;
        case 1:
          return ESTIMATED_SIZE;
        case 2:
          return ACTUAL_SIZE;
        default:
          return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<TotalResultSize> internalGetValueMap() {
      return internalValueMap;
    }

    private static final com.google.protobuf.Internal.EnumLiteMap<TotalResultSize>
        internalValueMap =
            new com.google.protobuf.Internal.EnumLiteMap<TotalResultSize>() {
              public TotalResultSize findValueByNumber(int number) {
                return TotalResultSize.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.contentwarehouse.v1.SearchDocumentsRequest.getDescriptor()
          .getEnumTypes()
          .get(0);
    }

    private static final TotalResultSize[] VALUES = values();

    public static TotalResultSize 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 TotalResultSize(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize)
  }

  public static final int PARENT_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object parent_ = "";
  /**
   *
   *
   * <pre>
   * Required. The parent, which owns this collection of documents.
   * Format: projects/{project_number}/locations/{location}.
   * </pre>
   *
   * <code>
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The parent.
   */
  @java.lang.Override
  public java.lang.String getParent() {
    java.lang.Object ref = parent_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      parent_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The parent, which owns this collection of documents.
   * Format: projects/{project_number}/locations/{location}.
   * </pre>
   *
   * <code>
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The bytes for parent.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getParentBytes() {
    java.lang.Object ref = parent_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      parent_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int REQUEST_METADATA_FIELD_NUMBER = 3;
  private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_;
  /**
   *
   *
   * <pre>
   * The meta information collected about the end user, used to enforce access
   * control and improve the search quality of the service.
   * </pre>
   *
   * <code>.google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;</code>
   *
   * @return Whether the requestMetadata field is set.
   */
  @java.lang.Override
  public boolean hasRequestMetadata() {
    return requestMetadata_ != null;
  }
  /**
   *
   *
   * <pre>
   * The meta information collected about the end user, used to enforce access
   * control and improve the search quality of the service.
   * </pre>
   *
   * <code>.google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;</code>
   *
   * @return The requestMetadata.
   */
  @java.lang.Override
  public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() {
    return requestMetadata_ == null
        ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance()
        : requestMetadata_;
  }
  /**
   *
   *
   * <pre>
   * The meta information collected about the end user, used to enforce access
   * control and improve the search quality of the service.
   * </pre>
   *
   * <code>.google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;</code>
   */
  @java.lang.Override
  public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder
      getRequestMetadataOrBuilder() {
    return requestMetadata_ == null
        ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance()
        : requestMetadata_;
  }

  public static final int DOCUMENT_QUERY_FIELD_NUMBER = 4;
  private com.google.cloud.contentwarehouse.v1.DocumentQuery documentQuery_;
  /**
   *
   *
   * <pre>
   * Query used to search against documents (keyword, filters, etc.).
   * </pre>
   *
   * <code>.google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;</code>
   *
   * @return Whether the documentQuery field is set.
   */
  @java.lang.Override
  public boolean hasDocumentQuery() {
    return documentQuery_ != null;
  }
  /**
   *
   *
   * <pre>
   * Query used to search against documents (keyword, filters, etc.).
   * </pre>
   *
   * <code>.google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;</code>
   *
   * @return The documentQuery.
   */
  @java.lang.Override
  public com.google.cloud.contentwarehouse.v1.DocumentQuery getDocumentQuery() {
    return documentQuery_ == null
        ? com.google.cloud.contentwarehouse.v1.DocumentQuery.getDefaultInstance()
        : documentQuery_;
  }
  /**
   *
   *
   * <pre>
   * Query used to search against documents (keyword, filters, etc.).
   * </pre>
   *
   * <code>.google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;</code>
   */
  @java.lang.Override
  public com.google.cloud.contentwarehouse.v1.DocumentQueryOrBuilder getDocumentQueryOrBuilder() {
    return documentQuery_ == null
        ? com.google.cloud.contentwarehouse.v1.DocumentQuery.getDefaultInstance()
        : documentQuery_;
  }

  public static final int OFFSET_FIELD_NUMBER = 5;
  private int offset_ = 0;
  /**
   *
   *
   * <pre>
   * An integer that specifies the current offset (that is, starting result
   * location, amongst the documents deemed by the API as relevant) in search
   * results. This field is only considered if
   * [page_token][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token]
   * is unset.
   * The maximum allowed value is 5000. Otherwise an error is thrown.
   * For example, 0 means to  return results starting from the first matching
   * document, and 10 means to return from the 11th document. This can be used
   * for pagination, (for example, pageSize = 10 and offset = 10 means to return
   * from the second page).
   * </pre>
   *
   * <code>int32 offset = 5;</code>
   *
   * @return The offset.
   */
  @java.lang.Override
  public int getOffset() {
    return offset_;
  }

  public static final int PAGE_SIZE_FIELD_NUMBER = 6;
  private int pageSize_ = 0;
  /**
   *
   *
   * <pre>
   * A limit on the number of documents returned in the search results.
   * Increasing this value above the default value of 10 can increase search
   * response time. The value can be between 1 and 100.
   * </pre>
   *
   * <code>int32 page_size = 6;</code>
   *
   * @return The pageSize.
   */
  @java.lang.Override
  public int getPageSize() {
    return pageSize_;
  }

  public static final int PAGE_TOKEN_FIELD_NUMBER = 7;

  @SuppressWarnings("serial")
  private volatile java.lang.Object pageToken_ = "";
  /**
   *
   *
   * <pre>
   * The token specifying the current offset within search results.
   * See
   * [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token]
   * for an explanation of how to obtain the next set of query results.
   * </pre>
   *
   * <code>string page_token = 7;</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>
   * The token specifying the current offset within search results.
   * See
   * [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token]
   * for an explanation of how to obtain the next set of query results.
   * </pre>
   *
   * <code>string page_token = 7;</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 ORDER_BY_FIELD_NUMBER = 8;

  @SuppressWarnings("serial")
  private volatile java.lang.Object orderBy_ = "";
  /**
   *
   *
   * <pre>
   * The criteria determining how search results are sorted. For non-empty
   * query, default is `"relevance desc"`. For empty query, default is
   * `"upload_date desc"`.
   * Supported options are:
   * * `"relevance desc"`: By relevance descending, as determined by the API
   *   algorithms.
   * * `"upload_date desc"`: By upload date descending.
   * * `"upload_date"`: By upload date ascending.
   * * `"update_date desc"`: By last updated date descending.
   * * `"update_date"`: By last updated date ascending.
   * * `"retrieval_importance desc"`: By retrieval importance of properties
   *   descending. This feature is still under development, please do not use
   *   unless otherwise instructed to do so.
   * </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 criteria determining how search results are sorted. For non-empty
   * query, default is `"relevance desc"`. For empty query, default is
   * `"upload_date desc"`.
   * Supported options are:
   * * `"relevance desc"`: By relevance descending, as determined by the API
   *   algorithms.
   * * `"upload_date desc"`: By upload date descending.
   * * `"upload_date"`: By upload date ascending.
   * * `"update_date desc"`: By last updated date descending.
   * * `"update_date"`: By last updated date ascending.
   * * `"retrieval_importance desc"`: By retrieval importance of properties
   *   descending. This feature is still under development, please do not use
   *   unless otherwise instructed to do so.
   * </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 HISTOGRAM_QUERIES_FIELD_NUMBER = 9;

  @SuppressWarnings("serial")
  private java.util.List<com.google.cloud.contentwarehouse.v1.HistogramQuery> histogramQueries_;
  /**
   *
   *
   * <pre>
   * An expression specifying a histogram request against matching
   * documents. Expression syntax is an aggregation function call with
   * histogram facets and other options.
   * The following aggregation functions are supported:
   * * `count(string_histogram_facet)`: Count the number of matching entities
   * for each distinct attribute value.
   * Data types:
   * * Histogram facet (aka filterable properties): Facet names with format
   * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
   * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
   * facet, then the parent hierarchy needs to be specified separated by
   * dots in the prefix after the schema id. Thus, the format for a multi-
   * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
   * &amp;lt;child facet name&amp;gt;. Example:
   * schema123.root_parent_facet.middle_facet.child_facet
   * * DocumentSchemaId: (with no schema id prefix) to get
   * histograms for each document type (returns the schema id path, e.g.
   * projects/12345/locations/us-west/documentSchemas/abc123).
   * Example expression:
   * * Document type counts:
   *   count('DocumentSchemaId')
   * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
   *   count('abc123.MORTGAGE_TYPE')
   * </pre>
   *
   * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.contentwarehouse.v1.HistogramQuery>
      getHistogramQueriesList() {
    return histogramQueries_;
  }
  /**
   *
   *
   * <pre>
   * An expression specifying a histogram request against matching
   * documents. Expression syntax is an aggregation function call with
   * histogram facets and other options.
   * The following aggregation functions are supported:
   * * `count(string_histogram_facet)`: Count the number of matching entities
   * for each distinct attribute value.
   * Data types:
   * * Histogram facet (aka filterable properties): Facet names with format
   * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
   * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
   * facet, then the parent hierarchy needs to be specified separated by
   * dots in the prefix after the schema id. Thus, the format for a multi-
   * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
   * &amp;lt;child facet name&amp;gt;. Example:
   * schema123.root_parent_facet.middle_facet.child_facet
   * * DocumentSchemaId: (with no schema id prefix) to get
   * histograms for each document type (returns the schema id path, e.g.
   * projects/12345/locations/us-west/documentSchemas/abc123).
   * Example expression:
   * * Document type counts:
   *   count('DocumentSchemaId')
   * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
   *   count('abc123.MORTGAGE_TYPE')
   * </pre>
   *
   * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.contentwarehouse.v1.HistogramQueryOrBuilder>
      getHistogramQueriesOrBuilderList() {
    return histogramQueries_;
  }
  /**
   *
   *
   * <pre>
   * An expression specifying a histogram request against matching
   * documents. Expression syntax is an aggregation function call with
   * histogram facets and other options.
   * The following aggregation functions are supported:
   * * `count(string_histogram_facet)`: Count the number of matching entities
   * for each distinct attribute value.
   * Data types:
   * * Histogram facet (aka filterable properties): Facet names with format
   * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
   * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
   * facet, then the parent hierarchy needs to be specified separated by
   * dots in the prefix after the schema id. Thus, the format for a multi-
   * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
   * &amp;lt;child facet name&amp;gt;. Example:
   * schema123.root_parent_facet.middle_facet.child_facet
   * * DocumentSchemaId: (with no schema id prefix) to get
   * histograms for each document type (returns the schema id path, e.g.
   * projects/12345/locations/us-west/documentSchemas/abc123).
   * Example expression:
   * * Document type counts:
   *   count('DocumentSchemaId')
   * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
   *   count('abc123.MORTGAGE_TYPE')
   * </pre>
   *
   * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
   */
  @java.lang.Override
  public int getHistogramQueriesCount() {
    return histogramQueries_.size();
  }
  /**
   *
   *
   * <pre>
   * An expression specifying a histogram request against matching
   * documents. Expression syntax is an aggregation function call with
   * histogram facets and other options.
   * The following aggregation functions are supported:
   * * `count(string_histogram_facet)`: Count the number of matching entities
   * for each distinct attribute value.
   * Data types:
   * * Histogram facet (aka filterable properties): Facet names with format
   * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
   * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
   * facet, then the parent hierarchy needs to be specified separated by
   * dots in the prefix after the schema id. Thus, the format for a multi-
   * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
   * &amp;lt;child facet name&amp;gt;. Example:
   * schema123.root_parent_facet.middle_facet.child_facet
   * * DocumentSchemaId: (with no schema id prefix) to get
   * histograms for each document type (returns the schema id path, e.g.
   * projects/12345/locations/us-west/documentSchemas/abc123).
   * Example expression:
   * * Document type counts:
   *   count('DocumentSchemaId')
   * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
   *   count('abc123.MORTGAGE_TYPE')
   * </pre>
   *
   * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
   */
  @java.lang.Override
  public com.google.cloud.contentwarehouse.v1.HistogramQuery getHistogramQueries(int index) {
    return histogramQueries_.get(index);
  }
  /**
   *
   *
   * <pre>
   * An expression specifying a histogram request against matching
   * documents. Expression syntax is an aggregation function call with
   * histogram facets and other options.
   * The following aggregation functions are supported:
   * * `count(string_histogram_facet)`: Count the number of matching entities
   * for each distinct attribute value.
   * Data types:
   * * Histogram facet (aka filterable properties): Facet names with format
   * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
   * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
   * facet, then the parent hierarchy needs to be specified separated by
   * dots in the prefix after the schema id. Thus, the format for a multi-
   * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
   * &amp;lt;child facet name&amp;gt;. Example:
   * schema123.root_parent_facet.middle_facet.child_facet
   * * DocumentSchemaId: (with no schema id prefix) to get
   * histograms for each document type (returns the schema id path, e.g.
   * projects/12345/locations/us-west/documentSchemas/abc123).
   * Example expression:
   * * Document type counts:
   *   count('DocumentSchemaId')
   * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
   *   count('abc123.MORTGAGE_TYPE')
   * </pre>
   *
   * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
   */
  @java.lang.Override
  public com.google.cloud.contentwarehouse.v1.HistogramQueryOrBuilder getHistogramQueriesOrBuilder(
      int index) {
    return histogramQueries_.get(index);
  }

  public static final int REQUIRE_TOTAL_SIZE_FIELD_NUMBER = 10;
  private boolean requireTotalSize_ = false;
  /**
   *
   *
   * <pre>
   * Controls if the search document request requires the return of a total size
   * of matched documents. See
   * [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
   * Enabling this flag may adversely impact performance. Hint: If this is
   * used with pagination, set this flag on the initial query but set this
   * to false on subsequent page calls (keep the total count locally).
   * Defaults to false.
   * </pre>
   *
   * <code>bool require_total_size = 10;</code>
   *
   * @return The requireTotalSize.
   */
  @java.lang.Override
  public boolean getRequireTotalSize() {
    return requireTotalSize_;
  }

  public static final int TOTAL_RESULT_SIZE_FIELD_NUMBER = 12;
  private int totalResultSize_ = 0;
  /**
   *
   *
   * <pre>
   * Controls if the search document request requires the return of a total size
   * of matched documents. See
   * [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
   * </pre>
   *
   * <code>
   * .google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize total_result_size = 12;
   * </code>
   *
   * @return The enum numeric value on the wire for totalResultSize.
   */
  @java.lang.Override
  public int getTotalResultSizeValue() {
    return totalResultSize_;
  }
  /**
   *
   *
   * <pre>
   * Controls if the search document request requires the return of a total size
   * of matched documents. See
   * [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
   * </pre>
   *
   * <code>
   * .google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize total_result_size = 12;
   * </code>
   *
   * @return The totalResultSize.
   */
  @java.lang.Override
  public com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize
      getTotalResultSize() {
    com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize result =
        com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize.forNumber(
            totalResultSize_);
    return result == null
        ? com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize.UNRECOGNIZED
        : result;
  }

  public static final int QA_SIZE_LIMIT_FIELD_NUMBER = 11;
  private int qaSizeLimit_ = 0;
  /**
   *
   *
   * <pre>
   * Experimental, do not use.
   * The limit on the number of documents returned for the question-answering
   * feature. To enable the question-answering feature, set
   * [DocumentQuery].[is_nl_query][] to true.
   * </pre>
   *
   * <code>int32 qa_size_limit = 11;</code>
   *
   * @return The qaSizeLimit.
   */
  @java.lang.Override
  public int getQaSizeLimit() {
    return qaSizeLimit_;
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
    }
    if (requestMetadata_ != null) {
      output.writeMessage(3, getRequestMetadata());
    }
    if (documentQuery_ != null) {
      output.writeMessage(4, getDocumentQuery());
    }
    if (offset_ != 0) {
      output.writeInt32(5, offset_);
    }
    if (pageSize_ != 0) {
      output.writeInt32(6, pageSize_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 7, pageToken_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 8, orderBy_);
    }
    for (int i = 0; i < histogramQueries_.size(); i++) {
      output.writeMessage(9, histogramQueries_.get(i));
    }
    if (requireTotalSize_ != false) {
      output.writeBool(10, requireTotalSize_);
    }
    if (qaSizeLimit_ != 0) {
      output.writeInt32(11, qaSizeLimit_);
    }
    if (totalResultSize_
        != com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize
            .TOTAL_RESULT_SIZE_UNSPECIFIED
            .getNumber()) {
      output.writeEnum(12, totalResultSize_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
    }
    if (requestMetadata_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRequestMetadata());
    }
    if (documentQuery_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDocumentQuery());
    }
    if (offset_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, offset_);
    }
    if (pageSize_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, pageSize_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, pageToken_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, orderBy_);
    }
    for (int i = 0; i < histogramQueries_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, histogramQueries_.get(i));
    }
    if (requireTotalSize_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(10, requireTotalSize_);
    }
    if (qaSizeLimit_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(11, qaSizeLimit_);
    }
    if (totalResultSize_
        != com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize
            .TOTAL_RESULT_SIZE_UNSPECIFIED
            .getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, totalResultSize_);
    }
    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.contentwarehouse.v1.SearchDocumentsRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest other =
        (com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest) obj;

    if (!getParent().equals(other.getParent())) return false;
    if (hasRequestMetadata() != other.hasRequestMetadata()) return false;
    if (hasRequestMetadata()) {
      if (!getRequestMetadata().equals(other.getRequestMetadata())) return false;
    }
    if (hasDocumentQuery() != other.hasDocumentQuery()) return false;
    if (hasDocumentQuery()) {
      if (!getDocumentQuery().equals(other.getDocumentQuery())) return false;
    }
    if (getOffset() != other.getOffset()) return false;
    if (getPageSize() != other.getPageSize()) return false;
    if (!getPageToken().equals(other.getPageToken())) return false;
    if (!getOrderBy().equals(other.getOrderBy())) return false;
    if (!getHistogramQueriesList().equals(other.getHistogramQueriesList())) return false;
    if (getRequireTotalSize() != other.getRequireTotalSize()) return false;
    if (totalResultSize_ != other.totalResultSize_) return false;
    if (getQaSizeLimit() != other.getQaSizeLimit()) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + PARENT_FIELD_NUMBER;
    hash = (53 * hash) + getParent().hashCode();
    if (hasRequestMetadata()) {
      hash = (37 * hash) + REQUEST_METADATA_FIELD_NUMBER;
      hash = (53 * hash) + getRequestMetadata().hashCode();
    }
    if (hasDocumentQuery()) {
      hash = (37 * hash) + DOCUMENT_QUERY_FIELD_NUMBER;
      hash = (53 * hash) + getDocumentQuery().hashCode();
    }
    hash = (37 * hash) + OFFSET_FIELD_NUMBER;
    hash = (53 * hash) + getOffset();
    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) + ORDER_BY_FIELD_NUMBER;
    hash = (53 * hash) + getOrderBy().hashCode();
    if (getHistogramQueriesCount() > 0) {
      hash = (37 * hash) + HISTOGRAM_QUERIES_FIELD_NUMBER;
      hash = (53 * hash) + getHistogramQueriesList().hashCode();
    }
    hash = (37 * hash) + REQUIRE_TOTAL_SIZE_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequireTotalSize());
    hash = (37 * hash) + TOTAL_RESULT_SIZE_FIELD_NUMBER;
    hash = (53 * hash) + totalResultSize_;
    hash = (37 * hash) + QA_SIZE_LIMIT_FIELD_NUMBER;
    hash = (53 * hash) + getQaSizeLimit();
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

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

  public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest 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.contentwarehouse.v1.SearchDocumentsRequest parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest 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.contentwarehouse.v1.SearchDocumentsRequest parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest 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.contentwarehouse.v1.SearchDocumentsRequest 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 DocumentService.SearchDocuments.
   * </pre>
   *
   * Protobuf type {@code google.cloud.contentwarehouse.v1.SearchDocumentsRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.SearchDocumentsRequest)
      com.google.cloud.contentwarehouse.v1.SearchDocumentsRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto
          .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsRequest_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto
          .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.class,
              com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.Builder.class);
    }

    // Construct using com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      parent_ = "";
      requestMetadata_ = null;
      if (requestMetadataBuilder_ != null) {
        requestMetadataBuilder_.dispose();
        requestMetadataBuilder_ = null;
      }
      documentQuery_ = null;
      if (documentQueryBuilder_ != null) {
        documentQueryBuilder_.dispose();
        documentQueryBuilder_ = null;
      }
      offset_ = 0;
      pageSize_ = 0;
      pageToken_ = "";
      orderBy_ = "";
      if (histogramQueriesBuilder_ == null) {
        histogramQueries_ = java.util.Collections.emptyList();
      } else {
        histogramQueries_ = null;
        histogramQueriesBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000080);
      requireTotalSize_ = false;
      totalResultSize_ = 0;
      qaSizeLimit_ = 0;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.contentwarehouse.v1.DocumentServiceRequestProto
          .internal_static_google_cloud_contentwarehouse_v1_SearchDocumentsRequest_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest getDefaultInstanceForType() {
      return com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.getDefaultInstance();
    }

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

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

    private void buildPartialRepeatedFields(
        com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest result) {
      if (histogramQueriesBuilder_ == null) {
        if (((bitField0_ & 0x00000080) != 0)) {
          histogramQueries_ = java.util.Collections.unmodifiableList(histogramQueries_);
          bitField0_ = (bitField0_ & ~0x00000080);
        }
        result.histogramQueries_ = histogramQueries_;
      } else {
        result.histogramQueries_ = histogramQueriesBuilder_.build();
      }
    }

    private void buildPartial0(com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.parent_ = parent_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.requestMetadata_ =
            requestMetadataBuilder_ == null ? requestMetadata_ : requestMetadataBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.documentQuery_ =
            documentQueryBuilder_ == null ? documentQuery_ : documentQueryBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.offset_ = offset_;
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.pageSize_ = pageSize_;
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        result.pageToken_ = pageToken_;
      }
      if (((from_bitField0_ & 0x00000040) != 0)) {
        result.orderBy_ = orderBy_;
      }
      if (((from_bitField0_ & 0x00000100) != 0)) {
        result.requireTotalSize_ = requireTotalSize_;
      }
      if (((from_bitField0_ & 0x00000200) != 0)) {
        result.totalResultSize_ = totalResultSize_;
      }
      if (((from_bitField0_ & 0x00000400) != 0)) {
        result.qaSizeLimit_ = qaSizeLimit_;
      }
    }

    @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.contentwarehouse.v1.SearchDocumentsRequest) {
        return mergeFrom((com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest other) {
      if (other == com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.getDefaultInstance())
        return this;
      if (!other.getParent().isEmpty()) {
        parent_ = other.parent_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (other.hasRequestMetadata()) {
        mergeRequestMetadata(other.getRequestMetadata());
      }
      if (other.hasDocumentQuery()) {
        mergeDocumentQuery(other.getDocumentQuery());
      }
      if (other.getOffset() != 0) {
        setOffset(other.getOffset());
      }
      if (other.getPageSize() != 0) {
        setPageSize(other.getPageSize());
      }
      if (!other.getPageToken().isEmpty()) {
        pageToken_ = other.pageToken_;
        bitField0_ |= 0x00000020;
        onChanged();
      }
      if (!other.getOrderBy().isEmpty()) {
        orderBy_ = other.orderBy_;
        bitField0_ |= 0x00000040;
        onChanged();
      }
      if (histogramQueriesBuilder_ == null) {
        if (!other.histogramQueries_.isEmpty()) {
          if (histogramQueries_.isEmpty()) {
            histogramQueries_ = other.histogramQueries_;
            bitField0_ = (bitField0_ & ~0x00000080);
          } else {
            ensureHistogramQueriesIsMutable();
            histogramQueries_.addAll(other.histogramQueries_);
          }
          onChanged();
        }
      } else {
        if (!other.histogramQueries_.isEmpty()) {
          if (histogramQueriesBuilder_.isEmpty()) {
            histogramQueriesBuilder_.dispose();
            histogramQueriesBuilder_ = null;
            histogramQueries_ = other.histogramQueries_;
            bitField0_ = (bitField0_ & ~0x00000080);
            histogramQueriesBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getHistogramQueriesFieldBuilder()
                    : null;
          } else {
            histogramQueriesBuilder_.addAllMessages(other.histogramQueries_);
          }
        }
      }
      if (other.getRequireTotalSize() != false) {
        setRequireTotalSize(other.getRequireTotalSize());
      }
      if (other.totalResultSize_ != 0) {
        setTotalResultSizeValue(other.getTotalResultSizeValue());
      }
      if (other.getQaSizeLimit() != 0) {
        setQaSizeLimit(other.getQaSizeLimit());
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                parent_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 26:
              {
                input.readMessage(getRequestMetadataFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000002;
                break;
              } // case 26
            case 34:
              {
                input.readMessage(getDocumentQueryFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000004;
                break;
              } // case 34
            case 40:
              {
                offset_ = input.readInt32();
                bitField0_ |= 0x00000008;
                break;
              } // case 40
            case 48:
              {
                pageSize_ = input.readInt32();
                bitField0_ |= 0x00000010;
                break;
              } // case 48
            case 58:
              {
                pageToken_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000020;
                break;
              } // case 58
            case 66:
              {
                orderBy_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000040;
                break;
              } // case 66
            case 74:
              {
                com.google.cloud.contentwarehouse.v1.HistogramQuery m =
                    input.readMessage(
                        com.google.cloud.contentwarehouse.v1.HistogramQuery.parser(),
                        extensionRegistry);
                if (histogramQueriesBuilder_ == null) {
                  ensureHistogramQueriesIsMutable();
                  histogramQueries_.add(m);
                } else {
                  histogramQueriesBuilder_.addMessage(m);
                }
                break;
              } // case 74
            case 80:
              {
                requireTotalSize_ = input.readBool();
                bitField0_ |= 0x00000100;
                break;
              } // case 80
            case 88:
              {
                qaSizeLimit_ = input.readInt32();
                bitField0_ |= 0x00000400;
                break;
              } // case 88
            case 96:
              {
                totalResultSize_ = input.readEnum();
                bitField0_ |= 0x00000200;
                break;
              } // case 96
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private java.lang.Object parent_ = "";
    /**
     *
     *
     * <pre>
     * Required. The parent, which owns this collection of documents.
     * Format: projects/{project_number}/locations/{location}.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The parent.
     */
    public java.lang.String getParent() {
      java.lang.Object ref = parent_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        parent_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The parent, which owns this collection of documents.
     * Format: projects/{project_number}/locations/{location}.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The bytes for parent.
     */
    public com.google.protobuf.ByteString getParentBytes() {
      java.lang.Object ref = parent_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        parent_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The parent, which owns this collection of documents.
     * Format: projects/{project_number}/locations/{location}.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The parent to set.
     * @return This builder for chaining.
     */
    public Builder setParent(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      parent_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The parent, which owns this collection of documents.
     * Format: projects/{project_number}/locations/{location}.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearParent() {
      parent_ = getDefaultInstance().getParent();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The parent, which owns this collection of documents.
     * Format: projects/{project_number}/locations/{location}.
     * </pre>
     *
     * <code>
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The bytes for parent to set.
     * @return This builder for chaining.
     */
    public Builder setParentBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      parent_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.contentwarehouse.v1.RequestMetadata,
            com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder,
            com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder>
        requestMetadataBuilder_;
    /**
     *
     *
     * <pre>
     * The meta information collected about the end user, used to enforce access
     * control and improve the search quality of the service.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;</code>
     *
     * @return Whether the requestMetadata field is set.
     */
    public boolean hasRequestMetadata() {
      return ((bitField0_ & 0x00000002) != 0);
    }
    /**
     *
     *
     * <pre>
     * The meta information collected about the end user, used to enforce access
     * control and improve the search quality of the service.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;</code>
     *
     * @return The requestMetadata.
     */
    public com.google.cloud.contentwarehouse.v1.RequestMetadata getRequestMetadata() {
      if (requestMetadataBuilder_ == null) {
        return requestMetadata_ == null
            ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance()
            : requestMetadata_;
      } else {
        return requestMetadataBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The meta information collected about the end user, used to enforce access
     * control and improve the search quality of the service.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;</code>
     */
    public Builder setRequestMetadata(com.google.cloud.contentwarehouse.v1.RequestMetadata value) {
      if (requestMetadataBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        requestMetadata_ = value;
      } else {
        requestMetadataBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The meta information collected about the end user, used to enforce access
     * control and improve the search quality of the service.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;</code>
     */
    public Builder setRequestMetadata(
        com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder builderForValue) {
      if (requestMetadataBuilder_ == null) {
        requestMetadata_ = builderForValue.build();
      } else {
        requestMetadataBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The meta information collected about the end user, used to enforce access
     * control and improve the search quality of the service.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;</code>
     */
    public Builder mergeRequestMetadata(
        com.google.cloud.contentwarehouse.v1.RequestMetadata value) {
      if (requestMetadataBuilder_ == null) {
        if (((bitField0_ & 0x00000002) != 0)
            && requestMetadata_ != null
            && requestMetadata_
                != com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance()) {
          getRequestMetadataBuilder().mergeFrom(value);
        } else {
          requestMetadata_ = value;
        }
      } else {
        requestMetadataBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The meta information collected about the end user, used to enforce access
     * control and improve the search quality of the service.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;</code>
     */
    public Builder clearRequestMetadata() {
      bitField0_ = (bitField0_ & ~0x00000002);
      requestMetadata_ = null;
      if (requestMetadataBuilder_ != null) {
        requestMetadataBuilder_.dispose();
        requestMetadataBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The meta information collected about the end user, used to enforce access
     * control and improve the search quality of the service.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;</code>
     */
    public com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder
        getRequestMetadataBuilder() {
      bitField0_ |= 0x00000002;
      onChanged();
      return getRequestMetadataFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The meta information collected about the end user, used to enforce access
     * control and improve the search quality of the service.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;</code>
     */
    public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder
        getRequestMetadataOrBuilder() {
      if (requestMetadataBuilder_ != null) {
        return requestMetadataBuilder_.getMessageOrBuilder();
      } else {
        return requestMetadata_ == null
            ? com.google.cloud.contentwarehouse.v1.RequestMetadata.getDefaultInstance()
            : requestMetadata_;
      }
    }
    /**
     *
     *
     * <pre>
     * The meta information collected about the end user, used to enforce access
     * control and improve the search quality of the service.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.contentwarehouse.v1.RequestMetadata,
            com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder,
            com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder>
        getRequestMetadataFieldBuilder() {
      if (requestMetadataBuilder_ == null) {
        requestMetadataBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.contentwarehouse.v1.RequestMetadata,
                com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder,
                com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder>(
                getRequestMetadata(), getParentForChildren(), isClean());
        requestMetadata_ = null;
      }
      return requestMetadataBuilder_;
    }

    private com.google.cloud.contentwarehouse.v1.DocumentQuery documentQuery_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.contentwarehouse.v1.DocumentQuery,
            com.google.cloud.contentwarehouse.v1.DocumentQuery.Builder,
            com.google.cloud.contentwarehouse.v1.DocumentQueryOrBuilder>
        documentQueryBuilder_;
    /**
     *
     *
     * <pre>
     * Query used to search against documents (keyword, filters, etc.).
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;</code>
     *
     * @return Whether the documentQuery field is set.
     */
    public boolean hasDocumentQuery() {
      return ((bitField0_ & 0x00000004) != 0);
    }
    /**
     *
     *
     * <pre>
     * Query used to search against documents (keyword, filters, etc.).
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;</code>
     *
     * @return The documentQuery.
     */
    public com.google.cloud.contentwarehouse.v1.DocumentQuery getDocumentQuery() {
      if (documentQueryBuilder_ == null) {
        return documentQuery_ == null
            ? com.google.cloud.contentwarehouse.v1.DocumentQuery.getDefaultInstance()
            : documentQuery_;
      } else {
        return documentQueryBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Query used to search against documents (keyword, filters, etc.).
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;</code>
     */
    public Builder setDocumentQuery(com.google.cloud.contentwarehouse.v1.DocumentQuery value) {
      if (documentQueryBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        documentQuery_ = value;
      } else {
        documentQueryBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Query used to search against documents (keyword, filters, etc.).
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;</code>
     */
    public Builder setDocumentQuery(
        com.google.cloud.contentwarehouse.v1.DocumentQuery.Builder builderForValue) {
      if (documentQueryBuilder_ == null) {
        documentQuery_ = builderForValue.build();
      } else {
        documentQueryBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Query used to search against documents (keyword, filters, etc.).
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;</code>
     */
    public Builder mergeDocumentQuery(com.google.cloud.contentwarehouse.v1.DocumentQuery value) {
      if (documentQueryBuilder_ == null) {
        if (((bitField0_ & 0x00000004) != 0)
            && documentQuery_ != null
            && documentQuery_
                != com.google.cloud.contentwarehouse.v1.DocumentQuery.getDefaultInstance()) {
          getDocumentQueryBuilder().mergeFrom(value);
        } else {
          documentQuery_ = value;
        }
      } else {
        documentQueryBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Query used to search against documents (keyword, filters, etc.).
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;</code>
     */
    public Builder clearDocumentQuery() {
      bitField0_ = (bitField0_ & ~0x00000004);
      documentQuery_ = null;
      if (documentQueryBuilder_ != null) {
        documentQueryBuilder_.dispose();
        documentQueryBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Query used to search against documents (keyword, filters, etc.).
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;</code>
     */
    public com.google.cloud.contentwarehouse.v1.DocumentQuery.Builder getDocumentQueryBuilder() {
      bitField0_ |= 0x00000004;
      onChanged();
      return getDocumentQueryFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Query used to search against documents (keyword, filters, etc.).
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;</code>
     */
    public com.google.cloud.contentwarehouse.v1.DocumentQueryOrBuilder getDocumentQueryOrBuilder() {
      if (documentQueryBuilder_ != null) {
        return documentQueryBuilder_.getMessageOrBuilder();
      } else {
        return documentQuery_ == null
            ? com.google.cloud.contentwarehouse.v1.DocumentQuery.getDefaultInstance()
            : documentQuery_;
      }
    }
    /**
     *
     *
     * <pre>
     * Query used to search against documents (keyword, filters, etc.).
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.contentwarehouse.v1.DocumentQuery,
            com.google.cloud.contentwarehouse.v1.DocumentQuery.Builder,
            com.google.cloud.contentwarehouse.v1.DocumentQueryOrBuilder>
        getDocumentQueryFieldBuilder() {
      if (documentQueryBuilder_ == null) {
        documentQueryBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.contentwarehouse.v1.DocumentQuery,
                com.google.cloud.contentwarehouse.v1.DocumentQuery.Builder,
                com.google.cloud.contentwarehouse.v1.DocumentQueryOrBuilder>(
                getDocumentQuery(), getParentForChildren(), isClean());
        documentQuery_ = null;
      }
      return documentQueryBuilder_;
    }

    private int offset_;
    /**
     *
     *
     * <pre>
     * An integer that specifies the current offset (that is, starting result
     * location, amongst the documents deemed by the API as relevant) in search
     * results. This field is only considered if
     * [page_token][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token]
     * is unset.
     * The maximum allowed value is 5000. Otherwise an error is thrown.
     * For example, 0 means to  return results starting from the first matching
     * document, and 10 means to return from the 11th document. This can be used
     * for pagination, (for example, pageSize = 10 and offset = 10 means to return
     * from the second page).
     * </pre>
     *
     * <code>int32 offset = 5;</code>
     *
     * @return The offset.
     */
    @java.lang.Override
    public int getOffset() {
      return offset_;
    }
    /**
     *
     *
     * <pre>
     * An integer that specifies the current offset (that is, starting result
     * location, amongst the documents deemed by the API as relevant) in search
     * results. This field is only considered if
     * [page_token][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token]
     * is unset.
     * The maximum allowed value is 5000. Otherwise an error is thrown.
     * For example, 0 means to  return results starting from the first matching
     * document, and 10 means to return from the 11th document. This can be used
     * for pagination, (for example, pageSize = 10 and offset = 10 means to return
     * from the second page).
     * </pre>
     *
     * <code>int32 offset = 5;</code>
     *
     * @param value The offset to set.
     * @return This builder for chaining.
     */
    public Builder setOffset(int value) {

      offset_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * An integer that specifies the current offset (that is, starting result
     * location, amongst the documents deemed by the API as relevant) in search
     * results. This field is only considered if
     * [page_token][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token]
     * is unset.
     * The maximum allowed value is 5000. Otherwise an error is thrown.
     * For example, 0 means to  return results starting from the first matching
     * document, and 10 means to return from the 11th document. This can be used
     * for pagination, (for example, pageSize = 10 and offset = 10 means to return
     * from the second page).
     * </pre>
     *
     * <code>int32 offset = 5;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearOffset() {
      bitField0_ = (bitField0_ & ~0x00000008);
      offset_ = 0;
      onChanged();
      return this;
    }

    private int pageSize_;
    /**
     *
     *
     * <pre>
     * A limit on the number of documents returned in the search results.
     * Increasing this value above the default value of 10 can increase search
     * response time. The value can be between 1 and 100.
     * </pre>
     *
     * <code>int32 page_size = 6;</code>
     *
     * @return The pageSize.
     */
    @java.lang.Override
    public int getPageSize() {
      return pageSize_;
    }
    /**
     *
     *
     * <pre>
     * A limit on the number of documents returned in the search results.
     * Increasing this value above the default value of 10 can increase search
     * response time. The value can be between 1 and 100.
     * </pre>
     *
     * <code>int32 page_size = 6;</code>
     *
     * @param value The pageSize to set.
     * @return This builder for chaining.
     */
    public Builder setPageSize(int value) {

      pageSize_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A limit on the number of documents returned in the search results.
     * Increasing this value above the default value of 10 can increase search
     * response time. The value can be between 1 and 100.
     * </pre>
     *
     * <code>int32 page_size = 6;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPageSize() {
      bitField0_ = (bitField0_ & ~0x00000010);
      pageSize_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object pageToken_ = "";
    /**
     *
     *
     * <pre>
     * The token specifying the current offset within search results.
     * See
     * [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token]
     * for an explanation of how to obtain the next set of query results.
     * </pre>
     *
     * <code>string page_token = 7;</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>
     * The token specifying the current offset within search results.
     * See
     * [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token]
     * for an explanation of how to obtain the next set of query results.
     * </pre>
     *
     * <code>string page_token = 7;</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>
     * The token specifying the current offset within search results.
     * See
     * [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token]
     * for an explanation of how to obtain the next set of query results.
     * </pre>
     *
     * <code>string page_token = 7;</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_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The token specifying the current offset within search results.
     * See
     * [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token]
     * for an explanation of how to obtain the next set of query results.
     * </pre>
     *
     * <code>string page_token = 7;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPageToken() {
      pageToken_ = getDefaultInstance().getPageToken();
      bitField0_ = (bitField0_ & ~0x00000020);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The token specifying the current offset within search results.
     * See
     * [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token]
     * for an explanation of how to obtain the next set of query results.
     * </pre>
     *
     * <code>string page_token = 7;</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_ |= 0x00000020;
      onChanged();
      return this;
    }

    private java.lang.Object orderBy_ = "";
    /**
     *
     *
     * <pre>
     * The criteria determining how search results are sorted. For non-empty
     * query, default is `"relevance desc"`. For empty query, default is
     * `"upload_date desc"`.
     * Supported options are:
     * * `"relevance desc"`: By relevance descending, as determined by the API
     *   algorithms.
     * * `"upload_date desc"`: By upload date descending.
     * * `"upload_date"`: By upload date ascending.
     * * `"update_date desc"`: By last updated date descending.
     * * `"update_date"`: By last updated date ascending.
     * * `"retrieval_importance desc"`: By retrieval importance of properties
     *   descending. This feature is still under development, please do not use
     *   unless otherwise instructed to do so.
     * </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 criteria determining how search results are sorted. For non-empty
     * query, default is `"relevance desc"`. For empty query, default is
     * `"upload_date desc"`.
     * Supported options are:
     * * `"relevance desc"`: By relevance descending, as determined by the API
     *   algorithms.
     * * `"upload_date desc"`: By upload date descending.
     * * `"upload_date"`: By upload date ascending.
     * * `"update_date desc"`: By last updated date descending.
     * * `"update_date"`: By last updated date ascending.
     * * `"retrieval_importance desc"`: By retrieval importance of properties
     *   descending. This feature is still under development, please do not use
     *   unless otherwise instructed to do so.
     * </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 criteria determining how search results are sorted. For non-empty
     * query, default is `"relevance desc"`. For empty query, default is
     * `"upload_date desc"`.
     * Supported options are:
     * * `"relevance desc"`: By relevance descending, as determined by the API
     *   algorithms.
     * * `"upload_date desc"`: By upload date descending.
     * * `"upload_date"`: By upload date ascending.
     * * `"update_date desc"`: By last updated date descending.
     * * `"update_date"`: By last updated date ascending.
     * * `"retrieval_importance desc"`: By retrieval importance of properties
     *   descending. This feature is still under development, please do not use
     *   unless otherwise instructed to do so.
     * </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_ |= 0x00000040;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The criteria determining how search results are sorted. For non-empty
     * query, default is `"relevance desc"`. For empty query, default is
     * `"upload_date desc"`.
     * Supported options are:
     * * `"relevance desc"`: By relevance descending, as determined by the API
     *   algorithms.
     * * `"upload_date desc"`: By upload date descending.
     * * `"upload_date"`: By upload date ascending.
     * * `"update_date desc"`: By last updated date descending.
     * * `"update_date"`: By last updated date ascending.
     * * `"retrieval_importance desc"`: By retrieval importance of properties
     *   descending. This feature is still under development, please do not use
     *   unless otherwise instructed to do so.
     * </pre>
     *
     * <code>string order_by = 8;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearOrderBy() {
      orderBy_ = getDefaultInstance().getOrderBy();
      bitField0_ = (bitField0_ & ~0x00000040);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The criteria determining how search results are sorted. For non-empty
     * query, default is `"relevance desc"`. For empty query, default is
     * `"upload_date desc"`.
     * Supported options are:
     * * `"relevance desc"`: By relevance descending, as determined by the API
     *   algorithms.
     * * `"upload_date desc"`: By upload date descending.
     * * `"upload_date"`: By upload date ascending.
     * * `"update_date desc"`: By last updated date descending.
     * * `"update_date"`: By last updated date ascending.
     * * `"retrieval_importance desc"`: By retrieval importance of properties
     *   descending. This feature is still under development, please do not use
     *   unless otherwise instructed to do so.
     * </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_ |= 0x00000040;
      onChanged();
      return this;
    }

    private java.util.List<com.google.cloud.contentwarehouse.v1.HistogramQuery> histogramQueries_ =
        java.util.Collections.emptyList();

    private void ensureHistogramQueriesIsMutable() {
      if (!((bitField0_ & 0x00000080) != 0)) {
        histogramQueries_ =
            new java.util.ArrayList<com.google.cloud.contentwarehouse.v1.HistogramQuery>(
                histogramQueries_);
        bitField0_ |= 0x00000080;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.contentwarehouse.v1.HistogramQuery,
            com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder,
            com.google.cloud.contentwarehouse.v1.HistogramQueryOrBuilder>
        histogramQueriesBuilder_;

    /**
     *
     *
     * <pre>
     * An expression specifying a histogram request against matching
     * documents. Expression syntax is an aggregation function call with
     * histogram facets and other options.
     * The following aggregation functions are supported:
     * * `count(string_histogram_facet)`: Count the number of matching entities
     * for each distinct attribute value.
     * Data types:
     * * Histogram facet (aka filterable properties): Facet names with format
     * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
     * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
     * facet, then the parent hierarchy needs to be specified separated by
     * dots in the prefix after the schema id. Thus, the format for a multi-
     * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
     * &amp;lt;child facet name&amp;gt;. Example:
     * schema123.root_parent_facet.middle_facet.child_facet
     * * DocumentSchemaId: (with no schema id prefix) to get
     * histograms for each document type (returns the schema id path, e.g.
     * projects/12345/locations/us-west/documentSchemas/abc123).
     * Example expression:
     * * Document type counts:
     *   count('DocumentSchemaId')
     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
     *   count('abc123.MORTGAGE_TYPE')
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
     */
    public java.util.List<com.google.cloud.contentwarehouse.v1.HistogramQuery>
        getHistogramQueriesList() {
      if (histogramQueriesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(histogramQueries_);
      } else {
        return histogramQueriesBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * An expression specifying a histogram request against matching
     * documents. Expression syntax is an aggregation function call with
     * histogram facets and other options.
     * The following aggregation functions are supported:
     * * `count(string_histogram_facet)`: Count the number of matching entities
     * for each distinct attribute value.
     * Data types:
     * * Histogram facet (aka filterable properties): Facet names with format
     * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
     * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
     * facet, then the parent hierarchy needs to be specified separated by
     * dots in the prefix after the schema id. Thus, the format for a multi-
     * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
     * &amp;lt;child facet name&amp;gt;. Example:
     * schema123.root_parent_facet.middle_facet.child_facet
     * * DocumentSchemaId: (with no schema id prefix) to get
     * histograms for each document type (returns the schema id path, e.g.
     * projects/12345/locations/us-west/documentSchemas/abc123).
     * Example expression:
     * * Document type counts:
     *   count('DocumentSchemaId')
     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
     *   count('abc123.MORTGAGE_TYPE')
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
     */
    public int getHistogramQueriesCount() {
      if (histogramQueriesBuilder_ == null) {
        return histogramQueries_.size();
      } else {
        return histogramQueriesBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * An expression specifying a histogram request against matching
     * documents. Expression syntax is an aggregation function call with
     * histogram facets and other options.
     * The following aggregation functions are supported:
     * * `count(string_histogram_facet)`: Count the number of matching entities
     * for each distinct attribute value.
     * Data types:
     * * Histogram facet (aka filterable properties): Facet names with format
     * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
     * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
     * facet, then the parent hierarchy needs to be specified separated by
     * dots in the prefix after the schema id. Thus, the format for a multi-
     * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
     * &amp;lt;child facet name&amp;gt;. Example:
     * schema123.root_parent_facet.middle_facet.child_facet
     * * DocumentSchemaId: (with no schema id prefix) to get
     * histograms for each document type (returns the schema id path, e.g.
     * projects/12345/locations/us-west/documentSchemas/abc123).
     * Example expression:
     * * Document type counts:
     *   count('DocumentSchemaId')
     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
     *   count('abc123.MORTGAGE_TYPE')
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
     */
    public com.google.cloud.contentwarehouse.v1.HistogramQuery getHistogramQueries(int index) {
      if (histogramQueriesBuilder_ == null) {
        return histogramQueries_.get(index);
      } else {
        return histogramQueriesBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * An expression specifying a histogram request against matching
     * documents. Expression syntax is an aggregation function call with
     * histogram facets and other options.
     * The following aggregation functions are supported:
     * * `count(string_histogram_facet)`: Count the number of matching entities
     * for each distinct attribute value.
     * Data types:
     * * Histogram facet (aka filterable properties): Facet names with format
     * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
     * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
     * facet, then the parent hierarchy needs to be specified separated by
     * dots in the prefix after the schema id. Thus, the format for a multi-
     * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
     * &amp;lt;child facet name&amp;gt;. Example:
     * schema123.root_parent_facet.middle_facet.child_facet
     * * DocumentSchemaId: (with no schema id prefix) to get
     * histograms for each document type (returns the schema id path, e.g.
     * projects/12345/locations/us-west/documentSchemas/abc123).
     * Example expression:
     * * Document type counts:
     *   count('DocumentSchemaId')
     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
     *   count('abc123.MORTGAGE_TYPE')
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
     */
    public Builder setHistogramQueries(
        int index, com.google.cloud.contentwarehouse.v1.HistogramQuery value) {
      if (histogramQueriesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureHistogramQueriesIsMutable();
        histogramQueries_.set(index, value);
        onChanged();
      } else {
        histogramQueriesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * An expression specifying a histogram request against matching
     * documents. Expression syntax is an aggregation function call with
     * histogram facets and other options.
     * The following aggregation functions are supported:
     * * `count(string_histogram_facet)`: Count the number of matching entities
     * for each distinct attribute value.
     * Data types:
     * * Histogram facet (aka filterable properties): Facet names with format
     * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
     * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
     * facet, then the parent hierarchy needs to be specified separated by
     * dots in the prefix after the schema id. Thus, the format for a multi-
     * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
     * &amp;lt;child facet name&amp;gt;. Example:
     * schema123.root_parent_facet.middle_facet.child_facet
     * * DocumentSchemaId: (with no schema id prefix) to get
     * histograms for each document type (returns the schema id path, e.g.
     * projects/12345/locations/us-west/documentSchemas/abc123).
     * Example expression:
     * * Document type counts:
     *   count('DocumentSchemaId')
     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
     *   count('abc123.MORTGAGE_TYPE')
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
     */
    public Builder setHistogramQueries(
        int index, com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder builderForValue) {
      if (histogramQueriesBuilder_ == null) {
        ensureHistogramQueriesIsMutable();
        histogramQueries_.set(index, builderForValue.build());
        onChanged();
      } else {
        histogramQueriesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * An expression specifying a histogram request against matching
     * documents. Expression syntax is an aggregation function call with
     * histogram facets and other options.
     * The following aggregation functions are supported:
     * * `count(string_histogram_facet)`: Count the number of matching entities
     * for each distinct attribute value.
     * Data types:
     * * Histogram facet (aka filterable properties): Facet names with format
     * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
     * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
     * facet, then the parent hierarchy needs to be specified separated by
     * dots in the prefix after the schema id. Thus, the format for a multi-
     * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
     * &amp;lt;child facet name&amp;gt;. Example:
     * schema123.root_parent_facet.middle_facet.child_facet
     * * DocumentSchemaId: (with no schema id prefix) to get
     * histograms for each document type (returns the schema id path, e.g.
     * projects/12345/locations/us-west/documentSchemas/abc123).
     * Example expression:
     * * Document type counts:
     *   count('DocumentSchemaId')
     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
     *   count('abc123.MORTGAGE_TYPE')
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
     */
    public Builder addHistogramQueries(com.google.cloud.contentwarehouse.v1.HistogramQuery value) {
      if (histogramQueriesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureHistogramQueriesIsMutable();
        histogramQueries_.add(value);
        onChanged();
      } else {
        histogramQueriesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * An expression specifying a histogram request against matching
     * documents. Expression syntax is an aggregation function call with
     * histogram facets and other options.
     * The following aggregation functions are supported:
     * * `count(string_histogram_facet)`: Count the number of matching entities
     * for each distinct attribute value.
     * Data types:
     * * Histogram facet (aka filterable properties): Facet names with format
     * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
     * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
     * facet, then the parent hierarchy needs to be specified separated by
     * dots in the prefix after the schema id. Thus, the format for a multi-
     * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
     * &amp;lt;child facet name&amp;gt;. Example:
     * schema123.root_parent_facet.middle_facet.child_facet
     * * DocumentSchemaId: (with no schema id prefix) to get
     * histograms for each document type (returns the schema id path, e.g.
     * projects/12345/locations/us-west/documentSchemas/abc123).
     * Example expression:
     * * Document type counts:
     *   count('DocumentSchemaId')
     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
     *   count('abc123.MORTGAGE_TYPE')
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
     */
    public Builder addHistogramQueries(
        int index, com.google.cloud.contentwarehouse.v1.HistogramQuery value) {
      if (histogramQueriesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureHistogramQueriesIsMutable();
        histogramQueries_.add(index, value);
        onChanged();
      } else {
        histogramQueriesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * An expression specifying a histogram request against matching
     * documents. Expression syntax is an aggregation function call with
     * histogram facets and other options.
     * The following aggregation functions are supported:
     * * `count(string_histogram_facet)`: Count the number of matching entities
     * for each distinct attribute value.
     * Data types:
     * * Histogram facet (aka filterable properties): Facet names with format
     * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
     * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
     * facet, then the parent hierarchy needs to be specified separated by
     * dots in the prefix after the schema id. Thus, the format for a multi-
     * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
     * &amp;lt;child facet name&amp;gt;. Example:
     * schema123.root_parent_facet.middle_facet.child_facet
     * * DocumentSchemaId: (with no schema id prefix) to get
     * histograms for each document type (returns the schema id path, e.g.
     * projects/12345/locations/us-west/documentSchemas/abc123).
     * Example expression:
     * * Document type counts:
     *   count('DocumentSchemaId')
     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
     *   count('abc123.MORTGAGE_TYPE')
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
     */
    public Builder addHistogramQueries(
        com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder builderForValue) {
      if (histogramQueriesBuilder_ == null) {
        ensureHistogramQueriesIsMutable();
        histogramQueries_.add(builderForValue.build());
        onChanged();
      } else {
        histogramQueriesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * An expression specifying a histogram request against matching
     * documents. Expression syntax is an aggregation function call with
     * histogram facets and other options.
     * The following aggregation functions are supported:
     * * `count(string_histogram_facet)`: Count the number of matching entities
     * for each distinct attribute value.
     * Data types:
     * * Histogram facet (aka filterable properties): Facet names with format
     * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
     * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
     * facet, then the parent hierarchy needs to be specified separated by
     * dots in the prefix after the schema id. Thus, the format for a multi-
     * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
     * &amp;lt;child facet name&amp;gt;. Example:
     * schema123.root_parent_facet.middle_facet.child_facet
     * * DocumentSchemaId: (with no schema id prefix) to get
     * histograms for each document type (returns the schema id path, e.g.
     * projects/12345/locations/us-west/documentSchemas/abc123).
     * Example expression:
     * * Document type counts:
     *   count('DocumentSchemaId')
     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
     *   count('abc123.MORTGAGE_TYPE')
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
     */
    public Builder addHistogramQueries(
        int index, com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder builderForValue) {
      if (histogramQueriesBuilder_ == null) {
        ensureHistogramQueriesIsMutable();
        histogramQueries_.add(index, builderForValue.build());
        onChanged();
      } else {
        histogramQueriesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * An expression specifying a histogram request against matching
     * documents. Expression syntax is an aggregation function call with
     * histogram facets and other options.
     * The following aggregation functions are supported:
     * * `count(string_histogram_facet)`: Count the number of matching entities
     * for each distinct attribute value.
     * Data types:
     * * Histogram facet (aka filterable properties): Facet names with format
     * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
     * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
     * facet, then the parent hierarchy needs to be specified separated by
     * dots in the prefix after the schema id. Thus, the format for a multi-
     * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
     * &amp;lt;child facet name&amp;gt;. Example:
     * schema123.root_parent_facet.middle_facet.child_facet
     * * DocumentSchemaId: (with no schema id prefix) to get
     * histograms for each document type (returns the schema id path, e.g.
     * projects/12345/locations/us-west/documentSchemas/abc123).
     * Example expression:
     * * Document type counts:
     *   count('DocumentSchemaId')
     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
     *   count('abc123.MORTGAGE_TYPE')
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
     */
    public Builder addAllHistogramQueries(
        java.lang.Iterable<? extends com.google.cloud.contentwarehouse.v1.HistogramQuery> values) {
      if (histogramQueriesBuilder_ == null) {
        ensureHistogramQueriesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, histogramQueries_);
        onChanged();
      } else {
        histogramQueriesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * An expression specifying a histogram request against matching
     * documents. Expression syntax is an aggregation function call with
     * histogram facets and other options.
     * The following aggregation functions are supported:
     * * `count(string_histogram_facet)`: Count the number of matching entities
     * for each distinct attribute value.
     * Data types:
     * * Histogram facet (aka filterable properties): Facet names with format
     * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
     * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
     * facet, then the parent hierarchy needs to be specified separated by
     * dots in the prefix after the schema id. Thus, the format for a multi-
     * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
     * &amp;lt;child facet name&amp;gt;. Example:
     * schema123.root_parent_facet.middle_facet.child_facet
     * * DocumentSchemaId: (with no schema id prefix) to get
     * histograms for each document type (returns the schema id path, e.g.
     * projects/12345/locations/us-west/documentSchemas/abc123).
     * Example expression:
     * * Document type counts:
     *   count('DocumentSchemaId')
     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
     *   count('abc123.MORTGAGE_TYPE')
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
     */
    public Builder clearHistogramQueries() {
      if (histogramQueriesBuilder_ == null) {
        histogramQueries_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000080);
        onChanged();
      } else {
        histogramQueriesBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * An expression specifying a histogram request against matching
     * documents. Expression syntax is an aggregation function call with
     * histogram facets and other options.
     * The following aggregation functions are supported:
     * * `count(string_histogram_facet)`: Count the number of matching entities
     * for each distinct attribute value.
     * Data types:
     * * Histogram facet (aka filterable properties): Facet names with format
     * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
     * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
     * facet, then the parent hierarchy needs to be specified separated by
     * dots in the prefix after the schema id. Thus, the format for a multi-
     * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
     * &amp;lt;child facet name&amp;gt;. Example:
     * schema123.root_parent_facet.middle_facet.child_facet
     * * DocumentSchemaId: (with no schema id prefix) to get
     * histograms for each document type (returns the schema id path, e.g.
     * projects/12345/locations/us-west/documentSchemas/abc123).
     * Example expression:
     * * Document type counts:
     *   count('DocumentSchemaId')
     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
     *   count('abc123.MORTGAGE_TYPE')
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
     */
    public Builder removeHistogramQueries(int index) {
      if (histogramQueriesBuilder_ == null) {
        ensureHistogramQueriesIsMutable();
        histogramQueries_.remove(index);
        onChanged();
      } else {
        histogramQueriesBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * An expression specifying a histogram request against matching
     * documents. Expression syntax is an aggregation function call with
     * histogram facets and other options.
     * The following aggregation functions are supported:
     * * `count(string_histogram_facet)`: Count the number of matching entities
     * for each distinct attribute value.
     * Data types:
     * * Histogram facet (aka filterable properties): Facet names with format
     * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
     * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
     * facet, then the parent hierarchy needs to be specified separated by
     * dots in the prefix after the schema id. Thus, the format for a multi-
     * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
     * &amp;lt;child facet name&amp;gt;. Example:
     * schema123.root_parent_facet.middle_facet.child_facet
     * * DocumentSchemaId: (with no schema id prefix) to get
     * histograms for each document type (returns the schema id path, e.g.
     * projects/12345/locations/us-west/documentSchemas/abc123).
     * Example expression:
     * * Document type counts:
     *   count('DocumentSchemaId')
     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
     *   count('abc123.MORTGAGE_TYPE')
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
     */
    public com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder getHistogramQueriesBuilder(
        int index) {
      return getHistogramQueriesFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * An expression specifying a histogram request against matching
     * documents. Expression syntax is an aggregation function call with
     * histogram facets and other options.
     * The following aggregation functions are supported:
     * * `count(string_histogram_facet)`: Count the number of matching entities
     * for each distinct attribute value.
     * Data types:
     * * Histogram facet (aka filterable properties): Facet names with format
     * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
     * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
     * facet, then the parent hierarchy needs to be specified separated by
     * dots in the prefix after the schema id. Thus, the format for a multi-
     * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
     * &amp;lt;child facet name&amp;gt;. Example:
     * schema123.root_parent_facet.middle_facet.child_facet
     * * DocumentSchemaId: (with no schema id prefix) to get
     * histograms for each document type (returns the schema id path, e.g.
     * projects/12345/locations/us-west/documentSchemas/abc123).
     * Example expression:
     * * Document type counts:
     *   count('DocumentSchemaId')
     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
     *   count('abc123.MORTGAGE_TYPE')
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
     */
    public com.google.cloud.contentwarehouse.v1.HistogramQueryOrBuilder
        getHistogramQueriesOrBuilder(int index) {
      if (histogramQueriesBuilder_ == null) {
        return histogramQueries_.get(index);
      } else {
        return histogramQueriesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * An expression specifying a histogram request against matching
     * documents. Expression syntax is an aggregation function call with
     * histogram facets and other options.
     * The following aggregation functions are supported:
     * * `count(string_histogram_facet)`: Count the number of matching entities
     * for each distinct attribute value.
     * Data types:
     * * Histogram facet (aka filterable properties): Facet names with format
     * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
     * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
     * facet, then the parent hierarchy needs to be specified separated by
     * dots in the prefix after the schema id. Thus, the format for a multi-
     * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
     * &amp;lt;child facet name&amp;gt;. Example:
     * schema123.root_parent_facet.middle_facet.child_facet
     * * DocumentSchemaId: (with no schema id prefix) to get
     * histograms for each document type (returns the schema id path, e.g.
     * projects/12345/locations/us-west/documentSchemas/abc123).
     * Example expression:
     * * Document type counts:
     *   count('DocumentSchemaId')
     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
     *   count('abc123.MORTGAGE_TYPE')
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
     */
    public java.util.List<? extends com.google.cloud.contentwarehouse.v1.HistogramQueryOrBuilder>
        getHistogramQueriesOrBuilderList() {
      if (histogramQueriesBuilder_ != null) {
        return histogramQueriesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(histogramQueries_);
      }
    }
    /**
     *
     *
     * <pre>
     * An expression specifying a histogram request against matching
     * documents. Expression syntax is an aggregation function call with
     * histogram facets and other options.
     * The following aggregation functions are supported:
     * * `count(string_histogram_facet)`: Count the number of matching entities
     * for each distinct attribute value.
     * Data types:
     * * Histogram facet (aka filterable properties): Facet names with format
     * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
     * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
     * facet, then the parent hierarchy needs to be specified separated by
     * dots in the prefix after the schema id. Thus, the format for a multi-
     * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
     * &amp;lt;child facet name&amp;gt;. Example:
     * schema123.root_parent_facet.middle_facet.child_facet
     * * DocumentSchemaId: (with no schema id prefix) to get
     * histograms for each document type (returns the schema id path, e.g.
     * projects/12345/locations/us-west/documentSchemas/abc123).
     * Example expression:
     * * Document type counts:
     *   count('DocumentSchemaId')
     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
     *   count('abc123.MORTGAGE_TYPE')
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
     */
    public com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder
        addHistogramQueriesBuilder() {
      return getHistogramQueriesFieldBuilder()
          .addBuilder(com.google.cloud.contentwarehouse.v1.HistogramQuery.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * An expression specifying a histogram request against matching
     * documents. Expression syntax is an aggregation function call with
     * histogram facets and other options.
     * The following aggregation functions are supported:
     * * `count(string_histogram_facet)`: Count the number of matching entities
     * for each distinct attribute value.
     * Data types:
     * * Histogram facet (aka filterable properties): Facet names with format
     * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
     * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
     * facet, then the parent hierarchy needs to be specified separated by
     * dots in the prefix after the schema id. Thus, the format for a multi-
     * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
     * &amp;lt;child facet name&amp;gt;. Example:
     * schema123.root_parent_facet.middle_facet.child_facet
     * * DocumentSchemaId: (with no schema id prefix) to get
     * histograms for each document type (returns the schema id path, e.g.
     * projects/12345/locations/us-west/documentSchemas/abc123).
     * Example expression:
     * * Document type counts:
     *   count('DocumentSchemaId')
     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
     *   count('abc123.MORTGAGE_TYPE')
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
     */
    public com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder addHistogramQueriesBuilder(
        int index) {
      return getHistogramQueriesFieldBuilder()
          .addBuilder(
              index, com.google.cloud.contentwarehouse.v1.HistogramQuery.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * An expression specifying a histogram request against matching
     * documents. Expression syntax is an aggregation function call with
     * histogram facets and other options.
     * The following aggregation functions are supported:
     * * `count(string_histogram_facet)`: Count the number of matching entities
     * for each distinct attribute value.
     * Data types:
     * * Histogram facet (aka filterable properties): Facet names with format
     * &amp;lt;schema id&amp;gt;.&amp;lt;facet&amp;gt;. Facets will have the
     * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
     * facet, then the parent hierarchy needs to be specified separated by
     * dots in the prefix after the schema id. Thus, the format for a multi-
     * level facet is: &amp;lt;schema id&amp;gt;.&amp;lt;parent facet name&amp;gt;.
     * &amp;lt;child facet name&amp;gt;. Example:
     * schema123.root_parent_facet.middle_facet.child_facet
     * * DocumentSchemaId: (with no schema id prefix) to get
     * histograms for each document type (returns the schema id path, e.g.
     * projects/12345/locations/us-west/documentSchemas/abc123).
     * Example expression:
     * * Document type counts:
     *   count('DocumentSchemaId')
     * * For schema id, abc123, get the counts for MORTGAGE_TYPE:
     *   count('abc123.MORTGAGE_TYPE')
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;</code>
     */
    public java.util.List<com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder>
        getHistogramQueriesBuilderList() {
      return getHistogramQueriesFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.contentwarehouse.v1.HistogramQuery,
            com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder,
            com.google.cloud.contentwarehouse.v1.HistogramQueryOrBuilder>
        getHistogramQueriesFieldBuilder() {
      if (histogramQueriesBuilder_ == null) {
        histogramQueriesBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.contentwarehouse.v1.HistogramQuery,
                com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder,
                com.google.cloud.contentwarehouse.v1.HistogramQueryOrBuilder>(
                histogramQueries_,
                ((bitField0_ & 0x00000080) != 0),
                getParentForChildren(),
                isClean());
        histogramQueries_ = null;
      }
      return histogramQueriesBuilder_;
    }

    private boolean requireTotalSize_;
    /**
     *
     *
     * <pre>
     * Controls if the search document request requires the return of a total size
     * of matched documents. See
     * [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
     * Enabling this flag may adversely impact performance. Hint: If this is
     * used with pagination, set this flag on the initial query but set this
     * to false on subsequent page calls (keep the total count locally).
     * Defaults to false.
     * </pre>
     *
     * <code>bool require_total_size = 10;</code>
     *
     * @return The requireTotalSize.
     */
    @java.lang.Override
    public boolean getRequireTotalSize() {
      return requireTotalSize_;
    }
    /**
     *
     *
     * <pre>
     * Controls if the search document request requires the return of a total size
     * of matched documents. See
     * [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
     * Enabling this flag may adversely impact performance. Hint: If this is
     * used with pagination, set this flag on the initial query but set this
     * to false on subsequent page calls (keep the total count locally).
     * Defaults to false.
     * </pre>
     *
     * <code>bool require_total_size = 10;</code>
     *
     * @param value The requireTotalSize to set.
     * @return This builder for chaining.
     */
    public Builder setRequireTotalSize(boolean value) {

      requireTotalSize_ = value;
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Controls if the search document request requires the return of a total size
     * of matched documents. See
     * [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
     * Enabling this flag may adversely impact performance. Hint: If this is
     * used with pagination, set this flag on the initial query but set this
     * to false on subsequent page calls (keep the total count locally).
     * Defaults to false.
     * </pre>
     *
     * <code>bool require_total_size = 10;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearRequireTotalSize() {
      bitField0_ = (bitField0_ & ~0x00000100);
      requireTotalSize_ = false;
      onChanged();
      return this;
    }

    private int totalResultSize_ = 0;
    /**
     *
     *
     * <pre>
     * Controls if the search document request requires the return of a total size
     * of matched documents. See
     * [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
     * </pre>
     *
     * <code>
     * .google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize total_result_size = 12;
     * </code>
     *
     * @return The enum numeric value on the wire for totalResultSize.
     */
    @java.lang.Override
    public int getTotalResultSizeValue() {
      return totalResultSize_;
    }
    /**
     *
     *
     * <pre>
     * Controls if the search document request requires the return of a total size
     * of matched documents. See
     * [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
     * </pre>
     *
     * <code>
     * .google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize total_result_size = 12;
     * </code>
     *
     * @param value The enum numeric value on the wire for totalResultSize to set.
     * @return This builder for chaining.
     */
    public Builder setTotalResultSizeValue(int value) {
      totalResultSize_ = value;
      bitField0_ |= 0x00000200;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Controls if the search document request requires the return of a total size
     * of matched documents. See
     * [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
     * </pre>
     *
     * <code>
     * .google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize total_result_size = 12;
     * </code>
     *
     * @return The totalResultSize.
     */
    @java.lang.Override
    public com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize
        getTotalResultSize() {
      com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize result =
          com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize.forNumber(
              totalResultSize_);
      return result == null
          ? com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * Controls if the search document request requires the return of a total size
     * of matched documents. See
     * [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
     * </pre>
     *
     * <code>
     * .google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize total_result_size = 12;
     * </code>
     *
     * @param value The totalResultSize to set.
     * @return This builder for chaining.
     */
    public Builder setTotalResultSize(
        com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000200;
      totalResultSize_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Controls if the search document request requires the return of a total size
     * of matched documents. See
     * [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
     * </pre>
     *
     * <code>
     * .google.cloud.contentwarehouse.v1.SearchDocumentsRequest.TotalResultSize total_result_size = 12;
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearTotalResultSize() {
      bitField0_ = (bitField0_ & ~0x00000200);
      totalResultSize_ = 0;
      onChanged();
      return this;
    }

    private int qaSizeLimit_;
    /**
     *
     *
     * <pre>
     * Experimental, do not use.
     * The limit on the number of documents returned for the question-answering
     * feature. To enable the question-answering feature, set
     * [DocumentQuery].[is_nl_query][] to true.
     * </pre>
     *
     * <code>int32 qa_size_limit = 11;</code>
     *
     * @return The qaSizeLimit.
     */
    @java.lang.Override
    public int getQaSizeLimit() {
      return qaSizeLimit_;
    }
    /**
     *
     *
     * <pre>
     * Experimental, do not use.
     * The limit on the number of documents returned for the question-answering
     * feature. To enable the question-answering feature, set
     * [DocumentQuery].[is_nl_query][] to true.
     * </pre>
     *
     * <code>int32 qa_size_limit = 11;</code>
     *
     * @param value The qaSizeLimit to set.
     * @return This builder for chaining.
     */
    public Builder setQaSizeLimit(int value) {

      qaSizeLimit_ = value;
      bitField0_ |= 0x00000400;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Experimental, do not use.
     * The limit on the number of documents returned for the question-answering
     * feature. To enable the question-answering feature, set
     * [DocumentQuery].[is_nl_query][] to true.
     * </pre>
     *
     * <code>int32 qa_size_limit = 11;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearQaSizeLimit() {
      bitField0_ = (bitField0_ & ~0x00000400);
      qaSizeLimit_ = 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.contentwarehouse.v1.SearchDocumentsRequest)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.contentwarehouse.v1.SearchDocumentsRequest)
  private static final com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest();
  }

  public static com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

  @java.lang.Override
  public com.google.cloud.contentwarehouse.v1.SearchDocumentsRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
