Class BatchTranslateDocumentRequest.Builder (2.22.0)

public static final class BatchTranslateDocumentRequest.Builder extends GeneratedMessageV3.Builder<BatchTranslateDocumentRequest.Builder> implements BatchTranslateDocumentRequestOrBuilder

The BatchTranslateDocument request.

Protobuf type google.cloud.translation.v3.BatchTranslateDocumentRequest

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllInputConfigs(Iterable<? extends BatchDocumentInputConfig> values)

public BatchTranslateDocumentRequest.Builder addAllInputConfigs(Iterable<? extends BatchDocumentInputConfig> values)

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

repeated .google.cloud.translation.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.translate.v3.BatchDocumentInputConfig>
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

addAllTargetLanguageCodes(Iterable<String> values)

public BatchTranslateDocumentRequest.Builder addAllTargetLanguageCodes(Iterable<String> values)

Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here.

repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valuesIterable<String>

The targetLanguageCodes to add.

Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

This builder for chaining.

addInputConfigs(BatchDocumentInputConfig value)

public BatchTranslateDocumentRequest.Builder addInputConfigs(BatchDocumentInputConfig value)

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

repeated .google.cloud.translation.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueBatchDocumentInputConfig
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

addInputConfigs(BatchDocumentInputConfig.Builder builderForValue)

public BatchTranslateDocumentRequest.Builder addInputConfigs(BatchDocumentInputConfig.Builder builderForValue)

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

repeated .google.cloud.translation.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
builderForValueBatchDocumentInputConfig.Builder
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

addInputConfigs(int index, BatchDocumentInputConfig value)

public BatchTranslateDocumentRequest.Builder addInputConfigs(int index, BatchDocumentInputConfig value)

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

repeated .google.cloud.translation.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint
valueBatchDocumentInputConfig
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

addInputConfigs(int index, BatchDocumentInputConfig.Builder builderForValue)

public BatchTranslateDocumentRequest.Builder addInputConfigs(int index, BatchDocumentInputConfig.Builder builderForValue)

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

repeated .google.cloud.translation.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint
builderForValueBatchDocumentInputConfig.Builder
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

addInputConfigsBuilder()

public BatchDocumentInputConfig.Builder addInputConfigsBuilder()

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

repeated .google.cloud.translation.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
BatchDocumentInputConfig.Builder

addInputConfigsBuilder(int index)

public BatchDocumentInputConfig.Builder addInputConfigsBuilder(int index)

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

repeated .google.cloud.translation.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
BatchDocumentInputConfig.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public BatchTranslateDocumentRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder
Overrides

addTargetLanguageCodes(String value)

public BatchTranslateDocumentRequest.Builder addTargetLanguageCodes(String value)

Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here.

repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueString

The targetLanguageCodes to add.

Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

This builder for chaining.

addTargetLanguageCodesBytes(ByteString value)

public BatchTranslateDocumentRequest.Builder addTargetLanguageCodesBytes(ByteString value)

Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here.

repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueByteString

The bytes of the targetLanguageCodes to add.

Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

This builder for chaining.

build()

public BatchTranslateDocumentRequest build()
Returns
TypeDescription
BatchTranslateDocumentRequest

buildPartial()

public BatchTranslateDocumentRequest buildPartial()
Returns
TypeDescription
BatchTranslateDocumentRequest

clear()

public BatchTranslateDocumentRequest.Builder clear()
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder
Overrides

clearCustomizedAttribution()

public BatchTranslateDocumentRequest.Builder clearCustomizedAttribution()

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];

Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public BatchTranslateDocumentRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder
Overrides

clearFormatConversions()

public BatchTranslateDocumentRequest.Builder clearFormatConversions()
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

clearGlossaries()

public BatchTranslateDocumentRequest.Builder clearGlossaries()
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

clearInputConfigs()

public BatchTranslateDocumentRequest.Builder clearInputConfigs()

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

repeated .google.cloud.translation.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

clearModels()

public BatchTranslateDocumentRequest.Builder clearModels()
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public BatchTranslateDocumentRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder
Overrides

clearOutputConfig()

public BatchTranslateDocumentRequest.Builder clearOutputConfig()

Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs.

.google.cloud.translation.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

clearParent()

public BatchTranslateDocumentRequest.Builder clearParent()

Required. Location to make a regional call.

Format: projects/{project-number-or-id}/locations/{location-id}.

