All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.translate.v3beta1.TranslateDocumentRequest Maven / Gradle / Ivy

There is a newer version: 0.136.0
Show newest version
/*
 * Copyright 2024 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/v3beta1/translation_service.proto

// Protobuf Java Version: 3.25.5
package com.google.cloud.translate.v3beta1;

/**
 *
 *
 * 
 * A document translation request.
 * 
* * Protobuf type {@code google.cloud.translation.v3beta1.TranslateDocumentRequest} */ public final class TranslateDocumentRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.translation.v3beta1.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(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.translate.v3beta1.TranslationServiceProto .internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_descriptor; } @SuppressWarnings({"rawtypes"}) @java.lang.Override protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( 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.v3beta1.TranslationServiceProto .internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.translate.v3beta1.TranslateDocumentRequest.class, com.google.cloud.translate.v3beta1.TranslateDocumentRequest.Builder.class); } private int bitField0_; public static final int PARENT_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object parent_ = ""; /** * * *
   * 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`.
   *
   * 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.
   * 
* * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The parent. */ @java.lang.Override public java.lang.String getParent() { java.lang.Object ref = parent_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); parent_ = s; return s; } } /** * * *
   * Required. 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`.
   *
   * 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.
   * 
* * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; * * @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_ = ""; /** * * *
   * Optional. The BCP-47 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.
   * 
* * string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @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; } } /** * * *
   * Optional. The BCP-47 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.
   * 
* * string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @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_ = ""; /** * * *
   * Required. The BCP-47 language code to use for translation of the input
   * document, set to one of the language codes listed in Language Support.
   * 
* * string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; * * @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; } } /** * * *
   * Required. The BCP-47 language code to use for translation of the input
   * document, set to one of the language codes listed in Language Support.
   * 
* * string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; * * @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.v3beta1.DocumentInputConfig documentInputConfig_; /** * * *
   * Required. Input configurations.
   * 
* * * .google.cloud.translation.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; * * * @return Whether the documentInputConfig field is set. */ @java.lang.Override public boolean hasDocumentInputConfig() { return ((bitField0_ & 0x00000001) != 0); } /** * * *
   * Required. Input configurations.
   * 
* * * .google.cloud.translation.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; * * * @return The documentInputConfig. */ @java.lang.Override public com.google.cloud.translate.v3beta1.DocumentInputConfig getDocumentInputConfig() { return documentInputConfig_ == null ? com.google.cloud.translate.v3beta1.DocumentInputConfig.getDefaultInstance() : documentInputConfig_; } /** * * *
   * Required. Input configurations.
   * 
* * * .google.cloud.translation.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; * */ @java.lang.Override public com.google.cloud.translate.v3beta1.DocumentInputConfigOrBuilder getDocumentInputConfigOrBuilder() { return documentInputConfig_ == null ? com.google.cloud.translate.v3beta1.DocumentInputConfig.getDefaultInstance() : documentInputConfig_; } public static final int DOCUMENT_OUTPUT_CONFIG_FIELD_NUMBER = 5; private com.google.cloud.translate.v3beta1.DocumentOutputConfig documentOutputConfig_; /** * * *
   * 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.
   * 
* * * .google.cloud.translation.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; * * * @return Whether the documentOutputConfig field is set. */ @java.lang.Override public boolean hasDocumentOutputConfig() { return ((bitField0_ & 0x00000002) != 0); } /** * * *
   * 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.
   * 
* * * .google.cloud.translation.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The documentOutputConfig. */ @java.lang.Override public com.google.cloud.translate.v3beta1.DocumentOutputConfig getDocumentOutputConfig() { return documentOutputConfig_ == null ? com.google.cloud.translate.v3beta1.DocumentOutputConfig.getDefaultInstance() : documentOutputConfig_; } /** * * *
   * 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.
   * 
* * * .google.cloud.translation.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override public com.google.cloud.translate.v3beta1.DocumentOutputConfigOrBuilder getDocumentOutputConfigOrBuilder() { return documentOutputConfig_ == null ? com.google.cloud.translate.v3beta1.DocumentOutputConfig.getDefaultInstance() : documentOutputConfig_; } public static final int MODEL_FIELD_NUMBER = 6; @SuppressWarnings("serial") private volatile java.lang.Object model_ = ""; /** * * *
   * 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.
   * 
* * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @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; } } /** * * *
   * 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.
   * 
* * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @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.v3beta1.TranslateTextGlossaryConfig glossaryConfig_; /** * * *
   * 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.
   * 
* * * .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; * * * @return Whether the glossaryConfig field is set. */ @java.lang.Override public boolean hasGlossaryConfig() { return ((bitField0_ & 0x00000004) != 0); } /** * * *
   * 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.
   * 
* * * .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The glossaryConfig. */ @java.lang.Override public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig getGlossaryConfig() { return glossaryConfig_ == null ? com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.getDefaultInstance() : glossaryConfig_; } /** * * *
   * 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.
   * 
* * * .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder getGlossaryConfigOrBuilder() { return glossaryConfig_ == null ? com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.getDefaultInstance() : glossaryConfig_; } public static final int LABELS_FIELD_NUMBER = 8; private static final class LabelsDefaultEntryHolder { static final com.google.protobuf.MapEntry defaultEntry = com.google.protobuf.MapEntry.newDefaultInstance( com.google.cloud.translate.v3beta1.TranslationServiceProto .internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_LabelsEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.STRING, ""); } @SuppressWarnings("serial") private com.google.protobuf.MapField labels_; private com.google.protobuf.MapField internalGetLabels() { if (labels_ == null) { return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); } return labels_; } public int getLabelsCount() { return internalGetLabels().getMap().size(); } /** * * *
   * 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.
   * 
* * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; */ @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 getLabels() { return getLabelsMap(); } /** * * *
   * 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.
   * 
* * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; */ @java.lang.Override public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); } /** * * *
   * 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.
   * 
* * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; */ @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 map = internalGetLabels().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * * *
   * 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.
   * 
* * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; */ @java.lang.Override public java.lang.String getLabelsOrThrow(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map 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_ = ""; /** * * *
   * 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
   * 
* * string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL]; * * @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; } } /** * * *
   * 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
   * 
* * string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL]; * * @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; /** * * *
   * Optional. is_translate_native_pdf_only field for external customers.
   * If true, the page limit of online native pdf translation is 300 and only
   * native pdf pages will be translated.
   * 
* * bool is_translate_native_pdf_only = 11 [(.google.api.field_behavior) = OPTIONAL]; * * @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; /** * * *
   * Optional. If true, use the text removal server 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: false && pdf_native_only: false
   * 
* * bool enable_shadow_removal_native_pdf = 12 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The enableShadowRemovalNativePdf. */ @java.lang.Override public boolean getEnableShadowRemovalNativePdf() { return enableShadowRemovalNativePdf_; } public static final int ENABLE_ROTATION_CORRECTION_FIELD_NUMBER = 13; private boolean enableRotationCorrection_ = false; /** * * *
   * Optional. If true, enable auto rotation correction in DVS.
   * 
* * bool enable_rotation_correction = 13 [(.google.api.field_behavior) = OPTIONAL]; * * @return The enableRotationCorrection. */ @java.lang.Override public boolean getEnableRotationCorrection() { return enableRotationCorrection_; } 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 (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(4, getDocumentInputConfig()); } if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(5, getDocumentOutputConfig()); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, model_); } if (((bitField0_ & 0x00000004) != 0)) { 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_); } if (enableRotationCorrection_ != false) { output.writeBool(13, enableRotationCorrection_); } 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 (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDocumentInputConfig()); } if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getDocumentOutputConfig()); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, model_); } if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getGlossaryConfig()); } for (java.util.Map.Entry entry : internalGetLabels().getMap().entrySet()) { com.google.protobuf.MapEntry 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_); } if (enableRotationCorrection_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(13, enableRotationCorrection_); } 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.v3beta1.TranslateDocumentRequest)) { return super.equals(obj); } com.google.cloud.translate.v3beta1.TranslateDocumentRequest other = (com.google.cloud.translate.v3beta1.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 (getEnableRotationCorrection() != other.getEnableRotationCorrection()) 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 = (37 * hash) + ENABLE_ROTATION_CORRECTION_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableRotationCorrection()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.translate.v3beta1.TranslateDocumentRequest parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentRequest parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.translate.v3beta1.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.v3beta1.TranslateDocumentRequest parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.translate.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.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; } /** * * *
   * A document translation request.
   * 
* * Protobuf type {@code google.cloud.translation.v3beta1.TranslateDocumentRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.translation.v3beta1.TranslateDocumentRequest) com.google.cloud.translate.v3beta1.TranslateDocumentRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.translate.v3beta1.TranslationServiceProto .internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_descriptor; } @SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( int number) { switch (number) { case 8: return internalGetLabels(); default: throw new RuntimeException("Invalid map field number: " + number); } } @SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( 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.v3beta1.TranslationServiceProto .internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.translate.v3beta1.TranslateDocumentRequest.class, com.google.cloud.translate.v3beta1.TranslateDocumentRequest.Builder.class); } // Construct using com.google.cloud.translate.v3beta1.TranslateDocumentRequest.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getDocumentInputConfigFieldBuilder(); getDocumentOutputConfigFieldBuilder(); getGlossaryConfigFieldBuilder(); } } @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; enableRotationCorrection_ = false; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.translate.v3beta1.TranslationServiceProto .internal_static_google_cloud_translation_v3beta1_TranslateDocumentRequest_descriptor; } @java.lang.Override public com.google.cloud.translate.v3beta1.TranslateDocumentRequest getDefaultInstanceForType() { return com.google.cloud.translate.v3beta1.TranslateDocumentRequest.getDefaultInstance(); } @java.lang.Override public com.google.cloud.translate.v3beta1.TranslateDocumentRequest build() { com.google.cloud.translate.v3beta1.TranslateDocumentRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.translate.v3beta1.TranslateDocumentRequest buildPartial() { com.google.cloud.translate.v3beta1.TranslateDocumentRequest result = new com.google.cloud.translate.v3beta1.TranslateDocumentRequest(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0(com.google.cloud.translate.v3beta1.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_; } int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000008) != 0)) { result.documentInputConfig_ = documentInputConfigBuilder_ == null ? documentInputConfig_ : documentInputConfigBuilder_.build(); to_bitField0_ |= 0x00000001; } if (((from_bitField0_ & 0x00000010) != 0)) { result.documentOutputConfig_ = documentOutputConfigBuilder_ == null ? documentOutputConfig_ : documentOutputConfigBuilder_.build(); to_bitField0_ |= 0x00000002; } if (((from_bitField0_ & 0x00000020) != 0)) { result.model_ = model_; } if (((from_bitField0_ & 0x00000040) != 0)) { result.glossaryConfig_ = glossaryConfigBuilder_ == null ? glossaryConfig_ : glossaryConfigBuilder_.build(); to_bitField0_ |= 0x00000004; } 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_; } if (((from_bitField0_ & 0x00000800) != 0)) { result.enableRotationCorrection_ = enableRotationCorrection_; } result.bitField0_ |= to_bitField0_; } @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.v3beta1.TranslateDocumentRequest) { return mergeFrom((com.google.cloud.translate.v3beta1.TranslateDocumentRequest) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.cloud.translate.v3beta1.TranslateDocumentRequest other) { if (other == com.google.cloud.translate.v3beta1.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()); } if (other.getEnableRotationCorrection() != false) { setEnableRotationCorrection(other.getEnableRotationCorrection()); } 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 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 case 104: { enableRotationCorrection_ = input.readBool(); bitField0_ |= 0x00000800; break; } // case 104 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag } break; } // default: } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int bitField0_; private java.lang.Object parent_ = ""; /** * * *
     * 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`.
     *
     * 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.
     * 
* * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The parent. */ public java.lang.String getParent() { java.lang.Object ref = parent_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); parent_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
     * Required. 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`.
     *
     * 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.
     * 
* * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for parent. */ public com.google.protobuf.ByteString getParentBytes() { java.lang.Object ref = parent_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); parent_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * Required. 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`.
     *
     * 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.
     * 
* * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; * * @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; } /** * * *
     * 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`.
     *
     * 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.
     * 
* * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * * *
     * 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`.
     *
     * 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.
     * 
* * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; * * @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_ = ""; /** * * *
     * Optional. The BCP-47 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.
     * 
* * string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @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; } } /** * * *
     * Optional. The BCP-47 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.
     * 
* * string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @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; } } /** * * *
     * Optional. The BCP-47 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.
     * 
* * string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @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; } /** * * *
     * Optional. The BCP-47 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.
     * 
* * string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ public Builder clearSourceLanguageCode() { sourceLanguageCode_ = getDefaultInstance().getSourceLanguageCode(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } /** * * *
     * Optional. The BCP-47 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.
     * 
* * string source_language_code = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @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_ = ""; /** * * *
     * Required. The BCP-47 language code to use for translation of the input
     * document, set to one of the language codes listed in Language Support.
     * 
* * string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; * * @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; } } /** * * *
     * Required. The BCP-47 language code to use for translation of the input
     * document, set to one of the language codes listed in Language Support.
     * 
* * string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; * * @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; } } /** * * *
     * Required. The BCP-47 language code to use for translation of the input
     * document, set to one of the language codes listed in Language Support.
     * 
* * string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; * * @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; } /** * * *
     * Required. The BCP-47 language code to use for translation of the input
     * document, set to one of the language codes listed in Language Support.
     * 
* * string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ public Builder clearTargetLanguageCode() { targetLanguageCode_ = getDefaultInstance().getTargetLanguageCode(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } /** * * *
     * Required. The BCP-47 language code to use for translation of the input
     * document, set to one of the language codes listed in Language Support.
     * 
* * string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED]; * * @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.v3beta1.DocumentInputConfig documentInputConfig_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.translate.v3beta1.DocumentInputConfig, com.google.cloud.translate.v3beta1.DocumentInputConfig.Builder, com.google.cloud.translate.v3beta1.DocumentInputConfigOrBuilder> documentInputConfigBuilder_; /** * * *
     * Required. Input configurations.
     * 
* * * .google.cloud.translation.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; * * * @return Whether the documentInputConfig field is set. */ public boolean hasDocumentInputConfig() { return ((bitField0_ & 0x00000008) != 0); } /** * * *
     * Required. Input configurations.
     * 
* * * .google.cloud.translation.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; * * * @return The documentInputConfig. */ public com.google.cloud.translate.v3beta1.DocumentInputConfig getDocumentInputConfig() { if (documentInputConfigBuilder_ == null) { return documentInputConfig_ == null ? com.google.cloud.translate.v3beta1.DocumentInputConfig.getDefaultInstance() : documentInputConfig_; } else { return documentInputConfigBuilder_.getMessage(); } } /** * * *
     * Required. Input configurations.
     * 
* * * .google.cloud.translation.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; * */ public Builder setDocumentInputConfig( com.google.cloud.translate.v3beta1.DocumentInputConfig value) { if (documentInputConfigBuilder_ == null) { if (value == null) { throw new NullPointerException(); } documentInputConfig_ = value; } else { documentInputConfigBuilder_.setMessage(value); } bitField0_ |= 0x00000008; onChanged(); return this; } /** * * *
     * Required. Input configurations.
     * 
* * * .google.cloud.translation.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; * */ public Builder setDocumentInputConfig( com.google.cloud.translate.v3beta1.DocumentInputConfig.Builder builderForValue) { if (documentInputConfigBuilder_ == null) { documentInputConfig_ = builderForValue.build(); } else { documentInputConfigBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000008; onChanged(); return this; } /** * * *
     * Required. Input configurations.
     * 
* * * .google.cloud.translation.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; * */ public Builder mergeDocumentInputConfig( com.google.cloud.translate.v3beta1.DocumentInputConfig value) { if (documentInputConfigBuilder_ == null) { if (((bitField0_ & 0x00000008) != 0) && documentInputConfig_ != null && documentInputConfig_ != com.google.cloud.translate.v3beta1.DocumentInputConfig.getDefaultInstance()) { getDocumentInputConfigBuilder().mergeFrom(value); } else { documentInputConfig_ = value; } } else { documentInputConfigBuilder_.mergeFrom(value); } if (documentInputConfig_ != null) { bitField0_ |= 0x00000008; onChanged(); } return this; } /** * * *
     * Required. Input configurations.
     * 
* * * .google.cloud.translation.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; * */ public Builder clearDocumentInputConfig() { bitField0_ = (bitField0_ & ~0x00000008); documentInputConfig_ = null; if (documentInputConfigBuilder_ != null) { documentInputConfigBuilder_.dispose(); documentInputConfigBuilder_ = null; } onChanged(); return this; } /** * * *
     * Required. Input configurations.
     * 
* * * .google.cloud.translation.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; * */ public com.google.cloud.translate.v3beta1.DocumentInputConfig.Builder getDocumentInputConfigBuilder() { bitField0_ |= 0x00000008; onChanged(); return getDocumentInputConfigFieldBuilder().getBuilder(); } /** * * *
     * Required. Input configurations.
     * 
* * * .google.cloud.translation.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; * */ public com.google.cloud.translate.v3beta1.DocumentInputConfigOrBuilder getDocumentInputConfigOrBuilder() { if (documentInputConfigBuilder_ != null) { return documentInputConfigBuilder_.getMessageOrBuilder(); } else { return documentInputConfig_ == null ? com.google.cloud.translate.v3beta1.DocumentInputConfig.getDefaultInstance() : documentInputConfig_; } } /** * * *
     * Required. Input configurations.
     * 
* * * .google.cloud.translation.v3beta1.DocumentInputConfig document_input_config = 4 [(.google.api.field_behavior) = REQUIRED]; * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.translate.v3beta1.DocumentInputConfig, com.google.cloud.translate.v3beta1.DocumentInputConfig.Builder, com.google.cloud.translate.v3beta1.DocumentInputConfigOrBuilder> getDocumentInputConfigFieldBuilder() { if (documentInputConfigBuilder_ == null) { documentInputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.translate.v3beta1.DocumentInputConfig, com.google.cloud.translate.v3beta1.DocumentInputConfig.Builder, com.google.cloud.translate.v3beta1.DocumentInputConfigOrBuilder>( getDocumentInputConfig(), getParentForChildren(), isClean()); documentInputConfig_ = null; } return documentInputConfigBuilder_; } private com.google.cloud.translate.v3beta1.DocumentOutputConfig documentOutputConfig_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.translate.v3beta1.DocumentOutputConfig, com.google.cloud.translate.v3beta1.DocumentOutputConfig.Builder, com.google.cloud.translate.v3beta1.DocumentOutputConfigOrBuilder> documentOutputConfigBuilder_; /** * * *
     * 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.
     * 
* * * .google.cloud.translation.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; * * * @return Whether the documentOutputConfig field is set. */ public boolean hasDocumentOutputConfig() { return ((bitField0_ & 0x00000010) != 0); } /** * * *
     * 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.
     * 
* * * .google.cloud.translation.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The documentOutputConfig. */ public com.google.cloud.translate.v3beta1.DocumentOutputConfig getDocumentOutputConfig() { if (documentOutputConfigBuilder_ == null) { return documentOutputConfig_ == null ? com.google.cloud.translate.v3beta1.DocumentOutputConfig.getDefaultInstance() : documentOutputConfig_; } else { return documentOutputConfigBuilder_.getMessage(); } } /** * * *
     * 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.
     * 
* * * .google.cloud.translation.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder setDocumentOutputConfig( com.google.cloud.translate.v3beta1.DocumentOutputConfig value) { if (documentOutputConfigBuilder_ == null) { if (value == null) { throw new NullPointerException(); } documentOutputConfig_ = value; } else { documentOutputConfigBuilder_.setMessage(value); } bitField0_ |= 0x00000010; onChanged(); return this; } /** * * *
     * 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.
     * 
* * * .google.cloud.translation.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder setDocumentOutputConfig( com.google.cloud.translate.v3beta1.DocumentOutputConfig.Builder builderForValue) { if (documentOutputConfigBuilder_ == null) { documentOutputConfig_ = builderForValue.build(); } else { documentOutputConfigBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000010; onChanged(); return this; } /** * * *
     * 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.
     * 
* * * .google.cloud.translation.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder mergeDocumentOutputConfig( com.google.cloud.translate.v3beta1.DocumentOutputConfig value) { if (documentOutputConfigBuilder_ == null) { if (((bitField0_ & 0x00000010) != 0) && documentOutputConfig_ != null && documentOutputConfig_ != com.google.cloud.translate.v3beta1.DocumentOutputConfig.getDefaultInstance()) { getDocumentOutputConfigBuilder().mergeFrom(value); } else { documentOutputConfig_ = value; } } else { documentOutputConfigBuilder_.mergeFrom(value); } if (documentOutputConfig_ != null) { bitField0_ |= 0x00000010; onChanged(); } return this; } /** * * *
     * 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.
     * 
* * * .google.cloud.translation.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder clearDocumentOutputConfig() { bitField0_ = (bitField0_ & ~0x00000010); documentOutputConfig_ = null; if (documentOutputConfigBuilder_ != null) { documentOutputConfigBuilder_.dispose(); documentOutputConfigBuilder_ = null; } onChanged(); return this; } /** * * *
     * 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.
     * 
* * * .google.cloud.translation.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.cloud.translate.v3beta1.DocumentOutputConfig.Builder getDocumentOutputConfigBuilder() { bitField0_ |= 0x00000010; onChanged(); return getDocumentOutputConfigFieldBuilder().getBuilder(); } /** * * *
     * 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.
     * 
* * * .google.cloud.translation.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.cloud.translate.v3beta1.DocumentOutputConfigOrBuilder getDocumentOutputConfigOrBuilder() { if (documentOutputConfigBuilder_ != null) { return documentOutputConfigBuilder_.getMessageOrBuilder(); } else { return documentOutputConfig_ == null ? com.google.cloud.translate.v3beta1.DocumentOutputConfig.getDefaultInstance() : documentOutputConfig_; } } /** * * *
     * 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.
     * 
* * * .google.cloud.translation.v3beta1.DocumentOutputConfig document_output_config = 5 [(.google.api.field_behavior) = OPTIONAL]; * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.translate.v3beta1.DocumentOutputConfig, com.google.cloud.translate.v3beta1.DocumentOutputConfig.Builder, com.google.cloud.translate.v3beta1.DocumentOutputConfigOrBuilder> getDocumentOutputConfigFieldBuilder() { if (documentOutputConfigBuilder_ == null) { documentOutputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.translate.v3beta1.DocumentOutputConfig, com.google.cloud.translate.v3beta1.DocumentOutputConfig.Builder, com.google.cloud.translate.v3beta1.DocumentOutputConfigOrBuilder>( getDocumentOutputConfig(), getParentForChildren(), isClean()); documentOutputConfig_ = null; } return documentOutputConfigBuilder_; } private java.lang.Object model_ = ""; /** * * *
     * 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.
     * 
* * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @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; } } /** * * *
     * 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.
     * 
* * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @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; } } /** * * *
     * 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.
     * 
* * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @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; } /** * * *
     * 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.
     * 
* * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ public Builder clearModel() { model_ = getDefaultInstance().getModel(); bitField0_ = (bitField0_ & ~0x00000020); onChanged(); return this; } /** * * *
     * 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.
     * 
* * string model = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @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.v3beta1.TranslateTextGlossaryConfig glossaryConfig_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.Builder, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder> glossaryConfigBuilder_; /** * * *
     * 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.
     * 
* * * .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; * * * @return Whether the glossaryConfig field is set. */ public boolean hasGlossaryConfig() { return ((bitField0_ & 0x00000040) != 0); } /** * * *
     * 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.
     * 
* * * .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The glossaryConfig. */ public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig getGlossaryConfig() { if (glossaryConfigBuilder_ == null) { return glossaryConfig_ == null ? com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.getDefaultInstance() : glossaryConfig_; } else { return glossaryConfigBuilder_.getMessage(); } } /** * * *
     * 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.
     * 
* * * .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder setGlossaryConfig( com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig value) { if (glossaryConfigBuilder_ == null) { if (value == null) { throw new NullPointerException(); } glossaryConfig_ = value; } else { glossaryConfigBuilder_.setMessage(value); } bitField0_ |= 0x00000040; onChanged(); return this; } /** * * *
     * 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.
     * 
* * * .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder setGlossaryConfig( com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.Builder builderForValue) { if (glossaryConfigBuilder_ == null) { glossaryConfig_ = builderForValue.build(); } else { glossaryConfigBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000040; onChanged(); return this; } /** * * *
     * 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.
     * 
* * * .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder mergeGlossaryConfig( com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig value) { if (glossaryConfigBuilder_ == null) { if (((bitField0_ & 0x00000040) != 0) && glossaryConfig_ != null && glossaryConfig_ != com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig .getDefaultInstance()) { getGlossaryConfigBuilder().mergeFrom(value); } else { glossaryConfig_ = value; } } else { glossaryConfigBuilder_.mergeFrom(value); } if (glossaryConfig_ != null) { bitField0_ |= 0x00000040; onChanged(); } return this; } /** * * *
     * 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.
     * 
* * * .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder clearGlossaryConfig() { bitField0_ = (bitField0_ & ~0x00000040); glossaryConfig_ = null; if (glossaryConfigBuilder_ != null) { glossaryConfigBuilder_.dispose(); glossaryConfigBuilder_ = null; } onChanged(); return this; } /** * * *
     * 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.
     * 
* * * .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.Builder getGlossaryConfigBuilder() { bitField0_ |= 0x00000040; onChanged(); return getGlossaryConfigFieldBuilder().getBuilder(); } /** * * *
     * 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.
     * 
* * * .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder getGlossaryConfigOrBuilder() { if (glossaryConfigBuilder_ != null) { return glossaryConfigBuilder_.getMessageOrBuilder(); } else { return glossaryConfig_ == null ? com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.getDefaultInstance() : glossaryConfig_; } } /** * * *
     * 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.
     * 
* * * .google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7 [(.google.api.field_behavior) = OPTIONAL]; * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.Builder, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder> getGlossaryConfigFieldBuilder() { if (glossaryConfigBuilder_ == null) { glossaryConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfig.Builder, com.google.cloud.translate.v3beta1.TranslateTextGlossaryConfigOrBuilder>( getGlossaryConfig(), getParentForChildren(), isClean()); glossaryConfig_ = null; } return glossaryConfigBuilder_; } private com.google.protobuf.MapField labels_; private com.google.protobuf.MapField internalGetLabels() { if (labels_ == null) { return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); } return labels_; } private com.google.protobuf.MapField 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(); } /** * * *
     * 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.
     * 
* * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; */ @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 getLabels() { return getLabelsMap(); } /** * * *
     * 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.
     * 
* * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; */ @java.lang.Override public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); } /** * * *
     * 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.
     * 
* * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; */ @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 map = internalGetLabels().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * * *
     * 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.
     * 
* * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; */ @java.lang.Override public java.lang.String getLabelsOrThrow(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map 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; } /** * * *
     * 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.
     * 
* * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; */ 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 getMutableLabels() { bitField0_ |= 0x00000080; return internalGetMutableLabels().getMutableMap(); } /** * * *
     * 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.
     * 
* * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; */ 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; } /** * * *
     * 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.
     * 
* * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL]; */ public Builder putAllLabels(java.util.Map values) { internalGetMutableLabels().getMutableMap().putAll(values); bitField0_ |= 0x00000080; return this; } private java.lang.Object customizedAttribution_ = ""; /** * * *
     * 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
     * 
* * string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL]; * * @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; } } /** * * *
     * 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
     * 
* * string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL]; * * @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; } } /** * * *
     * 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
     * 
* * string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL]; * * @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; } /** * * *
     * 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
     * 
* * string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ public Builder clearCustomizedAttribution() { customizedAttribution_ = getDefaultInstance().getCustomizedAttribution(); bitField0_ = (bitField0_ & ~0x00000100); onChanged(); return this; } /** * * *
     * 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
     * 
* * string customized_attribution = 10 [(.google.api.field_behavior) = OPTIONAL]; * * @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_; /** * * *
     * Optional. is_translate_native_pdf_only field for external customers.
     * If true, the page limit of online native pdf translation is 300 and only
     * native pdf pages will be translated.
     * 
* * bool is_translate_native_pdf_only = 11 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The isTranslateNativePdfOnly. */ @java.lang.Override public boolean getIsTranslateNativePdfOnly() { return isTranslateNativePdfOnly_; } /** * * *
     * Optional. is_translate_native_pdf_only field for external customers.
     * If true, the page limit of online native pdf translation is 300 and only
     * native pdf pages will be translated.
     * 
* * bool is_translate_native_pdf_only = 11 [(.google.api.field_behavior) = OPTIONAL]; * * * @param value The isTranslateNativePdfOnly to set. * @return This builder for chaining. */ public Builder setIsTranslateNativePdfOnly(boolean value) { isTranslateNativePdfOnly_ = value; bitField0_ |= 0x00000200; onChanged(); return this; } /** * * *
     * Optional. is_translate_native_pdf_only field for external customers.
     * If true, the page limit of online native pdf translation is 300 and only
     * native pdf pages will be translated.
     * 
* * bool is_translate_native_pdf_only = 11 [(.google.api.field_behavior) = OPTIONAL]; * * * @return This builder for chaining. */ public Builder clearIsTranslateNativePdfOnly() { bitField0_ = (bitField0_ & ~0x00000200); isTranslateNativePdfOnly_ = false; onChanged(); return this; } private boolean enableShadowRemovalNativePdf_; /** * * *
     * Optional. If true, use the text removal server 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: false && pdf_native_only: false
     * 
* * bool enable_shadow_removal_native_pdf = 12 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The enableShadowRemovalNativePdf. */ @java.lang.Override public boolean getEnableShadowRemovalNativePdf() { return enableShadowRemovalNativePdf_; } /** * * *
     * Optional. If true, use the text removal server 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: false && pdf_native_only: false
     * 
* * bool enable_shadow_removal_native_pdf = 12 [(.google.api.field_behavior) = OPTIONAL]; * * * @param value The enableShadowRemovalNativePdf to set. * @return This builder for chaining. */ public Builder setEnableShadowRemovalNativePdf(boolean value) { enableShadowRemovalNativePdf_ = value; bitField0_ |= 0x00000400; onChanged(); return this; } /** * * *
     * Optional. If true, use the text removal server 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: false && pdf_native_only: false
     * 
* * bool enable_shadow_removal_native_pdf = 12 [(.google.api.field_behavior) = OPTIONAL]; * * * @return This builder for chaining. */ public Builder clearEnableShadowRemovalNativePdf() { bitField0_ = (bitField0_ & ~0x00000400); enableShadowRemovalNativePdf_ = false; onChanged(); return this; } private boolean enableRotationCorrection_; /** * * *
     * Optional. If true, enable auto rotation correction in DVS.
     * 
* * bool enable_rotation_correction = 13 [(.google.api.field_behavior) = OPTIONAL]; * * @return The enableRotationCorrection. */ @java.lang.Override public boolean getEnableRotationCorrection() { return enableRotationCorrection_; } /** * * *
     * Optional. If true, enable auto rotation correction in DVS.
     * 
* * bool enable_rotation_correction = 13 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The enableRotationCorrection to set. * @return This builder for chaining. */ public Builder setEnableRotationCorrection(boolean value) { enableRotationCorrection_ = value; bitField0_ |= 0x00000800; onChanged(); return this; } /** * * *
     * Optional. If true, enable auto rotation correction in DVS.
     * 
* * bool enable_rotation_correction = 13 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ public Builder clearEnableRotationCorrection() { bitField0_ = (bitField0_ & ~0x00000800); enableRotationCorrection_ = 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.v3beta1.TranslateDocumentRequest) } // @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.TranslateDocumentRequest) private static final com.google.cloud.translate.v3beta1.TranslateDocumentRequest DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.translate.v3beta1.TranslateDocumentRequest(); } public static com.google.cloud.translate.v3beta1.TranslateDocumentRequest getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @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 parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override public com.google.cloud.translate.v3beta1.TranslateDocumentRequest getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy