#[non_exhaustive]pub struct TranslateDocumentInput {
pub document: Option<Document>,
pub terminology_names: Option<Vec<String>>,
pub source_language_code: Option<String>,
pub target_language_code: Option<String>,
pub settings: Option<TranslationSettings>,
}
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.document: Option<Document>
The content and content type for the document to be translated. The document size must not exceed 100 KB.
terminology_names: Option<Vec<String>>
The name of a terminology list file to add to the translation job. This file provides source terms and the desired translation for each term. A terminology list can contain a maximum of 256 terms. You can use one custom terminology resource in your translation request.
Use the ListTerminologies
operation to get the available terminology lists.
For more information about custom terminology lists, see Custom terminology.
source_language_code: Option<String>
The language code for the language of the source text. For a list of supported language codes, see Supported languages.
To have Amazon Translate determine the source language of your text, you can specify auto
in the SourceLanguageCode
field. If you specify auto
, Amazon Translate will call Amazon Comprehend to determine the source language.
If you specify auto
, you must send the TranslateDocument
request in a region that supports Amazon Comprehend. Otherwise, the request returns an error indicating that autodetect is not supported.
target_language_code: Option<String>
The language code requested for the translated document. For a list of supported language codes, see Supported languages.
settings: Option<TranslationSettings>
Settings to configure your translation output. You can configure the following options:
-
Brevity: not supported.
-
Formality: sets the formality level of the output text.
-
Profanity: masks profane words and phrases in your translation output.
Implementations§
source§impl TranslateDocumentInput
impl TranslateDocumentInput
sourcepub fn document(&self) -> Option<&Document>
pub fn document(&self) -> Option<&Document>
The content and content type for the document to be translated. The document size must not exceed 100 KB.
sourcepub fn terminology_names(&self) -> &[String]
pub fn terminology_names(&self) -> &[String]
The name of a terminology list file to add to the translation job. This file provides source terms and the desired translation for each term. A terminology list can contain a maximum of 256 terms. You can use one custom terminology resource in your translation request.
Use the ListTerminologies
operation to get the available terminology lists.
For more information about custom terminology lists, see Custom terminology.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .terminology_names.is_none()
.
sourcepub fn source_language_code(&self) -> Option<&str>
pub fn source_language_code(&self) -> Option<&str>
The language code for the language of the source text. For a list of supported language codes, see Supported languages.
To have Amazon Translate determine the source language of your text, you can specify auto
in the SourceLanguageCode
field. If you specify auto
, Amazon Translate will call Amazon Comprehend to determine the source language.
If you specify auto
, you must send the TranslateDocument
request in a region that supports Amazon Comprehend. Otherwise, the request returns an error indicating that autodetect is not supported.
sourcepub fn target_language_code(&self) -> Option<&str>
pub fn target_language_code(&self) -> Option<&str>
The language code requested for the translated document. For a list of supported language codes, see Supported languages.
sourcepub fn settings(&self) -> Option<&TranslationSettings>
pub fn settings(&self) -> Option<&TranslationSettings>
Settings to configure your translation output. You can configure the following options:
-
Brevity: not supported.
-
Formality: sets the formality level of the output text.
-
Profanity: masks profane words and phrases in your translation output.
source§impl TranslateDocumentInput
impl TranslateDocumentInput
sourcepub fn builder() -> TranslateDocumentInputBuilder
pub fn builder() -> TranslateDocumentInputBuilder
Creates a new builder-style object to manufacture TranslateDocumentInput
.
Trait Implementations§
source§impl Clone for TranslateDocumentInput
impl Clone for TranslateDocumentInput
source§fn clone(&self) -> TranslateDocumentInput
fn clone(&self) -> TranslateDocumentInput
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TranslateDocumentInput
impl Debug for TranslateDocumentInput
source§impl PartialEq for TranslateDocumentInput
impl PartialEq for TranslateDocumentInput
source§fn eq(&self, other: &TranslateDocumentInput) -> bool
fn eq(&self, other: &TranslateDocumentInput) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for TranslateDocumentInput
Auto Trait Implementations§
impl Freeze for TranslateDocumentInput
impl RefUnwindSafe for TranslateDocumentInput
impl Send for TranslateDocumentInput
impl Sync for TranslateDocumentInput
impl Unpin for TranslateDocumentInput
impl UnwindSafe for TranslateDocumentInput
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more