Class BatchTranslateTextRequest (2.18.0)

public final class BatchTranslateTextRequest extends GeneratedMessageV3 implements BatchTranslateTextRequestOrBuilder

The batch translation request.

Protobuf type google.cloud.translation.v3.BatchTranslateTextRequest

Static Fields

GLOSSARIES_FIELD_NUMBER

public static final int GLOSSARIES_FIELD_NUMBER
Field Value
TypeDescription
int

INPUT_CONFIGS_FIELD_NUMBER

public static final int INPUT_CONFIGS_FIELD_NUMBER
Field Value
TypeDescription
int

LABELS_FIELD_NUMBER

public static final int LABELS_FIELD_NUMBER
Field Value
TypeDescription
int

MODELS_FIELD_NUMBER

public static final int MODELS_FIELD_NUMBER
Field Value
TypeDescription
int

OUTPUT_CONFIG_FIELD_NUMBER

public static final int OUTPUT_CONFIG_FIELD_NUMBER
Field Value
TypeDescription
int

PARENT_FIELD_NUMBER

public static final int PARENT_FIELD_NUMBER
Field Value
TypeDescription
int

SOURCE_LANGUAGE_CODE_FIELD_NUMBER

public static final int SOURCE_LANGUAGE_CODE_FIELD_NUMBER
Field Value
TypeDescription
int

TARGET_LANGUAGE_CODES_FIELD_NUMBER

public static final int TARGET_LANGUAGE_CODES_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static BatchTranslateTextRequest getDefaultInstance()
Returns
TypeDescription
BatchTranslateTextRequest

getDescriptor()

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

newBuilder()

public static BatchTranslateTextRequest.Builder newBuilder()
Returns
TypeDescription
BatchTranslateTextRequest.Builder

newBuilder(BatchTranslateTextRequest prototype)

public static BatchTranslateTextRequest.Builder newBuilder(BatchTranslateTextRequest prototype)
Parameter
NameDescription
prototypeBatchTranslateTextRequest
Returns
TypeDescription
BatchTranslateTextRequest.Builder

parseDelimitedFrom(InputStream input)

public static BatchTranslateTextRequest parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
BatchTranslateTextRequest
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static BatchTranslateTextRequest parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BatchTranslateTextRequest
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static BatchTranslateTextRequest parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
BatchTranslateTextRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static BatchTranslateTextRequest parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BatchTranslateTextRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static BatchTranslateTextRequest parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
BatchTranslateTextRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static BatchTranslateTextRequest parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BatchTranslateTextRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static BatchTranslateTextRequest parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
BatchTranslateTextRequest
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static BatchTranslateTextRequest parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BatchTranslateTextRequest
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static BatchTranslateTextRequest parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
BatchTranslateTextRequest
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static BatchTranslateTextRequest parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BatchTranslateTextRequest
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static BatchTranslateTextRequest parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
BatchTranslateTextRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static BatchTranslateTextRequest parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BatchTranslateTextRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<BatchTranslateTextRequest> parser()
Returns
TypeDescription
Parser<BatchTranslateTextRequest>

Methods

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

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public BatchTranslateTextRequest getDefaultInstanceForType()
Returns
TypeDescription
BatchTranslateTextRequest

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

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

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.

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.

getParserForType()

public Parser<BatchTranslateTextRequest> getParserForType()
Returns
TypeDescription
Parser<BatchTranslateTextRequest>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

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.

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

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.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

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

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

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

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected BatchTranslateTextRequest.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
BatchTranslateTextRequest.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

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

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException