Class BatchTranslateTextRequest.Builder (2.19.0)

public static final class BatchTranslateTextRequest.Builder extends GeneratedMessageV3.Builder<BatchTranslateTextRequest.Builder> implements BatchTranslateTextRequestOrBuilder

The batch translation request.

Protobuf type google.cloud.translation.v3.BatchTranslateTextRequest

Static Methods

getDescriptor()

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

Methods

addAllInputConfigs(Iterable<? extends InputConfig> values)

public BatchTranslateTextRequest.Builder addAllInputConfigs(Iterable<? extends InputConfig> values)

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

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

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

addAllTargetLanguageCodes(Iterable<String> values)

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

Required. 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
BatchTranslateTextRequest.Builder

This builder for chaining.

addInputConfigs(InputConfig value)

public BatchTranslateTextRequest.Builder addInputConfigs(InputConfig value)

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

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

Parameter
NameDescription
valueInputConfig
Returns
TypeDescription
BatchTranslateTextRequest.Builder

addInputConfigs(InputConfig.Builder builderForValue)

public BatchTranslateTextRequest.Builder addInputConfigs(InputConfig.Builder builderForValue)

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

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

Parameter
NameDescription
builderForValueInputConfig.Builder
Returns
TypeDescription
BatchTranslateTextRequest.Builder

addInputConfigs(int index, InputConfig value)

public BatchTranslateTextRequest.Builder addInputConfigs(int index, InputConfig value)

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

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

Parameters
NameDescription
indexint
valueInputConfig
Returns
TypeDescription
BatchTranslateTextRequest.Builder

addInputConfigs(int index, InputConfig.Builder builderForValue)

public BatchTranslateTextRequest.Builder addInputConfigs(int index, InputConfig.Builder builderForValue)

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

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

Parameters
NameDescription
indexint
builderForValueInputConfig.Builder
Returns
TypeDescription
BatchTranslateTextRequest.Builder

addInputConfigsBuilder()

public InputConfig.Builder addInputConfigsBuilder()

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

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

Returns
TypeDescription
InputConfig.Builder

addInputConfigsBuilder(int index)

public InputConfig.Builder addInputConfigsBuilder(int index)

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

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

Parameter
NameDescription
indexint
Returns
TypeDescription
InputConfig.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

addTargetLanguageCodes(String value)

public BatchTranslateTextRequest.Builder addTargetLanguageCodes(String value)

Required. 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
BatchTranslateTextRequest.Builder

This builder for chaining.

addTargetLanguageCodesBytes(ByteString value)

public BatchTranslateTextRequest.Builder addTargetLanguageCodesBytes(ByteString value)

Required. 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
BatchTranslateTextRequest.Builder

This builder for chaining.

build()

public BatchTranslateTextRequest build()
Returns
TypeDescription
BatchTranslateTextRequest

buildPartial()

public BatchTranslateTextRequest buildPartial()
Returns
TypeDescription
BatchTranslateTextRequest

clear()

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

clearField(Descriptors.FieldDescriptor field)

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

clearGlossaries()

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

clearInputConfigs()

public BatchTranslateTextRequest.Builder clearInputConfigs()

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

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

Returns
TypeDescription
BatchTranslateTextRequest.Builder

clearLabels()

public BatchTranslateTextRequest.Builder clearLabels()
Returns
TypeDescription
BatchTranslateTextRequest.Builder

clearModels()

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearOutputConfig()

public BatchTranslateTextRequest.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.OutputConfig output_config = 6 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
BatchTranslateTextRequest.Builder

clearParent()

public BatchTranslateTextRequest.Builder clearParent()

Required. Location to make a call. Must refer to a caller's project.

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
BatchTranslateTextRequest.Builder

This builder for chaining.

clearSourceLanguageCode()

public BatchTranslateTextRequest.Builder clearSourceLanguageCode()

Required. Source language code.

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

Returns
TypeDescription
BatchTranslateTextRequest.Builder

This builder for chaining.

clearTargetLanguageCodes()

public BatchTranslateTextRequest.Builder clearTargetLanguageCodes()

Required. Specify up to 10 language codes here.

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