The global location is not supported for batch translation.

Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

This builder for chaining.

clearSourceLanguageCode()

public BatchTranslateDocumentRequest.Builder clearSourceLanguageCode()

Required. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support.

string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

This builder for chaining.

clearTargetLanguageCodes()

public BatchTranslateDocumentRequest.Builder clearTargetLanguageCodes()

Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here.

repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

This builder for chaining.

clone()

public BatchTranslateDocumentRequest.Builder clone()
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder
Overrides

containsFormatConversions(String key)

public boolean containsFormatConversions(String key)

Optional. File format conversion map to be applied to all input files. Map's key is the original mime_type. Map's value is the target mime_type of translated documents.

Supported file format conversion includes:

  • application/pdf to application/vnd.openxmlformats-officedocument.wordprocessingml.document

    If nothing specified, output files will be in the same format as the original file.

map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

containsGlossaries(String key)

public boolean containsGlossaries(String key)

Optional. Glossaries to be applied. It's keyed by target language code.

map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

containsModels(String key)

public boolean containsModels(String key)

Optional. The models to use for translation. Map's key is target language code. Map's value is the model name. Value can be a built-in general model, or an AutoML Translation model.

The value 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 the map is empty or a specific model is not requested for a language pair, then default google model (nmt) is used.

map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getCustomizedAttribution()

public String getCustomizedAttribution()

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];

Returns
TypeDescription
String

The customizedAttribution.

getCustomizedAttributionBytes()

public ByteString getCustomizedAttributionBytes()

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];

Returns
TypeDescription
ByteString

The bytes for customizedAttribution.

getDefaultInstanceForType()

public BatchTranslateDocumentRequest getDefaultInstanceForType()
Returns
TypeDescription
BatchTranslateDocumentRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getFormatConversions()

public Map<String,String> getFormatConversions()
Returns
TypeDescription
Map<String,String>

getFormatConversionsCount()

public int getFormatConversionsCount()

Optional. File format conversion map to be applied to all input files. Map's key is the original mime_type. Map's value is the target mime_type of translated documents.

Supported file format conversion includes:

  • application/pdf to application/vnd.openxmlformats-officedocument.wordprocessingml.document

    If nothing specified, output files will be in the same format as the original file.

map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

getFormatConversionsMap()

public Map<String,String> getFormatConversionsMap()

Optional. File format conversion map to be applied to all input files. Map's key is the original mime_type. Map's value is the target mime_type of translated documents.

Supported file format conversion includes:

  • application/pdf to application/vnd.openxmlformats-officedocument.wordprocessingml.document

    If nothing specified, output files will be in the same format as the original file.

map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
Map<String,String>

getFormatConversionsOrDefault(String key, String defaultValue)

public String getFormatConversionsOrDefault(String key, String defaultValue)

Optional. File format conversion map to be applied to all input files. Map's key is the original mime_type. Map's value is the target mime_type of translated documents.

Supported file format conversion includes:

  • application/pdf to application/vnd.openxmlformats-officedocument.wordprocessingml.document

    If nothing specified, output files will be in the same format as the original file.

map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getFormatConversionsOrThrow(String key)

public String getFormatConversionsOrThrow(String key)

Optional. File format conversion map to be applied to all input files. Map's key is the original mime_type. Map's value is the target mime_type of translated documents.

Supported file format conversion includes:

  • application/pdf to application/vnd.openxmlformats-officedocument.wordprocessingml.document

    If nothing specified, output files will be in the same format as the original file.

map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getGlossaries()

public Map<String,TranslateTextGlossaryConfig> getGlossaries()

Use #getGlossariesMap() instead.

Returns
TypeDescription
Map<String,TranslateTextGlossaryConfig>

getGlossariesCount()

public int getGlossariesCount()

Optional. Glossaries to be applied. It's keyed by target language code.

map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

getGlossariesMap()

public Map<String,TranslateTextGlossaryConfig> getGlossariesMap()

Optional. Glossaries to be applied. It's keyed by target language code.

map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
Map<String,TranslateTextGlossaryConfig>

getGlossariesOrDefault(String key, TranslateTextGlossaryConfig defaultValue)

public TranslateTextGlossaryConfig getGlossariesOrDefault(String key, TranslateTextGlossaryConfig defaultValue)

Optional. Glossaries to be applied. It's keyed by target language code.

