/*
 * 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/translate/v3/translation_service.proto

package com.google.cloud.translate.v3;

/**
 *
 *
 * <pre>
 * A document translation request.
 * </pre>
 *
 * Protobuf type {@code google.cloud.translation.v3.TranslateDocumentRequest}
 */
public final class TranslateDocumentRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.translation.v3.TranslateDocumentRequest)
    TranslateDocumentRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use TranslateDocumentRequest.newBuilder() to construct.
  private TranslateDocumentRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private TranslateDocumentRequest() {
    parent_ = "";
    sourceLanguageCode_ = "";
    targetLanguageCode_ = "";
    model_ = "";
    customizedAttribution_ = "";
  }

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

  @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.translate.v3.TranslationServiceProto
        .internal_static_google_cloud_translation_v3_TranslateDocumentRequest_descriptor;
  }

  @SuppressWarnings({"rawtypes"})
  @java.lang.Override
  protected com.google.protobuf.MapField internalGetMapField(int number) {
    switch (number) {
      case 8:
        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.translate.v3.TranslationServiceProto
        .internal_static_google_cloud_translation_v3_TranslateDocumentRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.translate.v3.TranslateDocumentRequest.class,
            com.google.cloud.translate.v3.TranslateDocumentRequest.Builder.class);
  }

  public static final int PARENT_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object parent_ = "";
  /**
   *
   *
   * <pre>
   * Required. Location to make a regional call.
   * Format: `projects/{project-number-or-id}/locations/{location-id}`.
   * For global calls, use `projects/{project-number-or-id}/locations/global` or
   * `projects/{project-number-or-id}`.
   * Non-global location is required for requests using AutoML models or custom
   * glossaries.
   * Models and glossaries must be within the same region (have the same
   * location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
   * </pre>
   *
   * <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The parent.
   */
  @java.lang.Override
  public java.lang.String getParent() {
    java.lang.Object ref = parent_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      parent_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. Location to make a regional call.
   * Format: `projects/{project-number-or-id}/locations/{location-id}`.
   * For global calls, use `projects/{project-number-or-id}/locations/global` or
   * `projects/{project-number-or-id}`.
   * Non-global location is required for requests using AutoML models or custom
   * glossaries.
   * Models and glossaries must be within the same region (have the same
   * location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
   * </pre>
   *
   * <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The bytes for parent.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getParentBytes() {
    java.lang.Object ref = parent_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      parent_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SOURCE_LANGUAGE_CODE_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  private volatile java.lang.Object sourceLanguageCode_ = "";
  /**
   *
   *
   * <pre>
   * Optional. The ISO-639 language code of the input document if known, for
   * example, "en-US" or "sr-Latn". Supported language codes are listed in
   * Language Support. If the source language isn't specified, the API attempts
   * to identify the source language automatically and returns the source
   * language within the response. Source language must be specified if the
   * request contains a glossary or a custom model.
   * </pre>
   *
   * <code>string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The sourceLanguageCode.
   */
  @java.lang.Override
  public java.lang.String getSourceLanguageCode() {
    java.lang.Object ref = sourceLanguageCode_;
    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();
      sourceLanguageCode_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional. The ISO-639 language code of the input document if known, for
   * example, "en-US" or "sr-Latn". Supported language codes are listed in
   * Language Support. If the source language isn't specified, the API attempts
   * to identify the source language automatically and returns the source
   * language within the response. Source language must be specified if the
   * request contains a glossary or a custom model.
   * </pre>
   *
   * <code>string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The bytes for sourceLanguageCode.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getSourceLanguageCodeBytes() {
    java.lang.Object ref = sourceLanguageCode_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      sourceLanguageCode_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int TARGET_LANGUAGE_CODE_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private volatile java.lang.Object targetLanguageCode_ = "";
  /**
   *
   *
   * <pre>
   * Required. The ISO-639 language code to use for translation of the input
   * document, set to one of the language codes listed in Language Support.
   * </pre>
   *
   * <code>string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The targetLanguageCode.
   */
  @java.lang.Override
  public java.lang.String getTargetLanguageCode() {
    java.lang.Object ref = targetLanguageCode_;
    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();
      targetLanguageCode_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The ISO-639 language code to use for translation of the input
   * document, set to one of the language codes listed in Language Support.
   * </pre>
   *
   * <code>string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The bytes for targetLanguageCode.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getTargetLanguageCodeBytes() {
    java.lang.Object ref = targetLanguageCode_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      targetLanguageCode_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DOCUMENT_INPUT_CONFIG_FIELD_NUMBER = 4;
  private com.google.cloud.translate.v3.DocumentInputConfig documentInputConfig_;
  /**
   *
   *
   * <pre>
   * Required. Input configurations.
   * </pre>
   *
   * <code>
   * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return Whether the documentInputConfig field is set.
   */
  @java.lang.Override
  public boolean hasDocumentInputConfig() {
    return documentInputConfig_ != null;
  }
  /**
   *
   *
   * <pre>
   * Required. Input configurations.
   * </pre>
   *
   * <code>
   * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return The documentInputConfig.
   */
  @java.lang.Override
  public com.google.cloud.translate.v3.DocumentInputConfig getDocumentInputConfig() {
    return documentInputConfig_ == null
        ? com.google.cloud.translate.v3.DocumentInputConfig.getDefaultInstance()
        : documentInputConfig_;
  }
  /**
   *
   *
   * <pre>
   * Required. Input configurations.
   * </pre>
   *
   * <code>
   * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.translate.v3.DocumentInputConfigOrBuilder
      getDocumentInputConfigOrBuilder() {
    return documentInputConfig_ == null
        ? com.google.cloud.translate.v3.DocumentInputConfig.getDefaultInstance()
        : documentInputConfig_;
  }

  public static final int DOCUMENT_OUTPUT_CONFIG_FIELD_NUMBER = 5;
  private com.google.cloud.translate.v3.DocumentOutputConfig documentOutputConfig_;
  /**
   *
   *
   * <pre>
   * Optional. Output configurations.
   * Defines if the output file should be stored within Cloud Storage as well
   * as the desired output format. If not provided the translated file will
   * only be returned through a byte-stream and its output mime type will be
   * the same as the input file's mime type.
   * </pre>
   *
   * <code>
   * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return Whether the documentOutputConfig field is set.
   */
  @java.lang.Override
  public boolean hasDocumentOutputConfig() {
    return documentOutputConfig_ != null;
  }
  /**
   *
   *
   * <pre>
   * Optional. Output configurations.
   * Defines if the output file should be stored within Cloud Storage as well
   * as the desired output format. If not provided the translated file will
   * only be returned through a byte-stream and its output mime type will be
   * the same as the input file's mime type.
   * </pre>
   *
   * <code>
   * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The documentOutputConfig.
   */
  @java.lang.Override
  public com.google.cloud.translate.v3.DocumentOutputConfig getDocumentOutputConfig() {
    return documentOutputConfig_ == null
        ? com.google.cloud.translate.v3.DocumentOutputConfig.getDefaultInstance()
        : documentOutputConfig_;
  }
  /**
   *
   *
   * <pre>
   * Optional. Output configurations.
   * Defines if the output file should be stored within Cloud Storage as well
   * as the desired output format. If not provided the translated file will
   * only be returned through a byte-stream and its output mime type will be
   * the same as the input file's mime type.
   * </pre>
   *
   * <code>
   * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.translate.v3.DocumentOutputConfigOrBuilder
      getDocumentOutputConfigOrBuilder() {
    return documentOutputConfig_ == null
        ? com.google.cloud.translate.v3.DocumentOutputConfig.getDefaultInstance()
        : documentOutputConfig_;
  }

  public static final int MODEL_FIELD_NUMBER = 6;

  @SuppressWarnings("serial")
  private volatile java.lang.Object model_ = "";
  /**
   *
   *
   * <pre>
   * Optional. The `model` type requested for this translation.
   * The format depends on model type:
   * - AutoML Translation models:
   *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
   * - General (built-in) models:
   *   `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
   * If not provided, the default Google model (NMT) will be used for
   * translation.
   * </pre>
   *
   * <code>string model = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The model.
   */
  @java.lang.Override
  public java.lang.String getModel() {
    java.lang.Object ref = model_;
    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();
      model_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional. The `model` type requested for this translation.
   * The format depends on model type:
   * - AutoML Translation models:
   *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
   * - General (built-in) models:
   *   `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
   * If not provided, the default Google model (NMT) will be used for
   * translation.
   * </pre>
   *
   * <code>string model = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The bytes for model.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getModelBytes() {
    java.lang.Object ref = model_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      model_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int GLOSSARY_CONFIG_FIELD_NUMBER = 7;
  private com.google.cloud.translate.v3.TranslateTextGlossaryConfig glossaryConfig_;
  /**
   *
   *
   * <pre>
   * Optional. Glossary to be applied. The glossary must be within the same
   * region (have the same location-id) as the model, otherwise an
   * INVALID_ARGUMENT (400) error is returned.
   * </pre>
   *
   * <code>
   * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return Whether the glossaryConfig field is set.
   */
  @java.lang.Override
  public boolean hasGlossaryConfig() {
    return glossaryConfig_ != null;
  }
  /**
   *
   *
   * <pre>
   * Optional. Glossary to be applied. The glossary must be within the same
   * region (have the same location-id) as the model, otherwise an
   * INVALID_ARGUMENT (400) error is returned.
   * </pre>
   *
   * <code>
   * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The glossaryConfig.
   */
  @java.lang.Override
  public com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossaryConfig() {
    return glossaryConfig_ == null
        ? com.google.cloud.translate.v3.TranslateTextGlossaryConfig.getDefaultInstance()
        : glossaryConfig_;
  }
  /**
   *
   *
   * <pre>
   * Optional. Glossary to be applied. The glossary must be within the same
   * region (have the same location-id) as the model, otherwise an
   * INVALID_ARGUMENT (400) error is returned.
   * </pre>
   *
   * <code>
   * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.translate.v3.TranslateTextGlossaryConfigOrBuilder
      getGlossaryConfigOrBuilder() {
    return glossaryConfig_ == null
        ? com.google.cloud.translate.v3.TranslateTextGlossaryConfig.getDefaultInstance()
        : glossaryConfig_;
  }

  public static final int LABELS_FIELD_NUMBER = 8;

  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.translate.v3.TranslationServiceProto
                .internal_static_google_cloud_translation_v3_TranslateDocumentRequest_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 for the request.
   * Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/advanced/labels for more
   * information.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 8 [(.google.api.field_behavior) = OPTIONAL];</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 for the request.
   * Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/advanced/labels for more
   * information.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 8 [(.google.api.field_behavior) = OPTIONAL];</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 for the request.
   * Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/advanced/labels for more
   * information.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 8 [(.google.api.field_behavior) = OPTIONAL];</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 for the request.
   * Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/advanced/labels for more
   * information.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 8 [(.google.api.field_behavior) = OPTIONAL];</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 static final int CUSTOMIZED_ATTRIBUTION_FIELD_NUMBER = 10;

  @SuppressWarnings("serial")
  private volatile java.lang.Object customizedAttribution_ = "";
  /**
   *
   *
   * <pre>
   * Optional. This flag is to support user customized attribution.
   * If not provided, the default is `Machine Translated by Google`.
   * Customized attribution should follow rules in
   * https://cloud.google.com/translate/attribution#attribution_and_logos
   * </pre>
   *
   * <code>string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The customizedAttribution.
   */
  @java.lang.Override
  public java.lang.String getCustomizedAttribution() {
    java.lang.Object ref = customizedAttribution_;
    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();
      customizedAttribution_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional. This flag is to support user customized attribution.
   * If not provided, the default is `Machine Translated by Google`.
   * Customized attribution should follow rules in
   * https://cloud.google.com/translate/attribution#attribution_and_logos
   * </pre>
   *
   * <code>string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The bytes for customizedAttribution.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getCustomizedAttributionBytes() {
    java.lang.Object ref = customizedAttribution_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      customizedAttribution_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int IS_TRANSLATE_NATIVE_PDF_ONLY_FIELD_NUMBER = 11;
  private boolean isTranslateNativePdfOnly_ = false;
  /**
   *
   *
   * <pre>
   * Optional. If true, the page limit of online native pdf translation is 300
   * and only native pdf pages will be translated.
   * </pre>
   *
   * <code>bool is_translate_native_pdf_only = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The isTranslateNativePdfOnly.
   */
  @java.lang.Override
  public boolean getIsTranslateNativePdfOnly() {
    return isTranslateNativePdfOnly_;
  }

  public static final int ENABLE_SHADOW_REMOVAL_NATIVE_PDF_FIELD_NUMBER = 12;
  private boolean enableShadowRemovalNativePdf_ = false;
  /**
   *
   *
   * <pre>
   * Optional. If true, use the text removal to remove the shadow text on
   * background image for native pdf translation.
   * Shadow removal feature can only be enabled when
   * is_translate_native_pdf_only is false
   * </pre>
   *
   * <code>bool enable_shadow_removal_native_pdf = 12 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The enableShadowRemovalNativePdf.
   */
  @java.lang.Override
  public boolean getEnableShadowRemovalNativePdf() {
    return enableShadowRemovalNativePdf_;
  }

  private byte memoizedIsInitialized = -1;

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceLanguageCode_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, sourceLanguageCode_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(targetLanguageCode_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, targetLanguageCode_);
    }
    if (documentInputConfig_ != null) {
      output.writeMessage(4, getDocumentInputConfig());
    }
    if (documentOutputConfig_ != null) {
      output.writeMessage(5, getDocumentOutputConfig());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, model_);
    }
    if (glossaryConfig_ != null) {
      output.writeMessage(7, getGlossaryConfig());
    }
    com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
        output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 8);
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customizedAttribution_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 10, customizedAttribution_);
    }
    if (isTranslateNativePdfOnly_ != false) {
      output.writeBool(11, isTranslateNativePdfOnly_);
    }
    if (enableShadowRemovalNativePdf_ != false) {
      output.writeBool(12, enableShadowRemovalNativePdf_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceLanguageCode_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, sourceLanguageCode_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(targetLanguageCode_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, targetLanguageCode_);
    }
    if (documentInputConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDocumentInputConfig());
    }
    if (documentOutputConfig_ != null) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(5, getDocumentOutputConfig());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, model_);
    }
    if (glossaryConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getGlossaryConfig());
    }
    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(8, labels__);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customizedAttribution_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, customizedAttribution_);
    }
    if (isTranslateNativePdfOnly_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, isTranslateNativePdfOnly_);
    }
    if (enableShadowRemovalNativePdf_ != false) {
      size +=
          com.google.protobuf.CodedOutputStream.computeBoolSize(12, enableShadowRemovalNativePdf_);
    }
    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.translate.v3.TranslateDocumentRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.translate.v3.TranslateDocumentRequest other =
        (com.google.cloud.translate.v3.TranslateDocumentRequest) obj;

    if (!getParent().equals(other.getParent())) return false;
    if (!getSourceLanguageCode().equals(other.getSourceLanguageCode())) return false;
    if (!getTargetLanguageCode().equals(other.getTargetLanguageCode())) return false;
    if (hasDocumentInputConfig() != other.hasDocumentInputConfig()) return false;
    if (hasDocumentInputConfig()) {
      if (!getDocumentInputConfig().equals(other.getDocumentInputConfig())) return false;
    }
    if (hasDocumentOutputConfig() != other.hasDocumentOutputConfig()) return false;
    if (hasDocumentOutputConfig()) {
      if (!getDocumentOutputConfig().equals(other.getDocumentOutputConfig())) return false;
    }
    if (!getModel().equals(other.getModel())) return false;
    if (hasGlossaryConfig() != other.hasGlossaryConfig()) return false;
    if (hasGlossaryConfig()) {
      if (!getGlossaryConfig().equals(other.getGlossaryConfig())) return false;
    }
    if (!internalGetLabels().equals(other.internalGetLabels())) return false;
    if (!getCustomizedAttribution().equals(other.getCustomizedAttribution())) return false;
    if (getIsTranslateNativePdfOnly() != other.getIsTranslateNativePdfOnly()) return false;
    if (getEnableShadowRemovalNativePdf() != other.getEnableShadowRemovalNativePdf()) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + PARENT_FIELD_NUMBER;
    hash = (53 * hash) + getParent().hashCode();
    hash = (37 * hash) + SOURCE_LANGUAGE_CODE_FIELD_NUMBER;
    hash = (53 * hash) + getSourceLanguageCode().hashCode();
    hash = (37 * hash) + TARGET_LANGUAGE_CODE_FIELD_NUMBER;
    hash = (53 * hash) + getTargetLanguageCode().hashCode();
    if (hasDocumentInputConfig()) {
      hash = (37 * hash) + DOCUMENT_INPUT_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getDocumentInputConfig().hashCode();
    }
    if (hasDocumentOutputConfig()) {
      hash = (37 * hash) + DOCUMENT_OUTPUT_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getDocumentOutputConfig().hashCode();
    }
    hash = (37 * hash) + MODEL_FIELD_NUMBER;
    hash = (53 * hash) + getModel().hashCode();
    if (hasGlossaryConfig()) {
      hash = (37 * hash) + GLOSSARY_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getGlossaryConfig().hashCode();
    }
    if (!internalGetLabels().getMap().isEmpty()) {
      hash = (37 * hash) + LABELS_FIELD_NUMBER;
      hash = (53 * hash) + internalGetLabels().hashCode();
    }
    hash = (37 * hash) + CUSTOMIZED_ATTRIBUTION_FIELD_NUMBER;
    hash = (53 * hash) + getCustomizedAttribution().hashCode();
    hash = (37 * hash) + IS_TRANSLATE_NATIVE_PDF_ONLY_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsTranslateNativePdfOnly());
    hash = (37 * hash) + ENABLE_SHADOW_REMOVAL_NATIVE_PDF_FIELD_NUMBER;
    hash =
        (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableShadowRemovalNativePdf());
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.translate.v3.TranslateDocumentRequest parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

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

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

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

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

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

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

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

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * A document translation request.
   * </pre>
   *
   * Protobuf type {@code google.cloud.translation.v3.TranslateDocumentRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3.TranslateDocumentRequest)
      com.google.cloud.translate.v3.TranslateDocumentRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.translate.v3.TranslationServiceProto
          .internal_static_google_cloud_translation_v3_TranslateDocumentRequest_descriptor;
    }

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

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
      switch (number) {
        case 8:
          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.translate.v3.TranslationServiceProto
          .internal_static_google_cloud_translation_v3_TranslateDocumentRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.translate.v3.TranslateDocumentRequest.class,
              com.google.cloud.translate.v3.TranslateDocumentRequest.Builder.class);
    }

    // Construct using com.google.cloud.translate.v3.TranslateDocumentRequest.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      parent_ = "";
      sourceLanguageCode_ = "";
      targetLanguageCode_ = "";
      documentInputConfig_ = null;
      if (documentInputConfigBuilder_ != null) {
        documentInputConfigBuilder_.dispose();
        documentInputConfigBuilder_ = null;
      }
      documentOutputConfig_ = null;
      if (documentOutputConfigBuilder_ != null) {
        documentOutputConfigBuilder_.dispose();
        documentOutputConfigBuilder_ = null;
      }
      model_ = "";
      glossaryConfig_ = null;
      if (glossaryConfigBuilder_ != null) {
        glossaryConfigBuilder_.dispose();
        glossaryConfigBuilder_ = null;
      }
      internalGetMutableLabels().clear();
      customizedAttribution_ = "";
      isTranslateNativePdfOnly_ = false;
      enableShadowRemovalNativePdf_ = false;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.translate.v3.TranslationServiceProto
          .internal_static_google_cloud_translation_v3_TranslateDocumentRequest_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.translate.v3.TranslateDocumentRequest getDefaultInstanceForType() {
      return com.google.cloud.translate.v3.TranslateDocumentRequest.getDefaultInstance();
    }

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

    @java.lang.Override
    public com.google.cloud.translate.v3.TranslateDocumentRequest buildPartial() {
      com.google.cloud.translate.v3.TranslateDocumentRequest result =
          new com.google.cloud.translate.v3.TranslateDocumentRequest(this);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartial0(com.google.cloud.translate.v3.TranslateDocumentRequest result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.parent_ = parent_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.sourceLanguageCode_ = sourceLanguageCode_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.targetLanguageCode_ = targetLanguageCode_;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.documentInputConfig_ =
            documentInputConfigBuilder_ == null
                ? documentInputConfig_
                : documentInputConfigBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.documentOutputConfig_ =
            documentOutputConfigBuilder_ == null
                ? documentOutputConfig_
                : documentOutputConfigBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        result.model_ = model_;
      }
      if (((from_bitField0_ & 0x00000040) != 0)) {
        result.glossaryConfig_ =
            glossaryConfigBuilder_ == null ? glossaryConfig_ : glossaryConfigBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000080) != 0)) {
        result.labels_ = internalGetLabels();
        result.labels_.makeImmutable();
      }
      if (((from_bitField0_ & 0x00000100) != 0)) {
        result.customizedAttribution_ = customizedAttribution_;
      }
      if (((from_bitField0_ & 0x00000200) != 0)) {
        result.isTranslateNativePdfOnly_ = isTranslateNativePdfOnly_;
      }
      if (((from_bitField0_ & 0x00000400) != 0)) {
        result.enableShadowRemovalNativePdf_ = enableShadowRemovalNativePdf_;
      }
    }

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

    public Builder mergeFrom(com.google.cloud.translate.v3.TranslateDocumentRequest other) {
      if (other == com.google.cloud.translate.v3.TranslateDocumentRequest.getDefaultInstance())
        return this;
      if (!other.getParent().isEmpty()) {
        parent_ = other.parent_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (!other.getSourceLanguageCode().isEmpty()) {
        sourceLanguageCode_ = other.sourceLanguageCode_;
        bitField0_ |= 0x00000002;
        onChanged();
      }
      if (!other.getTargetLanguageCode().isEmpty()) {
        targetLanguageCode_ = other.targetLanguageCode_;
        bitField0_ |= 0x00000004;
        onChanged();
      }
      if (other.hasDocumentInputConfig()) {
        mergeDocumentInputConfig(other.getDocumentInputConfig());
      }
      if (other.hasDocumentOutputConfig()) {
        mergeDocumentOutputConfig(other.getDocumentOutputConfig());
      }
      if (!other.getModel().isEmpty()) {
        model_ = other.model_;
        bitField0_ |= 0x00000020;
        onChanged();
      }
      if (other.hasGlossaryConfig()) {
        mergeGlossaryConfig(other.getGlossaryConfig());
      }
      internalGetMutableLabels().mergeFrom(other.internalGetLabels());
      bitField0_ |= 0x00000080;
      if (!other.getCustomizedAttribution().isEmpty()) {
        customizedAttribution_ = other.customizedAttribution_;
        bitField0_ |= 0x00000100;
        onChanged();
      }
      if (other.getIsTranslateNativePdfOnly() != false) {
        setIsTranslateNativePdfOnly(other.getIsTranslateNativePdfOnly());
      }
      if (other.getEnableShadowRemovalNativePdf() != false) {
        setEnableShadowRemovalNativePdf(other.getEnableShadowRemovalNativePdf());
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

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

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                parent_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                sourceLanguageCode_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 26:
              {
                targetLanguageCode_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 34:
              {
                input.readMessage(
                    getDocumentInputConfigFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000008;
                break;
              } // case 34
            case 42:
              {
                input.readMessage(
                    getDocumentOutputConfigFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000010;
                break;
              } // case 42
            case 50:
              {
                model_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000020;
                break;
              } // case 50
            case 58:
              {
                input.readMessage(getGlossaryConfigFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000040;
                break;
              } // case 58
            case 66:
              {
                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_ |= 0x00000080;
                break;
              } // case 66
            case 82:
              {
                customizedAttribution_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000100;
                break;
              } // case 82
            case 88:
              {
                isTranslateNativePdfOnly_ = input.readBool();
                bitField0_ |= 0x00000200;
                break;
              } // case 88
            case 96:
              {
                enableShadowRemovalNativePdf_ = input.readBool();
                bitField0_ |= 0x00000400;
                break;
              } // case 96
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private java.lang.Object parent_ = "";
    /**
     *
     *
     * <pre>
     * Required. Location to make a regional call.
     * Format: `projects/{project-number-or-id}/locations/{location-id}`.
     * For global calls, use `projects/{project-number-or-id}/locations/global` or
     * `projects/{project-number-or-id}`.
     * Non-global location is required for requests using AutoML models or custom
     * glossaries.
     * Models and glossaries must be within the same region (have the same
     * location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
     * </pre>
     *
     * <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The parent.
     */
    public java.lang.String getParent() {
      java.lang.Object ref = parent_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        parent_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Location to make a regional call.
     * Format: `projects/{project-number-or-id}/locations/{location-id}`.
     * For global calls, use `projects/{project-number-or-id}/locations/global` or
     * `projects/{project-number-or-id}`.
     * Non-global location is required for requests using AutoML models or custom
     * glossaries.
     * Models and glossaries must be within the same region (have the same
     * location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
     * </pre>
     *
     * <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The bytes for parent.
     */
    public com.google.protobuf.ByteString getParentBytes() {
      java.lang.Object ref = parent_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        parent_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Location to make a regional call.
     * Format: `projects/{project-number-or-id}/locations/{location-id}`.
     * For global calls, use `projects/{project-number-or-id}/locations/global` or
     * `projects/{project-number-or-id}`.
     * Non-global location is required for requests using AutoML models or custom
     * glossaries.
     * Models and glossaries must be within the same region (have the same
     * location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
     * </pre>
     *
     * <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The parent to set.
     * @return This builder for chaining.
     */
    public Builder setParent(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      parent_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Location to make a regional call.
     * Format: `projects/{project-number-or-id}/locations/{location-id}`.
     * For global calls, use `projects/{project-number-or-id}/locations/global` or
     * `projects/{project-number-or-id}`.
     * Non-global location is required for requests using AutoML models or custom
     * glossaries.
     * Models and glossaries must be within the same region (have the same
     * location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
     * </pre>
     *
     * <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearParent() {
      parent_ = getDefaultInstance().getParent();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Location to make a regional call.
     * Format: `projects/{project-number-or-id}/locations/{location-id}`.
     * For global calls, use `projects/{project-number-or-id}/locations/global` or
     * `projects/{project-number-or-id}`.
     * Non-global location is required for requests using AutoML models or custom
     * glossaries.
     * Models and glossaries must be within the same region (have the same
     * location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
     * </pre>
     *
     * <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The bytes for parent to set.
     * @return This builder for chaining.
     */
    public Builder setParentBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      parent_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private java.lang.Object sourceLanguageCode_ = "";
    /**
     *
     *
     * <pre>
     * Optional. The ISO-639 language code of the input document if known, for
     * example, "en-US" or "sr-Latn". Supported language codes are listed in
     * Language Support. If the source language isn't specified, the API attempts
     * to identify the source language automatically and returns the source
     * language within the response. Source language must be specified if the
     * request contains a glossary or a custom model.
     * </pre>
     *
     * <code>string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The sourceLanguageCode.
     */
    public java.lang.String getSourceLanguageCode() {
      java.lang.Object ref = sourceLanguageCode_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        sourceLanguageCode_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The ISO-639 language code of the input document if known, for
     * example, "en-US" or "sr-Latn". Supported language codes are listed in
     * Language Support. If the source language isn't specified, the API attempts
     * to identify the source language automatically and returns the source
     * language within the response. Source language must be specified if the
     * request contains a glossary or a custom model.
     * </pre>
     *
     * <code>string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for sourceLanguageCode.
     */
    public com.google.protobuf.ByteString getSourceLanguageCodeBytes() {
      java.lang.Object ref = sourceLanguageCode_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        sourceLanguageCode_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The ISO-639 language code of the input document if known, for
     * example, "en-US" or "sr-Latn". Supported language codes are listed in
     * Language Support. If the source language isn't specified, the API attempts
     * to identify the source language automatically and returns the source
     * language within the response. Source language must be specified if the
     * request contains a glossary or a custom model.
     * </pre>
     *
     * <code>string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The sourceLanguageCode to set.
     * @return This builder for chaining.
     */
    public Builder setSourceLanguageCode(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      sourceLanguageCode_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The ISO-639 language code of the input document if known, for
     * example, "en-US" or "sr-Latn". Supported language codes are listed in
     * Language Support. If the source language isn't specified, the API attempts
     * to identify the source language automatically and returns the source
     * language within the response. Source language must be specified if the
     * request contains a glossary or a custom model.
     * </pre>
     *
     * <code>string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearSourceLanguageCode() {
      sourceLanguageCode_ = getDefaultInstance().getSourceLanguageCode();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The ISO-639 language code of the input document if known, for
     * example, "en-US" or "sr-Latn". Supported language codes are listed in
     * Language Support. If the source language isn't specified, the API attempts
     * to identify the source language automatically and returns the source
     * language within the response. Source language must be specified if the
     * request contains a glossary or a custom model.
     * </pre>
     *
     * <code>string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The bytes for sourceLanguageCode to set.
     * @return This builder for chaining.
     */
    public Builder setSourceLanguageCodeBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      sourceLanguageCode_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    private java.lang.Object targetLanguageCode_ = "";
    /**
     *
     *
     * <pre>
     * Required. The ISO-639 language code to use for translation of the input
     * document, set to one of the language codes listed in Language Support.
     * </pre>
     *
     * <code>string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The targetLanguageCode.
     */
    public java.lang.String getTargetLanguageCode() {
      java.lang.Object ref = targetLanguageCode_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        targetLanguageCode_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The ISO-639 language code to use for translation of the input
     * document, set to one of the language codes listed in Language Support.
     * </pre>
     *
     * <code>string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The bytes for targetLanguageCode.
     */
    public com.google.protobuf.ByteString getTargetLanguageCodeBytes() {
      java.lang.Object ref = targetLanguageCode_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        targetLanguageCode_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The ISO-639 language code to use for translation of the input
     * document, set to one of the language codes listed in Language Support.
     * </pre>
     *
     * <code>string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The targetLanguageCode to set.
     * @return This builder for chaining.
     */
    public Builder setTargetLanguageCode(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      targetLanguageCode_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The ISO-639 language code to use for translation of the input
     * document, set to one of the language codes listed in Language Support.
     * </pre>
     *
     * <code>string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearTargetLanguageCode() {
      targetLanguageCode_ = getDefaultInstance().getTargetLanguageCode();
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The ISO-639 language code to use for translation of the input
     * document, set to one of the language codes listed in Language Support.
     * </pre>
     *
     * <code>string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The bytes for targetLanguageCode to set.
     * @return This builder for chaining.
     */
    public Builder setTargetLanguageCodeBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      targetLanguageCode_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    private com.google.cloud.translate.v3.DocumentInputConfig documentInputConfig_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.translate.v3.DocumentInputConfig,
            com.google.cloud.translate.v3.DocumentInputConfig.Builder,
            com.google.cloud.translate.v3.DocumentInputConfigOrBuilder>
        documentInputConfigBuilder_;
    /**
     *
     *
     * <pre>
     * Required. Input configurations.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return Whether the documentInputConfig field is set.
     */
    public boolean hasDocumentInputConfig() {
      return ((bitField0_ & 0x00000008) != 0);
    }
    /**
     *
     *
     * <pre>
     * Required. Input configurations.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return The documentInputConfig.
     */
    public com.google.cloud.translate.v3.DocumentInputConfig getDocumentInputConfig() {
      if (documentInputConfigBuilder_ == null) {
        return documentInputConfig_ == null
            ? com.google.cloud.translate.v3.DocumentInputConfig.getDefaultInstance()
            : documentInputConfig_;
      } else {
        return documentInputConfigBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Input configurations.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setDocumentInputConfig(com.google.cloud.translate.v3.DocumentInputConfig value) {
      if (documentInputConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        documentInputConfig_ = value;
      } else {
        documentInputConfigBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Input configurations.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder setDocumentInputConfig(
        com.google.cloud.translate.v3.DocumentInputConfig.Builder builderForValue) {
      if (documentInputConfigBuilder_ == null) {
        documentInputConfig_ = builderForValue.build();
      } else {
        documentInputConfigBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Input configurations.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder mergeDocumentInputConfig(
        com.google.cloud.translate.v3.DocumentInputConfig value) {
      if (documentInputConfigBuilder_ == null) {
        if (((bitField0_ & 0x00000008) != 0)
            && documentInputConfig_ != null
            && documentInputConfig_
                != com.google.cloud.translate.v3.DocumentInputConfig.getDefaultInstance()) {
          getDocumentInputConfigBuilder().mergeFrom(value);
        } else {
          documentInputConfig_ = value;
        }
      } else {
        documentInputConfigBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Input configurations.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public Builder clearDocumentInputConfig() {
      bitField0_ = (bitField0_ & ~0x00000008);
      documentInputConfig_ = null;
      if (documentInputConfigBuilder_ != null) {
        documentInputConfigBuilder_.dispose();
        documentInputConfigBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Input configurations.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.cloud.translate.v3.DocumentInputConfig.Builder
        getDocumentInputConfigBuilder() {
      bitField0_ |= 0x00000008;
      onChanged();
      return getDocumentInputConfigFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Required. Input configurations.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    public com.google.cloud.translate.v3.DocumentInputConfigOrBuilder
        getDocumentInputConfigOrBuilder() {
      if (documentInputConfigBuilder_ != null) {
        return documentInputConfigBuilder_.getMessageOrBuilder();
      } else {
        return documentInputConfig_ == null
            ? com.google.cloud.translate.v3.DocumentInputConfig.getDefaultInstance()
            : documentInputConfig_;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Input configurations.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.translate.v3.DocumentInputConfig,
            com.google.cloud.translate.v3.DocumentInputConfig.Builder,
            com.google.cloud.translate.v3.DocumentInputConfigOrBuilder>
        getDocumentInputConfigFieldBuilder() {
      if (documentInputConfigBuilder_ == null) {
        documentInputConfigBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.translate.v3.DocumentInputConfig,
                com.google.cloud.translate.v3.DocumentInputConfig.Builder,
                com.google.cloud.translate.v3.DocumentInputConfigOrBuilder>(
                getDocumentInputConfig(), getParentForChildren(), isClean());
        documentInputConfig_ = null;
      }
      return documentInputConfigBuilder_;
    }

    private com.google.cloud.translate.v3.DocumentOutputConfig documentOutputConfig_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.translate.v3.DocumentOutputConfig,
            com.google.cloud.translate.v3.DocumentOutputConfig.Builder,
            com.google.cloud.translate.v3.DocumentOutputConfigOrBuilder>
        documentOutputConfigBuilder_;
    /**
     *
     *
     * <pre>
     * Optional. Output configurations.
     * Defines if the output file should be stored within Cloud Storage as well
     * as the desired output format. If not provided the translated file will
     * only be returned through a byte-stream and its output mime type will be
     * the same as the input file's mime type.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the documentOutputConfig field is set.
     */
    public boolean hasDocumentOutputConfig() {
      return ((bitField0_ & 0x00000010) != 0);
    }
    /**
     *
     *
     * <pre>
     * Optional. Output configurations.
     * Defines if the output file should be stored within Cloud Storage as well
     * as the desired output format. If not provided the translated file will
     * only be returned through a byte-stream and its output mime type will be
     * the same as the input file's mime type.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The documentOutputConfig.
     */
    public com.google.cloud.translate.v3.DocumentOutputConfig getDocumentOutputConfig() {
      if (documentOutputConfigBuilder_ == null) {
        return documentOutputConfig_ == null
            ? com.google.cloud.translate.v3.DocumentOutputConfig.getDefaultInstance()
            : documentOutputConfig_;
      } else {
        return documentOutputConfigBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Output configurations.
     * Defines if the output file should be stored within Cloud Storage as well
     * as the desired output format. If not provided the translated file will
     * only be returned through a byte-stream and its output mime type will be
     * the same as the input file's mime type.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setDocumentOutputConfig(
        com.google.cloud.translate.v3.DocumentOutputConfig value) {
      if (documentOutputConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        documentOutputConfig_ = value;
      } else {
        documentOutputConfigBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Output configurations.
     * Defines if the output file should be stored within Cloud Storage as well
     * as the desired output format. If not provided the translated file will
     * only be returned through a byte-stream and its output mime type will be
     * the same as the input file's mime type.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setDocumentOutputConfig(
        com.google.cloud.translate.v3.DocumentOutputConfig.Builder builderForValue) {
      if (documentOutputConfigBuilder_ == null) {
        documentOutputConfig_ = builderForValue.build();
      } else {
        documentOutputConfigBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Output configurations.
     * Defines if the output file should be stored within Cloud Storage as well
     * as the desired output format. If not provided the translated file will
     * only be returned through a byte-stream and its output mime type will be
     * the same as the input file's mime type.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder mergeDocumentOutputConfig(
        com.google.cloud.translate.v3.DocumentOutputConfig value) {
      if (documentOutputConfigBuilder_ == null) {
        if (((bitField0_ & 0x00000010) != 0)
            && documentOutputConfig_ != null
            && documentOutputConfig_
                != com.google.cloud.translate.v3.DocumentOutputConfig.getDefaultInstance()) {
          getDocumentOutputConfigBuilder().mergeFrom(value);
        } else {
          documentOutputConfig_ = value;
        }
      } else {
        documentOutputConfigBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Output configurations.
     * Defines if the output file should be stored within Cloud Storage as well
     * as the desired output format. If not provided the translated file will
     * only be returned through a byte-stream and its output mime type will be
     * the same as the input file's mime type.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder clearDocumentOutputConfig() {
      bitField0_ = (bitField0_ & ~0x00000010);
      documentOutputConfig_ = null;
      if (documentOutputConfigBuilder_ != null) {
        documentOutputConfigBuilder_.dispose();
        documentOutputConfigBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Output configurations.
     * Defines if the output file should be stored within Cloud Storage as well
     * as the desired output format. If not provided the translated file will
     * only be returned through a byte-stream and its output mime type will be
     * the same as the input file's mime type.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public com.google.cloud.translate.v3.DocumentOutputConfig.Builder
        getDocumentOutputConfigBuilder() {
      bitField0_ |= 0x00000010;
      onChanged();
      return getDocumentOutputConfigFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Optional. Output configurations.
     * Defines if the output file should be stored within Cloud Storage as well
     * as the desired output format. If not provided the translated file will
     * only be returned through a byte-stream and its output mime type will be
     * the same as the input file's mime type.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public com.google.cloud.translate.v3.DocumentOutputConfigOrBuilder
        getDocumentOutputConfigOrBuilder() {
      if (documentOutputConfigBuilder_ != null) {
        return documentOutputConfigBuilder_.getMessageOrBuilder();
      } else {
        return documentOutputConfig_ == null
            ? com.google.cloud.translate.v3.DocumentOutputConfig.getDefaultInstance()
            : documentOutputConfig_;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Output configurations.
     * Defines if the output file should be stored within Cloud Storage as well
     * as the desired output format. If not provided the translated file will
     * only be returned through a byte-stream and its output mime type will be
     * the same as the input file's mime type.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.translate.v3.DocumentOutputConfig,
            com.google.cloud.translate.v3.DocumentOutputConfig.Builder,
            com.google.cloud.translate.v3.DocumentOutputConfigOrBuilder>
        getDocumentOutputConfigFieldBuilder() {
      if (documentOutputConfigBuilder_ == null) {
        documentOutputConfigBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.translate.v3.DocumentOutputConfig,
                com.google.cloud.translate.v3.DocumentOutputConfig.Builder,
                com.google.cloud.translate.v3.DocumentOutputConfigOrBuilder>(
                getDocumentOutputConfig(), getParentForChildren(), isClean());
        documentOutputConfig_ = null;
      }
      return documentOutputConfigBuilder_;
    }

    private java.lang.Object model_ = "";
    /**
     *
     *
     * <pre>
     * Optional. The `model` type requested for this translation.
     * The format depends on model type:
     * - AutoML Translation models:
     *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
     * - General (built-in) models:
     *   `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
     * If not provided, the default Google model (NMT) will be used for
     * translation.
     * </pre>
     *
     * <code>string model = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The model.
     */
    public java.lang.String getModel() {
      java.lang.Object ref = model_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        model_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The `model` type requested for this translation.
     * The format depends on model type:
     * - AutoML Translation models:
     *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
     * - General (built-in) models:
     *   `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
     * If not provided, the default Google model (NMT) will be used for
     * translation.
     * </pre>
     *
     * <code>string model = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for model.
     */
    public com.google.protobuf.ByteString getModelBytes() {
      java.lang.Object ref = model_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        model_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The `model` type requested for this translation.
     * The format depends on model type:
     * - AutoML Translation models:
     *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
     * - General (built-in) models:
     *   `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
     * If not provided, the default Google model (NMT) will be used for
     * translation.
     * </pre>
     *
     * <code>string model = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The model to set.
     * @return This builder for chaining.
     */
    public Builder setModel(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      model_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The `model` type requested for this translation.
     * The format depends on model type:
     * - AutoML Translation models:
     *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
     * - General (built-in) models:
     *   `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
     * If not provided, the default Google model (NMT) will be used for
     * translation.
     * </pre>
     *
     * <code>string model = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearModel() {
      model_ = getDefaultInstance().getModel();
      bitField0_ = (bitField0_ & ~0x00000020);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The `model` type requested for this translation.
     * The format depends on model type:
     * - AutoML Translation models:
     *   `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
     * - General (built-in) models:
     *   `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
     * If not provided, the default Google model (NMT) will be used for
     * translation.
     * </pre>
     *
     * <code>string model = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The bytes for model to set.
     * @return This builder for chaining.
     */
    public Builder setModelBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      model_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }

    private com.google.cloud.translate.v3.TranslateTextGlossaryConfig glossaryConfig_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.translate.v3.TranslateTextGlossaryConfig,
            com.google.cloud.translate.v3.TranslateTextGlossaryConfig.Builder,
            com.google.cloud.translate.v3.TranslateTextGlossaryConfigOrBuilder>
        glossaryConfigBuilder_;
    /**
     *
     *
     * <pre>
     * Optional. Glossary to be applied. The glossary must be within the same
     * region (have the same location-id) as the model, otherwise an
     * INVALID_ARGUMENT (400) error is returned.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the glossaryConfig field is set.
     */
    public boolean hasGlossaryConfig() {
      return ((bitField0_ & 0x00000040) != 0);
    }
    /**
     *
     *
     * <pre>
     * Optional. Glossary to be applied. The glossary must be within the same
     * region (have the same location-id) as the model, otherwise an
     * INVALID_ARGUMENT (400) error is returned.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The glossaryConfig.
     */
    public com.google.cloud.translate.v3.TranslateTextGlossaryConfig getGlossaryConfig() {
      if (glossaryConfigBuilder_ == null) {
        return glossaryConfig_ == null
            ? com.google.cloud.translate.v3.TranslateTextGlossaryConfig.getDefaultInstance()
            : glossaryConfig_;
      } else {
        return glossaryConfigBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Glossary to be applied. The glossary must be within the same
     * region (have the same location-id) as the model, otherwise an
     * INVALID_ARGUMENT (400) error is returned.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setGlossaryConfig(
        com.google.cloud.translate.v3.TranslateTextGlossaryConfig value) {
      if (glossaryConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        glossaryConfig_ = value;
      } else {
        glossaryConfigBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Glossary to be applied. The glossary must be within the same
     * region (have the same location-id) as the model, otherwise an
     * INVALID_ARGUMENT (400) error is returned.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setGlossaryConfig(
        com.google.cloud.translate.v3.TranslateTextGlossaryConfig.Builder builderForValue) {
      if (glossaryConfigBuilder_ == null) {
        glossaryConfig_ = builderForValue.build();
      } else {
        glossaryConfigBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Glossary to be applied. The glossary must be within the same
     * region (have the same location-id) as the model, otherwise an
     * INVALID_ARGUMENT (400) error is returned.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder mergeGlossaryConfig(
        com.google.cloud.translate.v3.TranslateTextGlossaryConfig value) {
      if (glossaryConfigBuilder_ == null) {
        if (((bitField0_ & 0x00000040) != 0)
            && glossaryConfig_ != null
            && glossaryConfig_
                != com.google.cloud.translate.v3.TranslateTextGlossaryConfig.getDefaultInstance()) {
          getGlossaryConfigBuilder().mergeFrom(value);
        } else {
          glossaryConfig_ = value;
        }
      } else {
        glossaryConfigBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Glossary to be applied. The glossary must be within the same
     * region (have the same location-id) as the model, otherwise an
     * INVALID_ARGUMENT (400) error is returned.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder clearGlossaryConfig() {
      bitField0_ = (bitField0_ & ~0x00000040);
      glossaryConfig_ = null;
      if (glossaryConfigBuilder_ != null) {
        glossaryConfigBuilder_.dispose();
        glossaryConfigBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Glossary to be applied. The glossary must be within the same
     * region (have the same location-id) as the model, otherwise an
     * INVALID_ARGUMENT (400) error is returned.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public com.google.cloud.translate.v3.TranslateTextGlossaryConfig.Builder
        getGlossaryConfigBuilder() {
      bitField0_ |= 0x00000040;
      onChanged();
      return getGlossaryConfigFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Optional. Glossary to be applied. The glossary must be within the same
     * region (have the same location-id) as the model, otherwise an
     * INVALID_ARGUMENT (400) error is returned.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public com.google.cloud.translate.v3.TranslateTextGlossaryConfigOrBuilder
        getGlossaryConfigOrBuilder() {
      if (glossaryConfigBuilder_ != null) {
        return glossaryConfigBuilder_.getMessageOrBuilder();
      } else {
        return glossaryConfig_ == null
            ? com.google.cloud.translate.v3.TranslateTextGlossaryConfig.getDefaultInstance()
            : glossaryConfig_;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Glossary to be applied. The glossary must be within the same
     * region (have the same location-id) as the model, otherwise an
     * INVALID_ARGUMENT (400) error is returned.
     * </pre>
     *
     * <code>
     * .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.translate.v3.TranslateTextGlossaryConfig,
            com.google.cloud.translate.v3.TranslateTextGlossaryConfig.Builder,
            com.google.cloud.translate.v3.TranslateTextGlossaryConfigOrBuilder>
        getGlossaryConfigFieldBuilder() {
      if (glossaryConfigBuilder_ == null) {
        glossaryConfigBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.translate.v3.TranslateTextGlossaryConfig,
                com.google.cloud.translate.v3.TranslateTextGlossaryConfig.Builder,
                com.google.cloud.translate.v3.TranslateTextGlossaryConfigOrBuilder>(
                getGlossaryConfig(), getParentForChildren(), isClean());
        glossaryConfig_ = null;
      }
      return glossaryConfigBuilder_;
    }

    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_ |= 0x00000080;
      onChanged();
      return labels_;
    }

    public int getLabelsCount() {
      return internalGetLabels().getMap().size();
    }
    /**
     *
     *
     * <pre>
     * Optional. The labels with user-defined metadata for the request.
     * Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/advanced/labels for more
     * information.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 8 [(.google.api.field_behavior) = OPTIONAL];</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 for the request.
     * Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/advanced/labels for more
     * information.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 8 [(.google.api.field_behavior) = OPTIONAL];</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 for the request.
     * Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/advanced/labels for more
     * information.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 8 [(.google.api.field_behavior) = OPTIONAL];</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 for the request.
     * Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/advanced/labels for more
     * information.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 8 [(.google.api.field_behavior) = OPTIONAL];</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_ & ~0x00000080);
      internalGetMutableLabels().getMutableMap().clear();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The labels with user-defined metadata for the request.
     * Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/advanced/labels for more
     * information.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 8 [(.google.api.field_behavior) = OPTIONAL];</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_ |= 0x00000080;
      return internalGetMutableLabels().getMutableMap();
    }
    /**
     *
     *
     * <pre>
     * Optional. The labels with user-defined metadata for the request.
     * Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/advanced/labels for more
     * information.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 8 [(.google.api.field_behavior) = OPTIONAL];</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_ |= 0x00000080;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The labels with user-defined metadata for the request.
     * Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/advanced/labels for more
     * information.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder putAllLabels(java.util.Map<java.lang.String, java.lang.String> values) {
      internalGetMutableLabels().getMutableMap().putAll(values);
      bitField0_ |= 0x00000080;
      return this;
    }

    private java.lang.Object customizedAttribution_ = "";
    /**
     *
     *
     * <pre>
     * Optional. This flag is to support user customized attribution.
     * If not provided, the default is `Machine Translated by Google`.
     * Customized attribution should follow rules in
     * https://cloud.google.com/translate/attribution#attribution_and_logos
     * </pre>
     *
     * <code>string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The customizedAttribution.
     */
    public java.lang.String getCustomizedAttribution() {
      java.lang.Object ref = customizedAttribution_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        customizedAttribution_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. This flag is to support user customized attribution.
     * If not provided, the default is `Machine Translated by Google`.
     * Customized attribution should follow rules in
     * https://cloud.google.com/translate/attribution#attribution_and_logos
     * </pre>
     *
     * <code>string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for customizedAttribution.
     */
    public com.google.protobuf.ByteString getCustomizedAttributionBytes() {
      java.lang.Object ref = customizedAttribution_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        customizedAttribution_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. This flag is to support user customized attribution.
     * If not provided, the default is `Machine Translated by Google`.
     * Customized attribution should follow rules in
     * https://cloud.google.com/translate/attribution#attribution_and_logos
     * </pre>
     *
     * <code>string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The customizedAttribution to set.
     * @return This builder for chaining.
     */
    public Builder setCustomizedAttribution(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      customizedAttribution_ = value;
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. This flag is to support user customized attribution.
     * If not provided, the default is `Machine Translated by Google`.
     * Customized attribution should follow rules in
     * https://cloud.google.com/translate/attribution#attribution_and_logos
     * </pre>
     *
     * <code>string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearCustomizedAttribution() {
      customizedAttribution_ = getDefaultInstance().getCustomizedAttribution();
      bitField0_ = (bitField0_ & ~0x00000100);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. This flag is to support user customized attribution.
     * If not provided, the default is `Machine Translated by Google`.
     * Customized attribution should follow rules in
     * https://cloud.google.com/translate/attribution#attribution_and_logos
     * </pre>
     *
     * <code>string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The bytes for customizedAttribution to set.
     * @return This builder for chaining.
     */
    public Builder setCustomizedAttributionBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      customizedAttribution_ = value;
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }

    private boolean isTranslateNativePdfOnly_;
    /**
     *
     *
     * <pre>
     * Optional. If true, the page limit of online native pdf translation is 300
     * and only native pdf pages will be translated.
     * </pre>
     *
     * <code>bool is_translate_native_pdf_only = 11 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The isTranslateNativePdfOnly.
     */
    @java.lang.Override
    public boolean getIsTranslateNativePdfOnly() {
      return isTranslateNativePdfOnly_;
    }
    /**
     *
     *
     * <pre>
     * Optional. If true, the page limit of online native pdf translation is 300
     * and only native pdf pages will be translated.
     * </pre>
     *
     * <code>bool is_translate_native_pdf_only = 11 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param value The isTranslateNativePdfOnly to set.
     * @return This builder for chaining.
     */
    public Builder setIsTranslateNativePdfOnly(boolean value) {

      isTranslateNativePdfOnly_ = value;
      bitField0_ |= 0x00000200;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. If true, the page limit of online native pdf translation is 300
     * and only native pdf pages will be translated.
     * </pre>
     *
     * <code>bool is_translate_native_pdf_only = 11 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearIsTranslateNativePdfOnly() {
      bitField0_ = (bitField0_ & ~0x00000200);
      isTranslateNativePdfOnly_ = false;
      onChanged();
      return this;
    }

    private boolean enableShadowRemovalNativePdf_;
    /**
     *
     *
     * <pre>
     * Optional. If true, use the text removal to remove the shadow text on
     * background image for native pdf translation.
     * Shadow removal feature can only be enabled when
     * is_translate_native_pdf_only is false
     * </pre>
     *
     * <code>bool enable_shadow_removal_native_pdf = 12 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The enableShadowRemovalNativePdf.
     */
    @java.lang.Override
    public boolean getEnableShadowRemovalNativePdf() {
      return enableShadowRemovalNativePdf_;
    }
    /**
     *
     *
     * <pre>
     * Optional. If true, use the text removal to remove the shadow text on
     * background image for native pdf translation.
     * Shadow removal feature can only be enabled when
     * is_translate_native_pdf_only is false
     * </pre>
     *
     * <code>bool enable_shadow_removal_native_pdf = 12 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param value The enableShadowRemovalNativePdf to set.
     * @return This builder for chaining.
     */
    public Builder setEnableShadowRemovalNativePdf(boolean value) {

      enableShadowRemovalNativePdf_ = value;
      bitField0_ |= 0x00000400;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. If true, use the text removal to remove the shadow text on
     * background image for native pdf translation.
     * Shadow removal feature can only be enabled when
     * is_translate_native_pdf_only is false
     * </pre>
     *
     * <code>bool enable_shadow_removal_native_pdf = 12 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearEnableShadowRemovalNativePdf() {
      bitField0_ = (bitField0_ & ~0x00000400);
      enableShadowRemovalNativePdf_ = false;
      onChanged();
      return this;
    }

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

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

    // @@protoc_insertion_point(builder_scope:google.cloud.translation.v3.TranslateDocumentRequest)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.translation.v3.TranslateDocumentRequest)
  private static final com.google.cloud.translate.v3.TranslateDocumentRequest DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.translate.v3.TranslateDocumentRequest();
  }

  public static com.google.cloud.translate.v3.TranslateDocumentRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

  @java.lang.Override
  public com.google.cloud.translate.v3.TranslateDocumentRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
