text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/contentwarehouse/v1/document_service_request.proto

package com.google.cloud.contentwarehouse.v1;

/**
 *
 *
 *

 * Request message for DocumentService.SearchDocuments.
 *

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

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

  public static final int PARENT_FIELD_NUMBER = 1;
  private volatile java.lang.Object parent_;
  /**
   *
   *
   *

   * Required. The parent, which owns this collection of documents.
   * Format: projects/{project_number}/locations/{location}.
   *

   *
   *
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   *
   *
   * @return The parent.
   */
  @java.lang.Override
  public java.lang.String getParent() {
    java.lang.Object ref = parent_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      parent_ = s;
      return s;
    }
  }
  /**
   *
   *
   *

   * Required. The parent, which owns this collection of documents.
   * Format: projects/{project_number}/locations/{location}.
   *

   *
   *
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   *
   *
   * @return The bytes for parent.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getParentBytes() {
    java.lang.Object ref = parent_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      parent_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int REQUEST_METADATA_FIELD_NUMBER = 3;
  private com.google.cloud.contentwarehouse.v1.RequestMetadata requestMetadata_;
  /**
   *
   *
   *

   * The meta information collected about the end user, used to enforce access
   * control and improve the search quality of the service.
   *

   *
   * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;
   *
   * @return Whether the requestMetadata field is set.
   */
  @java.lang.Override
  public boolean hasRequestMetadata() {
    return requestMetadata_ != null;
  }
  /**
   *
   *
   *

   * The meta information collected about the end user, used to enforce access
   * control and improve the search quality of the service.
   *

   *
   * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;
   *
   * @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_;
  }
  /**
   *
   *
   *

   * The meta information collected about the end user, used to enforce access
   * control and improve the search quality of the service.
   *

   *
   * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;
   */
  @java.lang.Override
  public com.google.cloud.contentwarehouse.v1.RequestMetadataOrBuilder
      getRequestMetadataOrBuilder() {
    return getRequestMetadata();
  }

  public static final int DOCUMENT_QUERY_FIELD_NUMBER = 4;
  private com.google.cloud.contentwarehouse.v1.DocumentQuery documentQuery_;
  /**
   *
   *
   *

   * Query used to search against documents (keyword, filters, etc.).
   *

   *
   * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;
   *
   * @return Whether the documentQuery field is set.
   */
  @java.lang.Override
  public boolean hasDocumentQuery() {
    return documentQuery_ != null;
  }
  /**
   *
   *
   *

   * Query used to search against documents (keyword, filters, etc.).
   *

   *
   * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;
   *
   * @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_;
  }
  /**
   *
   *
   *

   * Query used to search against documents (keyword, filters, etc.).
   *

   *
   * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;
   */
  @java.lang.Override
  public com.google.cloud.contentwarehouse.v1.DocumentQueryOrBuilder getDocumentQueryOrBuilder() {
    return getDocumentQuery();
  }

  public static final int OFFSET_FIELD_NUMBER = 5;
  private int offset_;
  /**
   *
   *
   *

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

   *
   * int32 offset = 5;
   *
   * @return The offset.
   */
  @java.lang.Override
  public int getOffset() {
    return offset_;
  }

  public static final int PAGE_SIZE_FIELD_NUMBER = 6;
  private int pageSize_;
  /**
   *
   *
   *

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

   *
   * int32 page_size = 6;
   *
   * @return The pageSize.
   */
  @java.lang.Override
  public int getPageSize() {
    return pageSize_;
  }

  public static final int PAGE_TOKEN_FIELD_NUMBER = 7;
  private volatile java.lang.Object pageToken_;
  /**
   *
   *
   *

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

   *
   * string page_token = 7;
   *
   * @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;
    }
  }
  /**
   *
   *
   *

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

   *
   * string page_token = 7;
   *
   * @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;
  private volatile java.lang.Object orderBy_;
  /**
   *
   *
   *

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

   *
   * string order_by = 8;
   *
   * @return The orderBy.
   */
  @java.lang.Override
  public java.lang.String getOrderBy() {
    java.lang.Object ref = orderBy_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      orderBy_ = s;
      return s;
    }
  }
  /**
   *
   *
   *

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

   *
   * string order_by = 8;
   *
   * @return The bytes for orderBy.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getOrderByBytes() {
    java.lang.Object ref = orderBy_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      orderBy_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int HISTOGRAM_QUERIES_FIELD_NUMBER = 9;
  private java.util.List<com.google.cloud.contentwarehouse.v1.HistogramQuery> histogramQueries_;
  /**
   *
   *
   *

   * 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
   * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
   * &lt;child facet name&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')
   *

   *
   * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.contentwarehouse.v1.HistogramQuery>
      getHistogramQueriesList() {
    return histogramQueries_;
  }
  /**
   *
   *
   *

   * 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
   * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
   * &lt;child facet name&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')
   *

   *
   * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.contentwarehouse.v1.HistogramQueryOrBuilder>
      getHistogramQueriesOrBuilderList() {
    return histogramQueries_;
  }
  /**
   *
   *
   *

   * 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
   * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
   * &lt;child facet name&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')
   *

   *
   * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
   */
  @java.lang.Override
  public int getHistogramQueriesCount() {
    return histogramQueries_.size();
  }
  /**
   *
   *
   *

   * 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
   * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
   * &lt;child facet name&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')
   *

   *
   * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
   */
  @java.lang.Override
  public com.google.cloud.contentwarehouse.v1.HistogramQuery getHistogramQueries(int index) {
    return histogramQueries_.get(index);
  }
  /**
   *
   *
   *

   * 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
   * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
   * &lt;child facet name&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')
   *

   *
   * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
   */
  @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_;
  /**
   *
   *
   *

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

   *
   * bool require_total_size = 10;
   *
   * @return The requireTotalSize.
   */
  @java.lang.Override
  public boolean getRequireTotalSize() {
    return requireTotalSize_;
  }

  public static final int QA_SIZE_LIMIT_FIELD_NUMBER = 11;
  private int qaSizeLimit_;
  /**
   *
   *
   *

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

   *
   * int32 qa_size_limit = 11;
   *
   * @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_);
    }
    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_);
    }
    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 (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) + 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;
  }
  /**
   *
   *
   *

   * Request message for DocumentService.SearchDocuments.
   *

   *
   * 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();
      parent_ = "";

      if (requestMetadataBuilder_ == null) {
        requestMetadata_ = null;
      } else {
        requestMetadata_ = null;
        requestMetadataBuilder_ = null;
      }
      if (documentQueryBuilder_ == null) {
        documentQuery_ = null;
      } else {
        documentQuery_ = null;
        documentQueryBuilder_ = null;
      }
      offset_ = 0;

      pageSize_ = 0;

      pageToken_ = "";

      orderBy_ = "";

      if (histogramQueriesBuilder_ == null) {
        histogramQueries_ = java.util.Collections.emptyList();
      } else {
        histogramQueries_ = null;
        histogramQueriesBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000001);
      requireTotalSize_ = false;

      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);
      int from_bitField0_ = bitField0_;
      result.parent_ = parent_;
      if (requestMetadataBuilder_ == null) {
        result.requestMetadata_ = requestMetadata_;
      } else {
        result.requestMetadata_ = requestMetadataBuilder_.build();
      }
      if (documentQueryBuilder_ == null) {
        result.documentQuery_ = documentQuery_;
      } else {
        result.documentQuery_ = documentQueryBuilder_.build();
      }
      result.offset_ = offset_;
      result.pageSize_ = pageSize_;
      result.pageToken_ = pageToken_;
      result.orderBy_ = orderBy_;
      if (histogramQueriesBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          histogramQueries_ = java.util.Collections.unmodifiableList(histogramQueries_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.histogramQueries_ = histogramQueries_;
      } else {
        result.histogramQueries_ = histogramQueriesBuilder_.build();
      }
      result.requireTotalSize_ = requireTotalSize_;
      result.qaSizeLimit_ = qaSizeLimit_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.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_;
        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_;
        onChanged();
      }
      if (!other.getOrderBy().isEmpty()) {
        orderBy_ = other.orderBy_;
        onChanged();
      }
      if (histogramQueriesBuilder_ == null) {
        if (!other.histogramQueries_.isEmpty()) {
          if (histogramQueries_.isEmpty()) {
            histogramQueries_ = other.histogramQueries_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureHistogramQueriesIsMutable();
            histogramQueries_.addAll(other.histogramQueries_);
          }
          onChanged();
        }
      } else {
        if (!other.histogramQueries_.isEmpty()) {
          if (histogramQueriesBuilder_.isEmpty()) {
            histogramQueriesBuilder_.dispose();
            histogramQueriesBuilder_ = null;
            histogramQueries_ = other.histogramQueries_;
            bitField0_ = (bitField0_ & ~0x00000001);
            histogramQueriesBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getHistogramQueriesFieldBuilder()
                    : null;
          } else {
            histogramQueriesBuilder_.addAllMessages(other.histogramQueries_);
          }
        }
      }
      if (other.getRequireTotalSize() != false) {
        setRequireTotalSize(other.getRequireTotalSize());
      }
      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();

                break;
              } // case 10
            case 26:
              {
                input.readMessage(getRequestMetadataFieldBuilder().getBuilder(), extensionRegistry);

                break;
              } // case 26
            case 34:
              {
                input.readMessage(getDocumentQueryFieldBuilder().getBuilder(), extensionRegistry);

                break;
              } // case 34
            case 40:
              {
                offset_ = input.readInt32();

                break;
              } // case 40
            case 48:
              {
                pageSize_ = input.readInt32();

                break;
              } // case 48
            case 58:
              {
                pageToken_ = input.readStringRequireUtf8();

                break;
              } // case 58
            case 66:
              {
                orderBy_ = input.readStringRequireUtf8();

                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();

                break;
              } // case 80
            case 88:
              {
                qaSizeLimit_ = input.readInt32();

                break;
              } // case 88
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private java.lang.Object parent_ = "";
    /**
     *
     *
     *

     * Required. The parent, which owns this collection of documents.
     * Format: projects/{project_number}/locations/{location}.
     *

     *
     *
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     *
     *
     * @return The parent.
     */
    public java.lang.String getParent() {
      java.lang.Object ref = parent_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        parent_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     *

     * Required. The parent, which owns this collection of documents.
     * Format: projects/{project_number}/locations/{location}.
     *

     *
     *
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     *
     *
     * @return The bytes for parent.
     */
    public com.google.protobuf.ByteString getParentBytes() {
      java.lang.Object ref = parent_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        parent_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     *

     * Required. The parent, which owns this collection of documents.
     * Format: projects/{project_number}/locations/{location}.
     *

     *
     *
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     *
     *
     * @param value The parent to set.
     * @return This builder for chaining.
     */
    public Builder setParent(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      parent_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Required. The parent, which owns this collection of documents.
     * Format: projects/{project_number}/locations/{location}.
     *

     *
     *
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     *
     *
     * @return This builder for chaining.
     */
    public Builder clearParent() {

      parent_ = getDefaultInstance().getParent();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Required. The parent, which owns this collection of documents.
     * Format: projects/{project_number}/locations/{location}.
     *

     *
     *
     * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     *
     *
     * @param value The bytes for parent to set.
     * @return This builder for chaining.
     */
    public Builder setParentBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      parent_ = value;
      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_;
    /**
     *
     *
     *

     * The meta information collected about the end user, used to enforce access
     * control and improve the search quality of the service.
     *

     *
     * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;
     *
     * @return Whether the requestMetadata field is set.
     */
    public boolean hasRequestMetadata() {
      return requestMetadataBuilder_ != null || requestMetadata_ != null;
    }
    /**
     *
     *
     *

     * The meta information collected about the end user, used to enforce access
     * control and improve the search quality of the service.
     *

     *
     * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;
     *
     * @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();
      }
    }
    /**
     *
     *
     *

     * The meta information collected about the end user, used to enforce access
     * control and improve the search quality of the service.
     *

     *
     * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;
     */
    public Builder setRequestMetadata(com.google.cloud.contentwarehouse.v1.RequestMetadata value) {
      if (requestMetadataBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        requestMetadata_ = value;
        onChanged();
      } else {
        requestMetadataBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     *

     * The meta information collected about the end user, used to enforce access
     * control and improve the search quality of the service.
     *

     *
     * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;
     */
    public Builder setRequestMetadata(
        com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder builderForValue) {
      if (requestMetadataBuilder_ == null) {
        requestMetadata_ = builderForValue.build();
        onChanged();
      } else {
        requestMetadataBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     *

     * The meta information collected about the end user, used to enforce access
     * control and improve the search quality of the service.
     *

     *
     * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;
     */
    public Builder mergeRequestMetadata(
        com.google.cloud.contentwarehouse.v1.RequestMetadata value) {
      if (requestMetadataBuilder_ == null) {
        if (requestMetadata_ != null) {
          requestMetadata_ =
              com.google.cloud.contentwarehouse.v1.RequestMetadata.newBuilder(requestMetadata_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          requestMetadata_ = value;
        }
        onChanged();
      } else {
        requestMetadataBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     *

     * The meta information collected about the end user, used to enforce access
     * control and improve the search quality of the service.
     *

     *
     * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;
     */
    public Builder clearRequestMetadata() {
      if (requestMetadataBuilder_ == null) {
        requestMetadata_ = null;
        onChanged();
      } else {
        requestMetadata_ = null;
        requestMetadataBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     *

     * The meta information collected about the end user, used to enforce access
     * control and improve the search quality of the service.
     *

     *
     * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;
     */
    public com.google.cloud.contentwarehouse.v1.RequestMetadata.Builder
        getRequestMetadataBuilder() {

      onChanged();
      return getRequestMetadataFieldBuilder().getBuilder();
    }
    /**
     *
     *
     *

     * The meta information collected about the end user, used to enforce access
     * control and improve the search quality of the service.
     *

     *
     * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;
     */
    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_;
      }
    }
    /**
     *
     *
     *

     * The meta information collected about the end user, used to enforce access
     * control and improve the search quality of the service.
     *

     *
     * .google.cloud.contentwarehouse.v1.RequestMetadata request_metadata = 3;
     */
    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_;
    /**
     *
     *
     *

     * Query used to search against documents (keyword, filters, etc.).
     *

     *
     * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;
     *
     * @return Whether the documentQuery field is set.
     */
    public boolean hasDocumentQuery() {
      return documentQueryBuilder_ != null || documentQuery_ != null;
    }
    /**
     *
     *
     *

     * Query used to search against documents (keyword, filters, etc.).
     *

     *
     * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;
     *
     * @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();
      }
    }
    /**
     *
     *
     *

     * Query used to search against documents (keyword, filters, etc.).
     *

     *
     * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;
     */
    public Builder setDocumentQuery(com.google.cloud.contentwarehouse.v1.DocumentQuery value) {
      if (documentQueryBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        documentQuery_ = value;
        onChanged();
      } else {
        documentQueryBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     *

     * Query used to search against documents (keyword, filters, etc.).
     *

     *
     * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;
     */
    public Builder setDocumentQuery(
        com.google.cloud.contentwarehouse.v1.DocumentQuery.Builder builderForValue) {
      if (documentQueryBuilder_ == null) {
        documentQuery_ = builderForValue.build();
        onChanged();
      } else {
        documentQueryBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     *

     * Query used to search against documents (keyword, filters, etc.).
     *

     *
     * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;
     */
    public Builder mergeDocumentQuery(com.google.cloud.contentwarehouse.v1.DocumentQuery value) {
      if (documentQueryBuilder_ == null) {
        if (documentQuery_ != null) {
          documentQuery_ =
              com.google.cloud.contentwarehouse.v1.DocumentQuery.newBuilder(documentQuery_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          documentQuery_ = value;
        }
        onChanged();
      } else {
        documentQueryBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     *

     * Query used to search against documents (keyword, filters, etc.).
     *

     *
     * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;
     */
    public Builder clearDocumentQuery() {
      if (documentQueryBuilder_ == null) {
        documentQuery_ = null;
        onChanged();
      } else {
        documentQuery_ = null;
        documentQueryBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     *

     * Query used to search against documents (keyword, filters, etc.).
     *

     *
     * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;
     */
    public com.google.cloud.contentwarehouse.v1.DocumentQuery.Builder getDocumentQueryBuilder() {

      onChanged();
      return getDocumentQueryFieldBuilder().getBuilder();
    }
    /**
     *
     *
     *

     * Query used to search against documents (keyword, filters, etc.).
     *

     *
     * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;
     */
    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_;
      }
    }
    /**
     *
     *
     *

     * Query used to search against documents (keyword, filters, etc.).
     *

     *
     * .google.cloud.contentwarehouse.v1.DocumentQuery document_query = 4;
     */
    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_;
    /**
     *
     *
     *

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

     *
     * int32 offset = 5;
     *
     * @return The offset.
     */
    @java.lang.Override
    public int getOffset() {
      return offset_;
    }
    /**
     *
     *
     *

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

     *
     * int32 offset = 5;
     *
     * @param value The offset to set.
     * @return This builder for chaining.
     */
    public Builder setOffset(int value) {

      offset_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

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

     *
     * int32 offset = 5;
     *
     * @return This builder for chaining.
     */
    public Builder clearOffset() {

      offset_ = 0;
      onChanged();
      return this;
    }

    private int pageSize_;
    /**
     *
     *
     *

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

     *
     * int32 page_size = 6;
     *
     * @return The pageSize.
     */
    @java.lang.Override
    public int getPageSize() {
      return pageSize_;
    }
    /**
     *
     *
     *

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

     *
     * int32 page_size = 6;
     *
     * @param value The pageSize to set.
     * @return This builder for chaining.
     */
    public Builder setPageSize(int value) {

      pageSize_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

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

     *
     * int32 page_size = 6;
     *
     * @return This builder for chaining.
     */
    public Builder clearPageSize() {

      pageSize_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object pageToken_ = "";
    /**
     *
     *
     *

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

     *
     * string page_token = 7;
     *
     * @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;
      }
    }
    /**
     *
     *
     *

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

     *
     * string page_token = 7;
     *
     * @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;
      }
    }
    /**
     *
     *
     *

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

     *
     * string page_token = 7;
     *
     * @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;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

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

     *
     * string page_token = 7;
     *
     * @return This builder for chaining.
     */
    public Builder clearPageToken() {

      pageToken_ = getDefaultInstance().getPageToken();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

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

     *
     * string page_token = 7;
     *
     * @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;
      onChanged();
      return this;
    }

    private java.lang.Object orderBy_ = "";
    /**
     *
     *
     *

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

     *
     * string order_by = 8;
     *
     * @return The orderBy.
     */
    public java.lang.String getOrderBy() {
      java.lang.Object ref = orderBy_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        orderBy_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     *

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

     *
     * string order_by = 8;
     *
     * @return The bytes for orderBy.
     */
    public com.google.protobuf.ByteString getOrderByBytes() {
      java.lang.Object ref = orderBy_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        orderBy_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     *

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

     *
     * string order_by = 8;
     *
     * @param value The orderBy to set.
     * @return This builder for chaining.
     */
    public Builder setOrderBy(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      orderBy_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

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

     *
     * string order_by = 8;
     *
     * @return This builder for chaining.
     */
    public Builder clearOrderBy() {

      orderBy_ = getDefaultInstance().getOrderBy();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

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

     *
     * string order_by = 8;
     *
     * @param value The bytes for orderBy to set.
     * @return This builder for chaining.
     */
    public Builder setOrderByBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      orderBy_ = value;
      onChanged();
      return this;
    }

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

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

    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_;

    /**
     *
     *
     *

     * 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
     * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
     * &lt;child facet name&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')
     *

     *
     * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
     */
    public java.util.List<com.google.cloud.contentwarehouse.v1.HistogramQuery>
        getHistogramQueriesList() {
      if (histogramQueriesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(histogramQueries_);
      } else {
        return histogramQueriesBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     *

     * 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
     * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
     * &lt;child facet name&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')
     *

     *
     * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
     */
    public int getHistogramQueriesCount() {
      if (histogramQueriesBuilder_ == null) {
        return histogramQueries_.size();
      } else {
        return histogramQueriesBuilder_.getCount();
      }
    }
    /**
     *
     *
     *

     * 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
     * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
     * &lt;child facet name&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')
     *

     *
     * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
     */
    public com.google.cloud.contentwarehouse.v1.HistogramQuery getHistogramQueries(int index) {
      if (histogramQueriesBuilder_ == null) {
        return histogramQueries_.get(index);
      } else {
        return histogramQueriesBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     *

     * 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
     * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
     * &lt;child facet name&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')
     *

     *
     * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
     */
    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;
    }
    /**
     *
     *
     *

     * 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
     * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
     * &lt;child facet name&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')
     *

     *
     * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
     */
    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;
    }
    /**
     *
     *
     *

     * 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
     * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
     * &lt;child facet name&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')
     *

     *
     * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
     */
    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;
    }
    /**
     *
     *
     *

     * 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
     * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
     * &lt;child facet name&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')
     *

     *
     * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
     */
    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;
    }
    /**
     *
     *
     *

     * 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
     * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
     * &lt;child facet name&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')
     *

     *
     * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
     */
    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;
    }
    /**
     *
     *
     *

     * 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
     * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
     * &lt;child facet name&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')
     *

     *
     * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
     */
    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;
    }
    /**
     *
     *
     *

     * 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
     * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
     * &lt;child facet name&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')
     *

     *
     * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
     */
    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;
    }
    /**
     *
     *
     *

     * 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
     * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
     * &lt;child facet name&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')
     *

     *
     * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
     */
    public Builder clearHistogramQueries() {
      if (histogramQueriesBuilder_ == null) {
        histogramQueries_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        histogramQueriesBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     *

     * 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
     * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
     * &lt;child facet name&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')
     *

     *
     * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
     */
    public Builder removeHistogramQueries(int index) {
      if (histogramQueriesBuilder_ == null) {
        ensureHistogramQueriesIsMutable();
        histogramQueries_.remove(index);
        onChanged();
      } else {
        histogramQueriesBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     *

     * 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
     * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
     * &lt;child facet name&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')
     *

     *
     * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
     */
    public com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder getHistogramQueriesBuilder(
        int index) {
      return getHistogramQueriesFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     *

     * 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
     * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
     * &lt;child facet name&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')
     *

     *
     * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
     */
    public com.google.cloud.contentwarehouse.v1.HistogramQueryOrBuilder
        getHistogramQueriesOrBuilder(int index) {
      if (histogramQueriesBuilder_ == null) {
        return histogramQueries_.get(index);
      } else {
        return histogramQueriesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     *

     * 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
     * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
     * &lt;child facet name&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')
     *

     *
     * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
     */
    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_);
      }
    }
    /**
     *
     *
     *

     * 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
     * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
     * &lt;child facet name&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')
     *

     *
     * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
     */
    public com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder
        addHistogramQueriesBuilder() {
      return getHistogramQueriesFieldBuilder()
          .addBuilder(com.google.cloud.contentwarehouse.v1.HistogramQuery.getDefaultInstance());
    }
    /**
     *
     *
     *

     * 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
     * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
     * &lt;child facet name&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')
     *

     *
     * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
     */
    public com.google.cloud.contentwarehouse.v1.HistogramQuery.Builder addHistogramQueriesBuilder(
        int index) {
      return getHistogramQueriesFieldBuilder()
          .addBuilder(
              index, com.google.cloud.contentwarehouse.v1.HistogramQuery.getDefaultInstance());
    }
    /**
     *
     *
     *

     * 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
     * &lt;schema id&gt;.&lt;facet&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: &lt;schema id&gt;.&lt;parent facet name&gt;.
     * &lt;child facet name&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')
     *

     *
     * repeated .google.cloud.contentwarehouse.v1.HistogramQuery histogram_queries = 9;
     */
    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_ & 0x00000001) != 0),
                getParentForChildren(),
                isClean());
        histogramQueries_ = null;
      }
      return histogramQueriesBuilder_;
    }

    private boolean requireTotalSize_;
    /**
     *
     *
     *

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

     *
     * bool require_total_size = 10;
     *
     * @return The requireTotalSize.
     */
    @java.lang.Override
    public boolean getRequireTotalSize() {
      return requireTotalSize_;
    }
    /**
     *
     *
     *

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

     *
     * bool require_total_size = 10;
     *
     * @param value The requireTotalSize to set.
     * @return This builder for chaining.
     */
    public Builder setRequireTotalSize(boolean value) {

      requireTotalSize_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

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

     *
     * bool require_total_size = 10;
     *
     * @return This builder for chaining.
     */
    public Builder clearRequireTotalSize() {

      requireTotalSize_ = false;
      onChanged();
      return this;
    }

    private int qaSizeLimit_;
    /**
     *
     *
     *

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

     *
     * int32 qa_size_limit = 11;
     *
     * @return The qaSizeLimit.
     */
    @java.lang.Override
    public int getQaSizeLimit() {
      return qaSizeLimit_;
    }
    /**
     *
     *
     *

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

     *
     * int32 qa_size_limit = 11;
     *
     * @param value The qaSizeLimit to set.
     * @return This builder for chaining.
     */
    public Builder setQaSizeLimit(int value) {

      qaSizeLimit_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

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

     *
     * int32 qa_size_limit = 11;
     *
     * @return This builder for chaining.
     */
    public Builder clearQaSizeLimit() {

      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;
  }
}

redpajama_set_name: RedPajamaGithub