map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
keyString
defaultValueTranslateTextGlossaryConfig
Returns
TypeDescription
TranslateTextGlossaryConfig

getGlossariesOrThrow(String key)

public TranslateTextGlossaryConfig getGlossariesOrThrow(String key)

Optional. Glossaries to be applied. It's keyed by target language code.

map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
keyString
Returns
TypeDescription
TranslateTextGlossaryConfig

getInputConfigs(int index)

public BatchDocumentInputConfig getInputConfigs(int index)

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

repeated .google.cloud.translation.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
BatchDocumentInputConfig

getInputConfigsBuilder(int index)

public BatchDocumentInputConfig.Builder getInputConfigsBuilder(int index)

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

repeated .google.cloud.translation.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
BatchDocumentInputConfig.Builder

getInputConfigsBuilderList()

public List<BatchDocumentInputConfig.Builder> getInputConfigsBuilderList()

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

repeated .google.cloud.translation.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
List<Builder>

getInputConfigsCount()

public int getInputConfigsCount()

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

repeated .google.cloud.translation.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
int

getInputConfigsList()

public List<BatchDocumentInputConfig> getInputConfigsList()

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

repeated .google.cloud.translation.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
List<BatchDocumentInputConfig>

getInputConfigsOrBuilder(int index)

public BatchDocumentInputConfigOrBuilder getInputConfigsOrBuilder(int index)

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

repeated .google.cloud.translation.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
BatchDocumentInputConfigOrBuilder

getInputConfigsOrBuilderList()

public List<? extends BatchDocumentInputConfigOrBuilder> getInputConfigsOrBuilderList()

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

repeated .google.cloud.translation.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
List<? extends com.google.cloud.translate.v3.BatchDocumentInputConfigOrBuilder>

getModels()

public Map<String,String> getModels()

Use #getModelsMap() instead.

Returns
TypeDescription
Map<String,String>

getModelsCount()

public int getModelsCount()

Optional. The models to use for translation. Map's key is target language code. Map's value is the model name. Value can be a built-in general model, or an AutoML Translation model.

The value 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 the map is empty or a specific model is not requested for a language pair, then default google model (nmt) is used.

map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

getModelsMap()

public Map<String,String> getModelsMap()

Optional. The models to use for translation. Map's key is target language code. Map's value is the model name. Value can be a built-in general model, or an AutoML Translation model.

The value 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 the map is empty or a specific model is not requested for a language pair, then default google model (nmt) is used.

map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
Map<String,String>

getModelsOrDefault(String key, String defaultValue)

public String getModelsOrDefault(String key, String defaultValue)

Optional. The models to use for translation. Map's key is target language code. Map's value is the model name. Value can be a built-in general model, or an AutoML Translation model.

The value 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 the map is empty or a specific model is not requested for a language pair, then default google model (nmt) is used.

map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getModelsOrThrow(String key)

public String getModelsOrThrow(String key)

Optional. The models to use for translation. Map's key is target language code. Map's value is the model name. Value can be a built-in general model, or an AutoML Translation model.

The value 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 the map is empty or a specific model is not requested for a language pair, then default google model (nmt) is used.

map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getMutableFormatConversions()

public Map<String,String> getMutableFormatConversions()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

getMutableGlossaries()

public Map<String,TranslateTextGlossaryConfig> getMutableGlossaries()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,TranslateTextGlossaryConfig>

getMutableModels()

public Map<String,String> getMutableModels()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

getOutputConfig()

public BatchDocumentOutputConfig getOutputConfig()

Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs.

.google.cloud.translation.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
BatchDocumentOutputConfig

The outputConfig.

getOutputConfigBuilder()

public BatchDocumentOutputConfig.Builder getOutputConfigBuilder()

Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs.

.google.cloud.translation.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
BatchDocumentOutputConfig.Builder

getOutputConfigOrBuilder()

public BatchDocumentOutputConfigOrBuilder getOutputConfigOrBuilder()

Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs.

.google.cloud.translation.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
BatchDocumentOutputConfigOrBuilder

getParent()

public String getParent()

Required. Location to make a regional call.

Format: projects/{project-number-or-id}/locations/{location-id}.

The global location is not supported for batch translation.

Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
String

The parent.

getParentBytes()

public ByteString getParentBytes()

Required. Location to make a regional call.

Format: projects/{project-number-or-id}/locations/{location-id}.

