public static final class TranslateTextRequest.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<TranslateTextRequest.Builder> implements TranslateTextRequestOrBuilder
The request message for synchronous translation.Protobuf type
google.cloud.translation.v3beta1.TranslateTextRequestgetAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<TranslateTextRequest.Builder>public TranslateTextRequest.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessageV3.Builder<TranslateTextRequest.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<TranslateTextRequest.Builder>public TranslateTextRequest getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic TranslateTextRequest build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic TranslateTextRequest buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic TranslateTextRequest.Builder clone()
clone in interface com.google.protobuf.Message.Builderclone in interface com.google.protobuf.MessageLite.Builderclone in class com.google.protobuf.GeneratedMessageV3.Builder<TranslateTextRequest.Builder>public TranslateTextRequest.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField in interface com.google.protobuf.Message.BuildersetField in class com.google.protobuf.GeneratedMessageV3.Builder<TranslateTextRequest.Builder>public TranslateTextRequest.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField in interface com.google.protobuf.Message.BuilderclearField in class com.google.protobuf.GeneratedMessageV3.Builder<TranslateTextRequest.Builder>public TranslateTextRequest.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof in interface com.google.protobuf.Message.BuilderclearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<TranslateTextRequest.Builder>public TranslateTextRequest.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField in interface com.google.protobuf.Message.BuildersetRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<TranslateTextRequest.Builder>public TranslateTextRequest.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField in interface com.google.protobuf.Message.BuilderaddRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<TranslateTextRequest.Builder>public TranslateTextRequest.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<TranslateTextRequest.Builder>public TranslateTextRequest.Builder mergeFrom(TranslateTextRequest other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<TranslateTextRequest.Builder>public TranslateTextRequest.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<TranslateTextRequest.Builder>IOExceptionpublic com.google.protobuf.ProtocolStringList getContentsList()
Required. The content of the input in string format. We recommend the total content be less than 30k codepoints. Use BatchTranslateText for larger text.
repeated string contents = 1;getContentsList in interface TranslateTextRequestOrBuilderpublic int getContentsCount()
Required. The content of the input in string format. We recommend the total content be less than 30k codepoints. Use BatchTranslateText for larger text.
repeated string contents = 1;getContentsCount in interface TranslateTextRequestOrBuilderpublic String getContents(int index)
Required. The content of the input in string format. We recommend the total content be less than 30k codepoints. Use BatchTranslateText for larger text.
repeated string contents = 1;getContents in interface TranslateTextRequestOrBuilderpublic com.google.protobuf.ByteString getContentsBytes(int index)
Required. The content of the input in string format. We recommend the total content be less than 30k codepoints. Use BatchTranslateText for larger text.
repeated string contents = 1;getContentsBytes in interface TranslateTextRequestOrBuilderpublic TranslateTextRequest.Builder setContents(int index, String value)
Required. The content of the input in string format. We recommend the total content be less than 30k codepoints. Use BatchTranslateText for larger text.
repeated string contents = 1;public TranslateTextRequest.Builder addContents(String value)
Required. The content of the input in string format. We recommend the total content be less than 30k codepoints. Use BatchTranslateText for larger text.
repeated string contents = 1;public TranslateTextRequest.Builder addAllContents(Iterable<String> values)
Required. The content of the input in string format. We recommend the total content be less than 30k codepoints. Use BatchTranslateText for larger text.
repeated string contents = 1;public TranslateTextRequest.Builder clearContents()
Required. The content of the input in string format. We recommend the total content be less than 30k codepoints. Use BatchTranslateText for larger text.
repeated string contents = 1;public TranslateTextRequest.Builder addContentsBytes(com.google.protobuf.ByteString value)
Required. The content of the input in string format. We recommend the total content be less than 30k codepoints. Use BatchTranslateText for larger text.
repeated string contents = 1;public String getMimeType()
Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".
string mime_type = 3;getMimeType in interface TranslateTextRequestOrBuilderpublic com.google.protobuf.ByteString getMimeTypeBytes()
Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".
string mime_type = 3;getMimeTypeBytes in interface TranslateTextRequestOrBuilderpublic TranslateTextRequest.Builder setMimeType(String value)
Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".
string mime_type = 3;public TranslateTextRequest.Builder clearMimeType()
Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".
string mime_type = 3;public TranslateTextRequest.Builder setMimeTypeBytes(com.google.protobuf.ByteString value)
Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".
string mime_type = 3;public String getSourceLanguageCode()
Optional. The BCP-47 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response.
string source_language_code = 4;getSourceLanguageCode in interface TranslateTextRequestOrBuilderpublic com.google.protobuf.ByteString getSourceLanguageCodeBytes()
Optional. The BCP-47 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response.
string source_language_code = 4;getSourceLanguageCodeBytes in interface TranslateTextRequestOrBuilderpublic TranslateTextRequest.Builder setSourceLanguageCode(String value)
Optional. The BCP-47 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response.
string source_language_code = 4;public TranslateTextRequest.Builder clearSourceLanguageCode()
Optional. The BCP-47 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response.
string source_language_code = 4;public TranslateTextRequest.Builder setSourceLanguageCodeBytes(com.google.protobuf.ByteString value)
Optional. The BCP-47 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response.
string source_language_code = 4;public String getTargetLanguageCode()
Required. The BCP-47 language code to use for translation of the input text, set to one of the language codes listed in Language Support.
string target_language_code = 5;getTargetLanguageCode in interface TranslateTextRequestOrBuilderpublic com.google.protobuf.ByteString getTargetLanguageCodeBytes()
Required. The BCP-47 language code to use for translation of the input text, set to one of the language codes listed in Language Support.
string target_language_code = 5;getTargetLanguageCodeBytes in interface TranslateTextRequestOrBuilderpublic TranslateTextRequest.Builder setTargetLanguageCode(String value)
Required. The BCP-47 language code to use for translation of the input text, set to one of the language codes listed in Language Support.
string target_language_code = 5;public TranslateTextRequest.Builder clearTargetLanguageCode()
Required. The BCP-47 language code to use for translation of the input text, set to one of the language codes listed in Language Support.
string target_language_code = 5;public TranslateTextRequest.Builder setTargetLanguageCodeBytes(com.google.protobuf.ByteString value)
Required. The BCP-47 language code to use for translation of the input text, set to one of the language codes listed in Language Support.
string target_language_code = 5;public String getParent()
Required. Location to make a regional or global call.
Format: `projects/{project-id}/locations/{location-id}`.
For global calls, use `projects/{project-id}/locations/global`.
Models and glossaries must be within the same region (have same
location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
string parent = 8;getParent in interface TranslateTextRequestOrBuilderpublic com.google.protobuf.ByteString getParentBytes()
Required. Location to make a regional or global call.
Format: `projects/{project-id}/locations/{location-id}`.
For global calls, use `projects/{project-id}/locations/global`.
Models and glossaries must be within the same region (have same
location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
string parent = 8;getParentBytes in interface TranslateTextRequestOrBuilderpublic TranslateTextRequest.Builder setParent(String value)
Required. Location to make a regional or global call.
Format: `projects/{project-id}/locations/{location-id}`.
For global calls, use `projects/{project-id}/locations/global`.
Models and glossaries must be within the same region (have same
location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
string parent = 8;public TranslateTextRequest.Builder clearParent()
Required. Location to make a regional or global call.
Format: `projects/{project-id}/locations/{location-id}`.
For global calls, use `projects/{project-id}/locations/global`.
Models and glossaries must be within the same region (have same
location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
string parent = 8;public TranslateTextRequest.Builder setParentBytes(com.google.protobuf.ByteString value)
Required. Location to make a regional or global call.
Format: `projects/{project-id}/locations/{location-id}`.
For global calls, use `projects/{project-id}/locations/global`.
Models and glossaries must be within the same region (have same
location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
string parent = 8;public String getModel()
Optional. The `model` type requested for this translation.
The format depends on model type:
- AutoML Translation models:
`projects/{project-id}/locations/{location-id}/models/{model-id}`
- General (built-in) models:
`projects/{project-id}/locations/{location-id}/models/general/nmt`,
`projects/{project-id}/locations/{location-id}/models/general/base`
For global (non-regionalized) requests, use `location-id` `global`.
For example,
`projects/{project-id}/locations/global/models/general/nmt`.
If missing, the system decides which google base model to use.
string model = 6;getModel in interface TranslateTextRequestOrBuilderpublic com.google.protobuf.ByteString getModelBytes()
Optional. The `model` type requested for this translation.
The format depends on model type:
- AutoML Translation models:
`projects/{project-id}/locations/{location-id}/models/{model-id}`
- General (built-in) models:
`projects/{project-id}/locations/{location-id}/models/general/nmt`,
`projects/{project-id}/locations/{location-id}/models/general/base`
For global (non-regionalized) requests, use `location-id` `global`.
For example,
`projects/{project-id}/locations/global/models/general/nmt`.
If missing, the system decides which google base model to use.
string model = 6;getModelBytes in interface TranslateTextRequestOrBuilderpublic TranslateTextRequest.Builder setModel(String value)
Optional. The `model` type requested for this translation.
The format depends on model type:
- AutoML Translation models:
`projects/{project-id}/locations/{location-id}/models/{model-id}`
- General (built-in) models:
`projects/{project-id}/locations/{location-id}/models/general/nmt`,
`projects/{project-id}/locations/{location-id}/models/general/base`
For global (non-regionalized) requests, use `location-id` `global`.
For example,
`projects/{project-id}/locations/global/models/general/nmt`.
If missing, the system decides which google base model to use.
string model = 6;public TranslateTextRequest.Builder clearModel()
Optional. The `model` type requested for this translation.
The format depends on model type:
- AutoML Translation models:
`projects/{project-id}/locations/{location-id}/models/{model-id}`
- General (built-in) models:
`projects/{project-id}/locations/{location-id}/models/general/nmt`,
`projects/{project-id}/locations/{location-id}/models/general/base`
For global (non-regionalized) requests, use `location-id` `global`.
For example,
`projects/{project-id}/locations/global/models/general/nmt`.
If missing, the system decides which google base model to use.
string model = 6;public TranslateTextRequest.Builder setModelBytes(com.google.protobuf.ByteString value)
Optional. The `model` type requested for this translation.
The format depends on model type:
- AutoML Translation models:
`projects/{project-id}/locations/{location-id}/models/{model-id}`
- General (built-in) models:
`projects/{project-id}/locations/{location-id}/models/general/nmt`,
`projects/{project-id}/locations/{location-id}/models/general/base`
For global (non-regionalized) requests, use `location-id` `global`.
For example,
`projects/{project-id}/locations/global/models/general/nmt`.
If missing, the system decides which google base model to use.
string model = 6;public boolean hasGlossaryConfig()
Optional. Glossary to be applied. The glossary must be within the same region (have the same location-id) as the model, otherwise an INVALID_ARGUMENT (400) error is returned.
.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7;
hasGlossaryConfig in interface TranslateTextRequestOrBuilderpublic TranslateTextGlossaryConfig getGlossaryConfig()
Optional. Glossary to be applied. The glossary must be within the same region (have the same location-id) as the model, otherwise an INVALID_ARGUMENT (400) error is returned.
.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7;
getGlossaryConfig in interface TranslateTextRequestOrBuilderpublic TranslateTextRequest.Builder setGlossaryConfig(TranslateTextGlossaryConfig value)
Optional. Glossary to be applied. The glossary must be within the same region (have the same location-id) as the model, otherwise an INVALID_ARGUMENT (400) error is returned.
.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7;
public TranslateTextRequest.Builder setGlossaryConfig(TranslateTextGlossaryConfig.Builder builderForValue)
Optional. Glossary to be applied. The glossary must be within the same region (have the same location-id) as the model, otherwise an INVALID_ARGUMENT (400) error is returned.
.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7;
public TranslateTextRequest.Builder mergeGlossaryConfig(TranslateTextGlossaryConfig value)
Optional. Glossary to be applied. The glossary must be within the same region (have the same location-id) as the model, otherwise an INVALID_ARGUMENT (400) error is returned.
.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7;
public TranslateTextRequest.Builder clearGlossaryConfig()
Optional. Glossary to be applied. The glossary must be within the same region (have the same location-id) as the model, otherwise an INVALID_ARGUMENT (400) error is returned.
.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7;
public TranslateTextGlossaryConfig.Builder getGlossaryConfigBuilder()
Optional. Glossary to be applied. The glossary must be within the same region (have the same location-id) as the model, otherwise an INVALID_ARGUMENT (400) error is returned.
.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7;
public TranslateTextGlossaryConfigOrBuilder getGlossaryConfigOrBuilder()
Optional. Glossary to be applied. The glossary must be within the same region (have the same location-id) as the model, otherwise an INVALID_ARGUMENT (400) error is returned.
.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 7;
getGlossaryConfigOrBuilder in interface TranslateTextRequestOrBuilderpublic final TranslateTextRequest.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields in interface com.google.protobuf.Message.BuildersetUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<TranslateTextRequest.Builder>public final TranslateTextRequest.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields in interface com.google.protobuf.Message.BuildermergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<TranslateTextRequest.Builder>Copyright © 2019 Google LLC. All rights reserved.