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

package com.google.cloud.contentwarehouse.v1;

/**
 *
 *
 * <pre>
 * Defines the structure for content warehouse document proto.
 * </pre>
 *
 * Protobuf type {@code google.cloud.contentwarehouse.v1.Document}
 */
public final class Document extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.contentwarehouse.v1.Document)
    DocumentOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use Document.newBuilder() to construct.
  private Document(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private Document() {
    name_ = "";
    referenceId_ = "";
    displayName_ = "";
    title_ = "";
    displayUri_ = "";
    documentSchemaName_ = "";
    structuredContentUri_ = "";
    properties_ = java.util.Collections.emptyList();
    rawDocumentFileType_ = 0;
    contentCategory_ = 0;
    creator_ = "";
    updater_ = "";
  }

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

  @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.DocumentProto
        .internal_static_google_cloud_contentwarehouse_v1_Document_descriptor;
  }

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

  private int structuredContentCase_ = 0;
  private java.lang.Object structuredContent_;

  public enum StructuredContentCase
      implements
          com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    PLAIN_TEXT(15),
    CLOUD_AI_DOCUMENT(4),
    STRUCTUREDCONTENT_NOT_SET(0);
    private final int value;

    private StructuredContentCase(int value) {
      this.value = value;
    }
    /**
     * @param value The number of the enum to look for.
     * @return The enum associated with the given number.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static StructuredContentCase valueOf(int value) {
      return forNumber(value);
    }

    public static StructuredContentCase forNumber(int value) {
      switch (value) {
        case 15:
          return PLAIN_TEXT;
        case 4:
          return CLOUD_AI_DOCUMENT;
        case 0:
          return STRUCTUREDCONTENT_NOT_SET;
        default:
          return null;
      }
    }

    public int getNumber() {
      return this.value;
    }
  };

  public StructuredContentCase getStructuredContentCase() {
    return StructuredContentCase.forNumber(structuredContentCase_);
  }

  private int rawDocumentCase_ = 0;
  private java.lang.Object rawDocument_;

  public enum RawDocumentCase
      implements
          com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    RAW_DOCUMENT_PATH(5),
    INLINE_RAW_DOCUMENT(6),
    RAWDOCUMENT_NOT_SET(0);
    private final int value;

    private RawDocumentCase(int value) {
      this.value = value;
    }
    /**
     * @param value The number of the enum to look for.
     * @return The enum associated with the given number.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static RawDocumentCase valueOf(int value) {
      return forNumber(value);
    }

    public static RawDocumentCase forNumber(int value) {
      switch (value) {
        case 5:
          return RAW_DOCUMENT_PATH;
        case 6:
          return INLINE_RAW_DOCUMENT;
        case 0:
          return RAWDOCUMENT_NOT_SET;
        default:
          return null;
      }
    }

    public int getNumber() {
      return this.value;
    }
  };

  public RawDocumentCase getRawDocumentCase() {
    return RawDocumentCase.forNumber(rawDocumentCase_);
  }

  public static final int NAME_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object name_ = "";
  /**
   *
   *
   * <pre>
   * The resource name of the document.
   * Format:
   * projects/{project_number}/locations/{location}/documents/{document_id}.
   * The name is ignored when creating a document.
   * </pre>
   *
   * <code>string name = 1;</code>
   *
   * @return The name.
   */
  @java.lang.Override
  public java.lang.String getName() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      name_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The resource name of the document.
   * Format:
   * projects/{project_number}/locations/{location}/documents/{document_id}.
   * The name is ignored when creating a document.
   * </pre>
   *
   * <code>string name = 1;</code>
   *
   * @return The bytes for name.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getNameBytes() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      name_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int REFERENCE_ID_FIELD_NUMBER = 11;

  @SuppressWarnings("serial")
  private volatile java.lang.Object referenceId_ = "";
  /**
   *
   *
   * <pre>
   * The reference ID set by customers. Must be unique per project and location.
   * </pre>
   *
   * <code>string reference_id = 11;</code>
   *
   * @return The referenceId.
   */
  @java.lang.Override
  public java.lang.String getReferenceId() {
    java.lang.Object ref = referenceId_;
    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();
      referenceId_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The reference ID set by customers. Must be unique per project and location.
   * </pre>
   *
   * <code>string reference_id = 11;</code>
   *
   * @return The bytes for referenceId.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getReferenceIdBytes() {
    java.lang.Object ref = referenceId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      referenceId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DISPLAY_NAME_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  private volatile java.lang.Object displayName_ = "";
  /**
   *
   *
   * <pre>
   * Required. Display name of the document given by the user. This name will be
   * displayed in the UI. Customer can populate this field with the name of the
   * document. This differs from the 'title' field as 'title' is optional and
   * stores the top heading in the document.
   * </pre>
   *
   * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The displayName.
   */
  @java.lang.Override
  public java.lang.String getDisplayName() {
    java.lang.Object ref = displayName_;
    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();
      displayName_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. Display name of the document given by the user. This name will be
   * displayed in the UI. Customer can populate this field with the name of the
   * document. This differs from the 'title' field as 'title' is optional and
   * stores the top heading in the document.
   * </pre>
   *
   * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The bytes for displayName.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getDisplayNameBytes() {
    java.lang.Object ref = displayName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      displayName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int TITLE_FIELD_NUMBER = 18;

  @SuppressWarnings("serial")
  private volatile java.lang.Object title_ = "";
  /**
   *
   *
   * <pre>
   * Title that describes the document.
   * This can be the top heading or text that describes the document.
   * </pre>
   *
   * <code>string title = 18;</code>
   *
   * @return The title.
   */
  @java.lang.Override
  public java.lang.String getTitle() {
    java.lang.Object ref = title_;
    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();
      title_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Title that describes the document.
   * This can be the top heading or text that describes the document.
   * </pre>
   *
   * <code>string title = 18;</code>
   *
   * @return The bytes for title.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getTitleBytes() {
    java.lang.Object ref = title_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      title_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DISPLAY_URI_FIELD_NUMBER = 17;

  @SuppressWarnings("serial")
  private volatile java.lang.Object displayUri_ = "";
  /**
   *
   *
   * <pre>
   * Uri to display the document, for example, in the UI.
   * </pre>
   *
   * <code>string display_uri = 17;</code>
   *
   * @return The displayUri.
   */
  @java.lang.Override
  public java.lang.String getDisplayUri() {
    java.lang.Object ref = displayUri_;
    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();
      displayUri_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Uri to display the document, for example, in the UI.
   * </pre>
   *
   * <code>string display_uri = 17;</code>
   *
   * @return The bytes for displayUri.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getDisplayUriBytes() {
    java.lang.Object ref = displayUri_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      displayUri_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DOCUMENT_SCHEMA_NAME_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private volatile java.lang.Object documentSchemaName_ = "";
  /**
   *
   *
   * <pre>
   * The Document schema name.
   * Format:
   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
   * </pre>
   *
   * <code>string document_schema_name = 3 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The documentSchemaName.
   */
  @java.lang.Override
  public java.lang.String getDocumentSchemaName() {
    java.lang.Object ref = documentSchemaName_;
    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();
      documentSchemaName_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The Document schema name.
   * Format:
   * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
   * </pre>
   *
   * <code>string document_schema_name = 3 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The bytes for documentSchemaName.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getDocumentSchemaNameBytes() {
    java.lang.Object ref = documentSchemaName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      documentSchemaName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PLAIN_TEXT_FIELD_NUMBER = 15;
  /**
   *
   *
   * <pre>
   * Other document format, such as PPTX, XLXS
   * </pre>
   *
   * <code>string plain_text = 15;</code>
   *
   * @return Whether the plainText field is set.
   */
  public boolean hasPlainText() {
    return structuredContentCase_ == 15;
  }
  /**
   *
   *
   * <pre>
   * Other document format, such as PPTX, XLXS
   * </pre>
   *
   * <code>string plain_text = 15;</code>
   *
   * @return The plainText.
   */
  public java.lang.String getPlainText() {
    java.lang.Object ref = "";
    if (structuredContentCase_ == 15) {
      ref = structuredContent_;
    }
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      if (structuredContentCase_ == 15) {
        structuredContent_ = s;
      }
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Other document format, such as PPTX, XLXS
   * </pre>
   *
   * <code>string plain_text = 15;</code>
   *
   * @return The bytes for plainText.
   */
  public com.google.protobuf.ByteString getPlainTextBytes() {
    java.lang.Object ref = "";
    if (structuredContentCase_ == 15) {
      ref = structuredContent_;
    }
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      if (structuredContentCase_ == 15) {
        structuredContent_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CLOUD_AI_DOCUMENT_FIELD_NUMBER = 4;
  /**
   *
   *
   * <pre>
   * Document AI format to save the structured content, including OCR.
   * </pre>
   *
   * <code>.google.cloud.documentai.v1.Document cloud_ai_document = 4;</code>
   *
   * @return Whether the cloudAiDocument field is set.
   */
  @java.lang.Override
  public boolean hasCloudAiDocument() {
    return structuredContentCase_ == 4;
  }
  /**
   *
   *
   * <pre>
   * Document AI format to save the structured content, including OCR.
   * </pre>
   *
   * <code>.google.cloud.documentai.v1.Document cloud_ai_document = 4;</code>
   *
   * @return The cloudAiDocument.
   */
  @java.lang.Override
  public com.google.cloud.documentai.v1.Document getCloudAiDocument() {
    if (structuredContentCase_ == 4) {
      return (com.google.cloud.documentai.v1.Document) structuredContent_;
    }
    return com.google.cloud.documentai.v1.Document.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * Document AI format to save the structured content, including OCR.
   * </pre>
   *
   * <code>.google.cloud.documentai.v1.Document cloud_ai_document = 4;</code>
   */
  @java.lang.Override
  public com.google.cloud.documentai.v1.DocumentOrBuilder getCloudAiDocumentOrBuilder() {
    if (structuredContentCase_ == 4) {
      return (com.google.cloud.documentai.v1.Document) structuredContent_;
    }
    return com.google.cloud.documentai.v1.Document.getDefaultInstance();
  }

  public static final int STRUCTURED_CONTENT_URI_FIELD_NUMBER = 16;

  @SuppressWarnings("serial")
  private volatile java.lang.Object structuredContentUri_ = "";
  /**
   *
   *
   * <pre>
   * A path linked to structured content file.
   * </pre>
   *
   * <code>string structured_content_uri = 16 [deprecated = true];</code>
   *
   * @deprecated google.cloud.contentwarehouse.v1.Document.structured_content_uri is deprecated. See
   *     google/cloud/contentwarehouse/v1/document.proto;l=79
   * @return The structuredContentUri.
   */
  @java.lang.Override
  @java.lang.Deprecated
  public java.lang.String getStructuredContentUri() {
    java.lang.Object ref = structuredContentUri_;
    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();
      structuredContentUri_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * A path linked to structured content file.
   * </pre>
   *
   * <code>string structured_content_uri = 16 [deprecated = true];</code>
   *
   * @deprecated google.cloud.contentwarehouse.v1.Document.structured_content_uri is deprecated. See
   *     google/cloud/contentwarehouse/v1/document.proto;l=79
   * @return The bytes for structuredContentUri.
   */
  @java.lang.Override
  @java.lang.Deprecated
  public com.google.protobuf.ByteString getStructuredContentUriBytes() {
    java.lang.Object ref = structuredContentUri_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      structuredContentUri_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int RAW_DOCUMENT_PATH_FIELD_NUMBER = 5;
  /**
   *
   *
   * <pre>
   * Raw document file in Cloud Storage path.
   * </pre>
   *
   * <code>string raw_document_path = 5;</code>
   *
   * @return Whether the rawDocumentPath field is set.
   */
  public boolean hasRawDocumentPath() {
    return rawDocumentCase_ == 5;
  }
  /**
   *
   *
   * <pre>
   * Raw document file in Cloud Storage path.
   * </pre>
   *
   * <code>string raw_document_path = 5;</code>
   *
   * @return The rawDocumentPath.
   */
  public java.lang.String getRawDocumentPath() {
    java.lang.Object ref = "";
    if (rawDocumentCase_ == 5) {
      ref = rawDocument_;
    }
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      if (rawDocumentCase_ == 5) {
        rawDocument_ = s;
      }
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Raw document file in Cloud Storage path.
   * </pre>
   *
   * <code>string raw_document_path = 5;</code>
   *
   * @return The bytes for rawDocumentPath.
   */
  public com.google.protobuf.ByteString getRawDocumentPathBytes() {
    java.lang.Object ref = "";
    if (rawDocumentCase_ == 5) {
      ref = rawDocument_;
    }
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      if (rawDocumentCase_ == 5) {
        rawDocument_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int INLINE_RAW_DOCUMENT_FIELD_NUMBER = 6;
  /**
   *
   *
   * <pre>
   * Raw document content.
   * </pre>
   *
   * <code>bytes inline_raw_document = 6;</code>
   *
   * @return Whether the inlineRawDocument field is set.
   */
  @java.lang.Override
  public boolean hasInlineRawDocument() {
    return rawDocumentCase_ == 6;
  }
  /**
   *
   *
   * <pre>
   * Raw document content.
   * </pre>
   *
   * <code>bytes inline_raw_document = 6;</code>
   *
   * @return The inlineRawDocument.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getInlineRawDocument() {
    if (rawDocumentCase_ == 6) {
      return (com.google.protobuf.ByteString) rawDocument_;
    }
    return com.google.protobuf.ByteString.EMPTY;
  }

  public static final int PROPERTIES_FIELD_NUMBER = 7;

  @SuppressWarnings("serial")
  private java.util.List<com.google.cloud.contentwarehouse.v1.Property> properties_;
  /**
   *
   *
   * <pre>
   * List of values that are user supplied metadata.
   * </pre>
   *
   * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.contentwarehouse.v1.Property> getPropertiesList() {
    return properties_;
  }
  /**
   *
   *
   * <pre>
   * List of values that are user supplied metadata.
   * </pre>
   *
   * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.contentwarehouse.v1.PropertyOrBuilder>
      getPropertiesOrBuilderList() {
    return properties_;
  }
  /**
   *
   *
   * <pre>
   * List of values that are user supplied metadata.
   * </pre>
   *
   * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
   */
  @java.lang.Override
  public int getPropertiesCount() {
    return properties_.size();
  }
  /**
   *
   *
   * <pre>
   * List of values that are user supplied metadata.
   * </pre>
   *
   * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
   */
  @java.lang.Override
  public com.google.cloud.contentwarehouse.v1.Property getProperties(int index) {
    return properties_.get(index);
  }
  /**
   *
   *
   * <pre>
   * List of values that are user supplied metadata.
   * </pre>
   *
   * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
   */
  @java.lang.Override
  public com.google.cloud.contentwarehouse.v1.PropertyOrBuilder getPropertiesOrBuilder(int index) {
    return properties_.get(index);
  }

  public static final int UPDATE_TIME_FIELD_NUMBER = 8;
  private com.google.protobuf.Timestamp updateTime_;
  /**
   *
   *
   * <pre>
   * Output only. The time when the document is last updated.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return Whether the updateTime field is set.
   */
  @java.lang.Override
  public boolean hasUpdateTime() {
    return updateTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * Output only. The time when the document is last updated.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The updateTime.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getUpdateTime() {
    return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_;
  }
  /**
   *
   *
   * <pre>
   * Output only. The time when the document is last updated.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() {
    return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_;
  }

  public static final int CREATE_TIME_FIELD_NUMBER = 9;
  private com.google.protobuf.Timestamp createTime_;
  /**
   *
   *
   * <pre>
   * Output only. The time when the document is created.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return Whether the createTime field is set.
   */
  @java.lang.Override
  public boolean hasCreateTime() {
    return createTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * Output only. The time when the document is created.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The createTime.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getCreateTime() {
    return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
  }
  /**
   *
   *
   * <pre>
   * Output only. The time when the document is created.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
    return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
  }

  public static final int RAW_DOCUMENT_FILE_TYPE_FIELD_NUMBER = 10;
  private int rawDocumentFileType_ = 0;
  /**
   *
   *
   * <pre>
   * This is used when DocAI was not used to load the document and parsing/
   * extracting is needed for the inline_raw_document.  For example, if
   * inline_raw_document is the byte representation of a PDF file, then
   * this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF.
   * </pre>
   *
   * <code>.google.cloud.contentwarehouse.v1.RawDocumentFileType raw_document_file_type = 10;</code>
   *
   * @return The enum numeric value on the wire for rawDocumentFileType.
   */
  @java.lang.Override
  public int getRawDocumentFileTypeValue() {
    return rawDocumentFileType_;
  }
  /**
   *
   *
   * <pre>
   * This is used when DocAI was not used to load the document and parsing/
   * extracting is needed for the inline_raw_document.  For example, if
   * inline_raw_document is the byte representation of a PDF file, then
   * this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF.
   * </pre>
   *
   * <code>.google.cloud.contentwarehouse.v1.RawDocumentFileType raw_document_file_type = 10;</code>
   *
   * @return The rawDocumentFileType.
   */
  @java.lang.Override
  public com.google.cloud.contentwarehouse.v1.RawDocumentFileType getRawDocumentFileType() {
    com.google.cloud.contentwarehouse.v1.RawDocumentFileType result =
        com.google.cloud.contentwarehouse.v1.RawDocumentFileType.forNumber(rawDocumentFileType_);
    return result == null
        ? com.google.cloud.contentwarehouse.v1.RawDocumentFileType.UNRECOGNIZED
        : result;
  }

  public static final int ASYNC_ENABLED_FIELD_NUMBER = 12;
  private boolean asyncEnabled_ = false;
  /**
   *
   *
   * <pre>
   * If true, makes the document visible to asynchronous policies and rules.
   * </pre>
   *
   * <code>bool async_enabled = 12 [deprecated = true];</code>
   *
   * @deprecated google.cloud.contentwarehouse.v1.Document.async_enabled is deprecated. See
   *     google/cloud/contentwarehouse/v1/document.proto;l=108
   * @return The asyncEnabled.
   */
  @java.lang.Override
  @java.lang.Deprecated
  public boolean getAsyncEnabled() {
    return asyncEnabled_;
  }

  public static final int CONTENT_CATEGORY_FIELD_NUMBER = 20;
  private int contentCategory_ = 0;
  /**
   *
   *
   * <pre>
   * Indicates the category (image, audio, video etc.) of the original content.
   * </pre>
   *
   * <code>.google.cloud.contentwarehouse.v1.ContentCategory content_category = 20;</code>
   *
   * @return The enum numeric value on the wire for contentCategory.
   */
  @java.lang.Override
  public int getContentCategoryValue() {
    return contentCategory_;
  }
  /**
   *
   *
   * <pre>
   * Indicates the category (image, audio, video etc.) of the original content.
   * </pre>
   *
   * <code>.google.cloud.contentwarehouse.v1.ContentCategory content_category = 20;</code>
   *
   * @return The contentCategory.
   */
  @java.lang.Override
  public com.google.cloud.contentwarehouse.v1.ContentCategory getContentCategory() {
    com.google.cloud.contentwarehouse.v1.ContentCategory result =
        com.google.cloud.contentwarehouse.v1.ContentCategory.forNumber(contentCategory_);
    return result == null
        ? com.google.cloud.contentwarehouse.v1.ContentCategory.UNRECOGNIZED
        : result;
  }

  public static final int TEXT_EXTRACTION_DISABLED_FIELD_NUMBER = 19;
  private boolean textExtractionDisabled_ = false;
  /**
   *
   *
   * <pre>
   * If true, text extraction will not be performed.
   * </pre>
   *
   * <code>bool text_extraction_disabled = 19 [deprecated = true];</code>
   *
   * @deprecated google.cloud.contentwarehouse.v1.Document.text_extraction_disabled is deprecated.
   *     See google/cloud/contentwarehouse/v1/document.proto;l=114
   * @return The textExtractionDisabled.
   */
  @java.lang.Override
  @java.lang.Deprecated
  public boolean getTextExtractionDisabled() {
    return textExtractionDisabled_;
  }

  public static final int TEXT_EXTRACTION_ENABLED_FIELD_NUMBER = 21;
  private boolean textExtractionEnabled_ = false;
  /**
   *
   *
   * <pre>
   * If true, text extraction will be performed.
   * </pre>
   *
   * <code>bool text_extraction_enabled = 21;</code>
   *
   * @return The textExtractionEnabled.
   */
  @java.lang.Override
  public boolean getTextExtractionEnabled() {
    return textExtractionEnabled_;
  }

  public static final int CREATOR_FIELD_NUMBER = 13;

  @SuppressWarnings("serial")
  private volatile java.lang.Object creator_ = "";
  /**
   *
   *
   * <pre>
   * The user who creates the document.
   * </pre>
   *
   * <code>string creator = 13;</code>
   *
   * @return The creator.
   */
  @java.lang.Override
  public java.lang.String getCreator() {
    java.lang.Object ref = creator_;
    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();
      creator_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The user who creates the document.
   * </pre>
   *
   * <code>string creator = 13;</code>
   *
   * @return The bytes for creator.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getCreatorBytes() {
    java.lang.Object ref = creator_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      creator_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int UPDATER_FIELD_NUMBER = 14;

  @SuppressWarnings("serial")
  private volatile java.lang.Object updater_ = "";
  /**
   *
   *
   * <pre>
   * The user who lastly updates the document.
   * </pre>
   *
   * <code>string updater = 14;</code>
   *
   * @return The updater.
   */
  @java.lang.Override
  public java.lang.String getUpdater() {
    java.lang.Object ref = updater_;
    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();
      updater_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The user who lastly updates the document.
   * </pre>
   *
   * <code>string updater = 14;</code>
   *
   * @return The bytes for updater.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getUpdaterBytes() {
    java.lang.Object ref = updater_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      updater_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentSchemaName_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, documentSchemaName_);
    }
    if (structuredContentCase_ == 4) {
      output.writeMessage(4, (com.google.cloud.documentai.v1.Document) structuredContent_);
    }
    if (rawDocumentCase_ == 5) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, rawDocument_);
    }
    if (rawDocumentCase_ == 6) {
      output.writeBytes(6, (com.google.protobuf.ByteString) rawDocument_);
    }
    for (int i = 0; i < properties_.size(); i++) {
      output.writeMessage(7, properties_.get(i));
    }
    if (updateTime_ != null) {
      output.writeMessage(8, getUpdateTime());
    }
    if (createTime_ != null) {
      output.writeMessage(9, getCreateTime());
    }
    if (rawDocumentFileType_
        != com.google.cloud.contentwarehouse.v1.RawDocumentFileType
            .RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED
            .getNumber()) {
      output.writeEnum(10, rawDocumentFileType_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referenceId_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 11, referenceId_);
    }
    if (asyncEnabled_ != false) {
      output.writeBool(12, asyncEnabled_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(creator_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 13, creator_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(updater_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 14, updater_);
    }
    if (structuredContentCase_ == 15) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 15, structuredContent_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(structuredContentUri_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 16, structuredContentUri_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayUri_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 17, displayUri_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 18, title_);
    }
    if (textExtractionDisabled_ != false) {
      output.writeBool(19, textExtractionDisabled_);
    }
    if (contentCategory_
        != com.google.cloud.contentwarehouse.v1.ContentCategory.CONTENT_CATEGORY_UNSPECIFIED
            .getNumber()) {
      output.writeEnum(20, contentCategory_);
    }
    if (textExtractionEnabled_ != false) {
      output.writeBool(21, textExtractionEnabled_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentSchemaName_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, documentSchemaName_);
    }
    if (structuredContentCase_ == 4) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              4, (com.google.cloud.documentai.v1.Document) structuredContent_);
    }
    if (rawDocumentCase_ == 5) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, rawDocument_);
    }
    if (rawDocumentCase_ == 6) {
      size +=
          com.google.protobuf.CodedOutputStream.computeBytesSize(
              6, (com.google.protobuf.ByteString) rawDocument_);
    }
    for (int i = 0; i < properties_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, properties_.get(i));
    }
    if (updateTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getUpdateTime());
    }
    if (createTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getCreateTime());
    }
    if (rawDocumentFileType_
        != com.google.cloud.contentwarehouse.v1.RawDocumentFileType
            .RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED
            .getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, rawDocumentFileType_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referenceId_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, referenceId_);
    }
    if (asyncEnabled_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(12, asyncEnabled_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(creator_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, creator_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(updater_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, updater_);
    }
    if (structuredContentCase_ == 15) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, structuredContent_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(structuredContentUri_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, structuredContentUri_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayUri_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, displayUri_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, title_);
    }
    if (textExtractionDisabled_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(19, textExtractionDisabled_);
    }
    if (contentCategory_
        != com.google.cloud.contentwarehouse.v1.ContentCategory.CONTENT_CATEGORY_UNSPECIFIED
            .getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(20, contentCategory_);
    }
    if (textExtractionEnabled_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(21, textExtractionEnabled_);
    }
    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.Document)) {
      return super.equals(obj);
    }
    com.google.cloud.contentwarehouse.v1.Document other =
        (com.google.cloud.contentwarehouse.v1.Document) obj;

    if (!getName().equals(other.getName())) return false;
    if (!getReferenceId().equals(other.getReferenceId())) return false;
    if (!getDisplayName().equals(other.getDisplayName())) return false;
    if (!getTitle().equals(other.getTitle())) return false;
    if (!getDisplayUri().equals(other.getDisplayUri())) return false;
    if (!getDocumentSchemaName().equals(other.getDocumentSchemaName())) return false;
    if (!getStructuredContentUri().equals(other.getStructuredContentUri())) return false;
    if (!getPropertiesList().equals(other.getPropertiesList())) return false;
    if (hasUpdateTime() != other.hasUpdateTime()) return false;
    if (hasUpdateTime()) {
      if (!getUpdateTime().equals(other.getUpdateTime())) return false;
    }
    if (hasCreateTime() != other.hasCreateTime()) return false;
    if (hasCreateTime()) {
      if (!getCreateTime().equals(other.getCreateTime())) return false;
    }
    if (rawDocumentFileType_ != other.rawDocumentFileType_) return false;
    if (getAsyncEnabled() != other.getAsyncEnabled()) return false;
    if (contentCategory_ != other.contentCategory_) return false;
    if (getTextExtractionDisabled() != other.getTextExtractionDisabled()) return false;
    if (getTextExtractionEnabled() != other.getTextExtractionEnabled()) return false;
    if (!getCreator().equals(other.getCreator())) return false;
    if (!getUpdater().equals(other.getUpdater())) return false;
    if (!getStructuredContentCase().equals(other.getStructuredContentCase())) return false;
    switch (structuredContentCase_) {
      case 15:
        if (!getPlainText().equals(other.getPlainText())) return false;
        break;
      case 4:
        if (!getCloudAiDocument().equals(other.getCloudAiDocument())) return false;
        break;
      case 0:
      default:
    }
    if (!getRawDocumentCase().equals(other.getRawDocumentCase())) return false;
    switch (rawDocumentCase_) {
      case 5:
        if (!getRawDocumentPath().equals(other.getRawDocumentPath())) return false;
        break;
      case 6:
        if (!getInlineRawDocument().equals(other.getInlineRawDocument())) return false;
        break;
      case 0:
      default:
    }
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    hash = (37 * hash) + REFERENCE_ID_FIELD_NUMBER;
    hash = (53 * hash) + getReferenceId().hashCode();
    hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getDisplayName().hashCode();
    hash = (37 * hash) + TITLE_FIELD_NUMBER;
    hash = (53 * hash) + getTitle().hashCode();
    hash = (37 * hash) + DISPLAY_URI_FIELD_NUMBER;
    hash = (53 * hash) + getDisplayUri().hashCode();
    hash = (37 * hash) + DOCUMENT_SCHEMA_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getDocumentSchemaName().hashCode();
    hash = (37 * hash) + STRUCTURED_CONTENT_URI_FIELD_NUMBER;
    hash = (53 * hash) + getStructuredContentUri().hashCode();
    if (getPropertiesCount() > 0) {
      hash = (37 * hash) + PROPERTIES_FIELD_NUMBER;
      hash = (53 * hash) + getPropertiesList().hashCode();
    }
    if (hasUpdateTime()) {
      hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getUpdateTime().hashCode();
    }
    if (hasCreateTime()) {
      hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getCreateTime().hashCode();
    }
    hash = (37 * hash) + RAW_DOCUMENT_FILE_TYPE_FIELD_NUMBER;
    hash = (53 * hash) + rawDocumentFileType_;
    hash = (37 * hash) + ASYNC_ENABLED_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAsyncEnabled());
    hash = (37 * hash) + CONTENT_CATEGORY_FIELD_NUMBER;
    hash = (53 * hash) + contentCategory_;
    hash = (37 * hash) + TEXT_EXTRACTION_DISABLED_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getTextExtractionDisabled());
    hash = (37 * hash) + TEXT_EXTRACTION_ENABLED_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getTextExtractionEnabled());
    hash = (37 * hash) + CREATOR_FIELD_NUMBER;
    hash = (53 * hash) + getCreator().hashCode();
    hash = (37 * hash) + UPDATER_FIELD_NUMBER;
    hash = (53 * hash) + getUpdater().hashCode();
    switch (structuredContentCase_) {
      case 15:
        hash = (37 * hash) + PLAIN_TEXT_FIELD_NUMBER;
        hash = (53 * hash) + getPlainText().hashCode();
        break;
      case 4:
        hash = (37 * hash) + CLOUD_AI_DOCUMENT_FIELD_NUMBER;
        hash = (53 * hash) + getCloudAiDocument().hashCode();
        break;
      case 0:
      default:
    }
    switch (rawDocumentCase_) {
      case 5:
        hash = (37 * hash) + RAW_DOCUMENT_PATH_FIELD_NUMBER;
        hash = (53 * hash) + getRawDocumentPath().hashCode();
        break;
      case 6:
        hash = (37 * hash) + INLINE_RAW_DOCUMENT_FIELD_NUMBER;
        hash = (53 * hash) + getInlineRawDocument().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

  public static com.google.cloud.contentwarehouse.v1.Document 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.Document 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.Document 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.Document prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * Defines the structure for content warehouse document proto.
   * </pre>
   *
   * Protobuf type {@code google.cloud.contentwarehouse.v1.Document}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.contentwarehouse.v1.Document)
      com.google.cloud.contentwarehouse.v1.DocumentOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.contentwarehouse.v1.DocumentProto
          .internal_static_google_cloud_contentwarehouse_v1_Document_descriptor;
    }

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

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

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      name_ = "";
      referenceId_ = "";
      displayName_ = "";
      title_ = "";
      displayUri_ = "";
      documentSchemaName_ = "";
      if (cloudAiDocumentBuilder_ != null) {
        cloudAiDocumentBuilder_.clear();
      }
      structuredContentUri_ = "";
      if (propertiesBuilder_ == null) {
        properties_ = java.util.Collections.emptyList();
      } else {
        properties_ = null;
        propertiesBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000800);
      updateTime_ = null;
      if (updateTimeBuilder_ != null) {
        updateTimeBuilder_.dispose();
        updateTimeBuilder_ = null;
      }
      createTime_ = null;
      if (createTimeBuilder_ != null) {
        createTimeBuilder_.dispose();
        createTimeBuilder_ = null;
      }
      rawDocumentFileType_ = 0;
      asyncEnabled_ = false;
      contentCategory_ = 0;
      textExtractionDisabled_ = false;
      textExtractionEnabled_ = false;
      creator_ = "";
      updater_ = "";
      structuredContentCase_ = 0;
      structuredContent_ = null;
      rawDocumentCase_ = 0;
      rawDocument_ = null;
      return this;
    }

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

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

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

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

    private void buildPartialRepeatedFields(com.google.cloud.contentwarehouse.v1.Document result) {
      if (propertiesBuilder_ == null) {
        if (((bitField0_ & 0x00000800) != 0)) {
          properties_ = java.util.Collections.unmodifiableList(properties_);
          bitField0_ = (bitField0_ & ~0x00000800);
        }
        result.properties_ = properties_;
      } else {
        result.properties_ = propertiesBuilder_.build();
      }
    }

    private void buildPartial0(com.google.cloud.contentwarehouse.v1.Document result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.name_ = name_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.referenceId_ = referenceId_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.displayName_ = displayName_;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.title_ = title_;
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.displayUri_ = displayUri_;
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        result.documentSchemaName_ = documentSchemaName_;
      }
      if (((from_bitField0_ & 0x00000100) != 0)) {
        result.structuredContentUri_ = structuredContentUri_;
      }
      if (((from_bitField0_ & 0x00001000) != 0)) {
        result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build();
      }
      if (((from_bitField0_ & 0x00002000) != 0)) {
        result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build();
      }
      if (((from_bitField0_ & 0x00004000) != 0)) {
        result.rawDocumentFileType_ = rawDocumentFileType_;
      }
      if (((from_bitField0_ & 0x00008000) != 0)) {
        result.asyncEnabled_ = asyncEnabled_;
      }
      if (((from_bitField0_ & 0x00010000) != 0)) {
        result.contentCategory_ = contentCategory_;
      }
      if (((from_bitField0_ & 0x00020000) != 0)) {
        result.textExtractionDisabled_ = textExtractionDisabled_;
      }
      if (((from_bitField0_ & 0x00040000) != 0)) {
        result.textExtractionEnabled_ = textExtractionEnabled_;
      }
      if (((from_bitField0_ & 0x00080000) != 0)) {
        result.creator_ = creator_;
      }
      if (((from_bitField0_ & 0x00100000) != 0)) {
        result.updater_ = updater_;
      }
    }

    private void buildPartialOneofs(com.google.cloud.contentwarehouse.v1.Document result) {
      result.structuredContentCase_ = structuredContentCase_;
      result.structuredContent_ = this.structuredContent_;
      if (structuredContentCase_ == 4 && cloudAiDocumentBuilder_ != null) {
        result.structuredContent_ = cloudAiDocumentBuilder_.build();
      }
      result.rawDocumentCase_ = rawDocumentCase_;
      result.rawDocument_ = this.rawDocument_;
    }

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

    public Builder mergeFrom(com.google.cloud.contentwarehouse.v1.Document other) {
      if (other == com.google.cloud.contentwarehouse.v1.Document.getDefaultInstance()) return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (!other.getReferenceId().isEmpty()) {
        referenceId_ = other.referenceId_;
        bitField0_ |= 0x00000002;
        onChanged();
      }
      if (!other.getDisplayName().isEmpty()) {
        displayName_ = other.displayName_;
        bitField0_ |= 0x00000004;
        onChanged();
      }
      if (!other.getTitle().isEmpty()) {
        title_ = other.title_;
        bitField0_ |= 0x00000008;
        onChanged();
      }
      if (!other.getDisplayUri().isEmpty()) {
        displayUri_ = other.displayUri_;
        bitField0_ |= 0x00000010;
        onChanged();
      }
      if (!other.getDocumentSchemaName().isEmpty()) {
        documentSchemaName_ = other.documentSchemaName_;
        bitField0_ |= 0x00000020;
        onChanged();
      }
      if (!other.getStructuredContentUri().isEmpty()) {
        structuredContentUri_ = other.structuredContentUri_;
        bitField0_ |= 0x00000100;
        onChanged();
      }
      if (propertiesBuilder_ == null) {
        if (!other.properties_.isEmpty()) {
          if (properties_.isEmpty()) {
            properties_ = other.properties_;
            bitField0_ = (bitField0_ & ~0x00000800);
          } else {
            ensurePropertiesIsMutable();
            properties_.addAll(other.properties_);
          }
          onChanged();
        }
      } else {
        if (!other.properties_.isEmpty()) {
          if (propertiesBuilder_.isEmpty()) {
            propertiesBuilder_.dispose();
            propertiesBuilder_ = null;
            properties_ = other.properties_;
            bitField0_ = (bitField0_ & ~0x00000800);
            propertiesBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getPropertiesFieldBuilder()
                    : null;
          } else {
            propertiesBuilder_.addAllMessages(other.properties_);
          }
        }
      }
      if (other.hasUpdateTime()) {
        mergeUpdateTime(other.getUpdateTime());
      }
      if (other.hasCreateTime()) {
        mergeCreateTime(other.getCreateTime());
      }
      if (other.rawDocumentFileType_ != 0) {
        setRawDocumentFileTypeValue(other.getRawDocumentFileTypeValue());
      }
      if (other.getAsyncEnabled() != false) {
        setAsyncEnabled(other.getAsyncEnabled());
      }
      if (other.contentCategory_ != 0) {
        setContentCategoryValue(other.getContentCategoryValue());
      }
      if (other.getTextExtractionDisabled() != false) {
        setTextExtractionDisabled(other.getTextExtractionDisabled());
      }
      if (other.getTextExtractionEnabled() != false) {
        setTextExtractionEnabled(other.getTextExtractionEnabled());
      }
      if (!other.getCreator().isEmpty()) {
        creator_ = other.creator_;
        bitField0_ |= 0x00080000;
        onChanged();
      }
      if (!other.getUpdater().isEmpty()) {
        updater_ = other.updater_;
        bitField0_ |= 0x00100000;
        onChanged();
      }
      switch (other.getStructuredContentCase()) {
        case PLAIN_TEXT:
          {
            structuredContentCase_ = 15;
            structuredContent_ = other.structuredContent_;
            onChanged();
            break;
          }
        case CLOUD_AI_DOCUMENT:
          {
            mergeCloudAiDocument(other.getCloudAiDocument());
            break;
          }
        case STRUCTUREDCONTENT_NOT_SET:
          {
            break;
          }
      }
      switch (other.getRawDocumentCase()) {
        case RAW_DOCUMENT_PATH:
          {
            rawDocumentCase_ = 5;
            rawDocument_ = other.rawDocument_;
            onChanged();
            break;
          }
        case INLINE_RAW_DOCUMENT:
          {
            setInlineRawDocument(other.getInlineRawDocument());
            break;
          }
        case RAWDOCUMENT_NOT_SET:
          {
            break;
          }
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

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

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                name_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                displayName_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000004;
                break;
              } // case 18
            case 26:
              {
                documentSchemaName_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000020;
                break;
              } // case 26
            case 34:
              {
                input.readMessage(getCloudAiDocumentFieldBuilder().getBuilder(), extensionRegistry);
                structuredContentCase_ = 4;
                break;
              } // case 34
            case 42:
              {
                java.lang.String s = input.readStringRequireUtf8();
                rawDocumentCase_ = 5;
                rawDocument_ = s;
                break;
              } // case 42
            case 50:
              {
                rawDocument_ = input.readBytes();
                rawDocumentCase_ = 6;
                break;
              } // case 50
            case 58:
              {
                com.google.cloud.contentwarehouse.v1.Property m =
                    input.readMessage(
                        com.google.cloud.contentwarehouse.v1.Property.parser(), extensionRegistry);
                if (propertiesBuilder_ == null) {
                  ensurePropertiesIsMutable();
                  properties_.add(m);
                } else {
                  propertiesBuilder_.addMessage(m);
                }
                break;
              } // case 58
            case 66:
              {
                input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00001000;
                break;
              } // case 66
            case 74:
              {
                input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00002000;
                break;
              } // case 74
            case 80:
              {
                rawDocumentFileType_ = input.readEnum();
                bitField0_ |= 0x00004000;
                break;
              } // case 80
            case 90:
              {
                referenceId_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000002;
                break;
              } // case 90
            case 96:
              {
                asyncEnabled_ = input.readBool();
                bitField0_ |= 0x00008000;
                break;
              } // case 96
            case 106:
              {
                creator_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00080000;
                break;
              } // case 106
            case 114:
              {
                updater_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00100000;
                break;
              } // case 114
            case 122:
              {
                java.lang.String s = input.readStringRequireUtf8();
                structuredContentCase_ = 15;
                structuredContent_ = s;
                break;
              } // case 122
            case 130:
              {
                structuredContentUri_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000100;
                break;
              } // case 130
            case 138:
              {
                displayUri_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000010;
                break;
              } // case 138
            case 146:
              {
                title_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000008;
                break;
              } // case 146
            case 152:
              {
                textExtractionDisabled_ = input.readBool();
                bitField0_ |= 0x00020000;
                break;
              } // case 152
            case 160:
              {
                contentCategory_ = input.readEnum();
                bitField0_ |= 0x00010000;
                break;
              } // case 160
            case 168:
              {
                textExtractionEnabled_ = input.readBool();
                bitField0_ |= 0x00040000;
                break;
              } // case 168
            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 structuredContentCase_ = 0;
    private java.lang.Object structuredContent_;

    public StructuredContentCase getStructuredContentCase() {
      return StructuredContentCase.forNumber(structuredContentCase_);
    }

    public Builder clearStructuredContent() {
      structuredContentCase_ = 0;
      structuredContent_ = null;
      onChanged();
      return this;
    }

    private int rawDocumentCase_ = 0;
    private java.lang.Object rawDocument_;

    public RawDocumentCase getRawDocumentCase() {
      return RawDocumentCase.forNumber(rawDocumentCase_);
    }

    public Builder clearRawDocument() {
      rawDocumentCase_ = 0;
      rawDocument_ = null;
      onChanged();
      return this;
    }

    private int bitField0_;

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * The resource name of the document.
     * Format:
     * projects/{project_number}/locations/{location}/documents/{document_id}.
     * The name is ignored when creating a document.
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @return The name.
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The resource name of the document.
     * Format:
     * projects/{project_number}/locations/{location}/documents/{document_id}.
     * The name is ignored when creating a document.
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @return The bytes for name.
     */
    public com.google.protobuf.ByteString getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The resource name of the document.
     * Format:
     * projects/{project_number}/locations/{location}/documents/{document_id}.
     * The name is ignored when creating a document.
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @param value The name to set.
     * @return This builder for chaining.
     */
    public Builder setName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      name_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource name of the document.
     * Format:
     * projects/{project_number}/locations/{location}/documents/{document_id}.
     * The name is ignored when creating a document.
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {
      name_ = getDefaultInstance().getName();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource name of the document.
     * Format:
     * projects/{project_number}/locations/{location}/documents/{document_id}.
     * The name is ignored when creating a document.
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @param value The bytes for name to set.
     * @return This builder for chaining.
     */
    public Builder setNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      name_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private java.lang.Object referenceId_ = "";
    /**
     *
     *
     * <pre>
     * The reference ID set by customers. Must be unique per project and location.
     * </pre>
     *
     * <code>string reference_id = 11;</code>
     *
     * @return The referenceId.
     */
    public java.lang.String getReferenceId() {
      java.lang.Object ref = referenceId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        referenceId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The reference ID set by customers. Must be unique per project and location.
     * </pre>
     *
     * <code>string reference_id = 11;</code>
     *
     * @return The bytes for referenceId.
     */
    public com.google.protobuf.ByteString getReferenceIdBytes() {
      java.lang.Object ref = referenceId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        referenceId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The reference ID set by customers. Must be unique per project and location.
     * </pre>
     *
     * <code>string reference_id = 11;</code>
     *
     * @param value The referenceId to set.
     * @return This builder for chaining.
     */
    public Builder setReferenceId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      referenceId_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The reference ID set by customers. Must be unique per project and location.
     * </pre>
     *
     * <code>string reference_id = 11;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearReferenceId() {
      referenceId_ = getDefaultInstance().getReferenceId();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The reference ID set by customers. Must be unique per project and location.
     * </pre>
     *
     * <code>string reference_id = 11;</code>
     *
     * @param value The bytes for referenceId to set.
     * @return This builder for chaining.
     */
    public Builder setReferenceIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      referenceId_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    private java.lang.Object displayName_ = "";
    /**
     *
     *
     * <pre>
     * Required. Display name of the document given by the user. This name will be
     * displayed in the UI. Customer can populate this field with the name of the
     * document. This differs from the 'title' field as 'title' is optional and
     * stores the top heading in the document.
     * </pre>
     *
     * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The displayName.
     */
    public java.lang.String getDisplayName() {
      java.lang.Object ref = displayName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        displayName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Display name of the document given by the user. This name will be
     * displayed in the UI. Customer can populate this field with the name of the
     * document. This differs from the 'title' field as 'title' is optional and
     * stores the top heading in the document.
     * </pre>
     *
     * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The bytes for displayName.
     */
    public com.google.protobuf.ByteString getDisplayNameBytes() {
      java.lang.Object ref = displayName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        displayName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Display name of the document given by the user. This name will be
     * displayed in the UI. Customer can populate this field with the name of the
     * document. This differs from the 'title' field as 'title' is optional and
     * stores the top heading in the document.
     * </pre>
     *
     * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The displayName to set.
     * @return This builder for chaining.
     */
    public Builder setDisplayName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      displayName_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Display name of the document given by the user. This name will be
     * displayed in the UI. Customer can populate this field with the name of the
     * document. This differs from the 'title' field as 'title' is optional and
     * stores the top heading in the document.
     * </pre>
     *
     * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDisplayName() {
      displayName_ = getDefaultInstance().getDisplayName();
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Display name of the document given by the user. This name will be
     * displayed in the UI. Customer can populate this field with the name of the
     * document. This differs from the 'title' field as 'title' is optional and
     * stores the top heading in the document.
     * </pre>
     *
     * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The bytes for displayName to set.
     * @return This builder for chaining.
     */
    public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      displayName_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    private java.lang.Object title_ = "";
    /**
     *
     *
     * <pre>
     * Title that describes the document.
     * This can be the top heading or text that describes the document.
     * </pre>
     *
     * <code>string title = 18;</code>
     *
     * @return The title.
     */
    public java.lang.String getTitle() {
      java.lang.Object ref = title_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        title_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Title that describes the document.
     * This can be the top heading or text that describes the document.
     * </pre>
     *
     * <code>string title = 18;</code>
     *
     * @return The bytes for title.
     */
    public com.google.protobuf.ByteString getTitleBytes() {
      java.lang.Object ref = title_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        title_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Title that describes the document.
     * This can be the top heading or text that describes the document.
     * </pre>
     *
     * <code>string title = 18;</code>
     *
     * @param value The title to set.
     * @return This builder for chaining.
     */
    public Builder setTitle(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      title_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Title that describes the document.
     * This can be the top heading or text that describes the document.
     * </pre>
     *
     * <code>string title = 18;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearTitle() {
      title_ = getDefaultInstance().getTitle();
      bitField0_ = (bitField0_ & ~0x00000008);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Title that describes the document.
     * This can be the top heading or text that describes the document.
     * </pre>
     *
     * <code>string title = 18;</code>
     *
     * @param value The bytes for title to set.
     * @return This builder for chaining.
     */
    public Builder setTitleBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      title_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }

    private java.lang.Object displayUri_ = "";
    /**
     *
     *
     * <pre>
     * Uri to display the document, for example, in the UI.
     * </pre>
     *
     * <code>string display_uri = 17;</code>
     *
     * @return The displayUri.
     */
    public java.lang.String getDisplayUri() {
      java.lang.Object ref = displayUri_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        displayUri_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Uri to display the document, for example, in the UI.
     * </pre>
     *
     * <code>string display_uri = 17;</code>
     *
     * @return The bytes for displayUri.
     */
    public com.google.protobuf.ByteString getDisplayUriBytes() {
      java.lang.Object ref = displayUri_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        displayUri_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Uri to display the document, for example, in the UI.
     * </pre>
     *
     * <code>string display_uri = 17;</code>
     *
     * @param value The displayUri to set.
     * @return This builder for chaining.
     */
    public Builder setDisplayUri(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      displayUri_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Uri to display the document, for example, in the UI.
     * </pre>
     *
     * <code>string display_uri = 17;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDisplayUri() {
      displayUri_ = getDefaultInstance().getDisplayUri();
      bitField0_ = (bitField0_ & ~0x00000010);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Uri to display the document, for example, in the UI.
     * </pre>
     *
     * <code>string display_uri = 17;</code>
     *
     * @param value The bytes for displayUri to set.
     * @return This builder for chaining.
     */
    public Builder setDisplayUriBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      displayUri_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }

    private java.lang.Object documentSchemaName_ = "";
    /**
     *
     *
     * <pre>
     * The Document schema name.
     * Format:
     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
     * </pre>
     *
     * <code>string document_schema_name = 3 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return The documentSchemaName.
     */
    public java.lang.String getDocumentSchemaName() {
      java.lang.Object ref = documentSchemaName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        documentSchemaName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The Document schema name.
     * Format:
     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
     * </pre>
     *
     * <code>string document_schema_name = 3 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return The bytes for documentSchemaName.
     */
    public com.google.protobuf.ByteString getDocumentSchemaNameBytes() {
      java.lang.Object ref = documentSchemaName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        documentSchemaName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The Document schema name.
     * Format:
     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
     * </pre>
     *
     * <code>string document_schema_name = 3 [(.google.api.resource_reference) = { ... }</code>
     *
     * @param value The documentSchemaName to set.
     * @return This builder for chaining.
     */
    public Builder setDocumentSchemaName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      documentSchemaName_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The Document schema name.
     * Format:
     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
     * </pre>
     *
     * <code>string document_schema_name = 3 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDocumentSchemaName() {
      documentSchemaName_ = getDefaultInstance().getDocumentSchemaName();
      bitField0_ = (bitField0_ & ~0x00000020);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The Document schema name.
     * Format:
     * projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.
     * </pre>
     *
     * <code>string document_schema_name = 3 [(.google.api.resource_reference) = { ... }</code>
     *
     * @param value The bytes for documentSchemaName to set.
     * @return This builder for chaining.
     */
    public Builder setDocumentSchemaNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      documentSchemaName_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Other document format, such as PPTX, XLXS
     * </pre>
     *
     * <code>string plain_text = 15;</code>
     *
     * @return Whether the plainText field is set.
     */
    @java.lang.Override
    public boolean hasPlainText() {
      return structuredContentCase_ == 15;
    }
    /**
     *
     *
     * <pre>
     * Other document format, such as PPTX, XLXS
     * </pre>
     *
     * <code>string plain_text = 15;</code>
     *
     * @return The plainText.
     */
    @java.lang.Override
    public java.lang.String getPlainText() {
      java.lang.Object ref = "";
      if (structuredContentCase_ == 15) {
        ref = structuredContent_;
      }
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (structuredContentCase_ == 15) {
          structuredContent_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Other document format, such as PPTX, XLXS
     * </pre>
     *
     * <code>string plain_text = 15;</code>
     *
     * @return The bytes for plainText.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getPlainTextBytes() {
      java.lang.Object ref = "";
      if (structuredContentCase_ == 15) {
        ref = structuredContent_;
      }
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        if (structuredContentCase_ == 15) {
          structuredContent_ = b;
        }
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Other document format, such as PPTX, XLXS
     * </pre>
     *
     * <code>string plain_text = 15;</code>
     *
     * @param value The plainText to set.
     * @return This builder for chaining.
     */
    public Builder setPlainText(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      structuredContentCase_ = 15;
      structuredContent_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Other document format, such as PPTX, XLXS
     * </pre>
     *
     * <code>string plain_text = 15;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPlainText() {
      if (structuredContentCase_ == 15) {
        structuredContentCase_ = 0;
        structuredContent_ = null;
        onChanged();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Other document format, such as PPTX, XLXS
     * </pre>
     *
     * <code>string plain_text = 15;</code>
     *
     * @param value The bytes for plainText to set.
     * @return This builder for chaining.
     */
    public Builder setPlainTextBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      structuredContentCase_ = 15;
      structuredContent_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.documentai.v1.Document,
            com.google.cloud.documentai.v1.Document.Builder,
            com.google.cloud.documentai.v1.DocumentOrBuilder>
        cloudAiDocumentBuilder_;
    /**
     *
     *
     * <pre>
     * Document AI format to save the structured content, including OCR.
     * </pre>
     *
     * <code>.google.cloud.documentai.v1.Document cloud_ai_document = 4;</code>
     *
     * @return Whether the cloudAiDocument field is set.
     */
    @java.lang.Override
    public boolean hasCloudAiDocument() {
      return structuredContentCase_ == 4;
    }
    /**
     *
     *
     * <pre>
     * Document AI format to save the structured content, including OCR.
     * </pre>
     *
     * <code>.google.cloud.documentai.v1.Document cloud_ai_document = 4;</code>
     *
     * @return The cloudAiDocument.
     */
    @java.lang.Override
    public com.google.cloud.documentai.v1.Document getCloudAiDocument() {
      if (cloudAiDocumentBuilder_ == null) {
        if (structuredContentCase_ == 4) {
          return (com.google.cloud.documentai.v1.Document) structuredContent_;
        }
        return com.google.cloud.documentai.v1.Document.getDefaultInstance();
      } else {
        if (structuredContentCase_ == 4) {
          return cloudAiDocumentBuilder_.getMessage();
        }
        return com.google.cloud.documentai.v1.Document.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Document AI format to save the structured content, including OCR.
     * </pre>
     *
     * <code>.google.cloud.documentai.v1.Document cloud_ai_document = 4;</code>
     */
    public Builder setCloudAiDocument(com.google.cloud.documentai.v1.Document value) {
      if (cloudAiDocumentBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        structuredContent_ = value;
        onChanged();
      } else {
        cloudAiDocumentBuilder_.setMessage(value);
      }
      structuredContentCase_ = 4;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Document AI format to save the structured content, including OCR.
     * </pre>
     *
     * <code>.google.cloud.documentai.v1.Document cloud_ai_document = 4;</code>
     */
    public Builder setCloudAiDocument(
        com.google.cloud.documentai.v1.Document.Builder builderForValue) {
      if (cloudAiDocumentBuilder_ == null) {
        structuredContent_ = builderForValue.build();
        onChanged();
      } else {
        cloudAiDocumentBuilder_.setMessage(builderForValue.build());
      }
      structuredContentCase_ = 4;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Document AI format to save the structured content, including OCR.
     * </pre>
     *
     * <code>.google.cloud.documentai.v1.Document cloud_ai_document = 4;</code>
     */
    public Builder mergeCloudAiDocument(com.google.cloud.documentai.v1.Document value) {
      if (cloudAiDocumentBuilder_ == null) {
        if (structuredContentCase_ == 4
            && structuredContent_ != com.google.cloud.documentai.v1.Document.getDefaultInstance()) {
          structuredContent_ =
              com.google.cloud.documentai.v1.Document.newBuilder(
                      (com.google.cloud.documentai.v1.Document) structuredContent_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          structuredContent_ = value;
        }
        onChanged();
      } else {
        if (structuredContentCase_ == 4) {
          cloudAiDocumentBuilder_.mergeFrom(value);
        } else {
          cloudAiDocumentBuilder_.setMessage(value);
        }
      }
      structuredContentCase_ = 4;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Document AI format to save the structured content, including OCR.
     * </pre>
     *
     * <code>.google.cloud.documentai.v1.Document cloud_ai_document = 4;</code>
     */
    public Builder clearCloudAiDocument() {
      if (cloudAiDocumentBuilder_ == null) {
        if (structuredContentCase_ == 4) {
          structuredContentCase_ = 0;
          structuredContent_ = null;
          onChanged();
        }
      } else {
        if (structuredContentCase_ == 4) {
          structuredContentCase_ = 0;
          structuredContent_ = null;
        }
        cloudAiDocumentBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Document AI format to save the structured content, including OCR.
     * </pre>
     *
     * <code>.google.cloud.documentai.v1.Document cloud_ai_document = 4;</code>
     */
    public com.google.cloud.documentai.v1.Document.Builder getCloudAiDocumentBuilder() {
      return getCloudAiDocumentFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Document AI format to save the structured content, including OCR.
     * </pre>
     *
     * <code>.google.cloud.documentai.v1.Document cloud_ai_document = 4;</code>
     */
    @java.lang.Override
    public com.google.cloud.documentai.v1.DocumentOrBuilder getCloudAiDocumentOrBuilder() {
      if ((structuredContentCase_ == 4) && (cloudAiDocumentBuilder_ != null)) {
        return cloudAiDocumentBuilder_.getMessageOrBuilder();
      } else {
        if (structuredContentCase_ == 4) {
          return (com.google.cloud.documentai.v1.Document) structuredContent_;
        }
        return com.google.cloud.documentai.v1.Document.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Document AI format to save the structured content, including OCR.
     * </pre>
     *
     * <code>.google.cloud.documentai.v1.Document cloud_ai_document = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.documentai.v1.Document,
            com.google.cloud.documentai.v1.Document.Builder,
            com.google.cloud.documentai.v1.DocumentOrBuilder>
        getCloudAiDocumentFieldBuilder() {
      if (cloudAiDocumentBuilder_ == null) {
        if (!(structuredContentCase_ == 4)) {
          structuredContent_ = com.google.cloud.documentai.v1.Document.getDefaultInstance();
        }
        cloudAiDocumentBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.documentai.v1.Document,
                com.google.cloud.documentai.v1.Document.Builder,
                com.google.cloud.documentai.v1.DocumentOrBuilder>(
                (com.google.cloud.documentai.v1.Document) structuredContent_,
                getParentForChildren(),
                isClean());
        structuredContent_ = null;
      }
      structuredContentCase_ = 4;
      onChanged();
      return cloudAiDocumentBuilder_;
    }

    private java.lang.Object structuredContentUri_ = "";
    /**
     *
     *
     * <pre>
     * A path linked to structured content file.
     * </pre>
     *
     * <code>string structured_content_uri = 16 [deprecated = true];</code>
     *
     * @deprecated google.cloud.contentwarehouse.v1.Document.structured_content_uri is deprecated.
     *     See google/cloud/contentwarehouse/v1/document.proto;l=79
     * @return The structuredContentUri.
     */
    @java.lang.Deprecated
    public java.lang.String getStructuredContentUri() {
      java.lang.Object ref = structuredContentUri_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        structuredContentUri_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * A path linked to structured content file.
     * </pre>
     *
     * <code>string structured_content_uri = 16 [deprecated = true];</code>
     *
     * @deprecated google.cloud.contentwarehouse.v1.Document.structured_content_uri is deprecated.
     *     See google/cloud/contentwarehouse/v1/document.proto;l=79
     * @return The bytes for structuredContentUri.
     */
    @java.lang.Deprecated
    public com.google.protobuf.ByteString getStructuredContentUriBytes() {
      java.lang.Object ref = structuredContentUri_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        structuredContentUri_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * A path linked to structured content file.
     * </pre>
     *
     * <code>string structured_content_uri = 16 [deprecated = true];</code>
     *
     * @deprecated google.cloud.contentwarehouse.v1.Document.structured_content_uri is deprecated.
     *     See google/cloud/contentwarehouse/v1/document.proto;l=79
     * @param value The structuredContentUri to set.
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder setStructuredContentUri(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      structuredContentUri_ = value;
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A path linked to structured content file.
     * </pre>
     *
     * <code>string structured_content_uri = 16 [deprecated = true];</code>
     *
     * @deprecated google.cloud.contentwarehouse.v1.Document.structured_content_uri is deprecated.
     *     See google/cloud/contentwarehouse/v1/document.proto;l=79
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder clearStructuredContentUri() {
      structuredContentUri_ = getDefaultInstance().getStructuredContentUri();
      bitField0_ = (bitField0_ & ~0x00000100);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A path linked to structured content file.
     * </pre>
     *
     * <code>string structured_content_uri = 16 [deprecated = true];</code>
     *
     * @deprecated google.cloud.contentwarehouse.v1.Document.structured_content_uri is deprecated.
     *     See google/cloud/contentwarehouse/v1/document.proto;l=79
     * @param value The bytes for structuredContentUri to set.
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder setStructuredContentUriBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      structuredContentUri_ = value;
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Raw document file in Cloud Storage path.
     * </pre>
     *
     * <code>string raw_document_path = 5;</code>
     *
     * @return Whether the rawDocumentPath field is set.
     */
    @java.lang.Override
    public boolean hasRawDocumentPath() {
      return rawDocumentCase_ == 5;
    }
    /**
     *
     *
     * <pre>
     * Raw document file in Cloud Storage path.
     * </pre>
     *
     * <code>string raw_document_path = 5;</code>
     *
     * @return The rawDocumentPath.
     */
    @java.lang.Override
    public java.lang.String getRawDocumentPath() {
      java.lang.Object ref = "";
      if (rawDocumentCase_ == 5) {
        ref = rawDocument_;
      }
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (rawDocumentCase_ == 5) {
          rawDocument_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Raw document file in Cloud Storage path.
     * </pre>
     *
     * <code>string raw_document_path = 5;</code>
     *
     * @return The bytes for rawDocumentPath.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getRawDocumentPathBytes() {
      java.lang.Object ref = "";
      if (rawDocumentCase_ == 5) {
        ref = rawDocument_;
      }
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        if (rawDocumentCase_ == 5) {
          rawDocument_ = b;
        }
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Raw document file in Cloud Storage path.
     * </pre>
     *
     * <code>string raw_document_path = 5;</code>
     *
     * @param value The rawDocumentPath to set.
     * @return This builder for chaining.
     */
    public Builder setRawDocumentPath(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      rawDocumentCase_ = 5;
      rawDocument_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Raw document file in Cloud Storage path.
     * </pre>
     *
     * <code>string raw_document_path = 5;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearRawDocumentPath() {
      if (rawDocumentCase_ == 5) {
        rawDocumentCase_ = 0;
        rawDocument_ = null;
        onChanged();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Raw document file in Cloud Storage path.
     * </pre>
     *
     * <code>string raw_document_path = 5;</code>
     *
     * @param value The bytes for rawDocumentPath to set.
     * @return This builder for chaining.
     */
    public Builder setRawDocumentPathBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      rawDocumentCase_ = 5;
      rawDocument_ = value;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Raw document content.
     * </pre>
     *
     * <code>bytes inline_raw_document = 6;</code>
     *
     * @return Whether the inlineRawDocument field is set.
     */
    public boolean hasInlineRawDocument() {
      return rawDocumentCase_ == 6;
    }
    /**
     *
     *
     * <pre>
     * Raw document content.
     * </pre>
     *
     * <code>bytes inline_raw_document = 6;</code>
     *
     * @return The inlineRawDocument.
     */
    public com.google.protobuf.ByteString getInlineRawDocument() {
      if (rawDocumentCase_ == 6) {
        return (com.google.protobuf.ByteString) rawDocument_;
      }
      return com.google.protobuf.ByteString.EMPTY;
    }
    /**
     *
     *
     * <pre>
     * Raw document content.
     * </pre>
     *
     * <code>bytes inline_raw_document = 6;</code>
     *
     * @param value The inlineRawDocument to set.
     * @return This builder for chaining.
     */
    public Builder setInlineRawDocument(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      rawDocumentCase_ = 6;
      rawDocument_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Raw document content.
     * </pre>
     *
     * <code>bytes inline_raw_document = 6;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearInlineRawDocument() {
      if (rawDocumentCase_ == 6) {
        rawDocumentCase_ = 0;
        rawDocument_ = null;
        onChanged();
      }
      return this;
    }

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

    private void ensurePropertiesIsMutable() {
      if (!((bitField0_ & 0x00000800) != 0)) {
        properties_ =
            new java.util.ArrayList<com.google.cloud.contentwarehouse.v1.Property>(properties_);
        bitField0_ |= 0x00000800;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.contentwarehouse.v1.Property,
            com.google.cloud.contentwarehouse.v1.Property.Builder,
            com.google.cloud.contentwarehouse.v1.PropertyOrBuilder>
        propertiesBuilder_;

    /**
     *
     *
     * <pre>
     * List of values that are user supplied metadata.
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
     */
    public java.util.List<com.google.cloud.contentwarehouse.v1.Property> getPropertiesList() {
      if (propertiesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(properties_);
      } else {
        return propertiesBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * List of values that are user supplied metadata.
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
     */
    public int getPropertiesCount() {
      if (propertiesBuilder_ == null) {
        return properties_.size();
      } else {
        return propertiesBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * List of values that are user supplied metadata.
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
     */
    public com.google.cloud.contentwarehouse.v1.Property getProperties(int index) {
      if (propertiesBuilder_ == null) {
        return properties_.get(index);
      } else {
        return propertiesBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * List of values that are user supplied metadata.
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
     */
    public Builder setProperties(int index, com.google.cloud.contentwarehouse.v1.Property value) {
      if (propertiesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensurePropertiesIsMutable();
        properties_.set(index, value);
        onChanged();
      } else {
        propertiesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of values that are user supplied metadata.
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
     */
    public Builder setProperties(
        int index, com.google.cloud.contentwarehouse.v1.Property.Builder builderForValue) {
      if (propertiesBuilder_ == null) {
        ensurePropertiesIsMutable();
        properties_.set(index, builderForValue.build());
        onChanged();
      } else {
        propertiesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of values that are user supplied metadata.
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
     */
    public Builder addProperties(com.google.cloud.contentwarehouse.v1.Property value) {
      if (propertiesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensurePropertiesIsMutable();
        properties_.add(value);
        onChanged();
      } else {
        propertiesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of values that are user supplied metadata.
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
     */
    public Builder addProperties(int index, com.google.cloud.contentwarehouse.v1.Property value) {
      if (propertiesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensurePropertiesIsMutable();
        properties_.add(index, value);
        onChanged();
      } else {
        propertiesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of values that are user supplied metadata.
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
     */
    public Builder addProperties(
        com.google.cloud.contentwarehouse.v1.Property.Builder builderForValue) {
      if (propertiesBuilder_ == null) {
        ensurePropertiesIsMutable();
        properties_.add(builderForValue.build());
        onChanged();
      } else {
        propertiesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of values that are user supplied metadata.
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
     */
    public Builder addProperties(
        int index, com.google.cloud.contentwarehouse.v1.Property.Builder builderForValue) {
      if (propertiesBuilder_ == null) {
        ensurePropertiesIsMutable();
        properties_.add(index, builderForValue.build());
        onChanged();
      } else {
        propertiesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of values that are user supplied metadata.
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
     */
    public Builder addAllProperties(
        java.lang.Iterable<? extends com.google.cloud.contentwarehouse.v1.Property> values) {
      if (propertiesBuilder_ == null) {
        ensurePropertiesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, properties_);
        onChanged();
      } else {
        propertiesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of values that are user supplied metadata.
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
     */
    public Builder clearProperties() {
      if (propertiesBuilder_ == null) {
        properties_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000800);
        onChanged();
      } else {
        propertiesBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of values that are user supplied metadata.
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
     */
    public Builder removeProperties(int index) {
      if (propertiesBuilder_ == null) {
        ensurePropertiesIsMutable();
        properties_.remove(index);
        onChanged();
      } else {
        propertiesBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of values that are user supplied metadata.
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
     */
    public com.google.cloud.contentwarehouse.v1.Property.Builder getPropertiesBuilder(int index) {
      return getPropertiesFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * List of values that are user supplied metadata.
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
     */
    public com.google.cloud.contentwarehouse.v1.PropertyOrBuilder getPropertiesOrBuilder(
        int index) {
      if (propertiesBuilder_ == null) {
        return properties_.get(index);
      } else {
        return propertiesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * List of values that are user supplied metadata.
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
     */
    public java.util.List<? extends com.google.cloud.contentwarehouse.v1.PropertyOrBuilder>
        getPropertiesOrBuilderList() {
      if (propertiesBuilder_ != null) {
        return propertiesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(properties_);
      }
    }
    /**
     *
     *
     * <pre>
     * List of values that are user supplied metadata.
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
     */
    public com.google.cloud.contentwarehouse.v1.Property.Builder addPropertiesBuilder() {
      return getPropertiesFieldBuilder()
          .addBuilder(com.google.cloud.contentwarehouse.v1.Property.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * List of values that are user supplied metadata.
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
     */
    public com.google.cloud.contentwarehouse.v1.Property.Builder addPropertiesBuilder(int index) {
      return getPropertiesFieldBuilder()
          .addBuilder(index, com.google.cloud.contentwarehouse.v1.Property.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * List of values that are user supplied metadata.
     * </pre>
     *
     * <code>repeated .google.cloud.contentwarehouse.v1.Property properties = 7;</code>
     */
    public java.util.List<com.google.cloud.contentwarehouse.v1.Property.Builder>
        getPropertiesBuilderList() {
      return getPropertiesFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.contentwarehouse.v1.Property,
            com.google.cloud.contentwarehouse.v1.Property.Builder,
            com.google.cloud.contentwarehouse.v1.PropertyOrBuilder>
        getPropertiesFieldBuilder() {
      if (propertiesBuilder_ == null) {
        propertiesBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.contentwarehouse.v1.Property,
                com.google.cloud.contentwarehouse.v1.Property.Builder,
                com.google.cloud.contentwarehouse.v1.PropertyOrBuilder>(
                properties_, ((bitField0_ & 0x00000800) != 0), getParentForChildren(), isClean());
        properties_ = null;
      }
      return propertiesBuilder_;
    }

    private com.google.protobuf.Timestamp updateTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        updateTimeBuilder_;
    /**
     *
     *
     * <pre>
     * Output only. The time when the document is last updated.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return Whether the updateTime field is set.
     */
    public boolean hasUpdateTime() {
      return ((bitField0_ & 0x00001000) != 0);
    }
    /**
     *
     *
     * <pre>
     * Output only. The time when the document is last updated.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The updateTime.
     */
    public com.google.protobuf.Timestamp getUpdateTime() {
      if (updateTimeBuilder_ == null) {
        return updateTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : updateTime_;
      } else {
        return updateTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The time when the document is last updated.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setUpdateTime(com.google.protobuf.Timestamp value) {
      if (updateTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        updateTime_ = value;
      } else {
        updateTimeBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00001000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time when the document is last updated.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (updateTimeBuilder_ == null) {
        updateTime_ = builderForValue.build();
      } else {
        updateTimeBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00001000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time when the document is last updated.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) {
      if (updateTimeBuilder_ == null) {
        if (((bitField0_ & 0x00001000) != 0)
            && updateTime_ != null
            && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
          getUpdateTimeBuilder().mergeFrom(value);
        } else {
          updateTime_ = value;
        }
      } else {
        updateTimeBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00001000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time when the document is last updated.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder clearUpdateTime() {
      bitField0_ = (bitField0_ & ~0x00001000);
      updateTime_ = null;
      if (updateTimeBuilder_ != null) {
        updateTimeBuilder_.dispose();
        updateTimeBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time when the document is last updated.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() {
      bitField0_ |= 0x00001000;
      onChanged();
      return getUpdateTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Output only. The time when the document is last updated.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() {
      if (updateTimeBuilder_ != null) {
        return updateTimeBuilder_.getMessageOrBuilder();
      } else {
        return updateTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : updateTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The time when the document is last updated.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getUpdateTimeFieldBuilder() {
      if (updateTimeBuilder_ == null) {
        updateTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getUpdateTime(), getParentForChildren(), isClean());
        updateTime_ = null;
      }
      return updateTimeBuilder_;
    }

    private com.google.protobuf.Timestamp createTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        createTimeBuilder_;
    /**
     *
     *
     * <pre>
     * Output only. The time when the document is created.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return Whether the createTime field is set.
     */
    public boolean hasCreateTime() {
      return ((bitField0_ & 0x00002000) != 0);
    }
    /**
     *
     *
     * <pre>
     * Output only. The time when the document is created.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The createTime.
     */
    public com.google.protobuf.Timestamp getCreateTime() {
      if (createTimeBuilder_ == null) {
        return createTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : createTime_;
      } else {
        return createTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The time when the document is created.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setCreateTime(com.google.protobuf.Timestamp value) {
      if (createTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        createTime_ = value;
      } else {
        createTimeBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00002000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time when the document is created.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (createTimeBuilder_ == null) {
        createTime_ = builderForValue.build();
      } else {
        createTimeBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00002000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time when the document is created.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder mergeCreateTime(com.google.protobuf.Timestamp value) {
      if (createTimeBuilder_ == null) {
        if (((bitField0_ & 0x00002000) != 0)
            && createTime_ != null
            && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
          getCreateTimeBuilder().mergeFrom(value);
        } else {
          createTime_ = value;
        }
      } else {
        createTimeBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00002000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time when the document is created.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder clearCreateTime() {
      bitField0_ = (bitField0_ & ~0x00002000);
      createTime_ = null;
      if (createTimeBuilder_ != null) {
        createTimeBuilder_.dispose();
        createTimeBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time when the document is created.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() {
      bitField0_ |= 0x00002000;
      onChanged();
      return getCreateTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Output only. The time when the document is created.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
      if (createTimeBuilder_ != null) {
        return createTimeBuilder_.getMessageOrBuilder();
      } else {
        return createTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : createTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The time when the document is created.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getCreateTimeFieldBuilder() {
      if (createTimeBuilder_ == null) {
        createTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getCreateTime(), getParentForChildren(), isClean());
        createTime_ = null;
      }
      return createTimeBuilder_;
    }

    private int rawDocumentFileType_ = 0;
    /**
     *
     *
     * <pre>
     * This is used when DocAI was not used to load the document and parsing/
     * extracting is needed for the inline_raw_document.  For example, if
     * inline_raw_document is the byte representation of a PDF file, then
     * this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.RawDocumentFileType raw_document_file_type = 10;
     * </code>
     *
     * @return The enum numeric value on the wire for rawDocumentFileType.
     */
    @java.lang.Override
    public int getRawDocumentFileTypeValue() {
      return rawDocumentFileType_;
    }
    /**
     *
     *
     * <pre>
     * This is used when DocAI was not used to load the document and parsing/
     * extracting is needed for the inline_raw_document.  For example, if
     * inline_raw_document is the byte representation of a PDF file, then
     * this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.RawDocumentFileType raw_document_file_type = 10;
     * </code>
     *
     * @param value The enum numeric value on the wire for rawDocumentFileType to set.
     * @return This builder for chaining.
     */
    public Builder setRawDocumentFileTypeValue(int value) {
      rawDocumentFileType_ = value;
      bitField0_ |= 0x00004000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * This is used when DocAI was not used to load the document and parsing/
     * extracting is needed for the inline_raw_document.  For example, if
     * inline_raw_document is the byte representation of a PDF file, then
     * this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.RawDocumentFileType raw_document_file_type = 10;
     * </code>
     *
     * @return The rawDocumentFileType.
     */
    @java.lang.Override
    public com.google.cloud.contentwarehouse.v1.RawDocumentFileType getRawDocumentFileType() {
      com.google.cloud.contentwarehouse.v1.RawDocumentFileType result =
          com.google.cloud.contentwarehouse.v1.RawDocumentFileType.forNumber(rawDocumentFileType_);
      return result == null
          ? com.google.cloud.contentwarehouse.v1.RawDocumentFileType.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * This is used when DocAI was not used to load the document and parsing/
     * extracting is needed for the inline_raw_document.  For example, if
     * inline_raw_document is the byte representation of a PDF file, then
     * this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.RawDocumentFileType raw_document_file_type = 10;
     * </code>
     *
     * @param value The rawDocumentFileType to set.
     * @return This builder for chaining.
     */
    public Builder setRawDocumentFileType(
        com.google.cloud.contentwarehouse.v1.RawDocumentFileType value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00004000;
      rawDocumentFileType_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * This is used when DocAI was not used to load the document and parsing/
     * extracting is needed for the inline_raw_document.  For example, if
     * inline_raw_document is the byte representation of a PDF file, then
     * this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.RawDocumentFileType raw_document_file_type = 10;
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearRawDocumentFileType() {
      bitField0_ = (bitField0_ & ~0x00004000);
      rawDocumentFileType_ = 0;
      onChanged();
      return this;
    }

    private boolean asyncEnabled_;
    /**
     *
     *
     * <pre>
     * If true, makes the document visible to asynchronous policies and rules.
     * </pre>
     *
     * <code>bool async_enabled = 12 [deprecated = true];</code>
     *
     * @deprecated google.cloud.contentwarehouse.v1.Document.async_enabled is deprecated. See
     *     google/cloud/contentwarehouse/v1/document.proto;l=108
     * @return The asyncEnabled.
     */
    @java.lang.Override
    @java.lang.Deprecated
    public boolean getAsyncEnabled() {
      return asyncEnabled_;
    }
    /**
     *
     *
     * <pre>
     * If true, makes the document visible to asynchronous policies and rules.
     * </pre>
     *
     * <code>bool async_enabled = 12 [deprecated = true];</code>
     *
     * @deprecated google.cloud.contentwarehouse.v1.Document.async_enabled is deprecated. See
     *     google/cloud/contentwarehouse/v1/document.proto;l=108
     * @param value The asyncEnabled to set.
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder setAsyncEnabled(boolean value) {

      asyncEnabled_ = value;
      bitField0_ |= 0x00008000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * If true, makes the document visible to asynchronous policies and rules.
     * </pre>
     *
     * <code>bool async_enabled = 12 [deprecated = true];</code>
     *
     * @deprecated google.cloud.contentwarehouse.v1.Document.async_enabled is deprecated. See
     *     google/cloud/contentwarehouse/v1/document.proto;l=108
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder clearAsyncEnabled() {
      bitField0_ = (bitField0_ & ~0x00008000);
      asyncEnabled_ = false;
      onChanged();
      return this;
    }

    private int contentCategory_ = 0;
    /**
     *
     *
     * <pre>
     * Indicates the category (image, audio, video etc.) of the original content.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.ContentCategory content_category = 20;</code>
     *
     * @return The enum numeric value on the wire for contentCategory.
     */
    @java.lang.Override
    public int getContentCategoryValue() {
      return contentCategory_;
    }
    /**
     *
     *
     * <pre>
     * Indicates the category (image, audio, video etc.) of the original content.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.ContentCategory content_category = 20;</code>
     *
     * @param value The enum numeric value on the wire for contentCategory to set.
     * @return This builder for chaining.
     */
    public Builder setContentCategoryValue(int value) {
      contentCategory_ = value;
      bitField0_ |= 0x00010000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Indicates the category (image, audio, video etc.) of the original content.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.ContentCategory content_category = 20;</code>
     *
     * @return The contentCategory.
     */
    @java.lang.Override
    public com.google.cloud.contentwarehouse.v1.ContentCategory getContentCategory() {
      com.google.cloud.contentwarehouse.v1.ContentCategory result =
          com.google.cloud.contentwarehouse.v1.ContentCategory.forNumber(contentCategory_);
      return result == null
          ? com.google.cloud.contentwarehouse.v1.ContentCategory.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * Indicates the category (image, audio, video etc.) of the original content.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.ContentCategory content_category = 20;</code>
     *
     * @param value The contentCategory to set.
     * @return This builder for chaining.
     */
    public Builder setContentCategory(com.google.cloud.contentwarehouse.v1.ContentCategory value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00010000;
      contentCategory_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Indicates the category (image, audio, video etc.) of the original content.
     * </pre>
     *
     * <code>.google.cloud.contentwarehouse.v1.ContentCategory content_category = 20;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearContentCategory() {
      bitField0_ = (bitField0_ & ~0x00010000);
      contentCategory_ = 0;
      onChanged();
      return this;
    }

    private boolean textExtractionDisabled_;
    /**
     *
     *
     * <pre>
     * If true, text extraction will not be performed.
     * </pre>
     *
     * <code>bool text_extraction_disabled = 19 [deprecated = true];</code>
     *
     * @deprecated google.cloud.contentwarehouse.v1.Document.text_extraction_disabled is deprecated.
     *     See google/cloud/contentwarehouse/v1/document.proto;l=114
     * @return The textExtractionDisabled.
     */
    @java.lang.Override
    @java.lang.Deprecated
    public boolean getTextExtractionDisabled() {
      return textExtractionDisabled_;
    }
    /**
     *
     *
     * <pre>
     * If true, text extraction will not be performed.
     * </pre>
     *
     * <code>bool text_extraction_disabled = 19 [deprecated = true];</code>
     *
     * @deprecated google.cloud.contentwarehouse.v1.Document.text_extraction_disabled is deprecated.
     *     See google/cloud/contentwarehouse/v1/document.proto;l=114
     * @param value The textExtractionDisabled to set.
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder setTextExtractionDisabled(boolean value) {

      textExtractionDisabled_ = value;
      bitField0_ |= 0x00020000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * If true, text extraction will not be performed.
     * </pre>
     *
     * <code>bool text_extraction_disabled = 19 [deprecated = true];</code>
     *
     * @deprecated google.cloud.contentwarehouse.v1.Document.text_extraction_disabled is deprecated.
     *     See google/cloud/contentwarehouse/v1/document.proto;l=114
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder clearTextExtractionDisabled() {
      bitField0_ = (bitField0_ & ~0x00020000);
      textExtractionDisabled_ = false;
      onChanged();
      return this;
    }

    private boolean textExtractionEnabled_;
    /**
     *
     *
     * <pre>
     * If true, text extraction will be performed.
     * </pre>
     *
     * <code>bool text_extraction_enabled = 21;</code>
     *
     * @return The textExtractionEnabled.
     */
    @java.lang.Override
    public boolean getTextExtractionEnabled() {
      return textExtractionEnabled_;
    }
    /**
     *
     *
     * <pre>
     * If true, text extraction will be performed.
     * </pre>
     *
     * <code>bool text_extraction_enabled = 21;</code>
     *
     * @param value The textExtractionEnabled to set.
     * @return This builder for chaining.
     */
    public Builder setTextExtractionEnabled(boolean value) {

      textExtractionEnabled_ = value;
      bitField0_ |= 0x00040000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * If true, text extraction will be performed.
     * </pre>
     *
     * <code>bool text_extraction_enabled = 21;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearTextExtractionEnabled() {
      bitField0_ = (bitField0_ & ~0x00040000);
      textExtractionEnabled_ = false;
      onChanged();
      return this;
    }

    private java.lang.Object creator_ = "";
    /**
     *
     *
     * <pre>
     * The user who creates the document.
     * </pre>
     *
     * <code>string creator = 13;</code>
     *
     * @return The creator.
     */
    public java.lang.String getCreator() {
      java.lang.Object ref = creator_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        creator_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The user who creates the document.
     * </pre>
     *
     * <code>string creator = 13;</code>
     *
     * @return The bytes for creator.
     */
    public com.google.protobuf.ByteString getCreatorBytes() {
      java.lang.Object ref = creator_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        creator_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The user who creates the document.
     * </pre>
     *
     * <code>string creator = 13;</code>
     *
     * @param value The creator to set.
     * @return This builder for chaining.
     */
    public Builder setCreator(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      creator_ = value;
      bitField0_ |= 0x00080000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The user who creates the document.
     * </pre>
     *
     * <code>string creator = 13;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearCreator() {
      creator_ = getDefaultInstance().getCreator();
      bitField0_ = (bitField0_ & ~0x00080000);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The user who creates the document.
     * </pre>
     *
     * <code>string creator = 13;</code>
     *
     * @param value The bytes for creator to set.
     * @return This builder for chaining.
     */
    public Builder setCreatorBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      creator_ = value;
      bitField0_ |= 0x00080000;
      onChanged();
      return this;
    }

    private java.lang.Object updater_ = "";
    /**
     *
     *
     * <pre>
     * The user who lastly updates the document.
     * </pre>
     *
     * <code>string updater = 14;</code>
     *
     * @return The updater.
     */
    public java.lang.String getUpdater() {
      java.lang.Object ref = updater_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        updater_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The user who lastly updates the document.
     * </pre>
     *
     * <code>string updater = 14;</code>
     *
     * @return The bytes for updater.
     */
    public com.google.protobuf.ByteString getUpdaterBytes() {
      java.lang.Object ref = updater_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        updater_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The user who lastly updates the document.
     * </pre>
     *
     * <code>string updater = 14;</code>
     *
     * @param value The updater to set.
     * @return This builder for chaining.
     */
    public Builder setUpdater(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      updater_ = value;
      bitField0_ |= 0x00100000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The user who lastly updates the document.
     * </pre>
     *
     * <code>string updater = 14;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearUpdater() {
      updater_ = getDefaultInstance().getUpdater();
      bitField0_ = (bitField0_ & ~0x00100000);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The user who lastly updates the document.
     * </pre>
     *
     * <code>string updater = 14;</code>
     *
     * @param value The bytes for updater to set.
     * @return This builder for chaining.
     */
    public Builder setUpdaterBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      updater_ = value;
      bitField0_ |= 0x00100000;
      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.Document)
  }

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

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

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

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

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

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