The global location is not supported for batch translation.

Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
ByteString

The bytes for parent.

getSourceLanguageCode()

public String getSourceLanguageCode()

Required. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support.

string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
String

The sourceLanguageCode.

getSourceLanguageCodeBytes()

public ByteString getSourceLanguageCodeBytes()

Required. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support.

string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
ByteString

The bytes for sourceLanguageCode.

getTargetLanguageCodes(int index)

public String getTargetLanguageCodes(int index)

Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here.

repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The targetLanguageCodes at the given index.

getTargetLanguageCodesBytes(int index)

public ByteString getTargetLanguageCodesBytes(int index)

Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here.

repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the targetLanguageCodes at the given index.

getTargetLanguageCodesCount()

public int getTargetLanguageCodesCount()

Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here.

repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
int

The count of targetLanguageCodes.

getTargetLanguageCodesList()

public ProtocolStringList getTargetLanguageCodesList()

Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here.

repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
ProtocolStringList

A list containing the targetLanguageCodes.

hasOutputConfig()

public boolean hasOutputConfig()

Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs.

.google.cloud.translation.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
boolean

Whether the outputConfig field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

internalGetMutableMapField(int number)

protected MapField internalGetMutableMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(BatchTranslateDocumentRequest other)

public BatchTranslateDocumentRequest.Builder mergeFrom(BatchTranslateDocumentRequest other)
Parameter
NameDescription
otherBatchTranslateDocumentRequest
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public BatchTranslateDocumentRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public BatchTranslateDocumentRequest.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder
Overrides

mergeOutputConfig(BatchDocumentOutputConfig value)

public BatchTranslateDocumentRequest.Builder mergeOutputConfig(BatchDocumentOutputConfig value)

Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs.

.google.cloud.translation.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueBatchDocumentOutputConfig
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final BatchTranslateDocumentRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder
Overrides

putAllFormatConversions(Map<String,String> values)

public BatchTranslateDocumentRequest.Builder putAllFormatConversions(Map<String,String> values)

Optional. File format conversion map to be applied to all input files. Map's key is the original mime_type. Map's value is the target mime_type of translated documents.

Supported file format conversion includes:

  • application/pdf to application/vnd.openxmlformats-officedocument.wordprocessingml.document

    If nothing specified, output files will be in the same format as the original file.

map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valuesMap<String,String>
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

putAllGlossaries(Map<String,TranslateTextGlossaryConfig> values)

public BatchTranslateDocumentRequest.Builder putAllGlossaries(Map<String,TranslateTextGlossaryConfig> values)

Optional. Glossaries to be applied. It's keyed by target language code.

map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valuesMap<String,TranslateTextGlossaryConfig>
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

putAllModels(Map<String,String> values)

public BatchTranslateDocumentRequest.Builder putAllModels(Map<String,String> values)

Optional. The models to use for translation. Map's key is target language code. Map's value is the model name. Value can be a built-in general model, or an AutoML Translation model.

The value 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 the map is empty or a specific model is not requested for a language pair, then default google model (nmt) is used.

map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valuesMap<String,String>
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

putFormatConversions(String key, String value)

public BatchTranslateDocumentRequest.Builder putFormatConversions(String key, String value)

Optional. File format conversion map to be applied to all input files. Map's key is the original mime_type. Map's value is the target mime_type of translated documents.

Supported file format conversion includes:

  • application/pdf to application/vnd.openxmlformats-officedocument.wordprocessingml.document

    If nothing specified, output files will be in the same format as the original file.

map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

putGlossaries(String key, TranslateTextGlossaryConfig value)

public BatchTranslateDocumentRequest.Builder putGlossaries(String key, TranslateTextGlossaryConfig value)

Optional. Glossaries to be applied. It's keyed by target language code.

map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
keyString
valueTranslateTextGlossaryConfig
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

putModels(String key, String value)

public BatchTranslateDocumentRequest.Builder putModels(String key, String value)

Optional. The models to use for translation. Map's key is target language code. Map's value is the model name. Value can be a built-in general model, or an AutoML Translation model.

The value 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 the map is empty or a specific model is not requested for a language pair, then default google model (nmt) is used.

map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

removeFormatConversions(String key)

public BatchTranslateDocumentRequest.Builder removeFormatConversions(String key)

Optional. File format conversion map to be applied to all input files. Map's key is the original mime_type. Map's value is the target mime_type of translated documents.

