@Generated(value="software.amazon.awssdk:codegen") public interface TranslateClient extends SdkClient
builder() method.
Provides translation between English and one of six languages, or between one of the six languages and English.
| Modifier and Type | Field and Description |
|---|---|
static String |
SERVICE_NAME |
| Modifier and Type | Method and Description |
|---|---|
static TranslateClientBuilder |
builder()
Create a builder that can be used to configure and create a
TranslateClient. |
static TranslateClient |
create()
Create a
TranslateClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from the
DefaultCredentialsProvider. |
static ServiceMetadata |
serviceMetadata() |
default TranslateTextResponse |
translateText(Consumer<TranslateTextRequest.Builder> translateTextRequest)
Translates input text from the source language to the target language.
|
default TranslateTextResponse |
translateText(TranslateTextRequest translateTextRequest)
Translates input text from the source language to the target language.
|
serviceNameclosestatic final String SERVICE_NAME
static TranslateClient create()
TranslateClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from the
DefaultCredentialsProvider.static TranslateClientBuilder builder()
TranslateClient.default TranslateTextResponse translateText(TranslateTextRequest translateTextRequest) throws InvalidRequestException, TextSizeLimitExceededException, TooManyRequestsException, UnsupportedLanguagePairException, DetectedLanguageLowConfidenceException, InternalServerException, ServiceUnavailableException, AwsServiceException, SdkClientException, TranslateException
Translates input text from the source language to the target language. You can translate between English (en) and one of the following languages, or between one of the following languages and English.
Arabic (ar)
Chinese (Simplified) (zh)
French (fr)
German (de)
Portuguese (pt)
Spanish (es)
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.
translateTextRequest - InvalidRequestException - The request is invalid.TextSizeLimitExceededException - The size of the input text exceeds the length constraint for the Text field. Try again with
a shorter text.TooManyRequestsException - The number of requests exceeds the limit. Resubmit your request later.UnsupportedLanguagePairException - Amazon Translate cannot translate input text in the source language into this target language. For more
information, see how-to-error-msg.DetectedLanguageLowConfidenceException - The confidence that Amazon Comprehend accurately detected the source language is low. If a low confidence
level is acceptable for your application, you can use the language in the exception to call Amazon
Translate again. For more information, see the DetectDominantLanguage operation in the Amazon Comprehend Developer Guide.InternalServerException - An internal server error occurred. Retry your request.ServiceUnavailableException - Amazon Translate is unavailable. Retry your request later.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.TranslateException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault TranslateTextResponse translateText(Consumer<TranslateTextRequest.Builder> translateTextRequest) throws InvalidRequestException, TextSizeLimitExceededException, TooManyRequestsException, UnsupportedLanguagePairException, DetectedLanguageLowConfidenceException, InternalServerException, ServiceUnavailableException, AwsServiceException, SdkClientException, TranslateException
Translates input text from the source language to the target language. You can translate between English (en) and one of the following languages, or between one of the following languages and English.
Arabic (ar)
Chinese (Simplified) (zh)
French (fr)
German (de)
Portuguese (pt)
Spanish (es)
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.
This is a convenience which creates an instance of the TranslateTextRequest.Builder avoiding the need to
create one manually via TranslateTextRequest.builder()
translateTextRequest - A Consumer that will call methods on TranslateTextRequest.Builder to create a request.InvalidRequestException - The request is invalid.TextSizeLimitExceededException - The size of the input text exceeds the length constraint for the Text field. Try again with
a shorter text.TooManyRequestsException - The number of requests exceeds the limit. Resubmit your request later.UnsupportedLanguagePairException - Amazon Translate cannot translate input text in the source language into this target language. For more
information, see how-to-error-msg.DetectedLanguageLowConfidenceException - The confidence that Amazon Comprehend accurately detected the source language is low. If a low confidence
level is acceptable for your application, you can use the language in the exception to call Amazon
Translate again. For more information, see the DetectDominantLanguage operation in the Amazon Comprehend Developer Guide.InternalServerException - An internal server error occurred. Retry your request.ServiceUnavailableException - Amazon Translate is unavailable. Retry your request later.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.TranslateException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptionstatic ServiceMetadata serviceMetadata()
Copyright © 2018. All rights reserved.