Struct googapis::google::cloud::translation::v3beta1::BatchTranslateDocumentRequest [−][src]
pub struct BatchTranslateDocumentRequest {
pub parent: String,
pub source_language_code: String,
pub target_language_codes: Vec<String>,
pub input_configs: Vec<BatchDocumentInputConfig>,
pub output_config: Option<BatchDocumentOutputConfig>,
pub models: HashMap<String, String>,
pub glossaries: HashMap<String, TranslateTextGlossaryConfig>,
pub format_conversions: HashMap<String, String>,
}
Expand description
The BatchTranslateDocument request.
Fields
parent: String
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.
source_language_code: String
Required. The BCP-47 language code of the input document if known, for example, “en-US” or “sr-Latn”. Supported language codes are listed in Language Support (https://cloud.google.com/translate/docs/languages).
target_language_codes: Vec<String>
Required. The BCP-47 language code to use for translation of the input document. Specify up to 10 language codes here.
input_configs: Vec<BatchDocumentInputConfig>
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.
output_config: Option<BatchDocumentOutputConfig>
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.
models: HashMap<String, String>
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.
glossaries: HashMap<String, TranslateTextGlossaryConfig>
Optional. Glossaries to be applied. It’s keyed by target language code.
format_conversions: HashMap<String, String>
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
toapplication/vnd.openxmlformats-officedocument.wordprocessingml.document
If nothing specified, output files will be in the same format as the original file.
Trait Implementations
fn merge_field<B>(
&mut self,
tag: u32,
wire_type: WireType,
buf: &mut B,
ctx: DecodeContext
) -> Result<(), DecodeError> where
B: Buf,
Returns the encoded length of the message without a length delimiter.
Encodes the message to a buffer. Read more
Encodes the message to a newly allocated buffer.
Encodes the message with a length-delimiter to a buffer. Read more
Encodes the message with a length-delimiter to a newly allocated buffer.
Decodes an instance of the message from a buffer. Read more
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
Self: Default,
B: Buf,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
Self: Default,
B: Buf,
Decodes a length-delimited instance of the message from the buffer.
Decodes an instance of the message from a buffer, and merges it into self
. Read more
Decodes a length-delimited instance of the message from buffer, and
merges it into self
. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl Send for BatchTranslateDocumentRequest
impl Sync for BatchTranslateDocumentRequest
impl Unpin for BatchTranslateDocumentRequest
impl UnwindSafe for BatchTranslateDocumentRequest
Blanket Implementations
Mutably borrows from an owned value. Read more
Wrap the input message T
in a tonic::Request
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more