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

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.

Usage example
client = boto3.client("translate")

try:
    do_something(client)
except (
    client.ClientError,
    client.ConcurrentModificationException,
    client.ConflictException,
    client.DetectedLanguageLowConfidenceException,
    client.InternalServerException,
    client.InvalidFilterException,
    client.InvalidParameterValueException,
    client.InvalidRequestException,
    client.LimitExceededException,
    client.ResourceNotFoundException,
    client.ServiceUnavailableException,
    client.TextSizeLimitExceededException,
    client.TooManyRequestsException,
    client.UnsupportedDisplayLanguageCodeException,
    client.UnsupportedLanguagePairException,
) as e:
    print(e)
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

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

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

Method definition
def create_parallel_data(
    self,
    *,
    Name: str,
    ParallelDataConfig: ParallelDataConfigTypeDef,  # (1)
    ClientToken: str,
    Description: str = ...,
    EncryptionKey: EncryptionKeyTypeDef = ...,  # (2)
) -> CreateParallelDataResponseTypeDef:  # (3)
    ...
  1. See ParallelDataConfigTypeDef
  2. See EncryptionKeyTypeDef
  3. See CreateParallelDataResponseTypeDef
Usage example with kwargs
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

Method definition
def delete_parallel_data(
    self,
    *,
    Name: str,
) -> DeleteParallelDataResponseTypeDef:  # (1)
    ...
  1. See DeleteParallelDataResponseTypeDef
Usage example with kwargs
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

Method definition
def delete_terminology(
    self,
    *,
    Name: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
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

Method definition
def describe_text_translation_job(
    self,
    *,
    JobId: str,
) -> DescribeTextTranslationJobResponseTypeDef:  # (1)
    ...
  1. See DescribeTextTranslationJobResponseTypeDef
Usage example with kwargs
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

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

Method definition
def get_parallel_data(
    self,
    *,
    Name: str,
) -> GetParallelDataResponseTypeDef:  # (1)
    ...
  1. See GetParallelDataResponseTypeDef
Usage example with kwargs
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

Method definition
def get_terminology(
    self,
    *,
    Name: str,
    TerminologyDataFormat: TerminologyDataFormatType = ...,  # (1)
) -> GetTerminologyResponseTypeDef:  # (2)
    ...
  1. See TerminologyDataFormatType
  2. See GetTerminologyResponseTypeDef
Usage example with kwargs
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

Method definition
def import_terminology(
    self,
    *,
    Name: str,
    MergeStrategy: MergeStrategyType,  # (1)
    TerminologyData: TerminologyDataTypeDef,  # (2)
    Description: str = ...,
    EncryptionKey: EncryptionKeyTypeDef = ...,  # (3)
) -> ImportTerminologyResponseTypeDef:  # (4)
    ...
  1. See MergeStrategyType
  2. See TerminologyDataTypeDef
  3. See EncryptionKeyTypeDef
  4. See ImportTerminologyResponseTypeDef
Usage example with kwargs
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

Method definition
def list_languages(
    self,
    *,
    DisplayLanguageCode: DisplayLanguageCodeType = ...,  # (1)
    NextToken: str = ...,
    MaxResults: int = ...,
) -> ListLanguagesResponseTypeDef:  # (2)
    ...
  1. See DisplayLanguageCodeType
  2. See ListLanguagesResponseTypeDef
Usage example with kwargs
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

Method definition
def list_parallel_data(
    self,
    *,
    NextToken: str = ...,
    MaxResults: int = ...,
) -> ListParallelDataResponseTypeDef:  # (1)
    ...
  1. See ListParallelDataResponseTypeDef
Usage example with kwargs
kwargs: ListParallelDataRequestRequestTypeDef = {  # (1)
    "NextToken": ...,
}

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

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

Method definition
def list_terminologies(
    self,
    *,
    NextToken: str = ...,
    MaxResults: int = ...,
) -> ListTerminologiesResponseTypeDef:  # (1)
    ...
  1. See ListTerminologiesResponseTypeDef
Usage example with kwargs
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

Method definition
def list_text_translation_jobs(
    self,
    *,
    Filter: TextTranslationJobFilterTypeDef = ...,  # (1)
    NextToken: str = ...,
    MaxResults: int = ...,
) -> ListTextTranslationJobsResponseTypeDef:  # (2)
    ...
  1. See TextTranslationJobFilterTypeDef
  2. See ListTextTranslationJobsResponseTypeDef
Usage example with kwargs
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

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
Usage example with kwargs
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

Method definition
def stop_text_translation_job(
    self,
    *,
    JobId: str,
) -> StopTextTranslationJobResponseTypeDef:  # (1)
    ...
  1. See StopTextTranslationJobResponseTypeDef
Usage example with kwargs
kwargs: StopTextTranslationJobRequestRequestTypeDef = {  # (1)
    "JobId": ...,
}

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

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

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
Usage example with kwargs
kwargs: TranslateTextRequestRequestTypeDef = {  # (1)
    "Text": ...,
    "SourceLanguageCode": ...,
    "TargetLanguageCode": ...,
}

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

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

Method definition
def update_parallel_data(
    self,
    *,
    Name: str,
    ParallelDataConfig: ParallelDataConfigTypeDef,  # (1)
    ClientToken: str,
    Description: str = ...,
) -> UpdateParallelDataResponseTypeDef:  # (2)
    ...
  1. See ParallelDataConfigTypeDef
  2. See UpdateParallelDataResponseTypeDef
Usage example with kwargs
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.