Struct aws_sdk_translate::Client
source · pub struct Client { /* private fields */ }
Expand description
Client for Amazon Translate
Client for invoking operations on Amazon Translate. Each operation on Amazon Translate is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
§Constructing a Client
A Config
is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env()
, since this will resolve an SdkConfig
which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env()
instead, which returns a ConfigLoader
that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_translate::Client::new(&config);
Occasionally, SDKs may have additional service-specific values that can be set on the Config
that
is absent from SdkConfig
, or slightly different settings for a specific client may be desired.
The Config
struct implements From<&SdkConfig>
, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_translate::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();
See the aws-config
docs and Config
for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
§Using the Client
A client has a function for every operation that can be performed by the service.
For example, the CreateParallelData
operation has
a Client::create_parallel_data
, function which returns a builder for that operation.
The fluent builder ultimately has a send()
function that returns an async future that
returns a result, as illustrated below:
let result = client.create_parallel_data()
.name("example")
.send()
.await;
The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize
module for more
information.
Implementations§
source§impl Client
impl Client
sourcepub fn create_parallel_data(&self) -> CreateParallelDataFluentBuilder
pub fn create_parallel_data(&self) -> CreateParallelDataFluentBuilder
Constructs a fluent builder for the CreateParallelData
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueA custom name for the parallel data resource in Amazon Translate. You must assign a name that is unique in the account and region.
description(impl Into<String>)
/set_description(Option<String>)
:
required: falseA custom description for the parallel data resource in Amazon Translate.
parallel_data_config(ParallelDataConfig)
/set_parallel_data_config(Option<ParallelDataConfig>)
:
required: trueSpecifies the format and S3 location of the parallel data input file.
encryption_key(EncryptionKey)
/set_encryption_key(Option<EncryptionKey>)
:
required: falseThe encryption key used to encrypt this object.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: trueA unique identifier for the request. This token is automatically generated when you use Amazon Translate through an AWS SDK.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: falseTags to be associated with this resource. A tag is a key-value pair that adds metadata to a resource. Each tag key for the resource must be unique. For more information, see Tagging your resources.
- On success, responds with
CreateParallelDataOutput
with field(s):name(Option<String>)
:The custom name that you assigned to the parallel data resource.
status(Option<ParallelDataStatus>)
:The status of the parallel data resource. When the resource is ready for you to use, the status is
ACTIVE
.
- On failure, responds with
SdkError<CreateParallelDataError>
source§impl Client
impl Client
sourcepub fn delete_parallel_data(&self) -> DeleteParallelDataFluentBuilder
pub fn delete_parallel_data(&self) -> DeleteParallelDataFluentBuilder
Constructs a fluent builder for the DeleteParallelData
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe name of the parallel data resource that is being deleted.
- On success, responds with
DeleteParallelDataOutput
with field(s):name(Option<String>)
:The name of the parallel data resource that is being deleted.
status(Option<ParallelDataStatus>)
:The status of the parallel data deletion.
- On failure, responds with
SdkError<DeleteParallelDataError>
source§impl Client
impl Client
sourcepub fn delete_terminology(&self) -> DeleteTerminologyFluentBuilder
pub fn delete_terminology(&self) -> DeleteTerminologyFluentBuilder
Constructs a fluent builder for the DeleteTerminology
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe name of the custom terminology being deleted.
- On success, responds with
DeleteTerminologyOutput
- On failure, responds with
SdkError<DeleteTerminologyError>
source§impl Client
impl Client
sourcepub fn describe_text_translation_job(
&self
) -> DescribeTextTranslationJobFluentBuilder
pub fn describe_text_translation_job( &self ) -> DescribeTextTranslationJobFluentBuilder
Constructs a fluent builder for the DescribeTextTranslationJob
operation.
- The fluent builder is configurable:
job_id(impl Into<String>)
/set_job_id(Option<String>)
:
required: trueThe identifier that Amazon Translate generated for the job. The
StartTextTranslationJob
operation returns this identifier in its response.
- On success, responds with
DescribeTextTranslationJobOutput
with field(s):text_translation_job_properties(Option<TextTranslationJobProperties>)
:An object that contains the properties associated with an asynchronous batch translation job.
- On failure, responds with
SdkError<DescribeTextTranslationJobError>
source§impl Client
impl Client
sourcepub fn get_parallel_data(&self) -> GetParallelDataFluentBuilder
pub fn get_parallel_data(&self) -> GetParallelDataFluentBuilder
Constructs a fluent builder for the GetParallelData
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe name of the parallel data resource that is being retrieved.
- On success, responds with
GetParallelDataOutput
with field(s):parallel_data_properties(Option<ParallelDataProperties>)
:The properties of the parallel data resource that is being retrieved.
data_location(Option<ParallelDataDataLocation>)
:The Amazon S3 location of the most recent parallel data input file that was successfully imported into Amazon Translate. The location is returned as a presigned URL that has a 30-minute expiration.
Amazon Translate doesn’t scan all input files for the risk of CSV injection attacks.
CSV injection occurs when a .csv or .tsv file is altered so that a record contains malicious code. The record begins with a special character, such as =, +, -, or @. When the file is opened in a spreadsheet program, the program might interpret the record as a formula and run the code within it.
Before you download an input file from Amazon S3, ensure that you recognize the file and trust its creator.
auxiliary_data_location(Option<ParallelDataDataLocation>)
:The Amazon S3 location of a file that provides any errors or warnings that were produced by your input file. This file was created when Amazon Translate attempted to create a parallel data resource. The location is returned as a presigned URL to that has a 30-minute expiration.
latest_update_attempt_auxiliary_data_location(Option<ParallelDataDataLocation>)
:The Amazon S3 location of a file that provides any errors or warnings that were produced by your input file. This file was created when Amazon Translate attempted to update a parallel data resource. The location is returned as a presigned URL to that has a 30-minute expiration.
- On failure, responds with
SdkError<GetParallelDataError>
source§impl Client
impl Client
sourcepub fn get_terminology(&self) -> GetTerminologyFluentBuilder
pub fn get_terminology(&self) -> GetTerminologyFluentBuilder
Constructs a fluent builder for the GetTerminology
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe name of the custom terminology being retrieved.
terminology_data_format(TerminologyDataFormat)
/set_terminology_data_format(Option<TerminologyDataFormat>)
:
required: falseThe data format of the custom terminology being retrieved.
If you don’t specify this parameter, Amazon Translate returns a file with the same format as the file that was imported to create the terminology.
If you specify this parameter when you retrieve a multi-directional terminology resource, you must specify the same format as the input file that was imported to create it. Otherwise, Amazon Translate throws an error.
- On success, responds with
GetTerminologyOutput
with field(s):terminology_properties(Option<TerminologyProperties>)
:The properties of the custom terminology being retrieved.
terminology_data_location(Option<TerminologyDataLocation>)
:The Amazon S3 location of the most recent custom terminology input file that was successfully imported into Amazon Translate. The location is returned as a presigned URL that has a 30-minute expiration.
Amazon Translate doesn’t scan all input files for the risk of CSV injection attacks.
CSV injection occurs when a .csv or .tsv file is altered so that a record contains malicious code. The record begins with a special character, such as =, +, -, or @. When the file is opened in a spreadsheet program, the program might interpret the record as a formula and run the code within it.
Before you download an input file from Amazon S3, ensure that you recognize the file and trust its creator.
auxiliary_data_location(Option<TerminologyDataLocation>)
:The Amazon S3 location of a file that provides any errors or warnings that were produced by your input file. This file was created when Amazon Translate attempted to create a terminology resource. The location is returned as a presigned URL to that has a 30-minute expiration.
- On failure, responds with
SdkError<GetTerminologyError>
source§impl Client
impl Client
sourcepub fn import_terminology(&self) -> ImportTerminologyFluentBuilder
pub fn import_terminology(&self) -> ImportTerminologyFluentBuilder
Constructs a fluent builder for the ImportTerminology
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe name of the custom terminology being imported.
merge_strategy(MergeStrategy)
/set_merge_strategy(Option<MergeStrategy>)
:
required: trueThe merge strategy of the custom terminology being imported. Currently, only the OVERWRITE merge strategy is supported. In this case, the imported terminology will overwrite an existing terminology of the same name.
description(impl Into<String>)
/set_description(Option<String>)
:
required: falseThe description of the custom terminology being imported.
terminology_data(TerminologyData)
/set_terminology_data(Option<TerminologyData>)
:
required: trueThe terminology data for the custom terminology being imported.
encryption_key(EncryptionKey)
/set_encryption_key(Option<EncryptionKey>)
:
required: falseThe encryption key for the custom terminology being imported.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: falseTags to be associated with this resource. A tag is a key-value pair that adds metadata to a resource. Each tag key for the resource must be unique. For more information, see Tagging your resources.
- On success, responds with
ImportTerminologyOutput
with field(s):terminology_properties(Option<TerminologyProperties>)
:The properties of the custom terminology being imported.
auxiliary_data_location(Option<TerminologyDataLocation>)
:The Amazon S3 location of a file that provides any errors or warnings that were produced by your input file. This file was created when Amazon Translate attempted to create a terminology resource. The location is returned as a presigned URL to that has a 30 minute expiration.
- On failure, responds with
SdkError<ImportTerminologyError>
source§impl Client
impl Client
sourcepub fn list_languages(&self) -> ListLanguagesFluentBuilder
pub fn list_languages(&self) -> ListLanguagesFluentBuilder
Constructs a fluent builder for the ListLanguages
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
display_language_code(DisplayLanguageCode)
/set_display_language_code(Option<DisplayLanguageCode>)
:
required: falseThe language code for the language to use to display the language names in the response. The language code is
en
by default.next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseInclude the NextToken value to fetch the next group of supported languages.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return in each response.
- On success, responds with
ListLanguagesOutput
with field(s):languages(Option<Vec::<Language>>)
:The list of supported languages.
display_language_code(Option<DisplayLanguageCode>)
:The language code passed in with the request.
next_token(Option<String>)
:If the response does not include all remaining results, use the NextToken in the next request to fetch the next group of supported languages.
- On failure, responds with
SdkError<ListLanguagesError>
source§impl Client
impl Client
sourcepub fn list_parallel_data(&self) -> ListParallelDataFluentBuilder
pub fn list_parallel_data(&self) -> ListParallelDataFluentBuilder
Constructs a fluent builder for the ListParallelData
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseA string that specifies the next page of results to return in a paginated response.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of parallel data resources returned for each request.
- On success, responds with
ListParallelDataOutput
with field(s):parallel_data_properties_list(Option<Vec::<ParallelDataProperties>>)
:The properties of the parallel data resources returned by this request.
next_token(Option<String>)
:The string to use in a subsequent request to get the next page of results in a paginated response. This value is null if there are no additional pages.
- On failure, responds with
SdkError<ListParallelDataError>
source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the given Amazon Translate resource you are querying.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<Vec::<Tag>>)
:Tags associated with the Amazon Translate resource being queried. A tag is a key-value pair that adds as a metadata to a resource used by Amazon Translate. For example, a tag with “Sales” as the key might be added to a resource to indicate its use by the sales department.
- On failure, responds with
SdkError<ListTagsForResourceError>
source§impl Client
impl Client
sourcepub fn list_terminologies(&self) -> ListTerminologiesFluentBuilder
pub fn list_terminologies(&self) -> ListTerminologiesFluentBuilder
Constructs a fluent builder for the ListTerminologies
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseIf the result of the request to ListTerminologies was truncated, include the NextToken to fetch the next group of custom terminologies.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of custom terminologies returned per list request.
- On success, responds with
ListTerminologiesOutput
with field(s):terminology_properties_list(Option<Vec::<TerminologyProperties>>)
:The properties list of the custom terminologies returned on the list request.
next_token(Option<String>)
:If the response to the ListTerminologies was truncated, the NextToken fetches the next group of custom terminologies.
- On failure, responds with
SdkError<ListTerminologiesError>
source§impl Client
impl Client
sourcepub fn list_text_translation_jobs(&self) -> ListTextTranslationJobsFluentBuilder
pub fn list_text_translation_jobs(&self) -> ListTextTranslationJobsFluentBuilder
Constructs a fluent builder for the ListTextTranslationJobs
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
filter(TextTranslationJobFilter)
/set_filter(Option<TextTranslationJobFilter>)
:
required: falseThe parameters that specify which batch translation jobs to retrieve. Filters include job name, job status, and submission time. You can only set one filter at a time.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to request the next page of results.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return in each page. The default value is 100.
- On success, responds with
ListTextTranslationJobsOutput
with field(s):text_translation_job_properties_list(Option<Vec::<TextTranslationJobProperties>>)
:A list containing the properties of each job that is returned.
next_token(Option<String>)
:The token to use to retrieve the next page of results. This value is
null
when there are no more results to return.
- On failure, responds with
SdkError<ListTextTranslationJobsError>
source§impl Client
impl Client
sourcepub fn start_text_translation_job(&self) -> StartTextTranslationJobFluentBuilder
pub fn start_text_translation_job(&self) -> StartTextTranslationJobFluentBuilder
Constructs a fluent builder for the StartTextTranslationJob
operation.
- The fluent builder is configurable:
job_name(impl Into<String>)
/set_job_name(Option<String>)
:
required: falseThe name of the batch translation job to be performed.
input_data_config(InputDataConfig)
/set_input_data_config(Option<InputDataConfig>)
:
required: trueSpecifies the format and location of the input documents for the translation job.
output_data_config(OutputDataConfig)
/set_output_data_config(Option<OutputDataConfig>)
:
required: trueSpecifies the S3 folder to which your job output will be saved.
data_access_role_arn(impl Into<String>)
/set_data_access_role_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) role that grants Amazon Translate read access to your input data. For more information, see Identity and access management .
source_language_code(impl Into<String>)
/set_source_language_code(Option<String>)
:
required: trueThe language code of the input language. Specify the language if all input documents share the same language. If you don’t know the language of the source files, or your input documents contains different source languages, select
auto
. Amazon Translate auto detects the source language for each input document. For a list of supported language codes, see Supported languages.target_language_codes(impl Into<String>)
/set_target_language_codes(Option<Vec::<String>>)
:
required: trueThe target languages of the translation job. Enter up to 10 language codes. Each input file is translated into each target language.
Each language code is 2 or 5 characters long. For a list of language codes, see Supported languages.
terminology_names(impl Into<String>)
/set_terminology_names(Option<Vec::<String>>)
:
required: falseThe name of a custom terminology resource to add to the translation job. This resource lists examples source terms and the desired translation for each term.
This parameter accepts only one custom terminology resource.
If you specify multiple target languages for the job, translate uses the designated terminology for each requested target language that has an entry for the source term in the terminology file.
For a list of available custom terminology resources, use the
ListTerminologies
operation.For more information, see Custom terminology.
parallel_data_names(impl Into<String>)
/set_parallel_data_names(Option<Vec::<String>>)
:
required: falseThe name of a parallel data resource to add to the translation job. This resource consists of examples that show how you want segments of text to be translated. If you specify multiple target languages for the job, the parallel data file must include translations for all the target languages.
When you add parallel data to a translation job, you create an Active Custom Translation job.
This parameter accepts only one parallel data resource.
Active Custom Translation jobs are priced at a higher rate than other jobs that don’t use parallel data. For more information, see Amazon Translate pricing.
For a list of available parallel data resources, use the
ListParallelData
operation.For more information, see Customizing your translations with parallel data.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: trueA unique identifier for the request. This token is generated for you when using the Amazon Translate SDK.
settings(TranslationSettings)
/set_settings(Option<TranslationSettings>)
:
required: falseSettings 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.
-
- On success, responds with
StartTextTranslationJobOutput
with field(s):job_id(Option<String>)
:The identifier generated for the job. To get the status of a job, use this ID with the
DescribeTextTranslationJob
operation.job_status(Option<JobStatus>)
:The status of the job. Possible values include:
-
SUBMITTED
- The job has been received and is queued for processing. -
IN_PROGRESS
- Amazon Translate is processing the job. -
COMPLETED
- The job was successfully completed and the output is available. -
COMPLETED_WITH_ERROR
- The job was completed with errors. The errors can be analyzed in the job’s output. -
FAILED
- The job did not complete. To get details, use theDescribeTextTranslationJob
operation. -
STOP_REQUESTED
- The user who started the job has requested that it be stopped. -
STOPPED
- The job has been stopped.
-
- On failure, responds with
SdkError<StartTextTranslationJobError>
source§impl Client
impl Client
sourcepub fn stop_text_translation_job(&self) -> StopTextTranslationJobFluentBuilder
pub fn stop_text_translation_job(&self) -> StopTextTranslationJobFluentBuilder
Constructs a fluent builder for the StopTextTranslationJob
operation.
- The fluent builder is configurable:
job_id(impl Into<String>)
/set_job_id(Option<String>)
:
required: trueThe job ID of the job to be stopped.
- On success, responds with
StopTextTranslationJobOutput
with field(s):job_id(Option<String>)
:The job ID of the stopped batch translation job.
job_status(Option<JobStatus>)
:The status of the designated job. Upon successful completion, the job’s status will be
STOPPED
.
- On failure, responds with
SdkError<StopTextTranslationJobError>
source§impl Client
impl Client
sourcepub fn tag_resource(&self) -> TagResourceFluentBuilder
pub fn tag_resource(&self) -> TagResourceFluentBuilder
Constructs a fluent builder for the TagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the given Amazon Translate resource to which you want to associate the tags.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: trueTags being associated with a specific Amazon Translate resource. There can be a maximum of 50 tags (both existing and pending) associated with a specific resource.
- On success, responds with
TagResourceOutput
- On failure, responds with
SdkError<TagResourceError>
source§impl Client
impl Client
sourcepub fn translate_document(&self) -> TranslateDocumentFluentBuilder
pub fn translate_document(&self) -> TranslateDocumentFluentBuilder
Constructs a fluent builder for the TranslateDocument
operation.
- The fluent builder is configurable:
document(Document)
/set_document(Option<Document>)
:
required: trueThe content and content type for the document to be translated. The document size must not exceed 100 KB.
terminology_names(impl Into<String>)
/set_terminology_names(Option<Vec::<String>>)
:
required: falseThe 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(impl Into<String>)
/set_source_language_code(Option<String>)
:
required: trueThe 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 theSourceLanguageCode
field. If you specifyauto
, Amazon Translate will call Amazon Comprehend to determine the source language.If you specify
auto
, you must send theTranslateDocument
request in a region that supports Amazon Comprehend. Otherwise, the request returns an error indicating that autodetect is not supported.target_language_code(impl Into<String>)
/set_target_language_code(Option<String>)
:
required: trueThe language code requested for the translated document. For a list of supported language codes, see Supported languages.
settings(TranslationSettings)
/set_settings(Option<TranslationSettings>)
:
required: falseSettings 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.
-
- On success, responds with
TranslateDocumentOutput
with field(s):translated_document(Option<TranslatedDocument>)
:The document containing the translated content. The document format matches the source document format.
source_language_code(String)
:The language code of the source document.
target_language_code(String)
:The language code of the translated document.
applied_terminologies(Option<Vec::<AppliedTerminology>>)
:The names of the custom terminologies applied to the input text by Amazon Translate to produce the translated text document.
applied_settings(Option<TranslationSettings>)
:Settings to configure your translation output. You can configure the following options:
-
Brevity: reduces the length of the translation output for most translations. Available for
TranslateText
only. -
Formality: sets the formality level of the translation output.
-
Profanity: masks profane words and phrases in the translation output.
-
- On failure, responds with
SdkError<TranslateDocumentError>
source§impl Client
impl Client
sourcepub fn translate_text(&self) -> TranslateTextFluentBuilder
pub fn translate_text(&self) -> TranslateTextFluentBuilder
Constructs a fluent builder for the TranslateText
operation.
- The fluent builder is configurable:
text(impl Into<String>)
/set_text(Option<String>)
:
required: trueThe text to translate. The text string can be a maximum of 10,000 bytes long. Depending on your character set, this may be fewer than 10,000 characters.
terminology_names(impl Into<String>)
/set_terminology_names(Option<Vec::<String>>)
:
required: falseThe 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(impl Into<String>)
/set_source_language_code(Option<String>)
:
required: trueThe language code for the language of the source text. For a list of language codes, see Supported languages.
To have Amazon Translate determine the source language of your text, you can specify
auto
in theSourceLanguageCode
field. If you specifyauto
, Amazon Translate will call Amazon Comprehend to determine the source language.If you specify
auto
, you must send theTranslateText
request in a region that supports Amazon Comprehend. Otherwise, the request returns an error indicating that autodetect is not supported.target_language_code(impl Into<String>)
/set_target_language_code(Option<String>)
:
required: trueThe language code requested for the language of the target text. For a list of language codes, see Supported languages.
settings(TranslationSettings)
/set_settings(Option<TranslationSettings>)
:
required: falseSettings to configure your translation output. You can configure the following options:
-
Brevity: reduces the length of the translated output for most translations.
-
Formality: sets the formality level of the output text.
-
Profanity: masks profane words and phrases in your translation output.
-
- On success, responds with
TranslateTextOutput
with field(s):translated_text(String)
:The translated text.
source_language_code(String)
:The language code for the language of the source text.
target_language_code(String)
:The language code for the language of the target text.
applied_terminologies(Option<Vec::<AppliedTerminology>>)
:The names of the custom terminologies applied to the input text by Amazon Translate for the translated text response.
applied_settings(Option<TranslationSettings>)
:Optional settings that modify the translation output.
- On failure, responds with
SdkError<TranslateTextError>
source§impl Client
impl Client
sourcepub fn untag_resource(&self) -> UntagResourceFluentBuilder
pub fn untag_resource(&self) -> UntagResourceFluentBuilder
Constructs a fluent builder for the UntagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the given Amazon Translate resource from which you want to remove the tags.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueThe initial part of a key-value pair that forms a tag being removed from a given resource. Keys must be unique and cannot be duplicated for a particular resource.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
source§impl Client
impl Client
sourcepub fn update_parallel_data(&self) -> UpdateParallelDataFluentBuilder
pub fn update_parallel_data(&self) -> UpdateParallelDataFluentBuilder
Constructs a fluent builder for the UpdateParallelData
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe name of the parallel data resource being updated.
description(impl Into<String>)
/set_description(Option<String>)
:
required: falseA custom description for the parallel data resource in Amazon Translate.
parallel_data_config(ParallelDataConfig)
/set_parallel_data_config(Option<ParallelDataConfig>)
:
required: trueSpecifies the format and S3 location of the parallel data input file.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: trueA unique identifier for the request. This token is automatically generated when you use Amazon Translate through an AWS SDK.
- On success, responds with
UpdateParallelDataOutput
with field(s):name(Option<String>)
:The name of the parallel data resource being updated.
status(Option<ParallelDataStatus>)
:The status of the parallel data resource that you are attempting to update. Your update request is accepted only if this status is either
ACTIVE
orFAILED
.latest_update_attempt_status(Option<ParallelDataStatus>)
:The status of the parallel data update attempt. When the updated parallel data resource is ready for you to use, the status is
ACTIVE
.latest_update_attempt_at(Option<DateTime>)
:The time that the most recent update was attempted.
- On failure, responds with
SdkError<UpdateParallelDataError>
source§impl Client
impl Client
sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
source§impl Client
impl Client
sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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