@Generated(value="software.amazon.awssdk:codegen") public interface TranslateClient extends SdkClient, SdkAutoCloseable
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.
|
serviceName
close
static 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, InternalServerException, ServiceUnavailableException, SdkServiceException, 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)
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.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.SdkServiceException
default TranslateTextResponse translateText(Consumer<TranslateTextRequest.Builder> translateTextRequest) throws InvalidRequestException, TextSizeLimitExceededException, TooManyRequestsException, UnsupportedLanguagePairException, InternalServerException, ServiceUnavailableException, SdkServiceException, 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)
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.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.SdkServiceException
static ServiceMetadata serviceMetadata()
Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.