Supported file format conversion includes:

  • application/pdf to application/vnd.openxmlformats-officedocument.wordprocessingml.document

    If nothing specified, output files will be in the same format as the original file.

map<string, string> format_conversions = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
keyString
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

removeGlossaries(String key)

public BatchTranslateDocumentRequest.Builder removeGlossaries(String key)

Optional. Glossaries to be applied. It's keyed by target language code.

map<string, .google.cloud.translation.v3.TranslateTextGlossaryConfig> glossaries = 7 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
keyString
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

removeInputConfigs(int index)

public BatchTranslateDocumentRequest.Builder removeInputConfigs(int index)

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

repeated .google.cloud.translation.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

removeModels(String key)

public BatchTranslateDocumentRequest.Builder removeModels(String key)

Optional. The models to use for translation. Map's key is target language code. Map's value is the model name. Value can be a built-in general model, or an AutoML Translation model.

The value 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 the map is empty or a specific model is not requested for a language pair, then default google model (nmt) is used.

map<string, string> models = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
keyString
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

setCustomizedAttribution(String value)

public BatchTranslateDocumentRequest.Builder setCustomizedAttribution(String value)

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];

Parameter
NameDescription
valueString

The customizedAttribution to set.

Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

This builder for chaining.

setCustomizedAttributionBytes(ByteString value)

public BatchTranslateDocumentRequest.Builder setCustomizedAttributionBytes(ByteString value)

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];

Parameter
NameDescription
valueByteString

The bytes for customizedAttribution to set.

Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public BatchTranslateDocumentRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder
Overrides

setInputConfigs(int index, BatchDocumentInputConfig value)

public BatchTranslateDocumentRequest.Builder setInputConfigs(int index, BatchDocumentInputConfig value)

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

repeated .google.cloud.translation.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint
valueBatchDocumentInputConfig
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

setInputConfigs(int index, BatchDocumentInputConfig.Builder builderForValue)

public BatchTranslateDocumentRequest.Builder setInputConfigs(int index, BatchDocumentInputConfig.Builder builderForValue)

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

repeated .google.cloud.translation.v3.BatchDocumentInputConfig input_configs = 4 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint
builderForValueBatchDocumentInputConfig.Builder
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

setOutputConfig(BatchDocumentOutputConfig value)

public BatchTranslateDocumentRequest.Builder setOutputConfig(BatchDocumentOutputConfig value)

Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs.

.google.cloud.translation.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueBatchDocumentOutputConfig
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

setOutputConfig(BatchDocumentOutputConfig.Builder builderForValue)

public BatchTranslateDocumentRequest.Builder setOutputConfig(BatchDocumentOutputConfig.Builder builderForValue)

Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs.

.google.cloud.translation.v3.BatchDocumentOutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
builderForValueBatchDocumentOutputConfig.Builder
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

setParent(String value)

public BatchTranslateDocumentRequest.Builder setParent(String value)

Required. Location to make a regional call.

Format: projects/{project-number-or-id}/locations/{location-id}.

The global location is not supported for batch translation.

Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueString

The parent to set.

Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

This builder for chaining.

setParentBytes(ByteString value)

public BatchTranslateDocumentRequest.Builder setParentBytes(ByteString value)

Required. Location to make a regional call.

Format: projects/{project-number-or-id}/locations/{location-id}.

The global location is not supported for batch translation.

Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueByteString

The bytes for parent to set.

Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public BatchTranslateDocumentRequest.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder
Overrides

setSourceLanguageCode(String value)

public BatchTranslateDocumentRequest.Builder setSourceLanguageCode(String value)

Required. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support.

string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueString

The sourceLanguageCode to set.

Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

This builder for chaining.

setSourceLanguageCodeBytes(ByteString value)

public BatchTranslateDocumentRequest.Builder setSourceLanguageCodeBytes(ByteString value)

Required. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support.

string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueByteString

The bytes for sourceLanguageCode to set.

Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

This builder for chaining.

setTargetLanguageCodes(int index, String value)

public BatchTranslateDocumentRequest.Builder setTargetLanguageCodes(int index, String value)

Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here.

repeated string target_language_codes = 3 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The targetLanguageCodes to set.

Returns
TypeDescription
BatchTranslateDocumentRequest.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final BatchTranslateDocumentRequest.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
BatchTranslateDocumentRequest.Builder
Overrides