Returns
TypeDescription
BatchTranslateTextRequest.Builder

This builder for chaining.

clone()

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

containsGlossaries(String key)

public boolean containsGlossaries(String key)

Optional. Glossaries to be applied for translation. 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

containsLabels(String key)

public boolean containsLabels(String key)

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 = 9 [(.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 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 = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getDefaultInstanceForType()

public BatchTranslateTextRequest getDefaultInstanceForType()
Returns
TypeDescription
BatchTranslateTextRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getGlossaries()

public Map<String,TranslateTextGlossaryConfig> getGlossaries()

Use #getGlossariesMap() instead.

Returns
TypeDescription
Map<String,TranslateTextGlossaryConfig>

getGlossariesCount()

public int getGlossariesCount()

Optional. Glossaries to be applied for translation. 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 for translation. 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 for translation. 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 for translation. 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 InputConfig getInputConfigs(int index)

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

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

Parameter
NameDescription
indexint
Returns
TypeDescription
InputConfig

getInputConfigsBuilder(int index)

public InputConfig.Builder getInputConfigsBuilder(int index)

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

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

Parameter
NameDescription
indexint
Returns
TypeDescription
InputConfig.Builder

getInputConfigsBuilderList()

public List<InputConfig.Builder> getInputConfigsBuilderList()

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

repeated .google.cloud.translation.v3.InputConfig input_configs = 5 [(.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 should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

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

Returns
TypeDescription
int

getInputConfigsList()

public List<InputConfig> getInputConfigsList()

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

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

Returns
TypeDescription
List<InputConfig>

getInputConfigsOrBuilder(int index)

public InputConfigOrBuilder getInputConfigsOrBuilder(int index)

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

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

Parameter
NameDescription
indexint
Returns
TypeDescription
InputConfigOrBuilder

getInputConfigsOrBuilderList()

public List<? extends InputConfigOrBuilder> getInputConfigsOrBuilderList()

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

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

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

getLabels()

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
TypeDescription
Map<String,String>

getLabelsCount()

public int getLabelsCount()

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 = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

getLabelsMap()

public Map<String,String> 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 = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String 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 = 9 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

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 = 9 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
keyString
Returns
TypeDescription
String

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 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 = 4 [(.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 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 = 4 [(.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 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 = 4 [(.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 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 = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getMutableGlossaries()

public Map<String,TranslateTextGlossaryConfig> getMutableGlossaries()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,TranslateTextGlossaryConfig>

getMutableLabels()

public Map<String,String> getMutableLabels()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

getMutableModels()

public Map<String,String> getMutableModels()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

getOutputConfig()

public OutputConfig 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.OutputConfig output_config = 6 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
OutputConfig

The outputConfig.

getOutputConfigBuilder()

public OutputConfig.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.OutputConfig output_config = 6 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
OutputConfig.Builder

getOutputConfigOrBuilder()

public OutputConfigOrBuilder 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.OutputConfig output_config = 6 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
OutputConfigOrBuilder

getParent()

public String getParent()

Required. Location to make a call. Must refer to a caller's project.

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 call. Must refer to a caller's project.

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. Source language code.

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

Returns
TypeDescription
String

The sourceLanguageCode.

getSourceLanguageCodeBytes()

public ByteString getSourceLanguageCodeBytes()

Required. Source language code.

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. 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. 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. 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. 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.OutputConfig output_config = 6 [(.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(BatchTranslateTextRequest other)

public BatchTranslateTextRequest.Builder mergeFrom(BatchTranslateTextRequest other)
Parameter
NameDescription
otherBatchTranslateTextRequest
Returns
TypeDescription
BatchTranslateTextRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeOutputConfig(OutputConfig value)

public BatchTranslateTextRequest.Builder mergeOutputConfig(OutputConfig 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.OutputConfig output_config = 6 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueOutputConfig
Returns
TypeDescription
BatchTranslateTextRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

putAllGlossaries(Map<String,TranslateTextGlossaryConfig> values)

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

Optional. Glossaries to be applied for translation. 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
BatchTranslateTextRequest.Builder

putAllLabels(Map<String,String> values)

public BatchTranslateTextRequest.Builder putAllLabels(Map<String,String> values)

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 = 9 [(.google.api.field_behavior) = OPTIONAL];

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

putAllModels(Map<String,String> values)

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

Optional. The models to use for translation. Map's key is target language code. Map's value is 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 = 4 [(.google.api.field_behavior) = OPTIONAL];

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

putGlossaries(String key, TranslateTextGlossaryConfig value)

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

Optional. Glossaries to be applied for translation. 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
BatchTranslateTextRequest.Builder

putLabels(String key, String value)

public BatchTranslateTextRequest.Builder putLabels(String key, String value)

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 = 9 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
BatchTranslateTextRequest.Builder

putModels(String key, String value)

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

Optional. The models to use for translation. Map's key is target language code. Map's value is 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 = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
BatchTranslateTextRequest.Builder

removeGlossaries(String key)

public BatchTranslateTextRequest.Builder removeGlossaries(String key)

Optional. Glossaries to be applied for translation. 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
BatchTranslateTextRequest.Builder

removeInputConfigs(int index)

public BatchTranslateTextRequest.Builder removeInputConfigs(int index)

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

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

Parameter
NameDescription
indexint
Returns
TypeDescription
BatchTranslateTextRequest.Builder

removeLabels(String key)

public BatchTranslateTextRequest.Builder removeLabels(String key)

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 = 9 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
keyString
Returns
TypeDescription
BatchTranslateTextRequest.Builder

removeModels(String key)

public BatchTranslateTextRequest.Builder removeModels(String key)

Optional. The models to use for translation. Map's key is target language code. Map's value is 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 = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
keyString
Returns
TypeDescription
BatchTranslateTextRequest.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

setInputConfigs(int index, InputConfig value)

public BatchTranslateTextRequest.Builder setInputConfigs(int index, InputConfig value)

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

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

Parameters
NameDescription
indexint
valueInputConfig
Returns
TypeDescription
BatchTranslateTextRequest.Builder

setInputConfigs(int index, InputConfig.Builder builderForValue)

public BatchTranslateTextRequest.Builder setInputConfigs(int index, InputConfig.Builder builderForValue)

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

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

Parameters
NameDescription
indexint
builderForValueInputConfig.Builder
Returns
TypeDescription
BatchTranslateTextRequest.Builder

setOutputConfig(OutputConfig value)

public BatchTranslateTextRequest.Builder setOutputConfig(OutputConfig 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.OutputConfig output_config = 6 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueOutputConfig
Returns
TypeDescription
BatchTranslateTextRequest.Builder

setOutputConfig(OutputConfig.Builder builderForValue)

public BatchTranslateTextRequest.Builder setOutputConfig(OutputConfig.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.OutputConfig output_config = 6 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
builderForValueOutputConfig.Builder
Returns
TypeDescription
BatchTranslateTextRequest.Builder

setParent(String value)

public BatchTranslateTextRequest.Builder setParent(String value)

Required. Location to make a call. Must refer to a caller's project.

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
BatchTranslateTextRequest.Builder

This builder for chaining.

setParentBytes(ByteString value)

public BatchTranslateTextRequest.Builder setParentBytes(ByteString value)

Required. Location to make a call. Must refer to a caller's project.

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
BatchTranslateTextRequest.Builder

This builder for chaining.

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

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

setSourceLanguageCode(String value)

public BatchTranslateTextRequest.Builder setSourceLanguageCode(String value)

Required. Source language code.

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

Parameter
NameDescription
valueString

The sourceLanguageCode to set.

Returns
TypeDescription
BatchTranslateTextRequest.Builder

This builder for chaining.

setSourceLanguageCodeBytes(ByteString value)

public BatchTranslateTextRequest.Builder setSourceLanguageCodeBytes(ByteString value)

Required. Source language code.

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

Parameter
NameDescription
valueByteString

The bytes for sourceLanguageCode to set.

Returns
TypeDescription
BatchTranslateTextRequest.Builder

This builder for chaining.

setTargetLanguageCodes(int index, String value)

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

Required. 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
BatchTranslateTextRequest.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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