/*
 * 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/automl/v1/model.proto

package com.google.cloud.automl.v1;

/**
 *
 *
 * <pre>
 * API proto representing a trained machine learning model.
 * </pre>
 *
 * Protobuf type {@code google.cloud.automl.v1.Model}
 */
public final class Model extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.Model)
    ModelOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use Model.newBuilder() to construct.
  private Model(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private Model() {
    name_ = "";
    displayName_ = "";
    datasetId_ = "";
    deploymentState_ = 0;
    etag_ = "";
  }

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

  @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.automl.v1.ModelOuterClass
        .internal_static_google_cloud_automl_v1_Model_descriptor;
  }

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

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.automl.v1.ModelOuterClass
        .internal_static_google_cloud_automl_v1_Model_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.automl.v1.Model.class, com.google.cloud.automl.v1.Model.Builder.class);
  }

  /**
   *
   *
   * <pre>
   * Deployment state of the model.
   * </pre>
   *
   * Protobuf enum {@code google.cloud.automl.v1.Model.DeploymentState}
   */
  public enum DeploymentState implements com.google.protobuf.ProtocolMessageEnum {
    /**
     *
     *
     * <pre>
     * Should not be used, an un-set enum has this value by default.
     * </pre>
     *
     * <code>DEPLOYMENT_STATE_UNSPECIFIED = 0;</code>
     */
    DEPLOYMENT_STATE_UNSPECIFIED(0),
    /**
     *
     *
     * <pre>
     * Model is deployed.
     * </pre>
     *
     * <code>DEPLOYED = 1;</code>
     */
    DEPLOYED(1),
    /**
     *
     *
     * <pre>
     * Model is not deployed.
     * </pre>
     *
     * <code>UNDEPLOYED = 2;</code>
     */
    UNDEPLOYED(2),
    UNRECOGNIZED(-1),
    ;

    /**
     *
     *
     * <pre>
     * Should not be used, an un-set enum has this value by default.
     * </pre>
     *
     * <code>DEPLOYMENT_STATE_UNSPECIFIED = 0;</code>
     */
    public static final int DEPLOYMENT_STATE_UNSPECIFIED_VALUE = 0;
    /**
     *
     *
     * <pre>
     * Model is deployed.
     * </pre>
     *
     * <code>DEPLOYED = 1;</code>
     */
    public static final int DEPLOYED_VALUE = 1;
    /**
     *
     *
     * <pre>
     * Model is not deployed.
     * </pre>
     *
     * <code>UNDEPLOYED = 2;</code>
     */
    public static final int UNDEPLOYED_VALUE = 2;

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

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static DeploymentState 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 DeploymentState forNumber(int value) {
      switch (value) {
        case 0:
          return DEPLOYMENT_STATE_UNSPECIFIED;
        case 1:
          return DEPLOYED;
        case 2:
          return UNDEPLOYED;
        default:
          return null;
      }
    }

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

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

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

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

    // @@protoc_insertion_point(enum_scope:google.cloud.automl.v1.Model.DeploymentState)
  }

  private int modelMetadataCase_ = 0;
  private java.lang.Object modelMetadata_;

  public enum ModelMetadataCase
      implements
          com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    TRANSLATION_MODEL_METADATA(15),
    IMAGE_CLASSIFICATION_MODEL_METADATA(13),
    TEXT_CLASSIFICATION_MODEL_METADATA(14),
    IMAGE_OBJECT_DETECTION_MODEL_METADATA(20),
    TEXT_EXTRACTION_MODEL_METADATA(19),
    TEXT_SENTIMENT_MODEL_METADATA(22),
    MODELMETADATA_NOT_SET(0);
    private final int value;

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

    public static ModelMetadataCase forNumber(int value) {
      switch (value) {
        case 15:
          return TRANSLATION_MODEL_METADATA;
        case 13:
          return IMAGE_CLASSIFICATION_MODEL_METADATA;
        case 14:
          return TEXT_CLASSIFICATION_MODEL_METADATA;
        case 20:
          return IMAGE_OBJECT_DETECTION_MODEL_METADATA;
        case 19:
          return TEXT_EXTRACTION_MODEL_METADATA;
        case 22:
          return TEXT_SENTIMENT_MODEL_METADATA;
        case 0:
          return MODELMETADATA_NOT_SET;
        default:
          return null;
      }
    }

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

  public ModelMetadataCase getModelMetadataCase() {
    return ModelMetadataCase.forNumber(modelMetadataCase_);
  }

  public static final int TRANSLATION_MODEL_METADATA_FIELD_NUMBER = 15;
  /**
   *
   *
   * <pre>
   * Metadata for translation models.
   * </pre>
   *
   * <code>.google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15;</code>
   *
   * @return Whether the translationModelMetadata field is set.
   */
  @java.lang.Override
  public boolean hasTranslationModelMetadata() {
    return modelMetadataCase_ == 15;
  }
  /**
   *
   *
   * <pre>
   * Metadata for translation models.
   * </pre>
   *
   * <code>.google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15;</code>
   *
   * @return The translationModelMetadata.
   */
  @java.lang.Override
  public com.google.cloud.automl.v1.TranslationModelMetadata getTranslationModelMetadata() {
    if (modelMetadataCase_ == 15) {
      return (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_;
    }
    return com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * Metadata for translation models.
   * </pre>
   *
   * <code>.google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15;</code>
   */
  @java.lang.Override
  public com.google.cloud.automl.v1.TranslationModelMetadataOrBuilder
      getTranslationModelMetadataOrBuilder() {
    if (modelMetadataCase_ == 15) {
      return (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_;
    }
    return com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance();
  }

  public static final int IMAGE_CLASSIFICATION_MODEL_METADATA_FIELD_NUMBER = 13;
  /**
   *
   *
   * <pre>
   * Metadata for image classification models.
   * </pre>
   *
   * <code>
   * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13;
   * </code>
   *
   * @return Whether the imageClassificationModelMetadata field is set.
   */
  @java.lang.Override
  public boolean hasImageClassificationModelMetadata() {
    return modelMetadataCase_ == 13;
  }
  /**
   *
   *
   * <pre>
   * Metadata for image classification models.
   * </pre>
   *
   * <code>
   * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13;
   * </code>
   *
   * @return The imageClassificationModelMetadata.
   */
  @java.lang.Override
  public com.google.cloud.automl.v1.ImageClassificationModelMetadata
      getImageClassificationModelMetadata() {
    if (modelMetadataCase_ == 13) {
      return (com.google.cloud.automl.v1.ImageClassificationModelMetadata) modelMetadata_;
    }
    return com.google.cloud.automl.v1.ImageClassificationModelMetadata.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * Metadata for image classification models.
   * </pre>
   *
   * <code>
   * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.automl.v1.ImageClassificationModelMetadataOrBuilder
      getImageClassificationModelMetadataOrBuilder() {
    if (modelMetadataCase_ == 13) {
      return (com.google.cloud.automl.v1.ImageClassificationModelMetadata) modelMetadata_;
    }
    return com.google.cloud.automl.v1.ImageClassificationModelMetadata.getDefaultInstance();
  }

  public static final int TEXT_CLASSIFICATION_MODEL_METADATA_FIELD_NUMBER = 14;
  /**
   *
   *
   * <pre>
   * Metadata for text classification models.
   * </pre>
   *
   * <code>
   * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14;
   * </code>
   *
   * @return Whether the textClassificationModelMetadata field is set.
   */
  @java.lang.Override
  public boolean hasTextClassificationModelMetadata() {
    return modelMetadataCase_ == 14;
  }
  /**
   *
   *
   * <pre>
   * Metadata for text classification models.
   * </pre>
   *
   * <code>
   * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14;
   * </code>
   *
   * @return The textClassificationModelMetadata.
   */
  @java.lang.Override
  public com.google.cloud.automl.v1.TextClassificationModelMetadata
      getTextClassificationModelMetadata() {
    if (modelMetadataCase_ == 14) {
      return (com.google.cloud.automl.v1.TextClassificationModelMetadata) modelMetadata_;
    }
    return com.google.cloud.automl.v1.TextClassificationModelMetadata.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * Metadata for text classification models.
   * </pre>
   *
   * <code>
   * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.automl.v1.TextClassificationModelMetadataOrBuilder
      getTextClassificationModelMetadataOrBuilder() {
    if (modelMetadataCase_ == 14) {
      return (com.google.cloud.automl.v1.TextClassificationModelMetadata) modelMetadata_;
    }
    return com.google.cloud.automl.v1.TextClassificationModelMetadata.getDefaultInstance();
  }

  public static final int IMAGE_OBJECT_DETECTION_MODEL_METADATA_FIELD_NUMBER = 20;
  /**
   *
   *
   * <pre>
   * Metadata for image object detection models.
   * </pre>
   *
   * <code>
   * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20;
   * </code>
   *
   * @return Whether the imageObjectDetectionModelMetadata field is set.
   */
  @java.lang.Override
  public boolean hasImageObjectDetectionModelMetadata() {
    return modelMetadataCase_ == 20;
  }
  /**
   *
   *
   * <pre>
   * Metadata for image object detection models.
   * </pre>
   *
   * <code>
   * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20;
   * </code>
   *
   * @return The imageObjectDetectionModelMetadata.
   */
  @java.lang.Override
  public com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata
      getImageObjectDetectionModelMetadata() {
    if (modelMetadataCase_ == 20) {
      return (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) modelMetadata_;
    }
    return com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * Metadata for image object detection models.
   * </pre>
   *
   * <code>
   * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.automl.v1.ImageObjectDetectionModelMetadataOrBuilder
      getImageObjectDetectionModelMetadataOrBuilder() {
    if (modelMetadataCase_ == 20) {
      return (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) modelMetadata_;
    }
    return com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.getDefaultInstance();
  }

  public static final int TEXT_EXTRACTION_MODEL_METADATA_FIELD_NUMBER = 19;
  /**
   *
   *
   * <pre>
   * Metadata for text extraction models.
   * </pre>
   *
   * <code>.google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19;
   * </code>
   *
   * @return Whether the textExtractionModelMetadata field is set.
   */
  @java.lang.Override
  public boolean hasTextExtractionModelMetadata() {
    return modelMetadataCase_ == 19;
  }
  /**
   *
   *
   * <pre>
   * Metadata for text extraction models.
   * </pre>
   *
   * <code>.google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19;
   * </code>
   *
   * @return The textExtractionModelMetadata.
   */
  @java.lang.Override
  public com.google.cloud.automl.v1.TextExtractionModelMetadata getTextExtractionModelMetadata() {
    if (modelMetadataCase_ == 19) {
      return (com.google.cloud.automl.v1.TextExtractionModelMetadata) modelMetadata_;
    }
    return com.google.cloud.automl.v1.TextExtractionModelMetadata.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * Metadata for text extraction models.
   * </pre>
   *
   * <code>.google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.automl.v1.TextExtractionModelMetadataOrBuilder
      getTextExtractionModelMetadataOrBuilder() {
    if (modelMetadataCase_ == 19) {
      return (com.google.cloud.automl.v1.TextExtractionModelMetadata) modelMetadata_;
    }
    return com.google.cloud.automl.v1.TextExtractionModelMetadata.getDefaultInstance();
  }

  public static final int TEXT_SENTIMENT_MODEL_METADATA_FIELD_NUMBER = 22;
  /**
   *
   *
   * <pre>
   * Metadata for text sentiment models.
   * </pre>
   *
   * <code>.google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22;
   * </code>
   *
   * @return Whether the textSentimentModelMetadata field is set.
   */
  @java.lang.Override
  public boolean hasTextSentimentModelMetadata() {
    return modelMetadataCase_ == 22;
  }
  /**
   *
   *
   * <pre>
   * Metadata for text sentiment models.
   * </pre>
   *
   * <code>.google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22;
   * </code>
   *
   * @return The textSentimentModelMetadata.
   */
  @java.lang.Override
  public com.google.cloud.automl.v1.TextSentimentModelMetadata getTextSentimentModelMetadata() {
    if (modelMetadataCase_ == 22) {
      return (com.google.cloud.automl.v1.TextSentimentModelMetadata) modelMetadata_;
    }
    return com.google.cloud.automl.v1.TextSentimentModelMetadata.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * Metadata for text sentiment models.
   * </pre>
   *
   * <code>.google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.automl.v1.TextSentimentModelMetadataOrBuilder
      getTextSentimentModelMetadataOrBuilder() {
    if (modelMetadataCase_ == 22) {
      return (com.google.cloud.automl.v1.TextSentimentModelMetadata) modelMetadata_;
    }
    return com.google.cloud.automl.v1.TextSentimentModelMetadata.getDefaultInstance();
  }

  public static final int NAME_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object name_ = "";
  /**
   *
   *
   * <pre>
   * Output only. Resource name of the model.
   * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}`
   * </pre>
   *
   * <code>string name = 1;</code>
   *
   * @return The name.
   */
  @java.lang.Override
  public java.lang.String getName() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      name_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Output only. Resource name of the model.
   * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}`
   * </pre>
   *
   * <code>string name = 1;</code>
   *
   * @return The bytes for name.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getNameBytes() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      name_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DISPLAY_NAME_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  private volatile java.lang.Object displayName_ = "";
  /**
   *
   *
   * <pre>
   * Required. The name of the model to show in the interface. The name can be
   * up to 32 characters long and can consist only of ASCII Latin letters A-Z
   * and a-z, underscores
   * (_), and ASCII digits 0-9. It must start with a letter.
   * </pre>
   *
   * <code>string display_name = 2;</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 name of the model to show in the interface. The name can be
   * up to 32 characters long and can consist only of ASCII Latin letters A-Z
   * and a-z, underscores
   * (_), and ASCII digits 0-9. It must start with a letter.
   * </pre>
   *
   * <code>string display_name = 2;</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 DATASET_ID_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private volatile java.lang.Object datasetId_ = "";
  /**
   *
   *
   * <pre>
   * Required. The resource ID of the dataset used to create the model. The dataset must
   * come from the same ancestor project and location.
   * </pre>
   *
   * <code>string dataset_id = 3;</code>
   *
   * @return The datasetId.
   */
  @java.lang.Override
  public java.lang.String getDatasetId() {
    java.lang.Object ref = datasetId_;
    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();
      datasetId_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The resource ID of the dataset used to create the model. The dataset must
   * come from the same ancestor project and location.
   * </pre>
   *
   * <code>string dataset_id = 3;</code>
   *
   * @return The bytes for datasetId.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getDatasetIdBytes() {
    java.lang.Object ref = datasetId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      datasetId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CREATE_TIME_FIELD_NUMBER = 7;
  private com.google.protobuf.Timestamp createTime_;
  /**
   *
   *
   * <pre>
   * Output only. Timestamp when the model training finished  and can be used for prediction.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 7;</code>
   *
   * @return Whether the createTime field is set.
   */
  @java.lang.Override
  public boolean hasCreateTime() {
    return createTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * Output only. Timestamp when the model training finished  and can be used for prediction.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 7;</code>
   *
   * @return The createTime.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getCreateTime() {
    return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
  }
  /**
   *
   *
   * <pre>
   * Output only. Timestamp when the model training finished  and can be used for prediction.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 7;</code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
    return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
  }

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

  public static final int DEPLOYMENT_STATE_FIELD_NUMBER = 8;
  private int deploymentState_ = 0;
  /**
   *
   *
   * <pre>
   * Output only. Deployment state of the model. A model can only serve
   * prediction requests after it gets deployed.
   * </pre>
   *
   * <code>.google.cloud.automl.v1.Model.DeploymentState deployment_state = 8;</code>
   *
   * @return The enum numeric value on the wire for deploymentState.
   */
  @java.lang.Override
  public int getDeploymentStateValue() {
    return deploymentState_;
  }
  /**
   *
   *
   * <pre>
   * Output only. Deployment state of the model. A model can only serve
   * prediction requests after it gets deployed.
   * </pre>
   *
   * <code>.google.cloud.automl.v1.Model.DeploymentState deployment_state = 8;</code>
   *
   * @return The deploymentState.
   */
  @java.lang.Override
  public com.google.cloud.automl.v1.Model.DeploymentState getDeploymentState() {
    com.google.cloud.automl.v1.Model.DeploymentState result =
        com.google.cloud.automl.v1.Model.DeploymentState.forNumber(deploymentState_);
    return result == null ? com.google.cloud.automl.v1.Model.DeploymentState.UNRECOGNIZED : result;
  }

  public static final int ETAG_FIELD_NUMBER = 10;

  @SuppressWarnings("serial")
  private volatile java.lang.Object etag_ = "";
  /**
   *
   *
   * <pre>
   * Used to perform a consistent read-modify-write updates. If not set, a blind
   * "overwrite" update happens.
   * </pre>
   *
   * <code>string etag = 10;</code>
   *
   * @return The etag.
   */
  @java.lang.Override
  public java.lang.String getEtag() {
    java.lang.Object ref = etag_;
    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();
      etag_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Used to perform a consistent read-modify-write updates. If not set, a blind
   * "overwrite" update happens.
   * </pre>
   *
   * <code>string etag = 10;</code>
   *
   * @return The bytes for etag.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getEtagBytes() {
    java.lang.Object ref = etag_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      etag_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int LABELS_FIELD_NUMBER = 34;

  private static final class LabelsDefaultEntryHolder {
    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.automl.v1.ModelOuterClass
                .internal_static_google_cloud_automl_v1_Model_LabelsEntry_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> labels_;

  private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() {
    if (labels_ == null) {
      return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry);
    }
    return labels_;
  }

  public int getLabelsCount() {
    return internalGetLabels().getMap().size();
  }
  /**
   *
   *
   * <pre>
   * Optional. The labels with user-defined metadata to organize your model.
   * Label keys and values can be no longer than 64 characters
   * (Unicode codepoints), can only contain lowercase letters, numeric
   * characters, underscores and dashes. International characters are allowed.
   * Label values are optional. Label keys must start with a letter.
   * See https://goo.gl/xmQnxf for more information on and examples of labels.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 34;</code>
   */
  @java.lang.Override
  public boolean containsLabels(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    return internalGetLabels().getMap().containsKey(key);
  }
  /** Use {@link #getLabelsMap()} instead. */
  @java.lang.Override
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getLabels() {
    return getLabelsMap();
  }
  /**
   *
   *
   * <pre>
   * Optional. The labels with user-defined metadata to organize your model.
   * Label keys and values can be no longer than 64 characters
   * (Unicode codepoints), can only contain lowercase letters, numeric
   * characters, underscores and dashes. International characters are allowed.
   * Label values are optional. Label keys must start with a letter.
   * See https://goo.gl/xmQnxf for more information on and examples of labels.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 34;</code>
   */
  @java.lang.Override
  public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() {
    return internalGetLabels().getMap();
  }
  /**
   *
   *
   * <pre>
   * Optional. The labels with user-defined metadata to organize your model.
   * Label keys and values can be no longer than 64 characters
   * (Unicode codepoints), can only contain lowercase letters, numeric
   * characters, underscores and dashes. International characters are allowed.
   * Label values are optional. Label keys must start with a letter.
   * See https://goo.gl/xmQnxf for more information on and examples of labels.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 34;</code>
   */
  @java.lang.Override
  public /* nullable */ java.lang.String getLabelsOrDefault(
      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 = internalGetLabels().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   *
   *
   * <pre>
   * Optional. The labels with user-defined metadata to organize your model.
   * Label keys and values can be no longer than 64 characters
   * (Unicode codepoints), can only contain lowercase letters, numeric
   * characters, underscores and dashes. International characters are allowed.
   * Label values are optional. Label keys must start with a letter.
   * See https://goo.gl/xmQnxf for more information on and examples of labels.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 34;</code>
   */
  @java.lang.Override
  public java.lang.String getLabelsOrThrow(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  private byte memoizedIsInitialized = -1;

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(datasetId_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, datasetId_);
    }
    if (createTime_ != null) {
      output.writeMessage(7, getCreateTime());
    }
    if (deploymentState_
        != com.google.cloud.automl.v1.Model.DeploymentState.DEPLOYMENT_STATE_UNSPECIFIED
            .getNumber()) {
      output.writeEnum(8, deploymentState_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 10, etag_);
    }
    if (updateTime_ != null) {
      output.writeMessage(11, getUpdateTime());
    }
    if (modelMetadataCase_ == 13) {
      output.writeMessage(
          13, (com.google.cloud.automl.v1.ImageClassificationModelMetadata) modelMetadata_);
    }
    if (modelMetadataCase_ == 14) {
      output.writeMessage(
          14, (com.google.cloud.automl.v1.TextClassificationModelMetadata) modelMetadata_);
    }
    if (modelMetadataCase_ == 15) {
      output.writeMessage(15, (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_);
    }
    if (modelMetadataCase_ == 19) {
      output.writeMessage(
          19, (com.google.cloud.automl.v1.TextExtractionModelMetadata) modelMetadata_);
    }
    if (modelMetadataCase_ == 20) {
      output.writeMessage(
          20, (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) modelMetadata_);
    }
    if (modelMetadataCase_ == 22) {
      output.writeMessage(
          22, (com.google.cloud.automl.v1.TextSentimentModelMetadata) modelMetadata_);
    }
    com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
        output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 34);
    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(datasetId_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, datasetId_);
    }
    if (createTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCreateTime());
    }
    if (deploymentState_
        != com.google.cloud.automl.v1.Model.DeploymentState.DEPLOYMENT_STATE_UNSPECIFIED
            .getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, deploymentState_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, etag_);
    }
    if (updateTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getUpdateTime());
    }
    if (modelMetadataCase_ == 13) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              13, (com.google.cloud.automl.v1.ImageClassificationModelMetadata) modelMetadata_);
    }
    if (modelMetadataCase_ == 14) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              14, (com.google.cloud.automl.v1.TextClassificationModelMetadata) modelMetadata_);
    }
    if (modelMetadataCase_ == 15) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              15, (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_);
    }
    if (modelMetadataCase_ == 19) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              19, (com.google.cloud.automl.v1.TextExtractionModelMetadata) modelMetadata_);
    }
    if (modelMetadataCase_ == 20) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              20, (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) modelMetadata_);
    }
    if (modelMetadataCase_ == 22) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              22, (com.google.cloud.automl.v1.TextSentimentModelMetadata) modelMetadata_);
    }
    for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
        internalGetLabels().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ =
          LabelsDefaultEntryHolder.defaultEntry
              .newBuilderForType()
              .setKey(entry.getKey())
              .setValue(entry.getValue())
              .build();
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(34, labels__);
    }
    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.automl.v1.Model)) {
      return super.equals(obj);
    }
    com.google.cloud.automl.v1.Model other = (com.google.cloud.automl.v1.Model) obj;

    if (!getName().equals(other.getName())) return false;
    if (!getDisplayName().equals(other.getDisplayName())) return false;
    if (!getDatasetId().equals(other.getDatasetId())) return false;
    if (hasCreateTime() != other.hasCreateTime()) return false;
    if (hasCreateTime()) {
      if (!getCreateTime().equals(other.getCreateTime())) return false;
    }
    if (hasUpdateTime() != other.hasUpdateTime()) return false;
    if (hasUpdateTime()) {
      if (!getUpdateTime().equals(other.getUpdateTime())) return false;
    }
    if (deploymentState_ != other.deploymentState_) return false;
    if (!getEtag().equals(other.getEtag())) return false;
    if (!internalGetLabels().equals(other.internalGetLabels())) return false;
    if (!getModelMetadataCase().equals(other.getModelMetadataCase())) return false;
    switch (modelMetadataCase_) {
      case 15:
        if (!getTranslationModelMetadata().equals(other.getTranslationModelMetadata()))
          return false;
        break;
      case 13:
        if (!getImageClassificationModelMetadata()
            .equals(other.getImageClassificationModelMetadata())) return false;
        break;
      case 14:
        if (!getTextClassificationModelMetadata()
            .equals(other.getTextClassificationModelMetadata())) return false;
        break;
      case 20:
        if (!getImageObjectDetectionModelMetadata()
            .equals(other.getImageObjectDetectionModelMetadata())) return false;
        break;
      case 19:
        if (!getTextExtractionModelMetadata().equals(other.getTextExtractionModelMetadata()))
          return false;
        break;
      case 22:
        if (!getTextSentimentModelMetadata().equals(other.getTextSentimentModelMetadata()))
          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) + DATASET_ID_FIELD_NUMBER;
    hash = (53 * hash) + getDatasetId().hashCode();
    if (hasCreateTime()) {
      hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getCreateTime().hashCode();
    }
    if (hasUpdateTime()) {
      hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getUpdateTime().hashCode();
    }
    hash = (37 * hash) + DEPLOYMENT_STATE_FIELD_NUMBER;
    hash = (53 * hash) + deploymentState_;
    hash = (37 * hash) + ETAG_FIELD_NUMBER;
    hash = (53 * hash) + getEtag().hashCode();
    if (!internalGetLabels().getMap().isEmpty()) {
      hash = (37 * hash) + LABELS_FIELD_NUMBER;
      hash = (53 * hash) + internalGetLabels().hashCode();
    }
    switch (modelMetadataCase_) {
      case 15:
        hash = (37 * hash) + TRANSLATION_MODEL_METADATA_FIELD_NUMBER;
        hash = (53 * hash) + getTranslationModelMetadata().hashCode();
        break;
      case 13:
        hash = (37 * hash) + IMAGE_CLASSIFICATION_MODEL_METADATA_FIELD_NUMBER;
        hash = (53 * hash) + getImageClassificationModelMetadata().hashCode();
        break;
      case 14:
        hash = (37 * hash) + TEXT_CLASSIFICATION_MODEL_METADATA_FIELD_NUMBER;
        hash = (53 * hash) + getTextClassificationModelMetadata().hashCode();
        break;
      case 20:
        hash = (37 * hash) + IMAGE_OBJECT_DETECTION_MODEL_METADATA_FIELD_NUMBER;
        hash = (53 * hash) + getImageObjectDetectionModelMetadata().hashCode();
        break;
      case 19:
        hash = (37 * hash) + TEXT_EXTRACTION_MODEL_METADATA_FIELD_NUMBER;
        hash = (53 * hash) + getTextExtractionModelMetadata().hashCode();
        break;
      case 22:
        hash = (37 * hash) + TEXT_SENTIMENT_MODEL_METADATA_FIELD_NUMBER;
        hash = (53 * hash) + getTextSentimentModelMetadata().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

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

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

  public static com.google.cloud.automl.v1.Model 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.automl.v1.Model 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>
   * API proto representing a trained machine learning model.
   * </pre>
   *
   * Protobuf type {@code google.cloud.automl.v1.Model}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.Model)
      com.google.cloud.automl.v1.ModelOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.automl.v1.ModelOuterClass
          .internal_static_google_cloud_automl_v1_Model_descriptor;
    }

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

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

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.automl.v1.ModelOuterClass
          .internal_static_google_cloud_automl_v1_Model_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.automl.v1.Model.class,
              com.google.cloud.automl.v1.Model.Builder.class);
    }

    // Construct using com.google.cloud.automl.v1.Model.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      if (translationModelMetadataBuilder_ != null) {
        translationModelMetadataBuilder_.clear();
      }
      if (imageClassificationModelMetadataBuilder_ != null) {
        imageClassificationModelMetadataBuilder_.clear();
      }
      if (textClassificationModelMetadataBuilder_ != null) {
        textClassificationModelMetadataBuilder_.clear();
      }
      if (imageObjectDetectionModelMetadataBuilder_ != null) {
        imageObjectDetectionModelMetadataBuilder_.clear();
      }
      if (textExtractionModelMetadataBuilder_ != null) {
        textExtractionModelMetadataBuilder_.clear();
      }
      if (textSentimentModelMetadataBuilder_ != null) {
        textSentimentModelMetadataBuilder_.clear();
      }
      name_ = "";
      displayName_ = "";
      datasetId_ = "";
      createTime_ = null;
      if (createTimeBuilder_ != null) {
        createTimeBuilder_.dispose();
        createTimeBuilder_ = null;
      }
      updateTime_ = null;
      if (updateTimeBuilder_ != null) {
        updateTimeBuilder_.dispose();
        updateTimeBuilder_ = null;
      }
      deploymentState_ = 0;
      etag_ = "";
      internalGetMutableLabels().clear();
      modelMetadataCase_ = 0;
      modelMetadata_ = null;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.automl.v1.ModelOuterClass
          .internal_static_google_cloud_automl_v1_Model_descriptor;
    }

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

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

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

    private void buildPartial0(com.google.cloud.automl.v1.Model result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000040) != 0)) {
        result.name_ = name_;
      }
      if (((from_bitField0_ & 0x00000080) != 0)) {
        result.displayName_ = displayName_;
      }
      if (((from_bitField0_ & 0x00000100) != 0)) {
        result.datasetId_ = datasetId_;
      }
      if (((from_bitField0_ & 0x00000200) != 0)) {
        result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000400) != 0)) {
        result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000800) != 0)) {
        result.deploymentState_ = deploymentState_;
      }
      if (((from_bitField0_ & 0x00001000) != 0)) {
        result.etag_ = etag_;
      }
      if (((from_bitField0_ & 0x00002000) != 0)) {
        result.labels_ = internalGetLabels();
        result.labels_.makeImmutable();
      }
    }

    private void buildPartialOneofs(com.google.cloud.automl.v1.Model result) {
      result.modelMetadataCase_ = modelMetadataCase_;
      result.modelMetadata_ = this.modelMetadata_;
      if (modelMetadataCase_ == 15 && translationModelMetadataBuilder_ != null) {
        result.modelMetadata_ = translationModelMetadataBuilder_.build();
      }
      if (modelMetadataCase_ == 13 && imageClassificationModelMetadataBuilder_ != null) {
        result.modelMetadata_ = imageClassificationModelMetadataBuilder_.build();
      }
      if (modelMetadataCase_ == 14 && textClassificationModelMetadataBuilder_ != null) {
        result.modelMetadata_ = textClassificationModelMetadataBuilder_.build();
      }
      if (modelMetadataCase_ == 20 && imageObjectDetectionModelMetadataBuilder_ != null) {
        result.modelMetadata_ = imageObjectDetectionModelMetadataBuilder_.build();
      }
      if (modelMetadataCase_ == 19 && textExtractionModelMetadataBuilder_ != null) {
        result.modelMetadata_ = textExtractionModelMetadataBuilder_.build();
      }
      if (modelMetadataCase_ == 22 && textSentimentModelMetadataBuilder_ != null) {
        result.modelMetadata_ = textSentimentModelMetadataBuilder_.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.automl.v1.Model) {
        return mergeFrom((com.google.cloud.automl.v1.Model) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.automl.v1.Model other) {
      if (other == com.google.cloud.automl.v1.Model.getDefaultInstance()) return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        bitField0_ |= 0x00000040;
        onChanged();
      }
      if (!other.getDisplayName().isEmpty()) {
        displayName_ = other.displayName_;
        bitField0_ |= 0x00000080;
        onChanged();
      }
      if (!other.getDatasetId().isEmpty()) {
        datasetId_ = other.datasetId_;
        bitField0_ |= 0x00000100;
        onChanged();
      }
      if (other.hasCreateTime()) {
        mergeCreateTime(other.getCreateTime());
      }
      if (other.hasUpdateTime()) {
        mergeUpdateTime(other.getUpdateTime());
      }
      if (other.deploymentState_ != 0) {
        setDeploymentStateValue(other.getDeploymentStateValue());
      }
      if (!other.getEtag().isEmpty()) {
        etag_ = other.etag_;
        bitField0_ |= 0x00001000;
        onChanged();
      }
      internalGetMutableLabels().mergeFrom(other.internalGetLabels());
      bitField0_ |= 0x00002000;
      switch (other.getModelMetadataCase()) {
        case TRANSLATION_MODEL_METADATA:
          {
            mergeTranslationModelMetadata(other.getTranslationModelMetadata());
            break;
          }
        case IMAGE_CLASSIFICATION_MODEL_METADATA:
          {
            mergeImageClassificationModelMetadata(other.getImageClassificationModelMetadata());
            break;
          }
        case TEXT_CLASSIFICATION_MODEL_METADATA:
          {
            mergeTextClassificationModelMetadata(other.getTextClassificationModelMetadata());
            break;
          }
        case IMAGE_OBJECT_DETECTION_MODEL_METADATA:
          {
            mergeImageObjectDetectionModelMetadata(other.getImageObjectDetectionModelMetadata());
            break;
          }
        case TEXT_EXTRACTION_MODEL_METADATA:
          {
            mergeTextExtractionModelMetadata(other.getTextExtractionModelMetadata());
            break;
          }
        case TEXT_SENTIMENT_MODEL_METADATA:
          {
            mergeTextSentimentModelMetadata(other.getTextSentimentModelMetadata());
            break;
          }
        case MODELMETADATA_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_ |= 0x00000040;
                break;
              } // case 10
            case 18:
              {
                displayName_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000080;
                break;
              } // case 18
            case 26:
              {
                datasetId_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000100;
                break;
              } // case 26
            case 58:
              {
                input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000200;
                break;
              } // case 58
            case 64:
              {
                deploymentState_ = input.readEnum();
                bitField0_ |= 0x00000800;
                break;
              } // case 64
            case 82:
              {
                etag_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00001000;
                break;
              } // case 82
            case 90:
              {
                input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000400;
                break;
              } // case 90
            case 106:
              {
                input.readMessage(
                    getImageClassificationModelMetadataFieldBuilder().getBuilder(),
                    extensionRegistry);
                modelMetadataCase_ = 13;
                break;
              } // case 106
            case 114:
              {
                input.readMessage(
                    getTextClassificationModelMetadataFieldBuilder().getBuilder(),
                    extensionRegistry);
                modelMetadataCase_ = 14;
                break;
              } // case 114
            case 122:
              {
                input.readMessage(
                    getTranslationModelMetadataFieldBuilder().getBuilder(), extensionRegistry);
                modelMetadataCase_ = 15;
                break;
              } // case 122
            case 154:
              {
                input.readMessage(
                    getTextExtractionModelMetadataFieldBuilder().getBuilder(), extensionRegistry);
                modelMetadataCase_ = 19;
                break;
              } // case 154
            case 162:
              {
                input.readMessage(
                    getImageObjectDetectionModelMetadataFieldBuilder().getBuilder(),
                    extensionRegistry);
                modelMetadataCase_ = 20;
                break;
              } // case 162
            case 178:
              {
                input.readMessage(
                    getTextSentimentModelMetadataFieldBuilder().getBuilder(), extensionRegistry);
                modelMetadataCase_ = 22;
                break;
              } // case 178
            case 274:
              {
                com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ =
                    input.readMessage(
                        LabelsDefaultEntryHolder.defaultEntry.getParserForType(),
                        extensionRegistry);
                internalGetMutableLabels()
                    .getMutableMap()
                    .put(labels__.getKey(), labels__.getValue());
                bitField0_ |= 0x00002000;
                break;
              } // case 274
            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 modelMetadataCase_ = 0;
    private java.lang.Object modelMetadata_;

    public ModelMetadataCase getModelMetadataCase() {
      return ModelMetadataCase.forNumber(modelMetadataCase_);
    }

    public Builder clearModelMetadata() {
      modelMetadataCase_ = 0;
      modelMetadata_ = null;
      onChanged();
      return this;
    }

    private int bitField0_;

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.automl.v1.TranslationModelMetadata,
            com.google.cloud.automl.v1.TranslationModelMetadata.Builder,
            com.google.cloud.automl.v1.TranslationModelMetadataOrBuilder>
        translationModelMetadataBuilder_;
    /**
     *
     *
     * <pre>
     * Metadata for translation models.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15;
     * </code>
     *
     * @return Whether the translationModelMetadata field is set.
     */
    @java.lang.Override
    public boolean hasTranslationModelMetadata() {
      return modelMetadataCase_ == 15;
    }
    /**
     *
     *
     * <pre>
     * Metadata for translation models.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15;
     * </code>
     *
     * @return The translationModelMetadata.
     */
    @java.lang.Override
    public com.google.cloud.automl.v1.TranslationModelMetadata getTranslationModelMetadata() {
      if (translationModelMetadataBuilder_ == null) {
        if (modelMetadataCase_ == 15) {
          return (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_;
        }
        return com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance();
      } else {
        if (modelMetadataCase_ == 15) {
          return translationModelMetadataBuilder_.getMessage();
        }
        return com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Metadata for translation models.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15;
     * </code>
     */
    public Builder setTranslationModelMetadata(
        com.google.cloud.automl.v1.TranslationModelMetadata value) {
      if (translationModelMetadataBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        modelMetadata_ = value;
        onChanged();
      } else {
        translationModelMetadataBuilder_.setMessage(value);
      }
      modelMetadataCase_ = 15;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for translation models.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15;
     * </code>
     */
    public Builder setTranslationModelMetadata(
        com.google.cloud.automl.v1.TranslationModelMetadata.Builder builderForValue) {
      if (translationModelMetadataBuilder_ == null) {
        modelMetadata_ = builderForValue.build();
        onChanged();
      } else {
        translationModelMetadataBuilder_.setMessage(builderForValue.build());
      }
      modelMetadataCase_ = 15;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for translation models.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15;
     * </code>
     */
    public Builder mergeTranslationModelMetadata(
        com.google.cloud.automl.v1.TranslationModelMetadata value) {
      if (translationModelMetadataBuilder_ == null) {
        if (modelMetadataCase_ == 15
            && modelMetadata_
                != com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance()) {
          modelMetadata_ =
              com.google.cloud.automl.v1.TranslationModelMetadata.newBuilder(
                      (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          modelMetadata_ = value;
        }
        onChanged();
      } else {
        if (modelMetadataCase_ == 15) {
          translationModelMetadataBuilder_.mergeFrom(value);
        } else {
          translationModelMetadataBuilder_.setMessage(value);
        }
      }
      modelMetadataCase_ = 15;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for translation models.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15;
     * </code>
     */
    public Builder clearTranslationModelMetadata() {
      if (translationModelMetadataBuilder_ == null) {
        if (modelMetadataCase_ == 15) {
          modelMetadataCase_ = 0;
          modelMetadata_ = null;
          onChanged();
        }
      } else {
        if (modelMetadataCase_ == 15) {
          modelMetadataCase_ = 0;
          modelMetadata_ = null;
        }
        translationModelMetadataBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for translation models.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15;
     * </code>
     */
    public com.google.cloud.automl.v1.TranslationModelMetadata.Builder
        getTranslationModelMetadataBuilder() {
      return getTranslationModelMetadataFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Metadata for translation models.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15;
     * </code>
     */
    @java.lang.Override
    public com.google.cloud.automl.v1.TranslationModelMetadataOrBuilder
        getTranslationModelMetadataOrBuilder() {
      if ((modelMetadataCase_ == 15) && (translationModelMetadataBuilder_ != null)) {
        return translationModelMetadataBuilder_.getMessageOrBuilder();
      } else {
        if (modelMetadataCase_ == 15) {
          return (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_;
        }
        return com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Metadata for translation models.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15;
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.automl.v1.TranslationModelMetadata,
            com.google.cloud.automl.v1.TranslationModelMetadata.Builder,
            com.google.cloud.automl.v1.TranslationModelMetadataOrBuilder>
        getTranslationModelMetadataFieldBuilder() {
      if (translationModelMetadataBuilder_ == null) {
        if (!(modelMetadataCase_ == 15)) {
          modelMetadata_ = com.google.cloud.automl.v1.TranslationModelMetadata.getDefaultInstance();
        }
        translationModelMetadataBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.automl.v1.TranslationModelMetadata,
                com.google.cloud.automl.v1.TranslationModelMetadata.Builder,
                com.google.cloud.automl.v1.TranslationModelMetadataOrBuilder>(
                (com.google.cloud.automl.v1.TranslationModelMetadata) modelMetadata_,
                getParentForChildren(),
                isClean());
        modelMetadata_ = null;
      }
      modelMetadataCase_ = 15;
      onChanged();
      return translationModelMetadataBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.automl.v1.ImageClassificationModelMetadata,
            com.google.cloud.automl.v1.ImageClassificationModelMetadata.Builder,
            com.google.cloud.automl.v1.ImageClassificationModelMetadataOrBuilder>
        imageClassificationModelMetadataBuilder_;
    /**
     *
     *
     * <pre>
     * Metadata for image classification models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13;
     * </code>
     *
     * @return Whether the imageClassificationModelMetadata field is set.
     */
    @java.lang.Override
    public boolean hasImageClassificationModelMetadata() {
      return modelMetadataCase_ == 13;
    }
    /**
     *
     *
     * <pre>
     * Metadata for image classification models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13;
     * </code>
     *
     * @return The imageClassificationModelMetadata.
     */
    @java.lang.Override
    public com.google.cloud.automl.v1.ImageClassificationModelMetadata
        getImageClassificationModelMetadata() {
      if (imageClassificationModelMetadataBuilder_ == null) {
        if (modelMetadataCase_ == 13) {
          return (com.google.cloud.automl.v1.ImageClassificationModelMetadata) modelMetadata_;
        }
        return com.google.cloud.automl.v1.ImageClassificationModelMetadata.getDefaultInstance();
      } else {
        if (modelMetadataCase_ == 13) {
          return imageClassificationModelMetadataBuilder_.getMessage();
        }
        return com.google.cloud.automl.v1.ImageClassificationModelMetadata.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Metadata for image classification models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13;
     * </code>
     */
    public Builder setImageClassificationModelMetadata(
        com.google.cloud.automl.v1.ImageClassificationModelMetadata value) {
      if (imageClassificationModelMetadataBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        modelMetadata_ = value;
        onChanged();
      } else {
        imageClassificationModelMetadataBuilder_.setMessage(value);
      }
      modelMetadataCase_ = 13;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for image classification models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13;
     * </code>
     */
    public Builder setImageClassificationModelMetadata(
        com.google.cloud.automl.v1.ImageClassificationModelMetadata.Builder builderForValue) {
      if (imageClassificationModelMetadataBuilder_ == null) {
        modelMetadata_ = builderForValue.build();
        onChanged();
      } else {
        imageClassificationModelMetadataBuilder_.setMessage(builderForValue.build());
      }
      modelMetadataCase_ = 13;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for image classification models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13;
     * </code>
     */
    public Builder mergeImageClassificationModelMetadata(
        com.google.cloud.automl.v1.ImageClassificationModelMetadata value) {
      if (imageClassificationModelMetadataBuilder_ == null) {
        if (modelMetadataCase_ == 13
            && modelMetadata_
                != com.google.cloud.automl.v1.ImageClassificationModelMetadata
                    .getDefaultInstance()) {
          modelMetadata_ =
              com.google.cloud.automl.v1.ImageClassificationModelMetadata.newBuilder(
                      (com.google.cloud.automl.v1.ImageClassificationModelMetadata) modelMetadata_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          modelMetadata_ = value;
        }
        onChanged();
      } else {
        if (modelMetadataCase_ == 13) {
          imageClassificationModelMetadataBuilder_.mergeFrom(value);
        } else {
          imageClassificationModelMetadataBuilder_.setMessage(value);
        }
      }
      modelMetadataCase_ = 13;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for image classification models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13;
     * </code>
     */
    public Builder clearImageClassificationModelMetadata() {
      if (imageClassificationModelMetadataBuilder_ == null) {
        if (modelMetadataCase_ == 13) {
          modelMetadataCase_ = 0;
          modelMetadata_ = null;
          onChanged();
        }
      } else {
        if (modelMetadataCase_ == 13) {
          modelMetadataCase_ = 0;
          modelMetadata_ = null;
        }
        imageClassificationModelMetadataBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for image classification models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13;
     * </code>
     */
    public com.google.cloud.automl.v1.ImageClassificationModelMetadata.Builder
        getImageClassificationModelMetadataBuilder() {
      return getImageClassificationModelMetadataFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Metadata for image classification models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13;
     * </code>
     */
    @java.lang.Override
    public com.google.cloud.automl.v1.ImageClassificationModelMetadataOrBuilder
        getImageClassificationModelMetadataOrBuilder() {
      if ((modelMetadataCase_ == 13) && (imageClassificationModelMetadataBuilder_ != null)) {
        return imageClassificationModelMetadataBuilder_.getMessageOrBuilder();
      } else {
        if (modelMetadataCase_ == 13) {
          return (com.google.cloud.automl.v1.ImageClassificationModelMetadata) modelMetadata_;
        }
        return com.google.cloud.automl.v1.ImageClassificationModelMetadata.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Metadata for image classification models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13;
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.automl.v1.ImageClassificationModelMetadata,
            com.google.cloud.automl.v1.ImageClassificationModelMetadata.Builder,
            com.google.cloud.automl.v1.ImageClassificationModelMetadataOrBuilder>
        getImageClassificationModelMetadataFieldBuilder() {
      if (imageClassificationModelMetadataBuilder_ == null) {
        if (!(modelMetadataCase_ == 13)) {
          modelMetadata_ =
              com.google.cloud.automl.v1.ImageClassificationModelMetadata.getDefaultInstance();
        }
        imageClassificationModelMetadataBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.automl.v1.ImageClassificationModelMetadata,
                com.google.cloud.automl.v1.ImageClassificationModelMetadata.Builder,
                com.google.cloud.automl.v1.ImageClassificationModelMetadataOrBuilder>(
                (com.google.cloud.automl.v1.ImageClassificationModelMetadata) modelMetadata_,
                getParentForChildren(),
                isClean());
        modelMetadata_ = null;
      }
      modelMetadataCase_ = 13;
      onChanged();
      return imageClassificationModelMetadataBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.automl.v1.TextClassificationModelMetadata,
            com.google.cloud.automl.v1.TextClassificationModelMetadata.Builder,
            com.google.cloud.automl.v1.TextClassificationModelMetadataOrBuilder>
        textClassificationModelMetadataBuilder_;
    /**
     *
     *
     * <pre>
     * Metadata for text classification models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14;
     * </code>
     *
     * @return Whether the textClassificationModelMetadata field is set.
     */
    @java.lang.Override
    public boolean hasTextClassificationModelMetadata() {
      return modelMetadataCase_ == 14;
    }
    /**
     *
     *
     * <pre>
     * Metadata for text classification models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14;
     * </code>
     *
     * @return The textClassificationModelMetadata.
     */
    @java.lang.Override
    public com.google.cloud.automl.v1.TextClassificationModelMetadata
        getTextClassificationModelMetadata() {
      if (textClassificationModelMetadataBuilder_ == null) {
        if (modelMetadataCase_ == 14) {
          return (com.google.cloud.automl.v1.TextClassificationModelMetadata) modelMetadata_;
        }
        return com.google.cloud.automl.v1.TextClassificationModelMetadata.getDefaultInstance();
      } else {
        if (modelMetadataCase_ == 14) {
          return textClassificationModelMetadataBuilder_.getMessage();
        }
        return com.google.cloud.automl.v1.TextClassificationModelMetadata.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Metadata for text classification models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14;
     * </code>
     */
    public Builder setTextClassificationModelMetadata(
        com.google.cloud.automl.v1.TextClassificationModelMetadata value) {
      if (textClassificationModelMetadataBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        modelMetadata_ = value;
        onChanged();
      } else {
        textClassificationModelMetadataBuilder_.setMessage(value);
      }
      modelMetadataCase_ = 14;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for text classification models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14;
     * </code>
     */
    public Builder setTextClassificationModelMetadata(
        com.google.cloud.automl.v1.TextClassificationModelMetadata.Builder builderForValue) {
      if (textClassificationModelMetadataBuilder_ == null) {
        modelMetadata_ = builderForValue.build();
        onChanged();
      } else {
        textClassificationModelMetadataBuilder_.setMessage(builderForValue.build());
      }
      modelMetadataCase_ = 14;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for text classification models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14;
     * </code>
     */
    public Builder mergeTextClassificationModelMetadata(
        com.google.cloud.automl.v1.TextClassificationModelMetadata value) {
      if (textClassificationModelMetadataBuilder_ == null) {
        if (modelMetadataCase_ == 14
            && modelMetadata_
                != com.google.cloud.automl.v1.TextClassificationModelMetadata
                    .getDefaultInstance()) {
          modelMetadata_ =
              com.google.cloud.automl.v1.TextClassificationModelMetadata.newBuilder(
                      (com.google.cloud.automl.v1.TextClassificationModelMetadata) modelMetadata_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          modelMetadata_ = value;
        }
        onChanged();
      } else {
        if (modelMetadataCase_ == 14) {
          textClassificationModelMetadataBuilder_.mergeFrom(value);
        } else {
          textClassificationModelMetadataBuilder_.setMessage(value);
        }
      }
      modelMetadataCase_ = 14;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for text classification models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14;
     * </code>
     */
    public Builder clearTextClassificationModelMetadata() {
      if (textClassificationModelMetadataBuilder_ == null) {
        if (modelMetadataCase_ == 14) {
          modelMetadataCase_ = 0;
          modelMetadata_ = null;
          onChanged();
        }
      } else {
        if (modelMetadataCase_ == 14) {
          modelMetadataCase_ = 0;
          modelMetadata_ = null;
        }
        textClassificationModelMetadataBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for text classification models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14;
     * </code>
     */
    public com.google.cloud.automl.v1.TextClassificationModelMetadata.Builder
        getTextClassificationModelMetadataBuilder() {
      return getTextClassificationModelMetadataFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Metadata for text classification models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14;
     * </code>
     */
    @java.lang.Override
    public com.google.cloud.automl.v1.TextClassificationModelMetadataOrBuilder
        getTextClassificationModelMetadataOrBuilder() {
      if ((modelMetadataCase_ == 14) && (textClassificationModelMetadataBuilder_ != null)) {
        return textClassificationModelMetadataBuilder_.getMessageOrBuilder();
      } else {
        if (modelMetadataCase_ == 14) {
          return (com.google.cloud.automl.v1.TextClassificationModelMetadata) modelMetadata_;
        }
        return com.google.cloud.automl.v1.TextClassificationModelMetadata.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Metadata for text classification models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14;
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.automl.v1.TextClassificationModelMetadata,
            com.google.cloud.automl.v1.TextClassificationModelMetadata.Builder,
            com.google.cloud.automl.v1.TextClassificationModelMetadataOrBuilder>
        getTextClassificationModelMetadataFieldBuilder() {
      if (textClassificationModelMetadataBuilder_ == null) {
        if (!(modelMetadataCase_ == 14)) {
          modelMetadata_ =
              com.google.cloud.automl.v1.TextClassificationModelMetadata.getDefaultInstance();
        }
        textClassificationModelMetadataBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.automl.v1.TextClassificationModelMetadata,
                com.google.cloud.automl.v1.TextClassificationModelMetadata.Builder,
                com.google.cloud.automl.v1.TextClassificationModelMetadataOrBuilder>(
                (com.google.cloud.automl.v1.TextClassificationModelMetadata) modelMetadata_,
                getParentForChildren(),
                isClean());
        modelMetadata_ = null;
      }
      modelMetadataCase_ = 14;
      onChanged();
      return textClassificationModelMetadataBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata,
            com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.Builder,
            com.google.cloud.automl.v1.ImageObjectDetectionModelMetadataOrBuilder>
        imageObjectDetectionModelMetadataBuilder_;
    /**
     *
     *
     * <pre>
     * Metadata for image object detection models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20;
     * </code>
     *
     * @return Whether the imageObjectDetectionModelMetadata field is set.
     */
    @java.lang.Override
    public boolean hasImageObjectDetectionModelMetadata() {
      return modelMetadataCase_ == 20;
    }
    /**
     *
     *
     * <pre>
     * Metadata for image object detection models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20;
     * </code>
     *
     * @return The imageObjectDetectionModelMetadata.
     */
    @java.lang.Override
    public com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata
        getImageObjectDetectionModelMetadata() {
      if (imageObjectDetectionModelMetadataBuilder_ == null) {
        if (modelMetadataCase_ == 20) {
          return (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) modelMetadata_;
        }
        return com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.getDefaultInstance();
      } else {
        if (modelMetadataCase_ == 20) {
          return imageObjectDetectionModelMetadataBuilder_.getMessage();
        }
        return com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Metadata for image object detection models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20;
     * </code>
     */
    public Builder setImageObjectDetectionModelMetadata(
        com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata value) {
      if (imageObjectDetectionModelMetadataBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        modelMetadata_ = value;
        onChanged();
      } else {
        imageObjectDetectionModelMetadataBuilder_.setMessage(value);
      }
      modelMetadataCase_ = 20;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for image object detection models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20;
     * </code>
     */
    public Builder setImageObjectDetectionModelMetadata(
        com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.Builder builderForValue) {
      if (imageObjectDetectionModelMetadataBuilder_ == null) {
        modelMetadata_ = builderForValue.build();
        onChanged();
      } else {
        imageObjectDetectionModelMetadataBuilder_.setMessage(builderForValue.build());
      }
      modelMetadataCase_ = 20;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for image object detection models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20;
     * </code>
     */
    public Builder mergeImageObjectDetectionModelMetadata(
        com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata value) {
      if (imageObjectDetectionModelMetadataBuilder_ == null) {
        if (modelMetadataCase_ == 20
            && modelMetadata_
                != com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata
                    .getDefaultInstance()) {
          modelMetadata_ =
              com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.newBuilder(
                      (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) modelMetadata_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          modelMetadata_ = value;
        }
        onChanged();
      } else {
        if (modelMetadataCase_ == 20) {
          imageObjectDetectionModelMetadataBuilder_.mergeFrom(value);
        } else {
          imageObjectDetectionModelMetadataBuilder_.setMessage(value);
        }
      }
      modelMetadataCase_ = 20;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for image object detection models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20;
     * </code>
     */
    public Builder clearImageObjectDetectionModelMetadata() {
      if (imageObjectDetectionModelMetadataBuilder_ == null) {
        if (modelMetadataCase_ == 20) {
          modelMetadataCase_ = 0;
          modelMetadata_ = null;
          onChanged();
        }
      } else {
        if (modelMetadataCase_ == 20) {
          modelMetadataCase_ = 0;
          modelMetadata_ = null;
        }
        imageObjectDetectionModelMetadataBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for image object detection models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20;
     * </code>
     */
    public com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.Builder
        getImageObjectDetectionModelMetadataBuilder() {
      return getImageObjectDetectionModelMetadataFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Metadata for image object detection models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20;
     * </code>
     */
    @java.lang.Override
    public com.google.cloud.automl.v1.ImageObjectDetectionModelMetadataOrBuilder
        getImageObjectDetectionModelMetadataOrBuilder() {
      if ((modelMetadataCase_ == 20) && (imageObjectDetectionModelMetadataBuilder_ != null)) {
        return imageObjectDetectionModelMetadataBuilder_.getMessageOrBuilder();
      } else {
        if (modelMetadataCase_ == 20) {
          return (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) modelMetadata_;
        }
        return com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Metadata for image object detection models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20;
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata,
            com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.Builder,
            com.google.cloud.automl.v1.ImageObjectDetectionModelMetadataOrBuilder>
        getImageObjectDetectionModelMetadataFieldBuilder() {
      if (imageObjectDetectionModelMetadataBuilder_ == null) {
        if (!(modelMetadataCase_ == 20)) {
          modelMetadata_ =
              com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.getDefaultInstance();
        }
        imageObjectDetectionModelMetadataBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata,
                com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.Builder,
                com.google.cloud.automl.v1.ImageObjectDetectionModelMetadataOrBuilder>(
                (com.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) modelMetadata_,
                getParentForChildren(),
                isClean());
        modelMetadata_ = null;
      }
      modelMetadataCase_ = 20;
      onChanged();
      return imageObjectDetectionModelMetadataBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.automl.v1.TextExtractionModelMetadata,
            com.google.cloud.automl.v1.TextExtractionModelMetadata.Builder,
            com.google.cloud.automl.v1.TextExtractionModelMetadataOrBuilder>
        textExtractionModelMetadataBuilder_;
    /**
     *
     *
     * <pre>
     * Metadata for text extraction models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19;
     * </code>
     *
     * @return Whether the textExtractionModelMetadata field is set.
     */
    @java.lang.Override
    public boolean hasTextExtractionModelMetadata() {
      return modelMetadataCase_ == 19;
    }
    /**
     *
     *
     * <pre>
     * Metadata for text extraction models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19;
     * </code>
     *
     * @return The textExtractionModelMetadata.
     */
    @java.lang.Override
    public com.google.cloud.automl.v1.TextExtractionModelMetadata getTextExtractionModelMetadata() {
      if (textExtractionModelMetadataBuilder_ == null) {
        if (modelMetadataCase_ == 19) {
          return (com.google.cloud.automl.v1.TextExtractionModelMetadata) modelMetadata_;
        }
        return com.google.cloud.automl.v1.TextExtractionModelMetadata.getDefaultInstance();
      } else {
        if (modelMetadataCase_ == 19) {
          return textExtractionModelMetadataBuilder_.getMessage();
        }
        return com.google.cloud.automl.v1.TextExtractionModelMetadata.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Metadata for text extraction models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19;
     * </code>
     */
    public Builder setTextExtractionModelMetadata(
        com.google.cloud.automl.v1.TextExtractionModelMetadata value) {
      if (textExtractionModelMetadataBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        modelMetadata_ = value;
        onChanged();
      } else {
        textExtractionModelMetadataBuilder_.setMessage(value);
      }
      modelMetadataCase_ = 19;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for text extraction models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19;
     * </code>
     */
    public Builder setTextExtractionModelMetadata(
        com.google.cloud.automl.v1.TextExtractionModelMetadata.Builder builderForValue) {
      if (textExtractionModelMetadataBuilder_ == null) {
        modelMetadata_ = builderForValue.build();
        onChanged();
      } else {
        textExtractionModelMetadataBuilder_.setMessage(builderForValue.build());
      }
      modelMetadataCase_ = 19;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for text extraction models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19;
     * </code>
     */
    public Builder mergeTextExtractionModelMetadata(
        com.google.cloud.automl.v1.TextExtractionModelMetadata value) {
      if (textExtractionModelMetadataBuilder_ == null) {
        if (modelMetadataCase_ == 19
            && modelMetadata_
                != com.google.cloud.automl.v1.TextExtractionModelMetadata.getDefaultInstance()) {
          modelMetadata_ =
              com.google.cloud.automl.v1.TextExtractionModelMetadata.newBuilder(
                      (com.google.cloud.automl.v1.TextExtractionModelMetadata) modelMetadata_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          modelMetadata_ = value;
        }
        onChanged();
      } else {
        if (modelMetadataCase_ == 19) {
          textExtractionModelMetadataBuilder_.mergeFrom(value);
        } else {
          textExtractionModelMetadataBuilder_.setMessage(value);
        }
      }
      modelMetadataCase_ = 19;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for text extraction models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19;
     * </code>
     */
    public Builder clearTextExtractionModelMetadata() {
      if (textExtractionModelMetadataBuilder_ == null) {
        if (modelMetadataCase_ == 19) {
          modelMetadataCase_ = 0;
          modelMetadata_ = null;
          onChanged();
        }
      } else {
        if (modelMetadataCase_ == 19) {
          modelMetadataCase_ = 0;
          modelMetadata_ = null;
        }
        textExtractionModelMetadataBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for text extraction models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19;
     * </code>
     */
    public com.google.cloud.automl.v1.TextExtractionModelMetadata.Builder
        getTextExtractionModelMetadataBuilder() {
      return getTextExtractionModelMetadataFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Metadata for text extraction models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19;
     * </code>
     */
    @java.lang.Override
    public com.google.cloud.automl.v1.TextExtractionModelMetadataOrBuilder
        getTextExtractionModelMetadataOrBuilder() {
      if ((modelMetadataCase_ == 19) && (textExtractionModelMetadataBuilder_ != null)) {
        return textExtractionModelMetadataBuilder_.getMessageOrBuilder();
      } else {
        if (modelMetadataCase_ == 19) {
          return (com.google.cloud.automl.v1.TextExtractionModelMetadata) modelMetadata_;
        }
        return com.google.cloud.automl.v1.TextExtractionModelMetadata.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Metadata for text extraction models.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19;
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.automl.v1.TextExtractionModelMetadata,
            com.google.cloud.automl.v1.TextExtractionModelMetadata.Builder,
            com.google.cloud.automl.v1.TextExtractionModelMetadataOrBuilder>
        getTextExtractionModelMetadataFieldBuilder() {
      if (textExtractionModelMetadataBuilder_ == null) {
        if (!(modelMetadataCase_ == 19)) {
          modelMetadata_ =
              com.google.cloud.automl.v1.TextExtractionModelMetadata.getDefaultInstance();
        }
        textExtractionModelMetadataBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.automl.v1.TextExtractionModelMetadata,
                com.google.cloud.automl.v1.TextExtractionModelMetadata.Builder,
                com.google.cloud.automl.v1.TextExtractionModelMetadataOrBuilder>(
                (com.google.cloud.automl.v1.TextExtractionModelMetadata) modelMetadata_,
                getParentForChildren(),
                isClean());
        modelMetadata_ = null;
      }
      modelMetadataCase_ = 19;
      onChanged();
      return textExtractionModelMetadataBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.automl.v1.TextSentimentModelMetadata,
            com.google.cloud.automl.v1.TextSentimentModelMetadata.Builder,
            com.google.cloud.automl.v1.TextSentimentModelMetadataOrBuilder>
        textSentimentModelMetadataBuilder_;
    /**
     *
     *
     * <pre>
     * Metadata for text sentiment models.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22;
     * </code>
     *
     * @return Whether the textSentimentModelMetadata field is set.
     */
    @java.lang.Override
    public boolean hasTextSentimentModelMetadata() {
      return modelMetadataCase_ == 22;
    }
    /**
     *
     *
     * <pre>
     * Metadata for text sentiment models.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22;
     * </code>
     *
     * @return The textSentimentModelMetadata.
     */
    @java.lang.Override
    public com.google.cloud.automl.v1.TextSentimentModelMetadata getTextSentimentModelMetadata() {
      if (textSentimentModelMetadataBuilder_ == null) {
        if (modelMetadataCase_ == 22) {
          return (com.google.cloud.automl.v1.TextSentimentModelMetadata) modelMetadata_;
        }
        return com.google.cloud.automl.v1.TextSentimentModelMetadata.getDefaultInstance();
      } else {
        if (modelMetadataCase_ == 22) {
          return textSentimentModelMetadataBuilder_.getMessage();
        }
        return com.google.cloud.automl.v1.TextSentimentModelMetadata.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Metadata for text sentiment models.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22;
     * </code>
     */
    public Builder setTextSentimentModelMetadata(
        com.google.cloud.automl.v1.TextSentimentModelMetadata value) {
      if (textSentimentModelMetadataBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        modelMetadata_ = value;
        onChanged();
      } else {
        textSentimentModelMetadataBuilder_.setMessage(value);
      }
      modelMetadataCase_ = 22;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for text sentiment models.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22;
     * </code>
     */
    public Builder setTextSentimentModelMetadata(
        com.google.cloud.automl.v1.TextSentimentModelMetadata.Builder builderForValue) {
      if (textSentimentModelMetadataBuilder_ == null) {
        modelMetadata_ = builderForValue.build();
        onChanged();
      } else {
        textSentimentModelMetadataBuilder_.setMessage(builderForValue.build());
      }
      modelMetadataCase_ = 22;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for text sentiment models.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22;
     * </code>
     */
    public Builder mergeTextSentimentModelMetadata(
        com.google.cloud.automl.v1.TextSentimentModelMetadata value) {
      if (textSentimentModelMetadataBuilder_ == null) {
        if (modelMetadataCase_ == 22
            && modelMetadata_
                != com.google.cloud.automl.v1.TextSentimentModelMetadata.getDefaultInstance()) {
          modelMetadata_ =
              com.google.cloud.automl.v1.TextSentimentModelMetadata.newBuilder(
                      (com.google.cloud.automl.v1.TextSentimentModelMetadata) modelMetadata_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          modelMetadata_ = value;
        }
        onChanged();
      } else {
        if (modelMetadataCase_ == 22) {
          textSentimentModelMetadataBuilder_.mergeFrom(value);
        } else {
          textSentimentModelMetadataBuilder_.setMessage(value);
        }
      }
      modelMetadataCase_ = 22;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for text sentiment models.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22;
     * </code>
     */
    public Builder clearTextSentimentModelMetadata() {
      if (textSentimentModelMetadataBuilder_ == null) {
        if (modelMetadataCase_ == 22) {
          modelMetadataCase_ = 0;
          modelMetadata_ = null;
          onChanged();
        }
      } else {
        if (modelMetadataCase_ == 22) {
          modelMetadataCase_ = 0;
          modelMetadata_ = null;
        }
        textSentimentModelMetadataBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata for text sentiment models.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22;
     * </code>
     */
    public com.google.cloud.automl.v1.TextSentimentModelMetadata.Builder
        getTextSentimentModelMetadataBuilder() {
      return getTextSentimentModelMetadataFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Metadata for text sentiment models.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22;
     * </code>
     */
    @java.lang.Override
    public com.google.cloud.automl.v1.TextSentimentModelMetadataOrBuilder
        getTextSentimentModelMetadataOrBuilder() {
      if ((modelMetadataCase_ == 22) && (textSentimentModelMetadataBuilder_ != null)) {
        return textSentimentModelMetadataBuilder_.getMessageOrBuilder();
      } else {
        if (modelMetadataCase_ == 22) {
          return (com.google.cloud.automl.v1.TextSentimentModelMetadata) modelMetadata_;
        }
        return com.google.cloud.automl.v1.TextSentimentModelMetadata.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Metadata for text sentiment models.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22;
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.automl.v1.TextSentimentModelMetadata,
            com.google.cloud.automl.v1.TextSentimentModelMetadata.Builder,
            com.google.cloud.automl.v1.TextSentimentModelMetadataOrBuilder>
        getTextSentimentModelMetadataFieldBuilder() {
      if (textSentimentModelMetadataBuilder_ == null) {
        if (!(modelMetadataCase_ == 22)) {
          modelMetadata_ =
              com.google.cloud.automl.v1.TextSentimentModelMetadata.getDefaultInstance();
        }
        textSentimentModelMetadataBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.automl.v1.TextSentimentModelMetadata,
                com.google.cloud.automl.v1.TextSentimentModelMetadata.Builder,
                com.google.cloud.automl.v1.TextSentimentModelMetadataOrBuilder>(
                (com.google.cloud.automl.v1.TextSentimentModelMetadata) modelMetadata_,
                getParentForChildren(),
                isClean());
        modelMetadata_ = null;
      }
      modelMetadataCase_ = 22;
      onChanged();
      return textSentimentModelMetadataBuilder_;
    }

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * Output only. Resource name of the model.
     * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}`
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @return The name.
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Resource name of the model.
     * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}`
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @return The bytes for name.
     */
    public com.google.protobuf.ByteString getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Resource name of the model.
     * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}`
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @param value The name to set.
     * @return This builder for chaining.
     */
    public Builder setName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      name_ = value;
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Resource name of the model.
     * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}`
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {
      name_ = getDefaultInstance().getName();
      bitField0_ = (bitField0_ & ~0x00000040);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Resource name of the model.
     * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}`
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @param value The bytes for name to set.
     * @return This builder for chaining.
     */
    public Builder setNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      name_ = value;
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }

    private java.lang.Object displayName_ = "";
    /**
     *
     *
     * <pre>
     * Required. The name of the model to show in the interface. The name can be
     * up to 32 characters long and can consist only of ASCII Latin letters A-Z
     * and a-z, underscores
     * (_), and ASCII digits 0-9. It must start with a letter.
     * </pre>
     *
     * <code>string display_name = 2;</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 name of the model to show in the interface. The name can be
     * up to 32 characters long and can consist only of ASCII Latin letters A-Z
     * and a-z, underscores
     * (_), and ASCII digits 0-9. It must start with a letter.
     * </pre>
     *
     * <code>string display_name = 2;</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 name of the model to show in the interface. The name can be
     * up to 32 characters long and can consist only of ASCII Latin letters A-Z
     * and a-z, underscores
     * (_), and ASCII digits 0-9. It must start with a letter.
     * </pre>
     *
     * <code>string display_name = 2;</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_ |= 0x00000080;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the model to show in the interface. The name can be
     * up to 32 characters long and can consist only of ASCII Latin letters A-Z
     * and a-z, underscores
     * (_), and ASCII digits 0-9. It must start with a letter.
     * </pre>
     *
     * <code>string display_name = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDisplayName() {
      displayName_ = getDefaultInstance().getDisplayName();
      bitField0_ = (bitField0_ & ~0x00000080);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The name of the model to show in the interface. The name can be
     * up to 32 characters long and can consist only of ASCII Latin letters A-Z
     * and a-z, underscores
     * (_), and ASCII digits 0-9. It must start with a letter.
     * </pre>
     *
     * <code>string display_name = 2;</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_ |= 0x00000080;
      onChanged();
      return this;
    }

    private java.lang.Object datasetId_ = "";
    /**
     *
     *
     * <pre>
     * Required. The resource ID of the dataset used to create the model. The dataset must
     * come from the same ancestor project and location.
     * </pre>
     *
     * <code>string dataset_id = 3;</code>
     *
     * @return The datasetId.
     */
    public java.lang.String getDatasetId() {
      java.lang.Object ref = datasetId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        datasetId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The resource ID of the dataset used to create the model. The dataset must
     * come from the same ancestor project and location.
     * </pre>
     *
     * <code>string dataset_id = 3;</code>
     *
     * @return The bytes for datasetId.
     */
    public com.google.protobuf.ByteString getDatasetIdBytes() {
      java.lang.Object ref = datasetId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        datasetId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The resource ID of the dataset used to create the model. The dataset must
     * come from the same ancestor project and location.
     * </pre>
     *
     * <code>string dataset_id = 3;</code>
     *
     * @param value The datasetId to set.
     * @return This builder for chaining.
     */
    public Builder setDatasetId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      datasetId_ = value;
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The resource ID of the dataset used to create the model. The dataset must
     * come from the same ancestor project and location.
     * </pre>
     *
     * <code>string dataset_id = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDatasetId() {
      datasetId_ = getDefaultInstance().getDatasetId();
      bitField0_ = (bitField0_ & ~0x00000100);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The resource ID of the dataset used to create the model. The dataset must
     * come from the same ancestor project and location.
     * </pre>
     *
     * <code>string dataset_id = 3;</code>
     *
     * @param value The bytes for datasetId to set.
     * @return This builder for chaining.
     */
    public Builder setDatasetIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      datasetId_ = value;
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }

    private com.google.protobuf.Timestamp createTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        createTimeBuilder_;
    /**
     *
     *
     * <pre>
     * Output only. Timestamp when the model training finished  and can be used for prediction.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 7;</code>
     *
     * @return Whether the createTime field is set.
     */
    public boolean hasCreateTime() {
      return ((bitField0_ & 0x00000200) != 0);
    }
    /**
     *
     *
     * <pre>
     * Output only. Timestamp when the model training finished  and can be used for prediction.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 7;</code>
     *
     * @return The createTime.
     */
    public com.google.protobuf.Timestamp getCreateTime() {
      if (createTimeBuilder_ == null) {
        return createTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : createTime_;
      } else {
        return createTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Timestamp when the model training finished  and can be used for prediction.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 7;</code>
     */
    public Builder setCreateTime(com.google.protobuf.Timestamp value) {
      if (createTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        createTime_ = value;
      } else {
        createTimeBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000200;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Timestamp when the model training finished  and can be used for prediction.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 7;</code>
     */
    public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (createTimeBuilder_ == null) {
        createTime_ = builderForValue.build();
      } else {
        createTimeBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000200;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Timestamp when the model training finished  and can be used for prediction.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 7;</code>
     */
    public Builder mergeCreateTime(com.google.protobuf.Timestamp value) {
      if (createTimeBuilder_ == null) {
        if (((bitField0_ & 0x00000200) != 0)
            && createTime_ != null
            && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
          getCreateTimeBuilder().mergeFrom(value);
        } else {
          createTime_ = value;
        }
      } else {
        createTimeBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000200;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Timestamp when the model training finished  and can be used for prediction.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 7;</code>
     */
    public Builder clearCreateTime() {
      bitField0_ = (bitField0_ & ~0x00000200);
      createTime_ = null;
      if (createTimeBuilder_ != null) {
        createTimeBuilder_.dispose();
        createTimeBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Timestamp when the model training finished  and can be used for prediction.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 7;</code>
     */
    public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() {
      bitField0_ |= 0x00000200;
      onChanged();
      return getCreateTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Output only. Timestamp when the model training finished  and can be used for prediction.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 7;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
      if (createTimeBuilder_ != null) {
        return createTimeBuilder_.getMessageOrBuilder();
      } else {
        return createTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : createTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Timestamp when the model training finished  and can be used for prediction.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 7;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getCreateTimeFieldBuilder() {
      if (createTimeBuilder_ == null) {
        createTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getCreateTime(), getParentForChildren(), isClean());
        createTime_ = null;
      }
      return createTimeBuilder_;
    }

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

    private int deploymentState_ = 0;
    /**
     *
     *
     * <pre>
     * Output only. Deployment state of the model. A model can only serve
     * prediction requests after it gets deployed.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.Model.DeploymentState deployment_state = 8;</code>
     *
     * @return The enum numeric value on the wire for deploymentState.
     */
    @java.lang.Override
    public int getDeploymentStateValue() {
      return deploymentState_;
    }
    /**
     *
     *
     * <pre>
     * Output only. Deployment state of the model. A model can only serve
     * prediction requests after it gets deployed.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.Model.DeploymentState deployment_state = 8;</code>
     *
     * @param value The enum numeric value on the wire for deploymentState to set.
     * @return This builder for chaining.
     */
    public Builder setDeploymentStateValue(int value) {
      deploymentState_ = value;
      bitField0_ |= 0x00000800;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Deployment state of the model. A model can only serve
     * prediction requests after it gets deployed.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.Model.DeploymentState deployment_state = 8;</code>
     *
     * @return The deploymentState.
     */
    @java.lang.Override
    public com.google.cloud.automl.v1.Model.DeploymentState getDeploymentState() {
      com.google.cloud.automl.v1.Model.DeploymentState result =
          com.google.cloud.automl.v1.Model.DeploymentState.forNumber(deploymentState_);
      return result == null
          ? com.google.cloud.automl.v1.Model.DeploymentState.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * Output only. Deployment state of the model. A model can only serve
     * prediction requests after it gets deployed.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.Model.DeploymentState deployment_state = 8;</code>
     *
     * @param value The deploymentState to set.
     * @return This builder for chaining.
     */
    public Builder setDeploymentState(com.google.cloud.automl.v1.Model.DeploymentState value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000800;
      deploymentState_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Deployment state of the model. A model can only serve
     * prediction requests after it gets deployed.
     * </pre>
     *
     * <code>.google.cloud.automl.v1.Model.DeploymentState deployment_state = 8;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDeploymentState() {
      bitField0_ = (bitField0_ & ~0x00000800);
      deploymentState_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object etag_ = "";
    /**
     *
     *
     * <pre>
     * Used to perform a consistent read-modify-write updates. If not set, a blind
     * "overwrite" update happens.
     * </pre>
     *
     * <code>string etag = 10;</code>
     *
     * @return The etag.
     */
    public java.lang.String getEtag() {
      java.lang.Object ref = etag_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        etag_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Used to perform a consistent read-modify-write updates. If not set, a blind
     * "overwrite" update happens.
     * </pre>
     *
     * <code>string etag = 10;</code>
     *
     * @return The bytes for etag.
     */
    public com.google.protobuf.ByteString getEtagBytes() {
      java.lang.Object ref = etag_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        etag_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Used to perform a consistent read-modify-write updates. If not set, a blind
     * "overwrite" update happens.
     * </pre>
     *
     * <code>string etag = 10;</code>
     *
     * @param value The etag to set.
     * @return This builder for chaining.
     */
    public Builder setEtag(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      etag_ = value;
      bitField0_ |= 0x00001000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Used to perform a consistent read-modify-write updates. If not set, a blind
     * "overwrite" update happens.
     * </pre>
     *
     * <code>string etag = 10;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearEtag() {
      etag_ = getDefaultInstance().getEtag();
      bitField0_ = (bitField0_ & ~0x00001000);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Used to perform a consistent read-modify-write updates. If not set, a blind
     * "overwrite" update happens.
     * </pre>
     *
     * <code>string etag = 10;</code>
     *
     * @param value The bytes for etag to set.
     * @return This builder for chaining.
     */
    public Builder setEtagBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      etag_ = value;
      bitField0_ |= 0x00001000;
      onChanged();
      return this;
    }

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

    private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() {
      if (labels_ == null) {
        return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry);
      }
      return labels_;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
        internalGetMutableLabels() {
      if (labels_ == null) {
        labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry);
      }
      if (!labels_.isMutable()) {
        labels_ = labels_.copy();
      }
      bitField0_ |= 0x00002000;
      onChanged();
      return labels_;
    }

    public int getLabelsCount() {
      return internalGetLabels().getMap().size();
    }
    /**
     *
     *
     * <pre>
     * Optional. The labels with user-defined metadata to organize your model.
     * Label keys and values can be no longer than 64 characters
     * (Unicode codepoints), can only contain lowercase letters, numeric
     * characters, underscores and dashes. International characters are allowed.
     * Label values are optional. Label keys must start with a letter.
     * See https://goo.gl/xmQnxf for more information on and examples of labels.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 34;</code>
     */
    @java.lang.Override
    public boolean containsLabels(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      return internalGetLabels().getMap().containsKey(key);
    }
    /** Use {@link #getLabelsMap()} instead. */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getLabels() {
      return getLabelsMap();
    }
    /**
     *
     *
     * <pre>
     * Optional. The labels with user-defined metadata to organize your model.
     * Label keys and values can be no longer than 64 characters
     * (Unicode codepoints), can only contain lowercase letters, numeric
     * characters, underscores and dashes. International characters are allowed.
     * Label values are optional. Label keys must start with a letter.
     * See https://goo.gl/xmQnxf for more information on and examples of labels.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 34;</code>
     */
    @java.lang.Override
    public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() {
      return internalGetLabels().getMap();
    }
    /**
     *
     *
     * <pre>
     * Optional. The labels with user-defined metadata to organize your model.
     * Label keys and values can be no longer than 64 characters
     * (Unicode codepoints), can only contain lowercase letters, numeric
     * characters, underscores and dashes. International characters are allowed.
     * Label values are optional. Label keys must start with a letter.
     * See https://goo.gl/xmQnxf for more information on and examples of labels.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 34;</code>
     */
    @java.lang.Override
    public /* nullable */ java.lang.String getLabelsOrDefault(
        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 = internalGetLabels().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *
     *
     * <pre>
     * Optional. The labels with user-defined metadata to organize your model.
     * Label keys and values can be no longer than 64 characters
     * (Unicode codepoints), can only contain lowercase letters, numeric
     * characters, underscores and dashes. International characters are allowed.
     * Label values are optional. Label keys must start with a letter.
     * See https://goo.gl/xmQnxf for more information on and examples of labels.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 34;</code>
     */
    @java.lang.Override
    public java.lang.String getLabelsOrThrow(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearLabels() {
      bitField0_ = (bitField0_ & ~0x00002000);
      internalGetMutableLabels().getMutableMap().clear();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The labels with user-defined metadata to organize your model.
     * Label keys and values can be no longer than 64 characters
     * (Unicode codepoints), can only contain lowercase letters, numeric
     * characters, underscores and dashes. International characters are allowed.
     * Label values are optional. Label keys must start with a letter.
     * See https://goo.gl/xmQnxf for more information on and examples of labels.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 34;</code>
     */
    public Builder removeLabels(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      internalGetMutableLabels().getMutableMap().remove(key);
      return this;
    }
    /** Use alternate mutation accessors instead. */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getMutableLabels() {
      bitField0_ |= 0x00002000;
      return internalGetMutableLabels().getMutableMap();
    }
    /**
     *
     *
     * <pre>
     * Optional. The labels with user-defined metadata to organize your model.
     * Label keys and values can be no longer than 64 characters
     * (Unicode codepoints), can only contain lowercase letters, numeric
     * characters, underscores and dashes. International characters are allowed.
     * Label values are optional. Label keys must start with a letter.
     * See https://goo.gl/xmQnxf for more information on and examples of labels.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 34;</code>
     */
    public Builder putLabels(java.lang.String key, java.lang.String value) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      if (value == null) {
        throw new NullPointerException("map value");
      }
      internalGetMutableLabels().getMutableMap().put(key, value);
      bitField0_ |= 0x00002000;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The labels with user-defined metadata to organize your model.
     * Label keys and values can be no longer than 64 characters
     * (Unicode codepoints), can only contain lowercase letters, numeric
     * characters, underscores and dashes. International characters are allowed.
     * Label values are optional. Label keys must start with a letter.
     * See https://goo.gl/xmQnxf for more information on and examples of labels.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 34;</code>
     */
    public Builder putAllLabels(java.util.Map<java.lang.String, java.lang.String> values) {
      internalGetMutableLabels().getMutableMap().putAll(values);
      bitField0_ |= 0x00002000;
      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.automl.v1.Model)
  }

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

  static {
    DEFAULT_INSTANCE = new com.google.cloud.automl.v1.Model();
  }

  public static com.google.cloud.automl.v1.Model getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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