Skip to content

TranslateClient#

Index > Translate > TranslateClient

Auto-generated documentation for Translate type annotations stubs module mypy-boto3-translate.

TranslateClient#

Type annotations and code completion for boto3.client("translate"). boto3 documentation

# TranslateClient usage example

from boto3.session import Session
from mypy_boto3_translate.client import TranslateClient

def get_translate_client() -> TranslateClient:
    return Session().client("translate")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("translate").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("translate")

try:
    do_something(client)
except (
    client.exceptions.ClientError,
    client.exceptions.ConcurrentModificationException,
    client.exceptions.ConflictException,
    client.exceptions.DetectedLanguageLowConfidenceException,
    client.exceptions.InternalServerException,
    client.exceptions.InvalidFilterException,
    client.exceptions.InvalidParameterValueException,
    client.exceptions.InvalidRequestException,
    client.exceptions.LimitExceededException,
    client.exceptions.ResourceNotFoundException,
    client.exceptions.ServiceUnavailableException,
    client.exceptions.TextSizeLimitExceededException,
    client.exceptions.TooManyRequestsException,
    client.exceptions.TooManyTagsException,
    client.exceptions.UnsupportedDisplayLanguageCodeException,
    client.exceptions.UnsupportedLanguagePairException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_translate.client import Exceptions

def handle_error(exc: Exceptions.ClientError) -> None:
    ...

Methods#

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("translate").can_paginate method. boto3 documentation

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close#

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("translate").close method. boto3 documentation

# close method definition

def close(
    self,
) -> None:
    ...

create_parallel_data#

Creates a parallel data resource in Amazon Translate by importing an input file from Amazon S3.

Type annotations and code completion for boto3.client("translate").create_parallel_data method. boto3 documentation

# create_parallel_data method definition

def create_parallel_data(
    self,
    *,
    Name: str,
    ParallelDataConfig: ParallelDataConfigTypeDef,  # (1)
    ClientToken: str,
    Description: str = ...,
    EncryptionKey: EncryptionKeyTypeDef = ...,  # (2)
    Tags: Sequence[TagTypeDef] = ...,  # (3)
) -> CreateParallelDataResponseTypeDef:  # (4)
    ...
  1. See ParallelDataConfigTypeDef
  2. See EncryptionKeyTypeDef
  3. See TagTypeDef
  4. See CreateParallelDataResponseTypeDef
# create_parallel_data method usage example with argument unpacking

kwargs: CreateParallelDataRequestRequestTypeDef = {  # (1)
    "Name": ...,
    "ParallelDataConfig": ...,
    "ClientToken": ...,
}

parent.create_parallel_data(**kwargs)
  1. See CreateParallelDataRequestRequestTypeDef

delete_parallel_data#

Deletes a parallel data resource in Amazon Translate.

Type annotations and code completion for boto3.client("translate").delete_parallel_data method. boto3 documentation

# delete_parallel_data method definition

def delete_parallel_data(
    self,
    *,
    Name: str,
) -> DeleteParallelDataResponseTypeDef:  # (1)
    ...
  1. See DeleteParallelDataResponseTypeDef
# delete_parallel_data method usage example with argument unpacking

kwargs: DeleteParallelDataRequestRequestTypeDef = {  # (1)
    "Name": ...,
}

parent.delete_parallel_data(**kwargs)
  1. See DeleteParallelDataRequestRequestTypeDef

delete_terminology#

A synchronous action that deletes a custom terminology.

Type annotations and code completion for boto3.client("translate").delete_terminology method. boto3 documentation

# delete_terminology method definition

def delete_terminology(
    self,
    *,
    Name: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_terminology method usage example with argument unpacking

kwargs: DeleteTerminologyRequestRequestTypeDef = {  # (1)
    "Name": ...,
}

parent.delete_terminology(**kwargs)
  1. See DeleteTerminologyRequestRequestTypeDef

describe_text_translation_job#

Gets the properties associated with an asynchronous batch translation job including name, ID, status, source and target languages, input/output S3 buckets, and so on.

Type annotations and code completion for boto3.client("translate").describe_text_translation_job method. boto3 documentation

# describe_text_translation_job method definition

def describe_text_translation_job(
    self,
    *,
    JobId: str,
) -> DescribeTextTranslationJobResponseTypeDef:  # (1)
    ...
  1. See DescribeTextTranslationJobResponseTypeDef
# describe_text_translation_job method usage example with argument unpacking

kwargs: DescribeTextTranslationJobRequestRequestTypeDef = {  # (1)
    "JobId": ...,
}

parent.describe_text_translation_job(**kwargs)
  1. See DescribeTextTranslationJobRequestRequestTypeDef

generate_presigned_url#

Generate a presigned url given a client, its method, and arguments.

Type annotations and code completion for boto3.client("translate").generate_presigned_url method. boto3 documentation

# generate_presigned_url method definition

def generate_presigned_url(
    self,
    ClientMethod: str,
    Params: Mapping[str, Any] = ...,
    ExpiresIn: int = 3600,
    HttpMethod: str = ...,
) -> str:
    ...

get_parallel_data#

Provides information about a parallel data resource.

Type annotations and code completion for boto3.client("translate").get_parallel_data method. boto3 documentation

# get_parallel_data method definition

def get_parallel_data(
    self,
    *,
    Name: str,
) -> GetParallelDataResponseTypeDef:  # (1)
    ...
  1. See GetParallelDataResponseTypeDef
# get_parallel_data method usage example with argument unpacking

kwargs: GetParallelDataRequestRequestTypeDef = {  # (1)
    "Name": ...,
}

parent.get_parallel_data(**kwargs)
  1. See GetParallelDataRequestRequestTypeDef

get_terminology#

Retrieves a custom terminology.

Type annotations and code completion for boto3.client("translate").get_terminology method. boto3 documentation

# get_terminology method definition

def get_terminology(
    self,
    *,
    Name: str,
    TerminologyDataFormat: TerminologyDataFormatType = ...,  # (1)
) -> GetTerminologyResponseTypeDef:  # (2)
    ...
  1. See TerminologyDataFormatType
  2. See GetTerminologyResponseTypeDef
# get_terminology method usage example with argument unpacking

kwargs: GetTerminologyRequestRequestTypeDef = {  # (1)
    "Name": ...,
}

parent.get_terminology(**kwargs)
  1. See GetTerminologyRequestRequestTypeDef

import_terminology#

Creates or updates a custom terminology, depending on whether one already exists for the given terminology name.

Type annotations and code completion for boto3.client("translate").import_terminology method. boto3 documentation

# import_terminology method definition

def import_terminology(
    self,
    *,
    Name: str,
    MergeStrategy: MergeStrategyType,  # (1)
    TerminologyData: TerminologyDataTypeDef,  # (2)
    Description: str = ...,
    EncryptionKey: EncryptionKeyTypeDef = ...,  # (3)
    Tags: Sequence[TagTypeDef] = ...,  # (4)
) -> ImportTerminologyResponseTypeDef:  # (5)
    ...
  1. See MergeStrategyType
  2. See TerminologyDataTypeDef
  3. See EncryptionKeyTypeDef
  4. See TagTypeDef
  5. See ImportTerminologyResponseTypeDef
# import_terminology method usage example with argument unpacking

kwargs: ImportTerminologyRequestRequestTypeDef = {  # (1)
    "Name": ...,
    "MergeStrategy": ...,
    "TerminologyData": ...,
}

parent.import_terminology(**kwargs)
  1. See ImportTerminologyRequestRequestTypeDef

list_languages#

Provides a list of languages (RFC-5646 codes and names) that Amazon Translate supports.

Type annotations and code completion for boto3.client("translate").list_languages method. boto3 documentation

# list_languages method definition

def list_languages(
    self,
    *,
    DisplayLanguageCode: DisplayLanguageCodeType = ...,  # (1)
    NextToken: str = ...,
    MaxResults: int = ...,
) -> ListLanguagesResponseTypeDef:  # (2)
    ...
  1. See DisplayLanguageCodeType
  2. See ListLanguagesResponseTypeDef
# list_languages method usage example with argument unpacking

kwargs: ListLanguagesRequestRequestTypeDef = {  # (1)
    "DisplayLanguageCode": ...,
}

parent.list_languages(**kwargs)
  1. See ListLanguagesRequestRequestTypeDef

list_parallel_data#

Provides a list of your parallel data resources in Amazon Translate.

Type annotations and code completion for boto3.client("translate").list_parallel_data method. boto3 documentation

# list_parallel_data method definition

def list_parallel_data(
    self,
    *,
    NextToken: str = ...,
    MaxResults: int = ...,
) -> ListParallelDataResponseTypeDef:  # (1)
    ...
  1. See ListParallelDataResponseTypeDef
# list_parallel_data method usage example with argument unpacking

kwargs: ListParallelDataRequestRequestTypeDef = {  # (1)
    "NextToken": ...,
}

parent.list_parallel_data(**kwargs)
  1. See ListParallelDataRequestRequestTypeDef

list_tags_for_resource#

Lists all tags associated with a given Amazon Translate resource.

Type annotations and code completion for boto3.client("translate").list_tags_for_resource method. boto3 documentation

# list_tags_for_resource method definition

def list_tags_for_resource(
    self,
    *,
    ResourceArn: str,
) -> ListTagsForResourceResponseTypeDef:  # (1)
    ...
  1. See ListTagsForResourceResponseTypeDef
# list_tags_for_resource method usage example with argument unpacking

kwargs: ListTagsForResourceRequestRequestTypeDef = {  # (1)
    "ResourceArn": ...,
}

parent.list_tags_for_resource(**kwargs)
  1. See ListTagsForResourceRequestRequestTypeDef

list_terminologies#

Provides a list of custom terminologies associated with your account.

Type annotations and code completion for boto3.client("translate").list_terminologies method. boto3 documentation

# list_terminologies method definition

def list_terminologies(
    self,
    *,
    NextToken: str = ...,
    MaxResults: int = ...,
) -> ListTerminologiesResponseTypeDef:  # (1)
    ...
  1. See ListTerminologiesResponseTypeDef
# list_terminologies method usage example with argument unpacking

kwargs: ListTerminologiesRequestRequestTypeDef = {  # (1)
    "NextToken": ...,
}

parent.list_terminologies(**kwargs)
  1. See ListTerminologiesRequestRequestTypeDef

list_text_translation_jobs#

Gets a list of the batch translation jobs that you have submitted.

Type annotations and code completion for boto3.client("translate").list_text_translation_jobs method. boto3 documentation

# list_text_translation_jobs method definition

def list_text_translation_jobs(
    self,
    *,
    Filter: TextTranslationJobFilterTypeDef = ...,  # (1)
    NextToken: str = ...,
    MaxResults: int = ...,
) -> ListTextTranslationJobsResponseTypeDef:  # (2)
    ...
  1. See TextTranslationJobFilterTypeDef
  2. See ListTextTranslationJobsResponseTypeDef
# list_text_translation_jobs method usage example with argument unpacking

kwargs: ListTextTranslationJobsRequestRequestTypeDef = {  # (1)
    "Filter": ...,
}

parent.list_text_translation_jobs(**kwargs)
  1. See ListTextTranslationJobsRequestRequestTypeDef

start_text_translation_job#

Starts an asynchronous batch translation job.

Type annotations and code completion for boto3.client("translate").start_text_translation_job method. boto3 documentation

# start_text_translation_job method definition

def start_text_translation_job(
    self,
    *,
    InputDataConfig: InputDataConfigTypeDef,  # (1)
    OutputDataConfig: OutputDataConfigTypeDef,  # (2)
    DataAccessRoleArn: str,
    SourceLanguageCode: str,
    TargetLanguageCodes: Sequence[str],
    ClientToken: str,
    JobName: str = ...,
    TerminologyNames: Sequence[str] = ...,
    ParallelDataNames: Sequence[str] = ...,
    Settings: TranslationSettingsTypeDef = ...,  # (3)
) -> StartTextTranslationJobResponseTypeDef:  # (4)
    ...
  1. See InputDataConfigTypeDef
  2. See OutputDataConfigTypeDef
  3. See TranslationSettingsTypeDef
  4. See StartTextTranslationJobResponseTypeDef
# start_text_translation_job method usage example with argument unpacking

kwargs: StartTextTranslationJobRequestRequestTypeDef = {  # (1)
    "InputDataConfig": ...,
    "OutputDataConfig": ...,
    "DataAccessRoleArn": ...,
    "SourceLanguageCode": ...,
    "TargetLanguageCodes": ...,
    "ClientToken": ...,
}

parent.start_text_translation_job(**kwargs)
  1. See StartTextTranslationJobRequestRequestTypeDef

stop_text_translation_job#

Stops an asynchronous batch translation job that is in progress.

Type annotations and code completion for boto3.client("translate").stop_text_translation_job method. boto3 documentation

# stop_text_translation_job method definition

def stop_text_translation_job(
    self,
    *,
    JobId: str,
) -> StopTextTranslationJobResponseTypeDef:  # (1)
    ...
  1. See StopTextTranslationJobResponseTypeDef
# stop_text_translation_job method usage example with argument unpacking

kwargs: StopTextTranslationJobRequestRequestTypeDef = {  # (1)
    "JobId": ...,
}

parent.stop_text_translation_job(**kwargs)
  1. See StopTextTranslationJobRequestRequestTypeDef

tag_resource#

Associates a specific tag with a resource.

Type annotations and code completion for boto3.client("translate").tag_resource method. boto3 documentation

# tag_resource method definition

def tag_resource(
    self,
    *,
    ResourceArn: str,
    Tags: Sequence[TagTypeDef],  # (1)
) -> Dict[str, Any]:
    ...
  1. See TagTypeDef
# tag_resource method usage example with argument unpacking

kwargs: TagResourceRequestRequestTypeDef = {  # (1)
    "ResourceArn": ...,
    "Tags": ...,
}

parent.tag_resource(**kwargs)
  1. See TagResourceRequestRequestTypeDef

translate_document#

Translates the input document from the source language to the target language.

Type annotations and code completion for boto3.client("translate").translate_document method. boto3 documentation

# translate_document method definition

def translate_document(
    self,
    *,
    Document: DocumentTypeDef,  # (1)
    SourceLanguageCode: str,
    TargetLanguageCode: str,
    TerminologyNames: Sequence[str] = ...,
    Settings: TranslationSettingsTypeDef = ...,  # (2)
) -> TranslateDocumentResponseTypeDef:  # (3)
    ...
  1. See DocumentTypeDef
  2. See TranslationSettingsTypeDef
  3. See TranslateDocumentResponseTypeDef
# translate_document method usage example with argument unpacking

kwargs: TranslateDocumentRequestRequestTypeDef = {  # (1)
    "Document": ...,
    "SourceLanguageCode": ...,
    "TargetLanguageCode": ...,
}

parent.translate_document(**kwargs)
  1. See TranslateDocumentRequestRequestTypeDef

translate_text#

Translates input text from the source language to the target language.

Type annotations and code completion for boto3.client("translate").translate_text method. boto3 documentation

# translate_text method definition

def translate_text(
    self,
    *,
    Text: str,
    SourceLanguageCode: str,
    TargetLanguageCode: str,
    TerminologyNames: Sequence[str] = ...,
    Settings: TranslationSettingsTypeDef = ...,  # (1)
) -> TranslateTextResponseTypeDef:  # (2)
    ...
  1. See TranslationSettingsTypeDef
  2. See TranslateTextResponseTypeDef
# translate_text method usage example with argument unpacking

kwargs: TranslateTextRequestRequestTypeDef = {  # (1)
    "Text": ...,
    "SourceLanguageCode": ...,
    "TargetLanguageCode": ...,
}

parent.translate_text(**kwargs)
  1. See TranslateTextRequestRequestTypeDef

untag_resource#

Removes a specific tag associated with an Amazon Translate resource.

Type annotations and code completion for boto3.client("translate").untag_resource method. boto3 documentation

# untag_resource method definition

def untag_resource(
    self,
    *,
    ResourceArn: str,
    TagKeys: Sequence[str],
) -> Dict[str, Any]:
    ...
# untag_resource method usage example with argument unpacking

kwargs: UntagResourceRequestRequestTypeDef = {  # (1)
    "ResourceArn": ...,
    "TagKeys": ...,
}

parent.untag_resource(**kwargs)
  1. See UntagResourceRequestRequestTypeDef

update_parallel_data#

Updates a previously created parallel data resource by importing a new input file from Amazon S3.

Type annotations and code completion for boto3.client("translate").update_parallel_data method. boto3 documentation

# update_parallel_data method definition

def update_parallel_data(
    self,
    *,
    Name: str,
    ParallelDataConfig: ParallelDataConfigTypeDef,  # (1)
    ClientToken: str,
    Description: str = ...,
) -> UpdateParallelDataResponseTypeDef:  # (2)
    ...
  1. See ParallelDataConfigTypeDef
  2. See UpdateParallelDataResponseTypeDef
# update_parallel_data method usage example with argument unpacking

kwargs: UpdateParallelDataRequestRequestTypeDef = {  # (1)
    "Name": ...,
    "ParallelDataConfig": ...,
    "ClientToken": ...,
}

parent.update_parallel_data(**kwargs)
  1. See UpdateParallelDataRequestRequestTypeDef

get_paginator#

Type annotations and code completion for boto3.client("translate").get_paginator method with overloads.