/*
 * 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/dialogflow/v2beta1/document.proto

package com.google.cloud.dialogflow.v2beta1;

/**
 *
 *
 * <pre>
 * A knowledge document to be used by a
 * [KnowledgeBase][google.cloud.dialogflow.v2beta1.KnowledgeBase].
 * For more information, see the [knowledge base
 * guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases).
 * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
 * only use `projects.knowledgeBases.documents`.
 * </pre>
 *
 * Protobuf type {@code google.cloud.dialogflow.v2beta1.Document}
 */
public final class Document extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2beta1.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_ = "";
    displayName_ = "";
    mimeType_ = "";
    knowledgeTypes_ = java.util.Collections.emptyList();
    state_ = 0;
  }

  @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.dialogflow.v2beta1.DocumentProto
        .internal_static_google_cloud_dialogflow_v2beta1_Document_descriptor;
  }

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

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

  /**
   *
   *
   * <pre>
   * The knowledge type of document content.
   * </pre>
   *
   * Protobuf enum {@code google.cloud.dialogflow.v2beta1.Document.KnowledgeType}
   */
  public enum KnowledgeType implements com.google.protobuf.ProtocolMessageEnum {
    /**
     *
     *
     * <pre>
     * The type is unspecified or arbitrary.
     * </pre>
     *
     * <code>KNOWLEDGE_TYPE_UNSPECIFIED = 0;</code>
     */
    KNOWLEDGE_TYPE_UNSPECIFIED(0),
    /**
     *
     *
     * <pre>
     * The document content contains question and answer pairs as either HTML or
     * CSV. Typical FAQ HTML formats are parsed accurately, but unusual formats
     * may fail to be parsed.
     * CSV must have questions in the first column and answers in the second,
     * with no header. Because of this explicit format, they are always parsed
     * accurately.
     * </pre>
     *
     * <code>FAQ = 1;</code>
     */
    FAQ(1),
    /**
     *
     *
     * <pre>
     * Documents for which unstructured text is extracted and used for
     * question answering.
     * </pre>
     *
     * <code>EXTRACTIVE_QA = 2;</code>
     */
    EXTRACTIVE_QA(2),
    /**
     *
     *
     * <pre>
     * The entire document content as a whole can be used for query results.
     * Only for Contact Center Solutions on Dialogflow.
     * </pre>
     *
     * <code>ARTICLE_SUGGESTION = 3;</code>
     */
    ARTICLE_SUGGESTION(3),
    /**
     *
     *
     * <pre>
     * The document contains agent-facing Smart Reply entries.
     * </pre>
     *
     * <code>AGENT_FACING_SMART_REPLY = 4;</code>
     */
    AGENT_FACING_SMART_REPLY(4),
    UNRECOGNIZED(-1),
    ;

    /**
     *
     *
     * <pre>
     * The legacy enum for agent-facing smart reply feature.
     * </pre>
     *
     * <code>SMART_REPLY = 4;</code>
     */
    public static final KnowledgeType SMART_REPLY = AGENT_FACING_SMART_REPLY;
    /**
     *
     *
     * <pre>
     * The type is unspecified or arbitrary.
     * </pre>
     *
     * <code>KNOWLEDGE_TYPE_UNSPECIFIED = 0;</code>
     */
    public static final int KNOWLEDGE_TYPE_UNSPECIFIED_VALUE = 0;
    /**
     *
     *
     * <pre>
     * The document content contains question and answer pairs as either HTML or
     * CSV. Typical FAQ HTML formats are parsed accurately, but unusual formats
     * may fail to be parsed.
     * CSV must have questions in the first column and answers in the second,
     * with no header. Because of this explicit format, they are always parsed
     * accurately.
     * </pre>
     *
     * <code>FAQ = 1;</code>
     */
    public static final int FAQ_VALUE = 1;
    /**
     *
     *
     * <pre>
     * Documents for which unstructured text is extracted and used for
     * question answering.
     * </pre>
     *
     * <code>EXTRACTIVE_QA = 2;</code>
     */
    public static final int EXTRACTIVE_QA_VALUE = 2;
    /**
     *
     *
     * <pre>
     * The entire document content as a whole can be used for query results.
     * Only for Contact Center Solutions on Dialogflow.
     * </pre>
     *
     * <code>ARTICLE_SUGGESTION = 3;</code>
     */
    public static final int ARTICLE_SUGGESTION_VALUE = 3;
    /**
     *
     *
     * <pre>
     * The document contains agent-facing Smart Reply entries.
     * </pre>
     *
     * <code>AGENT_FACING_SMART_REPLY = 4;</code>
     */
    public static final int AGENT_FACING_SMART_REPLY_VALUE = 4;
    /**
     *
     *
     * <pre>
     * The legacy enum for agent-facing smart reply feature.
     * </pre>
     *
     * <code>SMART_REPLY = 4;</code>
     */
    public static final int SMART_REPLY_VALUE = 4;

    public final int getNumber() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalArgumentException(
            "Can't get the number of an unknown enum value.");
      }
      return value;
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static KnowledgeType valueOf(int value) {
      return forNumber(value);
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     */
    public static KnowledgeType forNumber(int value) {
      switch (value) {
        case 0:
          return KNOWLEDGE_TYPE_UNSPECIFIED;
        case 1:
          return FAQ;
        case 2:
          return EXTRACTIVE_QA;
        case 3:
          return ARTICLE_SUGGESTION;
        case 4:
          return AGENT_FACING_SMART_REPLY;
        default:
          return null;
      }
    }

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

    private static final com.google.protobuf.Internal.EnumLiteMap<KnowledgeType> internalValueMap =
        new com.google.protobuf.Internal.EnumLiteMap<KnowledgeType>() {
          public KnowledgeType findValueByNumber(int number) {
            return KnowledgeType.forNumber(number);
          }
        };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalStateException(
            "Can't get the descriptor of an unrecognized enum value.");
      }
      return getDescriptor().getValues().get(ordinal());
    }

    public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
      return getDescriptor();
    }

    public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
      return com.google.cloud.dialogflow.v2beta1.Document.getDescriptor().getEnumTypes().get(0);
    }

    private static final KnowledgeType[] VALUES = getStaticValuesArray();

    private static KnowledgeType[] getStaticValuesArray() {
      return new KnowledgeType[] {
        KNOWLEDGE_TYPE_UNSPECIFIED,
        FAQ,
        EXTRACTIVE_QA,
        ARTICLE_SUGGESTION,
        AGENT_FACING_SMART_REPLY,
        SMART_REPLY,
      };
    }

    public static KnowledgeType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
      }
      if (desc.getIndex() == -1) {
        return UNRECOGNIZED;
      }
      return VALUES[desc.getIndex()];
    }

    private final int value;

    private KnowledgeType(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.v2beta1.Document.KnowledgeType)
  }

  /**
   *
   *
   * <pre>
   * Possible states of the document
   * </pre>
   *
   * Protobuf enum {@code google.cloud.dialogflow.v2beta1.Document.State}
   */
  public enum State implements com.google.protobuf.ProtocolMessageEnum {
    /**
     *
     *
     * <pre>
     * The document state is unspecified.
     * </pre>
     *
     * <code>STATE_UNSPECIFIED = 0;</code>
     */
    STATE_UNSPECIFIED(0),
    /**
     *
     *
     * <pre>
     * The document creation is in progress.
     * </pre>
     *
     * <code>CREATING = 1;</code>
     */
    CREATING(1),
    /**
     *
     *
     * <pre>
     * The document is active and ready to use.
     * </pre>
     *
     * <code>ACTIVE = 2;</code>
     */
    ACTIVE(2),
    /**
     *
     *
     * <pre>
     * The document updation is in progress.
     * </pre>
     *
     * <code>UPDATING = 3;</code>
     */
    UPDATING(3),
    /**
     *
     *
     * <pre>
     * The document is reloading.
     * </pre>
     *
     * <code>RELOADING = 4;</code>
     */
    RELOADING(4),
    /**
     *
     *
     * <pre>
     * The document deletion is in progress.
     * </pre>
     *
     * <code>DELETING = 5;</code>
     */
    DELETING(5),
    UNRECOGNIZED(-1),
    ;

    /**
     *
     *
     * <pre>
     * The document state is unspecified.
     * </pre>
     *
     * <code>STATE_UNSPECIFIED = 0;</code>
     */
    public static final int STATE_UNSPECIFIED_VALUE = 0;
    /**
     *
     *
     * <pre>
     * The document creation is in progress.
     * </pre>
     *
     * <code>CREATING = 1;</code>
     */
    public static final int CREATING_VALUE = 1;
    /**
     *
     *
     * <pre>
     * The document is active and ready to use.
     * </pre>
     *
     * <code>ACTIVE = 2;</code>
     */
    public static final int ACTIVE_VALUE = 2;
    /**
     *
     *
     * <pre>
     * The document updation is in progress.
     * </pre>
     *
     * <code>UPDATING = 3;</code>
     */
    public static final int UPDATING_VALUE = 3;
    /**
     *
     *
     * <pre>
     * The document is reloading.
     * </pre>
     *
     * <code>RELOADING = 4;</code>
     */
    public static final int RELOADING_VALUE = 4;
    /**
     *
     *
     * <pre>
     * The document deletion is in progress.
     * </pre>
     *
     * <code>DELETING = 5;</code>
     */
    public static final int DELETING_VALUE = 5;

    public final int getNumber() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalArgumentException(
            "Can't get the number of an unknown enum value.");
      }
      return value;
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static State valueOf(int value) {
      return forNumber(value);
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     */
    public static State forNumber(int value) {
      switch (value) {
        case 0:
          return STATE_UNSPECIFIED;
        case 1:
          return CREATING;
        case 2:
          return ACTIVE;
        case 3:
          return UPDATING;
        case 4:
          return RELOADING;
        case 5:
          return DELETING;
        default:
          return null;
      }
    }

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

    private static final com.google.protobuf.Internal.EnumLiteMap<State> internalValueMap =
        new com.google.protobuf.Internal.EnumLiteMap<State>() {
          public State findValueByNumber(int number) {
            return State.forNumber(number);
          }
        };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalStateException(
            "Can't get the descriptor of an unrecognized enum value.");
      }
      return getDescriptor().getValues().get(ordinal());
    }

    public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
      return getDescriptor();
    }

    public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
      return com.google.cloud.dialogflow.v2beta1.Document.getDescriptor().getEnumTypes().get(1);
    }

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

    public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
      }
      if (desc.getIndex() == -1) {
        return UNRECOGNIZED;
      }
      return VALUES[desc.getIndex()];
    }

    private final int value;

    private State(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.v2beta1.Document.State)
  }

  public interface ReloadStatusOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2beta1.Document.ReloadStatus)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * Output only. The time of a reload attempt.
     * This reload may have been triggered automatically or manually and may
     * not have succeeded.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 1;</code>
     *
     * @return Whether the time field is set.
     */
    boolean hasTime();
    /**
     *
     *
     * <pre>
     * Output only. The time of a reload attempt.
     * This reload may have been triggered automatically or manually and may
     * not have succeeded.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 1;</code>
     *
     * @return The time.
     */
    com.google.protobuf.Timestamp getTime();
    /**
     *
     *
     * <pre>
     * Output only. The time of a reload attempt.
     * This reload may have been triggered automatically or manually and may
     * not have succeeded.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 1;</code>
     */
    com.google.protobuf.TimestampOrBuilder getTimeOrBuilder();

    /**
     *
     *
     * <pre>
     * Output only. The status of a reload attempt or the initial load.
     * </pre>
     *
     * <code>.google.rpc.Status status = 2;</code>
     *
     * @return Whether the status field is set.
     */
    boolean hasStatus();
    /**
     *
     *
     * <pre>
     * Output only. The status of a reload attempt or the initial load.
     * </pre>
     *
     * <code>.google.rpc.Status status = 2;</code>
     *
     * @return The status.
     */
    com.google.rpc.Status getStatus();
    /**
     *
     *
     * <pre>
     * Output only. The status of a reload attempt or the initial load.
     * </pre>
     *
     * <code>.google.rpc.Status status = 2;</code>
     */
    com.google.rpc.StatusOrBuilder getStatusOrBuilder();
  }
  /**
   *
   *
   * <pre>
   * The status of a reload attempt.
   * </pre>
   *
   * Protobuf type {@code google.cloud.dialogflow.v2beta1.Document.ReloadStatus}
   */
  public static final class ReloadStatus extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2beta1.Document.ReloadStatus)
      ReloadStatusOrBuilder {
    private static final long serialVersionUID = 0L;
    // Use ReloadStatus.newBuilder() to construct.
    private ReloadStatus(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private ReloadStatus() {}

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

    @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.dialogflow.v2beta1.DocumentProto
          .internal_static_google_cloud_dialogflow_v2beta1_Document_ReloadStatus_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.dialogflow.v2beta1.DocumentProto
          .internal_static_google_cloud_dialogflow_v2beta1_Document_ReloadStatus_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.class,
              com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.Builder.class);
    }

    public static final int TIME_FIELD_NUMBER = 1;
    private com.google.protobuf.Timestamp time_;
    /**
     *
     *
     * <pre>
     * Output only. The time of a reload attempt.
     * This reload may have been triggered automatically or manually and may
     * not have succeeded.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 1;</code>
     *
     * @return Whether the time field is set.
     */
    @java.lang.Override
    public boolean hasTime() {
      return time_ != null;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time of a reload attempt.
     * This reload may have been triggered automatically or manually and may
     * not have succeeded.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 1;</code>
     *
     * @return The time.
     */
    @java.lang.Override
    public com.google.protobuf.Timestamp getTime() {
      return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time of a reload attempt.
     * This reload may have been triggered automatically or manually and may
     * not have succeeded.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 1;</code>
     */
    @java.lang.Override
    public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() {
      return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
    }

    public static final int STATUS_FIELD_NUMBER = 2;
    private com.google.rpc.Status status_;
    /**
     *
     *
     * <pre>
     * Output only. The status of a reload attempt or the initial load.
     * </pre>
     *
     * <code>.google.rpc.Status status = 2;</code>
     *
     * @return Whether the status field is set.
     */
    @java.lang.Override
    public boolean hasStatus() {
      return status_ != null;
    }
    /**
     *
     *
     * <pre>
     * Output only. The status of a reload attempt or the initial load.
     * </pre>
     *
     * <code>.google.rpc.Status status = 2;</code>
     *
     * @return The status.
     */
    @java.lang.Override
    public com.google.rpc.Status getStatus() {
      return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
    }
    /**
     *
     *
     * <pre>
     * Output only. The status of a reload attempt or the initial load.
     * </pre>
     *
     * <code>.google.rpc.Status status = 2;</code>
     */
    @java.lang.Override
    public com.google.rpc.StatusOrBuilder getStatusOrBuilder() {
      return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
    }

    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 (time_ != null) {
        output.writeMessage(1, getTime());
      }
      if (status_ != null) {
        output.writeMessage(2, getStatus());
      }
      getUnknownFields().writeTo(output);
    }

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

      size = 0;
      if (time_ != null) {
        size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTime());
      }
      if (status_ != null) {
        size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStatus());
      }
      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.dialogflow.v2beta1.Document.ReloadStatus)) {
        return super.equals(obj);
      }
      com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus other =
          (com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus) obj;

      if (hasTime() != other.hasTime()) return false;
      if (hasTime()) {
        if (!getTime().equals(other.getTime())) return false;
      }
      if (hasStatus() != other.hasStatus()) return false;
      if (hasStatus()) {
        if (!getStatus().equals(other.getStatus())) return false;
      }
      if (!getUnknownFields().equals(other.getUnknownFields())) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      if (hasTime()) {
        hash = (37 * hash) + TIME_FIELD_NUMBER;
        hash = (53 * hash) + getTime().hashCode();
      }
      if (hasStatus()) {
        hash = (37 * hash) + STATUS_FIELD_NUMBER;
        hash = (53 * hash) + getStatus().hashCode();
      }
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

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

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

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

    public static com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus parseFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

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

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

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

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

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     *
     *
     * <pre>
     * The status of a reload attempt.
     * </pre>
     *
     * Protobuf type {@code google.cloud.dialogflow.v2beta1.Document.ReloadStatus}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2beta1.Document.ReloadStatus)
        com.google.cloud.dialogflow.v2beta1.Document.ReloadStatusOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.dialogflow.v2beta1.DocumentProto
            .internal_static_google_cloud_dialogflow_v2beta1_Document_ReloadStatus_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.cloud.dialogflow.v2beta1.DocumentProto
            .internal_static_google_cloud_dialogflow_v2beta1_Document_ReloadStatus_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.class,
                com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.Builder.class);
      }

      // Construct using com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.newBuilder()
      private Builder() {}

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

      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        time_ = null;
        if (timeBuilder_ != null) {
          timeBuilder_.dispose();
          timeBuilder_ = null;
        }
        status_ = null;
        if (statusBuilder_ != null) {
          statusBuilder_.dispose();
          statusBuilder_ = null;
        }
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.cloud.dialogflow.v2beta1.DocumentProto
            .internal_static_google_cloud_dialogflow_v2beta1_Document_ReloadStatus_descriptor;
      }

      @java.lang.Override
      public com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus getDefaultInstanceForType() {
        return com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.getDefaultInstance();
      }

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

      @java.lang.Override
      public com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus buildPartial() {
        com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus result =
            new com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus(this);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        onBuilt();
        return result;
      }

      private void buildPartial0(com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          result.time_ = timeBuilder_ == null ? time_ : timeBuilder_.build();
        }
        if (((from_bitField0_ & 0x00000002) != 0)) {
          result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build();
        }
      }

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

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

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

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

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

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

      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus) {
          return mergeFrom((com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus other) {
        if (other == com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.getDefaultInstance())
          return this;
        if (other.hasTime()) {
          mergeTime(other.getTime());
        }
        if (other.hasStatus()) {
          mergeStatus(other.getStatus());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        onChanged();
        return this;
      }

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

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        if (extensionRegistry == null) {
          throw new java.lang.NullPointerException();
        }
        try {
          boolean done = false;
          while (!done) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                done = true;
                break;
              case 10:
                {
                  input.readMessage(getTimeFieldBuilder().getBuilder(), extensionRegistry);
                  bitField0_ |= 0x00000001;
                  break;
                } // case 10
              case 18:
                {
                  input.readMessage(getStatusFieldBuilder().getBuilder(), extensionRegistry);
                  bitField0_ |= 0x00000002;
                  break;
                } // case 18
              default:
                {
                  if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                    done = true; // was an endgroup tag
                  }
                  break;
                } // default:
            } // switch (tag)
          } // while (!done)
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.unwrapIOException();
        } finally {
          onChanged();
        } // finally
        return this;
      }

      private int bitField0_;

      private com.google.protobuf.Timestamp time_;
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.protobuf.Timestamp,
              com.google.protobuf.Timestamp.Builder,
              com.google.protobuf.TimestampOrBuilder>
          timeBuilder_;
      /**
       *
       *
       * <pre>
       * Output only. The time of a reload attempt.
       * This reload may have been triggered automatically or manually and may
       * not have succeeded.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp time = 1;</code>
       *
       * @return Whether the time field is set.
       */
      public boolean hasTime() {
        return ((bitField0_ & 0x00000001) != 0);
      }
      /**
       *
       *
       * <pre>
       * Output only. The time of a reload attempt.
       * This reload may have been triggered automatically or manually and may
       * not have succeeded.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp time = 1;</code>
       *
       * @return The time.
       */
      public com.google.protobuf.Timestamp getTime() {
        if (timeBuilder_ == null) {
          return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
        } else {
          return timeBuilder_.getMessage();
        }
      }
      /**
       *
       *
       * <pre>
       * Output only. The time of a reload attempt.
       * This reload may have been triggered automatically or manually and may
       * not have succeeded.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp time = 1;</code>
       */
      public Builder setTime(com.google.protobuf.Timestamp value) {
        if (timeBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          time_ = value;
        } else {
          timeBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. The time of a reload attempt.
       * This reload may have been triggered automatically or manually and may
       * not have succeeded.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp time = 1;</code>
       */
      public Builder setTime(com.google.protobuf.Timestamp.Builder builderForValue) {
        if (timeBuilder_ == null) {
          time_ = builderForValue.build();
        } else {
          timeBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. The time of a reload attempt.
       * This reload may have been triggered automatically or manually and may
       * not have succeeded.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp time = 1;</code>
       */
      public Builder mergeTime(com.google.protobuf.Timestamp value) {
        if (timeBuilder_ == null) {
          if (((bitField0_ & 0x00000001) != 0)
              && time_ != null
              && time_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
            getTimeBuilder().mergeFrom(value);
          } else {
            time_ = value;
          }
        } else {
          timeBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. The time of a reload attempt.
       * This reload may have been triggered automatically or manually and may
       * not have succeeded.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp time = 1;</code>
       */
      public Builder clearTime() {
        bitField0_ = (bitField0_ & ~0x00000001);
        time_ = null;
        if (timeBuilder_ != null) {
          timeBuilder_.dispose();
          timeBuilder_ = null;
        }
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. The time of a reload attempt.
       * This reload may have been triggered automatically or manually and may
       * not have succeeded.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp time = 1;</code>
       */
      public com.google.protobuf.Timestamp.Builder getTimeBuilder() {
        bitField0_ |= 0x00000001;
        onChanged();
        return getTimeFieldBuilder().getBuilder();
      }
      /**
       *
       *
       * <pre>
       * Output only. The time of a reload attempt.
       * This reload may have been triggered automatically or manually and may
       * not have succeeded.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp time = 1;</code>
       */
      public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() {
        if (timeBuilder_ != null) {
          return timeBuilder_.getMessageOrBuilder();
        } else {
          return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
        }
      }
      /**
       *
       *
       * <pre>
       * Output only. The time of a reload attempt.
       * This reload may have been triggered automatically or manually and may
       * not have succeeded.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp time = 1;</code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.protobuf.Timestamp,
              com.google.protobuf.Timestamp.Builder,
              com.google.protobuf.TimestampOrBuilder>
          getTimeFieldBuilder() {
        if (timeBuilder_ == null) {
          timeBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.protobuf.Timestamp,
                  com.google.protobuf.Timestamp.Builder,
                  com.google.protobuf.TimestampOrBuilder>(
                  getTime(), getParentForChildren(), isClean());
          time_ = null;
        }
        return timeBuilder_;
      }

      private com.google.rpc.Status status_;
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
          statusBuilder_;
      /**
       *
       *
       * <pre>
       * Output only. The status of a reload attempt or the initial load.
       * </pre>
       *
       * <code>.google.rpc.Status status = 2;</code>
       *
       * @return Whether the status field is set.
       */
      public boolean hasStatus() {
        return ((bitField0_ & 0x00000002) != 0);
      }
      /**
       *
       *
       * <pre>
       * Output only. The status of a reload attempt or the initial load.
       * </pre>
       *
       * <code>.google.rpc.Status status = 2;</code>
       *
       * @return The status.
       */
      public com.google.rpc.Status getStatus() {
        if (statusBuilder_ == null) {
          return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
        } else {
          return statusBuilder_.getMessage();
        }
      }
      /**
       *
       *
       * <pre>
       * Output only. The status of a reload attempt or the initial load.
       * </pre>
       *
       * <code>.google.rpc.Status status = 2;</code>
       */
      public Builder setStatus(com.google.rpc.Status value) {
        if (statusBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          status_ = value;
        } else {
          statusBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. The status of a reload attempt or the initial load.
       * </pre>
       *
       * <code>.google.rpc.Status status = 2;</code>
       */
      public Builder setStatus(com.google.rpc.Status.Builder builderForValue) {
        if (statusBuilder_ == null) {
          status_ = builderForValue.build();
        } else {
          statusBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. The status of a reload attempt or the initial load.
       * </pre>
       *
       * <code>.google.rpc.Status status = 2;</code>
       */
      public Builder mergeStatus(com.google.rpc.Status value) {
        if (statusBuilder_ == null) {
          if (((bitField0_ & 0x00000002) != 0)
              && status_ != null
              && status_ != com.google.rpc.Status.getDefaultInstance()) {
            getStatusBuilder().mergeFrom(value);
          } else {
            status_ = value;
          }
        } else {
          statusBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. The status of a reload attempt or the initial load.
       * </pre>
       *
       * <code>.google.rpc.Status status = 2;</code>
       */
      public Builder clearStatus() {
        bitField0_ = (bitField0_ & ~0x00000002);
        status_ = null;
        if (statusBuilder_ != null) {
          statusBuilder_.dispose();
          statusBuilder_ = null;
        }
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. The status of a reload attempt or the initial load.
       * </pre>
       *
       * <code>.google.rpc.Status status = 2;</code>
       */
      public com.google.rpc.Status.Builder getStatusBuilder() {
        bitField0_ |= 0x00000002;
        onChanged();
        return getStatusFieldBuilder().getBuilder();
      }
      /**
       *
       *
       * <pre>
       * Output only. The status of a reload attempt or the initial load.
       * </pre>
       *
       * <code>.google.rpc.Status status = 2;</code>
       */
      public com.google.rpc.StatusOrBuilder getStatusOrBuilder() {
        if (statusBuilder_ != null) {
          return statusBuilder_.getMessageOrBuilder();
        } else {
          return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
        }
      }
      /**
       *
       *
       * <pre>
       * Output only. The status of a reload attempt or the initial load.
       * </pre>
       *
       * <code>.google.rpc.Status status = 2;</code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
          getStatusFieldBuilder() {
        if (statusBuilder_ == null) {
          statusBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.rpc.Status,
                  com.google.rpc.Status.Builder,
                  com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean());
          status_ = null;
        }
        return statusBuilder_;
      }

      @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.dialogflow.v2beta1.Document.ReloadStatus)
    }

    // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.Document.ReloadStatus)
    private static final com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus();
    }

    public static com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

    @java.lang.Override
    public com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  private int sourceCase_ = 0;
  private java.lang.Object source_;

  public enum SourceCase
      implements
          com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    CONTENT_URI(5),
    @java.lang.Deprecated
    CONTENT(6),
    RAW_CONTENT(9),
    SOURCE_NOT_SET(0);
    private final int value;

    private SourceCase(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 SourceCase valueOf(int value) {
      return forNumber(value);
    }

    public static SourceCase forNumber(int value) {
      switch (value) {
        case 5:
          return CONTENT_URI;
        case 6:
          return CONTENT;
        case 9:
          return RAW_CONTENT;
        case 0:
          return SOURCE_NOT_SET;
        default:
          return null;
      }
    }

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

  public SourceCase getSourceCase() {
    return SourceCase.forNumber(sourceCase_);
  }

  public static final int NAME_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object name_ = "";
  /**
   *
   *
   * <pre>
   * Optional. The document resource name.
   * The name must be empty when creating a document.
   * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
   * ID&gt;/knowledgeBases/&lt;Knowledge Base ID&gt;/documents/&lt;Document ID&gt;`.
   * </pre>
   *
   * <code>string name = 1 [(.google.api.field_behavior) = OPTIONAL];</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>
   * Optional. The document resource name.
   * The name must be empty when creating a document.
   * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
   * ID&gt;/knowledgeBases/&lt;Knowledge Base ID&gt;/documents/&lt;Document ID&gt;`.
   * </pre>
   *
   * <code>string name = 1 [(.google.api.field_behavior) = OPTIONAL];</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 DISPLAY_NAME_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  private volatile java.lang.Object displayName_ = "";
  /**
   *
   *
   * <pre>
   * Required. The display name of the document. The name must be 1024 bytes or
   * less; otherwise, the creation request fails.
   * </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. The display name of the document. The name must be 1024 bytes or
   * less; otherwise, the creation request fails.
   * </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 MIME_TYPE_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private volatile java.lang.Object mimeType_ = "";
  /**
   *
   *
   * <pre>
   * Required. The MIME type of this document.
   * </pre>
   *
   * <code>string mime_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The mimeType.
   */
  @java.lang.Override
  public java.lang.String getMimeType() {
    java.lang.Object ref = mimeType_;
    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();
      mimeType_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The MIME type of this document.
   * </pre>
   *
   * <code>string mime_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The bytes for mimeType.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getMimeTypeBytes() {
    java.lang.Object ref = mimeType_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      mimeType_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int KNOWLEDGE_TYPES_FIELD_NUMBER = 4;

  @SuppressWarnings("serial")
  private java.util.List<java.lang.Integer> knowledgeTypes_;

  private static final com.google.protobuf.Internal.ListAdapter.Converter<
          java.lang.Integer, com.google.cloud.dialogflow.v2beta1.Document.KnowledgeType>
      knowledgeTypes_converter_ =
          new com.google.protobuf.Internal.ListAdapter.Converter<
              java.lang.Integer, com.google.cloud.dialogflow.v2beta1.Document.KnowledgeType>() {
            public com.google.cloud.dialogflow.v2beta1.Document.KnowledgeType convert(
                java.lang.Integer from) {
              com.google.cloud.dialogflow.v2beta1.Document.KnowledgeType result =
                  com.google.cloud.dialogflow.v2beta1.Document.KnowledgeType.forNumber(from);
              return result == null
                  ? com.google.cloud.dialogflow.v2beta1.Document.KnowledgeType.UNRECOGNIZED
                  : result;
            }
          };
  /**
   *
   *
   * <pre>
   * Required. The knowledge type of document content.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.dialogflow.v2beta1.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return A list containing the knowledgeTypes.
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.dialogflow.v2beta1.Document.KnowledgeType>
      getKnowledgeTypesList() {
    return new com.google.protobuf.Internal.ListAdapter<
        java.lang.Integer, com.google.cloud.dialogflow.v2beta1.Document.KnowledgeType>(
        knowledgeTypes_, knowledgeTypes_converter_);
  }
  /**
   *
   *
   * <pre>
   * Required. The knowledge type of document content.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.dialogflow.v2beta1.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return The count of knowledgeTypes.
   */
  @java.lang.Override
  public int getKnowledgeTypesCount() {
    return knowledgeTypes_.size();
  }
  /**
   *
   *
   * <pre>
   * Required. The knowledge type of document content.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.dialogflow.v2beta1.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @param index The index of the element to return.
   * @return The knowledgeTypes at the given index.
   */
  @java.lang.Override
  public com.google.cloud.dialogflow.v2beta1.Document.KnowledgeType getKnowledgeTypes(int index) {
    return knowledgeTypes_converter_.convert(knowledgeTypes_.get(index));
  }
  /**
   *
   *
   * <pre>
   * Required. The knowledge type of document content.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.dialogflow.v2beta1.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return A list containing the enum numeric values on the wire for knowledgeTypes.
   */
  @java.lang.Override
  public java.util.List<java.lang.Integer> getKnowledgeTypesValueList() {
    return knowledgeTypes_;
  }
  /**
   *
   *
   * <pre>
   * Required. The knowledge type of document content.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.dialogflow.v2beta1.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @param index The index of the value to return.
   * @return The enum numeric value on the wire of knowledgeTypes at the given index.
   */
  @java.lang.Override
  public int getKnowledgeTypesValue(int index) {
    return knowledgeTypes_.get(index);
  }

  private int knowledgeTypesMemoizedSerializedSize;

  public static final int CONTENT_URI_FIELD_NUMBER = 5;
  /**
   *
   *
   * <pre>
   * The URI where the file content is located.
   * For documents stored in Google Cloud Storage, these URIs must have
   * the form `gs://&lt;bucket-name&gt;/&lt;object-name&gt;`.
   * NOTE: External URLs must correspond to public webpages, i.e., they must
   * be indexed by Google Search. In particular, URLs for showing documents in
   * Google Cloud Storage (i.e. the URL in your browser) are not supported.
   * Instead use the `gs://` format URI described above.
   * </pre>
   *
   * <code>string content_uri = 5;</code>
   *
   * @return Whether the contentUri field is set.
   */
  public boolean hasContentUri() {
    return sourceCase_ == 5;
  }
  /**
   *
   *
   * <pre>
   * The URI where the file content is located.
   * For documents stored in Google Cloud Storage, these URIs must have
   * the form `gs://&lt;bucket-name&gt;/&lt;object-name&gt;`.
   * NOTE: External URLs must correspond to public webpages, i.e., they must
   * be indexed by Google Search. In particular, URLs for showing documents in
   * Google Cloud Storage (i.e. the URL in your browser) are not supported.
   * Instead use the `gs://` format URI described above.
   * </pre>
   *
   * <code>string content_uri = 5;</code>
   *
   * @return The contentUri.
   */
  public java.lang.String getContentUri() {
    java.lang.Object ref = "";
    if (sourceCase_ == 5) {
      ref = source_;
    }
    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 (sourceCase_ == 5) {
        source_ = s;
      }
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The URI where the file content is located.
   * For documents stored in Google Cloud Storage, these URIs must have
   * the form `gs://&lt;bucket-name&gt;/&lt;object-name&gt;`.
   * NOTE: External URLs must correspond to public webpages, i.e., they must
   * be indexed by Google Search. In particular, URLs for showing documents in
   * Google Cloud Storage (i.e. the URL in your browser) are not supported.
   * Instead use the `gs://` format URI described above.
   * </pre>
   *
   * <code>string content_uri = 5;</code>
   *
   * @return The bytes for contentUri.
   */
  public com.google.protobuf.ByteString getContentUriBytes() {
    java.lang.Object ref = "";
    if (sourceCase_ == 5) {
      ref = source_;
    }
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      if (sourceCase_ == 5) {
        source_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CONTENT_FIELD_NUMBER = 6;
  /**
   *
   *
   * <pre>
   * The raw content of the document. This field is only permitted for
   * EXTRACTIVE_QA and FAQ knowledge types.
   * Note: This field is in the process of being deprecated, please use
   * raw_content instead.
   * </pre>
   *
   * <code>string content = 6 [deprecated = true];</code>
   *
   * @deprecated google.cloud.dialogflow.v2beta1.Document.content is deprecated. See
   *     google/cloud/dialogflow/v2beta1/document.proto;l=357
   * @return Whether the content field is set.
   */
  @java.lang.Deprecated
  public boolean hasContent() {
    return sourceCase_ == 6;
  }
  /**
   *
   *
   * <pre>
   * The raw content of the document. This field is only permitted for
   * EXTRACTIVE_QA and FAQ knowledge types.
   * Note: This field is in the process of being deprecated, please use
   * raw_content instead.
   * </pre>
   *
   * <code>string content = 6 [deprecated = true];</code>
   *
   * @deprecated google.cloud.dialogflow.v2beta1.Document.content is deprecated. See
   *     google/cloud/dialogflow/v2beta1/document.proto;l=357
   * @return The content.
   */
  @java.lang.Deprecated
  public java.lang.String getContent() {
    java.lang.Object ref = "";
    if (sourceCase_ == 6) {
      ref = source_;
    }
    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 (sourceCase_ == 6) {
        source_ = s;
      }
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The raw content of the document. This field is only permitted for
   * EXTRACTIVE_QA and FAQ knowledge types.
   * Note: This field is in the process of being deprecated, please use
   * raw_content instead.
   * </pre>
   *
   * <code>string content = 6 [deprecated = true];</code>
   *
   * @deprecated google.cloud.dialogflow.v2beta1.Document.content is deprecated. See
   *     google/cloud/dialogflow/v2beta1/document.proto;l=357
   * @return The bytes for content.
   */
  @java.lang.Deprecated
  public com.google.protobuf.ByteString getContentBytes() {
    java.lang.Object ref = "";
    if (sourceCase_ == 6) {
      ref = source_;
    }
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      if (sourceCase_ == 6) {
        source_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int RAW_CONTENT_FIELD_NUMBER = 9;
  /**
   *
   *
   * <pre>
   * The raw content of the document. This field is only permitted for
   * EXTRACTIVE_QA and FAQ knowledge types.
   * </pre>
   *
   * <code>bytes raw_content = 9;</code>
   *
   * @return Whether the rawContent field is set.
   */
  @java.lang.Override
  public boolean hasRawContent() {
    return sourceCase_ == 9;
  }
  /**
   *
   *
   * <pre>
   * The raw content of the document. This field is only permitted for
   * EXTRACTIVE_QA and FAQ knowledge types.
   * </pre>
   *
   * <code>bytes raw_content = 9;</code>
   *
   * @return The rawContent.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getRawContent() {
    if (sourceCase_ == 9) {
      return (com.google.protobuf.ByteString) source_;
    }
    return com.google.protobuf.ByteString.EMPTY;
  }

  public static final int ENABLE_AUTO_RELOAD_FIELD_NUMBER = 11;
  private boolean enableAutoReload_ = false;
  /**
   *
   *
   * <pre>
   * Optional. If true, we try to automatically reload the document every day
   * (at a time picked by the system). If false or unspecified, we don't try
   * to automatically reload the document.
   * Currently you can only enable automatic reload for documents sourced from
   * a public url, see `source` field for the source types.
   * Reload status can be tracked in `latest_reload_status`. If a reload
   * fails, we will keep the document unchanged.
   * If a reload fails with internal errors, the system will try to reload the
   * document on the next day.
   * If a reload fails with non-retriable errors (e.g. PERMISSION_DENIED), the
   * system will not try to reload the document anymore. You need to manually
   * reload the document successfully by calling `ReloadDocument` and clear the
   * errors.
   * </pre>
   *
   * <code>bool enable_auto_reload = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The enableAutoReload.
   */
  @java.lang.Override
  public boolean getEnableAutoReload() {
    return enableAutoReload_;
  }

  public static final int LATEST_RELOAD_STATUS_FIELD_NUMBER = 12;
  private com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus latestReloadStatus_;
  /**
   *
   *
   * <pre>
   * Output only. The time and status of the latest reload.
   * This reload may have been triggered automatically or manually
   * and may not have succeeded.
   * </pre>
   *
   * <code>
   * .google.cloud.dialogflow.v2beta1.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return Whether the latestReloadStatus field is set.
   */
  @java.lang.Override
  public boolean hasLatestReloadStatus() {
    return latestReloadStatus_ != null;
  }
  /**
   *
   *
   * <pre>
   * Output only. The time and status of the latest reload.
   * This reload may have been triggered automatically or manually
   * and may not have succeeded.
   * </pre>
   *
   * <code>
   * .google.cloud.dialogflow.v2beta1.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The latestReloadStatus.
   */
  @java.lang.Override
  public com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus getLatestReloadStatus() {
    return latestReloadStatus_ == null
        ? com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.getDefaultInstance()
        : latestReloadStatus_;
  }
  /**
   *
   *
   * <pre>
   * Output only. The time and status of the latest reload.
   * This reload may have been triggered automatically or manually
   * and may not have succeeded.
   * </pre>
   *
   * <code>
   * .google.cloud.dialogflow.v2beta1.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.dialogflow.v2beta1.Document.ReloadStatusOrBuilder
      getLatestReloadStatusOrBuilder() {
    return latestReloadStatus_ == null
        ? com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.getDefaultInstance()
        : latestReloadStatus_;
  }

  public static final int METADATA_FIELD_NUMBER = 7;

  private static final class MetadataDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry =
        com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance(
            com.google.cloud.dialogflow.v2beta1.DocumentProto
                .internal_static_google_cloud_dialogflow_v2beta1_Document_MetadataEntry_descriptor,
            com.google.protobuf.WireFormat.FieldType.STRING,
            "",
            com.google.protobuf.WireFormat.FieldType.STRING,
            "");
  }

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

  private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMetadata() {
    if (metadata_ == null) {
      return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry);
    }
    return metadata_;
  }

  public int getMetadataCount() {
    return internalGetMetadata().getMap().size();
  }
  /**
   *
   *
   * <pre>
   * Optional. Metadata for the document. The metadata supports arbitrary
   * key-value pairs. Suggested use cases include storing a document's title,
   * an external URL distinct from the document's content_uri, etc.
   * The max size of a `key` or a `value` of the metadata is 1024 bytes.
   * </pre>
   *
   * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  @java.lang.Override
  public boolean containsMetadata(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    return internalGetMetadata().getMap().containsKey(key);
  }
  /** Use {@link #getMetadataMap()} instead. */
  @java.lang.Override
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getMetadata() {
    return getMetadataMap();
  }
  /**
   *
   *
   * <pre>
   * Optional. Metadata for the document. The metadata supports arbitrary
   * key-value pairs. Suggested use cases include storing a document's title,
   * an external URL distinct from the document's content_uri, etc.
   * The max size of a `key` or a `value` of the metadata is 1024 bytes.
   * </pre>
   *
   * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  @java.lang.Override
  public java.util.Map<java.lang.String, java.lang.String> getMetadataMap() {
    return internalGetMetadata().getMap();
  }
  /**
   *
   *
   * <pre>
   * Optional. Metadata for the document. The metadata supports arbitrary
   * key-value pairs. Suggested use cases include storing a document's title,
   * an external URL distinct from the document's content_uri, etc.
   * The max size of a `key` or a `value` of the metadata is 1024 bytes.
   * </pre>
   *
   * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  @java.lang.Override
  public /* nullable */ java.lang.String getMetadataOrDefault(
      java.lang.String key,
      /* nullable */
      java.lang.String defaultValue) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   *
   *
   * <pre>
   * Optional. Metadata for the document. The metadata supports arbitrary
   * key-value pairs. Suggested use cases include storing a document's title,
   * an external URL distinct from the document's content_uri, etc.
   * The max size of a `key` or a `value` of the metadata is 1024 bytes.
   * </pre>
   *
   * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  @java.lang.Override
  public java.lang.String getMetadataOrThrow(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  public static final int STATE_FIELD_NUMBER = 13;
  private int state_ = 0;
  /**
   *
   *
   * <pre>
   * Output only. The current state of the document.
   * </pre>
   *
   * <code>
   * .google.cloud.dialogflow.v2beta1.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The enum numeric value on the wire for state.
   */
  @java.lang.Override
  public int getStateValue() {
    return state_;
  }
  /**
   *
   *
   * <pre>
   * Output only. The current state of the document.
   * </pre>
   *
   * <code>
   * .google.cloud.dialogflow.v2beta1.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The state.
   */
  @java.lang.Override
  public com.google.cloud.dialogflow.v2beta1.Document.State getState() {
    com.google.cloud.dialogflow.v2beta1.Document.State result =
        com.google.cloud.dialogflow.v2beta1.Document.State.forNumber(state_);
    return result == null
        ? com.google.cloud.dialogflow.v2beta1.Document.State.UNRECOGNIZED
        : result;
  }

  private byte memoizedIsInitialized = -1;

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    getSerializedSize();
    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(mimeType_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, mimeType_);
    }
    if (getKnowledgeTypesList().size() > 0) {
      output.writeUInt32NoTag(34);
      output.writeUInt32NoTag(knowledgeTypesMemoizedSerializedSize);
    }
    for (int i = 0; i < knowledgeTypes_.size(); i++) {
      output.writeEnumNoTag(knowledgeTypes_.get(i));
    }
    if (sourceCase_ == 5) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, source_);
    }
    if (sourceCase_ == 6) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, source_);
    }
    com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
        output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 7);
    if (sourceCase_ == 9) {
      output.writeBytes(9, (com.google.protobuf.ByteString) source_);
    }
    if (enableAutoReload_ != false) {
      output.writeBool(11, enableAutoReload_);
    }
    if (latestReloadStatus_ != null) {
      output.writeMessage(12, getLatestReloadStatus());
    }
    if (state_
        != com.google.cloud.dialogflow.v2beta1.Document.State.STATE_UNSPECIFIED.getNumber()) {
      output.writeEnum(13, state_);
    }
    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(mimeType_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, mimeType_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < knowledgeTypes_.size(); i++) {
        dataSize +=
            com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(knowledgeTypes_.get(i));
      }
      size += dataSize;
      if (!getKnowledgeTypesList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize);
      }
      knowledgeTypesMemoizedSerializedSize = dataSize;
    }
    if (sourceCase_ == 5) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, source_);
    }
    if (sourceCase_ == 6) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, source_);
    }
    for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
        internalGetMetadata().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, java.lang.String> metadata__ =
          MetadataDefaultEntryHolder.defaultEntry
              .newBuilderForType()
              .setKey(entry.getKey())
              .setValue(entry.getValue())
              .build();
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, metadata__);
    }
    if (sourceCase_ == 9) {
      size +=
          com.google.protobuf.CodedOutputStream.computeBytesSize(
              9, (com.google.protobuf.ByteString) source_);
    }
    if (enableAutoReload_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, enableAutoReload_);
    }
    if (latestReloadStatus_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getLatestReloadStatus());
    }
    if (state_
        != com.google.cloud.dialogflow.v2beta1.Document.State.STATE_UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(13, state_);
    }
    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.dialogflow.v2beta1.Document)) {
      return super.equals(obj);
    }
    com.google.cloud.dialogflow.v2beta1.Document other =
        (com.google.cloud.dialogflow.v2beta1.Document) obj;

    if (!getName().equals(other.getName())) return false;
    if (!getDisplayName().equals(other.getDisplayName())) return false;
    if (!getMimeType().equals(other.getMimeType())) return false;
    if (!knowledgeTypes_.equals(other.knowledgeTypes_)) return false;
    if (getEnableAutoReload() != other.getEnableAutoReload()) return false;
    if (hasLatestReloadStatus() != other.hasLatestReloadStatus()) return false;
    if (hasLatestReloadStatus()) {
      if (!getLatestReloadStatus().equals(other.getLatestReloadStatus())) return false;
    }
    if (!internalGetMetadata().equals(other.internalGetMetadata())) return false;
    if (state_ != other.state_) return false;
    if (!getSourceCase().equals(other.getSourceCase())) return false;
    switch (sourceCase_) {
      case 5:
        if (!getContentUri().equals(other.getContentUri())) return false;
        break;
      case 6:
        if (!getContent().equals(other.getContent())) return false;
        break;
      case 9:
        if (!getRawContent().equals(other.getRawContent())) 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) + DISPLAY_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getDisplayName().hashCode();
    hash = (37 * hash) + MIME_TYPE_FIELD_NUMBER;
    hash = (53 * hash) + getMimeType().hashCode();
    if (getKnowledgeTypesCount() > 0) {
      hash = (37 * hash) + KNOWLEDGE_TYPES_FIELD_NUMBER;
      hash = (53 * hash) + knowledgeTypes_.hashCode();
    }
    hash = (37 * hash) + ENABLE_AUTO_RELOAD_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableAutoReload());
    if (hasLatestReloadStatus()) {
      hash = (37 * hash) + LATEST_RELOAD_STATUS_FIELD_NUMBER;
      hash = (53 * hash) + getLatestReloadStatus().hashCode();
    }
    if (!internalGetMetadata().getMap().isEmpty()) {
      hash = (37 * hash) + METADATA_FIELD_NUMBER;
      hash = (53 * hash) + internalGetMetadata().hashCode();
    }
    hash = (37 * hash) + STATE_FIELD_NUMBER;
    hash = (53 * hash) + state_;
    switch (sourceCase_) {
      case 5:
        hash = (37 * hash) + CONTENT_URI_FIELD_NUMBER;
        hash = (53 * hash) + getContentUri().hashCode();
        break;
      case 6:
        hash = (37 * hash) + CONTENT_FIELD_NUMBER;
        hash = (53 * hash) + getContent().hashCode();
        break;
      case 9:
        hash = (37 * hash) + RAW_CONTENT_FIELD_NUMBER;
        hash = (53 * hash) + getRawContent().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

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

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

  public static com.google.cloud.dialogflow.v2beta1.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.dialogflow.v2beta1.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>
   * A knowledge document to be used by a
   * [KnowledgeBase][google.cloud.dialogflow.v2beta1.KnowledgeBase].
   * For more information, see the [knowledge base
   * guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases).
   * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
   * only use `projects.knowledgeBases.documents`.
   * </pre>
   *
   * Protobuf type {@code google.cloud.dialogflow.v2beta1.Document}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2beta1.Document)
      com.google.cloud.dialogflow.v2beta1.DocumentOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.dialogflow.v2beta1.DocumentProto
          .internal_static_google_cloud_dialogflow_v2beta1_Document_descriptor;
    }

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

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

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

    // Construct using com.google.cloud.dialogflow.v2beta1.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_ = "";
      displayName_ = "";
      mimeType_ = "";
      knowledgeTypes_ = java.util.Collections.emptyList();
      bitField0_ = (bitField0_ & ~0x00000008);
      enableAutoReload_ = false;
      latestReloadStatus_ = null;
      if (latestReloadStatusBuilder_ != null) {
        latestReloadStatusBuilder_.dispose();
        latestReloadStatusBuilder_ = null;
      }
      internalGetMutableMetadata().clear();
      state_ = 0;
      sourceCase_ = 0;
      source_ = null;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.dialogflow.v2beta1.DocumentProto
          .internal_static_google_cloud_dialogflow_v2beta1_Document_descriptor;
    }

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

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

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

    private void buildPartialRepeatedFields(com.google.cloud.dialogflow.v2beta1.Document result) {
      if (((bitField0_ & 0x00000008) != 0)) {
        knowledgeTypes_ = java.util.Collections.unmodifiableList(knowledgeTypes_);
        bitField0_ = (bitField0_ & ~0x00000008);
      }
      result.knowledgeTypes_ = knowledgeTypes_;
    }

    private void buildPartial0(com.google.cloud.dialogflow.v2beta1.Document result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.name_ = name_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.displayName_ = displayName_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.mimeType_ = mimeType_;
      }
      if (((from_bitField0_ & 0x00000080) != 0)) {
        result.enableAutoReload_ = enableAutoReload_;
      }
      if (((from_bitField0_ & 0x00000100) != 0)) {
        result.latestReloadStatus_ =
            latestReloadStatusBuilder_ == null
                ? latestReloadStatus_
                : latestReloadStatusBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000200) != 0)) {
        result.metadata_ = internalGetMetadata();
        result.metadata_.makeImmutable();
      }
      if (((from_bitField0_ & 0x00000400) != 0)) {
        result.state_ = state_;
      }
    }

    private void buildPartialOneofs(com.google.cloud.dialogflow.v2beta1.Document result) {
      result.sourceCase_ = sourceCase_;
      result.source_ = this.source_;
    }

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

    public Builder mergeFrom(com.google.cloud.dialogflow.v2beta1.Document other) {
      if (other == com.google.cloud.dialogflow.v2beta1.Document.getDefaultInstance()) return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (!other.getDisplayName().isEmpty()) {
        displayName_ = other.displayName_;
        bitField0_ |= 0x00000002;
        onChanged();
      }
      if (!other.getMimeType().isEmpty()) {
        mimeType_ = other.mimeType_;
        bitField0_ |= 0x00000004;
        onChanged();
      }
      if (!other.knowledgeTypes_.isEmpty()) {
        if (knowledgeTypes_.isEmpty()) {
          knowledgeTypes_ = other.knowledgeTypes_;
          bitField0_ = (bitField0_ & ~0x00000008);
        } else {
          ensureKnowledgeTypesIsMutable();
          knowledgeTypes_.addAll(other.knowledgeTypes_);
        }
        onChanged();
      }
      if (other.getEnableAutoReload() != false) {
        setEnableAutoReload(other.getEnableAutoReload());
      }
      if (other.hasLatestReloadStatus()) {
        mergeLatestReloadStatus(other.getLatestReloadStatus());
      }
      internalGetMutableMetadata().mergeFrom(other.internalGetMetadata());
      bitField0_ |= 0x00000200;
      if (other.state_ != 0) {
        setStateValue(other.getStateValue());
      }
      switch (other.getSourceCase()) {
        case CONTENT_URI:
          {
            sourceCase_ = 5;
            source_ = other.source_;
            onChanged();
            break;
          }
        case CONTENT:
          {
            sourceCase_ = 6;
            source_ = other.source_;
            onChanged();
            break;
          }
        case RAW_CONTENT:
          {
            setRawContent(other.getRawContent());
            break;
          }
        case SOURCE_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_ |= 0x00000002;
                break;
              } // case 18
            case 26:
              {
                mimeType_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 32:
              {
                int tmpRaw = input.readEnum();
                ensureKnowledgeTypesIsMutable();
                knowledgeTypes_.add(tmpRaw);
                break;
              } // case 32
            case 34:
              {
                int length = input.readRawVarint32();
                int oldLimit = input.pushLimit(length);
                while (input.getBytesUntilLimit() > 0) {
                  int tmpRaw = input.readEnum();
                  ensureKnowledgeTypesIsMutable();
                  knowledgeTypes_.add(tmpRaw);
                }
                input.popLimit(oldLimit);
                break;
              } // case 34
            case 42:
              {
                java.lang.String s = input.readStringRequireUtf8();
                sourceCase_ = 5;
                source_ = s;
                break;
              } // case 42
            case 50:
              {
                java.lang.String s = input.readStringRequireUtf8();
                sourceCase_ = 6;
                source_ = s;
                break;
              } // case 50
            case 58:
              {
                com.google.protobuf.MapEntry<java.lang.String, java.lang.String> metadata__ =
                    input.readMessage(
                        MetadataDefaultEntryHolder.defaultEntry.getParserForType(),
                        extensionRegistry);
                internalGetMutableMetadata()
                    .getMutableMap()
                    .put(metadata__.getKey(), metadata__.getValue());
                bitField0_ |= 0x00000200;
                break;
              } // case 58
            case 74:
              {
                source_ = input.readBytes();
                sourceCase_ = 9;
                break;
              } // case 74
            case 88:
              {
                enableAutoReload_ = input.readBool();
                bitField0_ |= 0x00000080;
                break;
              } // case 88
            case 98:
              {
                input.readMessage(
                    getLatestReloadStatusFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000100;
                break;
              } // case 98
            case 104:
              {
                state_ = input.readEnum();
                bitField0_ |= 0x00000400;
                break;
              } // case 104
            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 sourceCase_ = 0;
    private java.lang.Object source_;

    public SourceCase getSourceCase() {
      return SourceCase.forNumber(sourceCase_);
    }

    public Builder clearSource() {
      sourceCase_ = 0;
      source_ = null;
      onChanged();
      return this;
    }

    private int bitField0_;

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * Optional. The document resource name.
     * The name must be empty when creating a document.
     * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
     * ID&gt;/knowledgeBases/&lt;Knowledge Base ID&gt;/documents/&lt;Document ID&gt;`.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = OPTIONAL];</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>
     * Optional. The document resource name.
     * The name must be empty when creating a document.
     * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
     * ID&gt;/knowledgeBases/&lt;Knowledge Base ID&gt;/documents/&lt;Document ID&gt;`.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = OPTIONAL];</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>
     * Optional. The document resource name.
     * The name must be empty when creating a document.
     * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
     * ID&gt;/knowledgeBases/&lt;Knowledge Base ID&gt;/documents/&lt;Document ID&gt;`.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = OPTIONAL];</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>
     * Optional. The document resource name.
     * The name must be empty when creating a document.
     * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
     * ID&gt;/knowledgeBases/&lt;Knowledge Base ID&gt;/documents/&lt;Document ID&gt;`.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {
      name_ = getDefaultInstance().getName();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The document resource name.
     * The name must be empty when creating a document.
     * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
     * ID&gt;/knowledgeBases/&lt;Knowledge Base ID&gt;/documents/&lt;Document ID&gt;`.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = OPTIONAL];</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 displayName_ = "";
    /**
     *
     *
     * <pre>
     * Required. The display name of the document. The name must be 1024 bytes or
     * less; otherwise, the creation request fails.
     * </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. The display name of the document. The name must be 1024 bytes or
     * less; otherwise, the creation request fails.
     * </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. The display name of the document. The name must be 1024 bytes or
     * less; otherwise, the creation request fails.
     * </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_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The display name of the document. The name must be 1024 bytes or
     * less; otherwise, the creation request fails.
     * </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_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The display name of the document. The name must be 1024 bytes or
     * less; otherwise, the creation request fails.
     * </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_ |= 0x00000002;
      onChanged();
      return this;
    }

    private java.lang.Object mimeType_ = "";
    /**
     *
     *
     * <pre>
     * Required. The MIME type of this document.
     * </pre>
     *
     * <code>string mime_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The mimeType.
     */
    public java.lang.String getMimeType() {
      java.lang.Object ref = mimeType_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        mimeType_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The MIME type of this document.
     * </pre>
     *
     * <code>string mime_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The bytes for mimeType.
     */
    public com.google.protobuf.ByteString getMimeTypeBytes() {
      java.lang.Object ref = mimeType_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        mimeType_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The MIME type of this document.
     * </pre>
     *
     * <code>string mime_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The mimeType to set.
     * @return This builder for chaining.
     */
    public Builder setMimeType(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      mimeType_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The MIME type of this document.
     * </pre>
     *
     * <code>string mime_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearMimeType() {
      mimeType_ = getDefaultInstance().getMimeType();
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The MIME type of this document.
     * </pre>
     *
     * <code>string mime_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The bytes for mimeType to set.
     * @return This builder for chaining.
     */
    public Builder setMimeTypeBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      mimeType_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    private java.util.List<java.lang.Integer> knowledgeTypes_ = java.util.Collections.emptyList();

    private void ensureKnowledgeTypesIsMutable() {
      if (!((bitField0_ & 0x00000008) != 0)) {
        knowledgeTypes_ = new java.util.ArrayList<java.lang.Integer>(knowledgeTypes_);
        bitField0_ |= 0x00000008;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The knowledge type of document content.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.dialogflow.v2beta1.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return A list containing the knowledgeTypes.
     */
    public java.util.List<com.google.cloud.dialogflow.v2beta1.Document.KnowledgeType>
        getKnowledgeTypesList() {
      return new com.google.protobuf.Internal.ListAdapter<
          java.lang.Integer, com.google.cloud.dialogflow.v2beta1.Document.KnowledgeType>(
          knowledgeTypes_, knowledgeTypes_converter_);
    }
    /**
     *
     *
     * <pre>
     * Required. The knowledge type of document content.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.dialogflow.v2beta1.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return The count of knowledgeTypes.
     */
    public int getKnowledgeTypesCount() {
      return knowledgeTypes_.size();
    }
    /**
     *
     *
     * <pre>
     * Required. The knowledge type of document content.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.dialogflow.v2beta1.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @param index The index of the element to return.
     * @return The knowledgeTypes at the given index.
     */
    public com.google.cloud.dialogflow.v2beta1.Document.KnowledgeType getKnowledgeTypes(int index) {
      return knowledgeTypes_converter_.convert(knowledgeTypes_.get(index));
    }
    /**
     *
     *
     * <pre>
     * Required. The knowledge type of document content.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.dialogflow.v2beta1.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @param index The index to set the value at.
     * @param value The knowledgeTypes to set.
     * @return This builder for chaining.
     */
    public Builder setKnowledgeTypes(
        int index, com.google.cloud.dialogflow.v2beta1.Document.KnowledgeType value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureKnowledgeTypesIsMutable();
      knowledgeTypes_.set(index, value.getNumber());
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The knowledge type of document content.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.dialogflow.v2beta1.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @param value The knowledgeTypes to add.
     * @return This builder for chaining.
     */
    public Builder addKnowledgeTypes(
        com.google.cloud.dialogflow.v2beta1.Document.KnowledgeType value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureKnowledgeTypesIsMutable();
      knowledgeTypes_.add(value.getNumber());
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The knowledge type of document content.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.dialogflow.v2beta1.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @param values The knowledgeTypes to add.
     * @return This builder for chaining.
     */
    public Builder addAllKnowledgeTypes(
        java.lang.Iterable<? extends com.google.cloud.dialogflow.v2beta1.Document.KnowledgeType>
            values) {
      ensureKnowledgeTypesIsMutable();
      for (com.google.cloud.dialogflow.v2beta1.Document.KnowledgeType value : values) {
        knowledgeTypes_.add(value.getNumber());
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The knowledge type of document content.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.dialogflow.v2beta1.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearKnowledgeTypes() {
      knowledgeTypes_ = java.util.Collections.emptyList();
      bitField0_ = (bitField0_ & ~0x00000008);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The knowledge type of document content.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.dialogflow.v2beta1.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return A list containing the enum numeric values on the wire for knowledgeTypes.
     */
    public java.util.List<java.lang.Integer> getKnowledgeTypesValueList() {
      return java.util.Collections.unmodifiableList(knowledgeTypes_);
    }
    /**
     *
     *
     * <pre>
     * Required. The knowledge type of document content.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.dialogflow.v2beta1.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @param index The index of the value to return.
     * @return The enum numeric value on the wire of knowledgeTypes at the given index.
     */
    public int getKnowledgeTypesValue(int index) {
      return knowledgeTypes_.get(index);
    }
    /**
     *
     *
     * <pre>
     * Required. The knowledge type of document content.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.dialogflow.v2beta1.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @param index The index to set the value at.
     * @param value The enum numeric value on the wire for knowledgeTypes to set.
     * @return This builder for chaining.
     */
    public Builder setKnowledgeTypesValue(int index, int value) {
      ensureKnowledgeTypesIsMutable();
      knowledgeTypes_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The knowledge type of document content.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.dialogflow.v2beta1.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @param value The enum numeric value on the wire for knowledgeTypes to add.
     * @return This builder for chaining.
     */
    public Builder addKnowledgeTypesValue(int value) {
      ensureKnowledgeTypesIsMutable();
      knowledgeTypes_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The knowledge type of document content.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.dialogflow.v2beta1.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @param values The enum numeric values on the wire for knowledgeTypes to add.
     * @return This builder for chaining.
     */
    public Builder addAllKnowledgeTypesValue(java.lang.Iterable<java.lang.Integer> values) {
      ensureKnowledgeTypesIsMutable();
      for (int value : values) {
        knowledgeTypes_.add(value);
      }
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * The URI where the file content is located.
     * For documents stored in Google Cloud Storage, these URIs must have
     * the form `gs://&lt;bucket-name&gt;/&lt;object-name&gt;`.
     * NOTE: External URLs must correspond to public webpages, i.e., they must
     * be indexed by Google Search. In particular, URLs for showing documents in
     * Google Cloud Storage (i.e. the URL in your browser) are not supported.
     * Instead use the `gs://` format URI described above.
     * </pre>
     *
     * <code>string content_uri = 5;</code>
     *
     * @return Whether the contentUri field is set.
     */
    @java.lang.Override
    public boolean hasContentUri() {
      return sourceCase_ == 5;
    }
    /**
     *
     *
     * <pre>
     * The URI where the file content is located.
     * For documents stored in Google Cloud Storage, these URIs must have
     * the form `gs://&lt;bucket-name&gt;/&lt;object-name&gt;`.
     * NOTE: External URLs must correspond to public webpages, i.e., they must
     * be indexed by Google Search. In particular, URLs for showing documents in
     * Google Cloud Storage (i.e. the URL in your browser) are not supported.
     * Instead use the `gs://` format URI described above.
     * </pre>
     *
     * <code>string content_uri = 5;</code>
     *
     * @return The contentUri.
     */
    @java.lang.Override
    public java.lang.String getContentUri() {
      java.lang.Object ref = "";
      if (sourceCase_ == 5) {
        ref = source_;
      }
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (sourceCase_ == 5) {
          source_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The URI where the file content is located.
     * For documents stored in Google Cloud Storage, these URIs must have
     * the form `gs://&lt;bucket-name&gt;/&lt;object-name&gt;`.
     * NOTE: External URLs must correspond to public webpages, i.e., they must
     * be indexed by Google Search. In particular, URLs for showing documents in
     * Google Cloud Storage (i.e. the URL in your browser) are not supported.
     * Instead use the `gs://` format URI described above.
     * </pre>
     *
     * <code>string content_uri = 5;</code>
     *
     * @return The bytes for contentUri.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getContentUriBytes() {
      java.lang.Object ref = "";
      if (sourceCase_ == 5) {
        ref = source_;
      }
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        if (sourceCase_ == 5) {
          source_ = b;
        }
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The URI where the file content is located.
     * For documents stored in Google Cloud Storage, these URIs must have
     * the form `gs://&lt;bucket-name&gt;/&lt;object-name&gt;`.
     * NOTE: External URLs must correspond to public webpages, i.e., they must
     * be indexed by Google Search. In particular, URLs for showing documents in
     * Google Cloud Storage (i.e. the URL in your browser) are not supported.
     * Instead use the `gs://` format URI described above.
     * </pre>
     *
     * <code>string content_uri = 5;</code>
     *
     * @param value The contentUri to set.
     * @return This builder for chaining.
     */
    public Builder setContentUri(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      sourceCase_ = 5;
      source_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The URI where the file content is located.
     * For documents stored in Google Cloud Storage, these URIs must have
     * the form `gs://&lt;bucket-name&gt;/&lt;object-name&gt;`.
     * NOTE: External URLs must correspond to public webpages, i.e., they must
     * be indexed by Google Search. In particular, URLs for showing documents in
     * Google Cloud Storage (i.e. the URL in your browser) are not supported.
     * Instead use the `gs://` format URI described above.
     * </pre>
     *
     * <code>string content_uri = 5;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearContentUri() {
      if (sourceCase_ == 5) {
        sourceCase_ = 0;
        source_ = null;
        onChanged();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The URI where the file content is located.
     * For documents stored in Google Cloud Storage, these URIs must have
     * the form `gs://&lt;bucket-name&gt;/&lt;object-name&gt;`.
     * NOTE: External URLs must correspond to public webpages, i.e., they must
     * be indexed by Google Search. In particular, URLs for showing documents in
     * Google Cloud Storage (i.e. the URL in your browser) are not supported.
     * Instead use the `gs://` format URI described above.
     * </pre>
     *
     * <code>string content_uri = 5;</code>
     *
     * @param value The bytes for contentUri to set.
     * @return This builder for chaining.
     */
    public Builder setContentUriBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      sourceCase_ = 5;
      source_ = value;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * The raw content of the document. This field is only permitted for
     * EXTRACTIVE_QA and FAQ knowledge types.
     * Note: This field is in the process of being deprecated, please use
     * raw_content instead.
     * </pre>
     *
     * <code>string content = 6 [deprecated = true];</code>
     *
     * @deprecated google.cloud.dialogflow.v2beta1.Document.content is deprecated. See
     *     google/cloud/dialogflow/v2beta1/document.proto;l=357
     * @return Whether the content field is set.
     */
    @java.lang.Override
    @java.lang.Deprecated
    public boolean hasContent() {
      return sourceCase_ == 6;
    }
    /**
     *
     *
     * <pre>
     * The raw content of the document. This field is only permitted for
     * EXTRACTIVE_QA and FAQ knowledge types.
     * Note: This field is in the process of being deprecated, please use
     * raw_content instead.
     * </pre>
     *
     * <code>string content = 6 [deprecated = true];</code>
     *
     * @deprecated google.cloud.dialogflow.v2beta1.Document.content is deprecated. See
     *     google/cloud/dialogflow/v2beta1/document.proto;l=357
     * @return The content.
     */
    @java.lang.Override
    @java.lang.Deprecated
    public java.lang.String getContent() {
      java.lang.Object ref = "";
      if (sourceCase_ == 6) {
        ref = source_;
      }
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (sourceCase_ == 6) {
          source_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The raw content of the document. This field is only permitted for
     * EXTRACTIVE_QA and FAQ knowledge types.
     * Note: This field is in the process of being deprecated, please use
     * raw_content instead.
     * </pre>
     *
     * <code>string content = 6 [deprecated = true];</code>
     *
     * @deprecated google.cloud.dialogflow.v2beta1.Document.content is deprecated. See
     *     google/cloud/dialogflow/v2beta1/document.proto;l=357
     * @return The bytes for content.
     */
    @java.lang.Override
    @java.lang.Deprecated
    public com.google.protobuf.ByteString getContentBytes() {
      java.lang.Object ref = "";
      if (sourceCase_ == 6) {
        ref = source_;
      }
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        if (sourceCase_ == 6) {
          source_ = b;
        }
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The raw content of the document. This field is only permitted for
     * EXTRACTIVE_QA and FAQ knowledge types.
     * Note: This field is in the process of being deprecated, please use
     * raw_content instead.
     * </pre>
     *
     * <code>string content = 6 [deprecated = true];</code>
     *
     * @deprecated google.cloud.dialogflow.v2beta1.Document.content is deprecated. See
     *     google/cloud/dialogflow/v2beta1/document.proto;l=357
     * @param value The content to set.
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder setContent(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      sourceCase_ = 6;
      source_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The raw content of the document. This field is only permitted for
     * EXTRACTIVE_QA and FAQ knowledge types.
     * Note: This field is in the process of being deprecated, please use
     * raw_content instead.
     * </pre>
     *
     * <code>string content = 6 [deprecated = true];</code>
     *
     * @deprecated google.cloud.dialogflow.v2beta1.Document.content is deprecated. See
     *     google/cloud/dialogflow/v2beta1/document.proto;l=357
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder clearContent() {
      if (sourceCase_ == 6) {
        sourceCase_ = 0;
        source_ = null;
        onChanged();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The raw content of the document. This field is only permitted for
     * EXTRACTIVE_QA and FAQ knowledge types.
     * Note: This field is in the process of being deprecated, please use
     * raw_content instead.
     * </pre>
     *
     * <code>string content = 6 [deprecated = true];</code>
     *
     * @deprecated google.cloud.dialogflow.v2beta1.Document.content is deprecated. See
     *     google/cloud/dialogflow/v2beta1/document.proto;l=357
     * @param value The bytes for content to set.
     * @return This builder for chaining.
     */
    @java.lang.Deprecated
    public Builder setContentBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      sourceCase_ = 6;
      source_ = value;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * The raw content of the document. This field is only permitted for
     * EXTRACTIVE_QA and FAQ knowledge types.
     * </pre>
     *
     * <code>bytes raw_content = 9;</code>
     *
     * @return Whether the rawContent field is set.
     */
    public boolean hasRawContent() {
      return sourceCase_ == 9;
    }
    /**
     *
     *
     * <pre>
     * The raw content of the document. This field is only permitted for
     * EXTRACTIVE_QA and FAQ knowledge types.
     * </pre>
     *
     * <code>bytes raw_content = 9;</code>
     *
     * @return The rawContent.
     */
    public com.google.protobuf.ByteString getRawContent() {
      if (sourceCase_ == 9) {
        return (com.google.protobuf.ByteString) source_;
      }
      return com.google.protobuf.ByteString.EMPTY;
    }
    /**
     *
     *
     * <pre>
     * The raw content of the document. This field is only permitted for
     * EXTRACTIVE_QA and FAQ knowledge types.
     * </pre>
     *
     * <code>bytes raw_content = 9;</code>
     *
     * @param value The rawContent to set.
     * @return This builder for chaining.
     */
    public Builder setRawContent(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      sourceCase_ = 9;
      source_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The raw content of the document. This field is only permitted for
     * EXTRACTIVE_QA and FAQ knowledge types.
     * </pre>
     *
     * <code>bytes raw_content = 9;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearRawContent() {
      if (sourceCase_ == 9) {
        sourceCase_ = 0;
        source_ = null;
        onChanged();
      }
      return this;
    }

    private boolean enableAutoReload_;
    /**
     *
     *
     * <pre>
     * Optional. If true, we try to automatically reload the document every day
     * (at a time picked by the system). If false or unspecified, we don't try
     * to automatically reload the document.
     * Currently you can only enable automatic reload for documents sourced from
     * a public url, see `source` field for the source types.
     * Reload status can be tracked in `latest_reload_status`. If a reload
     * fails, we will keep the document unchanged.
     * If a reload fails with internal errors, the system will try to reload the
     * document on the next day.
     * If a reload fails with non-retriable errors (e.g. PERMISSION_DENIED), the
     * system will not try to reload the document anymore. You need to manually
     * reload the document successfully by calling `ReloadDocument` and clear the
     * errors.
     * </pre>
     *
     * <code>bool enable_auto_reload = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The enableAutoReload.
     */
    @java.lang.Override
    public boolean getEnableAutoReload() {
      return enableAutoReload_;
    }
    /**
     *
     *
     * <pre>
     * Optional. If true, we try to automatically reload the document every day
     * (at a time picked by the system). If false or unspecified, we don't try
     * to automatically reload the document.
     * Currently you can only enable automatic reload for documents sourced from
     * a public url, see `source` field for the source types.
     * Reload status can be tracked in `latest_reload_status`. If a reload
     * fails, we will keep the document unchanged.
     * If a reload fails with internal errors, the system will try to reload the
     * document on the next day.
     * If a reload fails with non-retriable errors (e.g. PERMISSION_DENIED), the
     * system will not try to reload the document anymore. You need to manually
     * reload the document successfully by calling `ReloadDocument` and clear the
     * errors.
     * </pre>
     *
     * <code>bool enable_auto_reload = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The enableAutoReload to set.
     * @return This builder for chaining.
     */
    public Builder setEnableAutoReload(boolean value) {

      enableAutoReload_ = value;
      bitField0_ |= 0x00000080;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. If true, we try to automatically reload the document every day
     * (at a time picked by the system). If false or unspecified, we don't try
     * to automatically reload the document.
     * Currently you can only enable automatic reload for documents sourced from
     * a public url, see `source` field for the source types.
     * Reload status can be tracked in `latest_reload_status`. If a reload
     * fails, we will keep the document unchanged.
     * If a reload fails with internal errors, the system will try to reload the
     * document on the next day.
     * If a reload fails with non-retriable errors (e.g. PERMISSION_DENIED), the
     * system will not try to reload the document anymore. You need to manually
     * reload the document successfully by calling `ReloadDocument` and clear the
     * errors.
     * </pre>
     *
     * <code>bool enable_auto_reload = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearEnableAutoReload() {
      bitField0_ = (bitField0_ & ~0x00000080);
      enableAutoReload_ = false;
      onChanged();
      return this;
    }

    private com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus latestReloadStatus_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus,
            com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.Builder,
            com.google.cloud.dialogflow.v2beta1.Document.ReloadStatusOrBuilder>
        latestReloadStatusBuilder_;
    /**
     *
     *
     * <pre>
     * Output only. The time and status of the latest reload.
     * This reload may have been triggered automatically or manually
     * and may not have succeeded.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.v2beta1.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return Whether the latestReloadStatus field is set.
     */
    public boolean hasLatestReloadStatus() {
      return ((bitField0_ & 0x00000100) != 0);
    }
    /**
     *
     *
     * <pre>
     * Output only. The time and status of the latest reload.
     * This reload may have been triggered automatically or manually
     * and may not have succeeded.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.v2beta1.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The latestReloadStatus.
     */
    public com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus getLatestReloadStatus() {
      if (latestReloadStatusBuilder_ == null) {
        return latestReloadStatus_ == null
            ? com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.getDefaultInstance()
            : latestReloadStatus_;
      } else {
        return latestReloadStatusBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The time and status of the latest reload.
     * This reload may have been triggered automatically or manually
     * and may not have succeeded.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.v2beta1.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setLatestReloadStatus(
        com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus value) {
      if (latestReloadStatusBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        latestReloadStatus_ = value;
      } else {
        latestReloadStatusBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time and status of the latest reload.
     * This reload may have been triggered automatically or manually
     * and may not have succeeded.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.v2beta1.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setLatestReloadStatus(
        com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.Builder builderForValue) {
      if (latestReloadStatusBuilder_ == null) {
        latestReloadStatus_ = builderForValue.build();
      } else {
        latestReloadStatusBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time and status of the latest reload.
     * This reload may have been triggered automatically or manually
     * and may not have succeeded.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.v2beta1.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder mergeLatestReloadStatus(
        com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus value) {
      if (latestReloadStatusBuilder_ == null) {
        if (((bitField0_ & 0x00000100) != 0)
            && latestReloadStatus_ != null
            && latestReloadStatus_
                != com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.getDefaultInstance()) {
          getLatestReloadStatusBuilder().mergeFrom(value);
        } else {
          latestReloadStatus_ = value;
        }
      } else {
        latestReloadStatusBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time and status of the latest reload.
     * This reload may have been triggered automatically or manually
     * and may not have succeeded.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.v2beta1.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder clearLatestReloadStatus() {
      bitField0_ = (bitField0_ & ~0x00000100);
      latestReloadStatus_ = null;
      if (latestReloadStatusBuilder_ != null) {
        latestReloadStatusBuilder_.dispose();
        latestReloadStatusBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time and status of the latest reload.
     * This reload may have been triggered automatically or manually
     * and may not have succeeded.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.v2beta1.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.Builder
        getLatestReloadStatusBuilder() {
      bitField0_ |= 0x00000100;
      onChanged();
      return getLatestReloadStatusFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Output only. The time and status of the latest reload.
     * This reload may have been triggered automatically or manually
     * and may not have succeeded.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.v2beta1.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.cloud.dialogflow.v2beta1.Document.ReloadStatusOrBuilder
        getLatestReloadStatusOrBuilder() {
      if (latestReloadStatusBuilder_ != null) {
        return latestReloadStatusBuilder_.getMessageOrBuilder();
      } else {
        return latestReloadStatus_ == null
            ? com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.getDefaultInstance()
            : latestReloadStatus_;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The time and status of the latest reload.
     * This reload may have been triggered automatically or manually
     * and may not have succeeded.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.v2beta1.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus,
            com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.Builder,
            com.google.cloud.dialogflow.v2beta1.Document.ReloadStatusOrBuilder>
        getLatestReloadStatusFieldBuilder() {
      if (latestReloadStatusBuilder_ == null) {
        latestReloadStatusBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus,
                com.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.Builder,
                com.google.cloud.dialogflow.v2beta1.Document.ReloadStatusOrBuilder>(
                getLatestReloadStatus(), getParentForChildren(), isClean());
        latestReloadStatus_ = null;
      }
      return latestReloadStatusBuilder_;
    }

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

    private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMetadata() {
      if (metadata_ == null) {
        return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry);
      }
      return metadata_;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
        internalGetMutableMetadata() {
      if (metadata_ == null) {
        metadata_ =
            com.google.protobuf.MapField.newMapField(MetadataDefaultEntryHolder.defaultEntry);
      }
      if (!metadata_.isMutable()) {
        metadata_ = metadata_.copy();
      }
      bitField0_ |= 0x00000200;
      onChanged();
      return metadata_;
    }

    public int getMetadataCount() {
      return internalGetMetadata().getMap().size();
    }
    /**
     *
     *
     * <pre>
     * Optional. Metadata for the document. The metadata supports arbitrary
     * key-value pairs. Suggested use cases include storing a document's title,
     * an external URL distinct from the document's content_uri, etc.
     * The max size of a `key` or a `value` of the metadata is 1024 bytes.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public boolean containsMetadata(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      return internalGetMetadata().getMap().containsKey(key);
    }
    /** Use {@link #getMetadataMap()} instead. */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getMetadata() {
      return getMetadataMap();
    }
    /**
     *
     *
     * <pre>
     * Optional. Metadata for the document. The metadata supports arbitrary
     * key-value pairs. Suggested use cases include storing a document's title,
     * an external URL distinct from the document's content_uri, etc.
     * The max size of a `key` or a `value` of the metadata is 1024 bytes.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public java.util.Map<java.lang.String, java.lang.String> getMetadataMap() {
      return internalGetMetadata().getMap();
    }
    /**
     *
     *
     * <pre>
     * Optional. Metadata for the document. The metadata supports arbitrary
     * key-value pairs. Suggested use cases include storing a document's title,
     * an external URL distinct from the document's content_uri, etc.
     * The max size of a `key` or a `value` of the metadata is 1024 bytes.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public /* nullable */ java.lang.String getMetadataOrDefault(
        java.lang.String key,
        /* nullable */
        java.lang.String defaultValue) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *
     *
     * <pre>
     * Optional. Metadata for the document. The metadata supports arbitrary
     * key-value pairs. Suggested use cases include storing a document's title,
     * an external URL distinct from the document's content_uri, etc.
     * The max size of a `key` or a `value` of the metadata is 1024 bytes.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public java.lang.String getMetadataOrThrow(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearMetadata() {
      bitField0_ = (bitField0_ & ~0x00000200);
      internalGetMutableMetadata().getMutableMap().clear();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Metadata for the document. The metadata supports arbitrary
     * key-value pairs. Suggested use cases include storing a document's title,
     * an external URL distinct from the document's content_uri, etc.
     * The max size of a `key` or a `value` of the metadata is 1024 bytes.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder removeMetadata(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      internalGetMutableMetadata().getMutableMap().remove(key);
      return this;
    }
    /** Use alternate mutation accessors instead. */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getMutableMetadata() {
      bitField0_ |= 0x00000200;
      return internalGetMutableMetadata().getMutableMap();
    }
    /**
     *
     *
     * <pre>
     * Optional. Metadata for the document. The metadata supports arbitrary
     * key-value pairs. Suggested use cases include storing a document's title,
     * an external URL distinct from the document's content_uri, etc.
     * The max size of a `key` or a `value` of the metadata is 1024 bytes.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder putMetadata(java.lang.String key, java.lang.String value) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      if (value == null) {
        throw new NullPointerException("map value");
      }
      internalGetMutableMetadata().getMutableMap().put(key, value);
      bitField0_ |= 0x00000200;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Metadata for the document. The metadata supports arbitrary
     * key-value pairs. Suggested use cases include storing a document's title,
     * an external URL distinct from the document's content_uri, etc.
     * The max size of a `key` or a `value` of the metadata is 1024 bytes.
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder putAllMetadata(java.util.Map<java.lang.String, java.lang.String> values) {
      internalGetMutableMetadata().getMutableMap().putAll(values);
      bitField0_ |= 0x00000200;
      return this;
    }

    private int state_ = 0;
    /**
     *
     *
     * <pre>
     * Output only. The current state of the document.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.v2beta1.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The enum numeric value on the wire for state.
     */
    @java.lang.Override
    public int getStateValue() {
      return state_;
    }
    /**
     *
     *
     * <pre>
     * Output only. The current state of the document.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.v2beta1.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @param value The enum numeric value on the wire for state to set.
     * @return This builder for chaining.
     */
    public Builder setStateValue(int value) {
      state_ = value;
      bitField0_ |= 0x00000400;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The current state of the document.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.v2beta1.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The state.
     */
    @java.lang.Override
    public com.google.cloud.dialogflow.v2beta1.Document.State getState() {
      com.google.cloud.dialogflow.v2beta1.Document.State result =
          com.google.cloud.dialogflow.v2beta1.Document.State.forNumber(state_);
      return result == null
          ? com.google.cloud.dialogflow.v2beta1.Document.State.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * Output only. The current state of the document.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.v2beta1.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @param value The state to set.
     * @return This builder for chaining.
     */
    public Builder setState(com.google.cloud.dialogflow.v2beta1.Document.State value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000400;
      state_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The current state of the document.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.v2beta1.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearState() {
      bitField0_ = (bitField0_ & ~0x00000400);
      state_ = 0;
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2beta1.Document)
  }

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

  static {
    DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2beta1.Document();
  }

  public static com.google.cloud.dialogflow.v2beta1.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.dialogflow.v2beta1.Document getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
