public class AmazonTranslateClient extends AmazonWebServiceClient implements AmazonTranslate
Provides translation between one source language and another of the same set of languages.
LOGGING_AWS_REQUEST_METRIC
Constructor and Description |
---|
AmazonTranslateClient()
Deprecated.
|
AmazonTranslateClient(AWSCredentials awsCredentials)
Constructs a new client to invoke service methods on AmazonTranslate
using the specified AWS account credentials.
|
AmazonTranslateClient(AWSCredentials awsCredentials,
ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on AmazonTranslate
using the specified AWS account credentials and client configuration
options.
|
AmazonTranslateClient(AWSCredentialsProvider awsCredentialsProvider)
Constructs a new client to invoke service methods on AmazonTranslate
using the specified AWS account credentials provider.
|
AmazonTranslateClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on AmazonTranslate
using the specified AWS account credentials provider and client
configuration options.
|
AmazonTranslateClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
HttpClient httpClient)
Constructs a new client to invoke service methods on AmazonTranslate
using the specified AWS account credentials provider, client
configuration options and request metric collector.
|
AmazonTranslateClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
com.amazonaws.metrics.RequestMetricCollector requestMetricCollector)
Deprecated.
|
AmazonTranslateClient(ClientConfiguration clientConfiguration)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
CreateParallelDataResult |
createParallelData(CreateParallelDataRequest createParallelDataRequest)
Creates a parallel data resource in Amazon Translate by importing an
input file from Amazon S3.
|
DeleteParallelDataResult |
deleteParallelData(DeleteParallelDataRequest deleteParallelDataRequest)
Deletes a parallel data resource in Amazon Translate.
|
void |
deleteTerminology(DeleteTerminologyRequest deleteTerminologyRequest)
A synchronous action that deletes a custom terminology.
|
DescribeTextTranslationJobResult |
describeTextTranslationJob(DescribeTextTranslationJobRequest describeTextTranslationJobRequest)
Gets the properties associated with an asycnhronous batch translation job
including name, ID, status, source and target languages, input/output S3
buckets, and so on.
|
ResponseMetadata |
getCachedResponseMetadata(AmazonWebServiceRequest request)
Deprecated.
ResponseMetadata cache can hold up to 50 requests and
responses in memory and will cause memory issue. This method
now always returns null.
|
GetParallelDataResult |
getParallelData(GetParallelDataRequest getParallelDataRequest)
Provides information about a parallel data resource.
|
GetTerminologyResult |
getTerminology(GetTerminologyRequest getTerminologyRequest)
Retrieves a custom terminology.
|
ImportTerminologyResult |
importTerminology(ImportTerminologyRequest importTerminologyRequest)
Creates or updates a custom terminology, depending on whether or not one
already exists for the given terminology name.
|
ListParallelDataResult |
listParallelData(ListParallelDataRequest listParallelDataRequest)
Provides a list of your parallel data resources in Amazon Translate.
|
ListTerminologiesResult |
listTerminologies(ListTerminologiesRequest listTerminologiesRequest)
Provides a list of custom terminologies associated with your account.
|
ListTextTranslationJobsResult |
listTextTranslationJobs(ListTextTranslationJobsRequest listTextTranslationJobsRequest)
Gets a list of the batch translation jobs that you have submitted.
|
StartTextTranslationJobResult |
startTextTranslationJob(StartTextTranslationJobRequest startTextTranslationJobRequest)
Starts an asynchronous batch translation job.
|
StopTextTranslationJobResult |
stopTextTranslationJob(StopTextTranslationJobRequest stopTextTranslationJobRequest)
Stops an asynchronous batch translation job that is in progress.
|
TranslateTextResult |
translateText(TranslateTextRequest translateTextRequest)
Translates input text from the source language to the target language.
|
UpdateParallelDataResult |
updateParallelData(UpdateParallelDataRequest updateParallelDataRequest)
Updates a previously created parallel data resource by importing a new
input file from Amazon S3.
|
addRequestHandler, addRequestHandler, getEndpoint, getEndpointPrefix, getRegions, getRequestMetricsCollector, getServiceName, getSignerByURI, getSignerRegionOverride, getTimeOffset, removeRequestHandler, removeRequestHandler, setConfiguration, setEndpoint, setEndpoint, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, shutdown, withTimeOffset
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setEndpoint, setRegion, shutdown
@Deprecated public AmazonTranslateClient()
All service calls made using this new client object are blocking, and will not return until the service call completes.
DefaultAWSCredentialsProviderChain
@Deprecated public AmazonTranslateClient(ClientConfiguration clientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
clientConfiguration
- The client configuration options controlling
how this client connects to AmazonTranslate (ex: proxy
settings, retry counts, etc.).DefaultAWSCredentialsProviderChain
public AmazonTranslateClient(AWSCredentials awsCredentials)
The client requests are authenticated using the AWSCredentials
provided in this constructor. Static AWSCredentials can be passed for
quick testing. However, it is strongly recommended to use Amazon Cognito
vended temporary credentials for use in production. This can be achieved
by using AWSMobileClient
. Please see
https://aws-amplify.github.io/docs/android/authentication for
instructions on how to enable AWSMobileClient
.
AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() { @Override public void onResult(final UserStateDetails details) { AmazonTranslateClient client = new AmazonTranslateClient(AWSMobileClient.getInstance()); } @Override public void onError(final Exception e) { e.printStackTrace(); } });
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials
- The AWS credentials (access key ID and secret key)
to use when authenticating with AWS services.public AmazonTranslateClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration)
The client requests are authenticated using the AWSCredentials
provided in this constructor. Static AWSCredentials can be passed for
quick testing. However, it is strongly recommended to use Amazon Cognito
vended temporary credentials for use in production. This can be achieved
by using AWSMobileClient
. Please see
https://aws-amplify.github.io/docs/android/authentication for
instructions on how to enable AWSMobileClient
.
AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() { @Override public void onResult(final UserStateDetails details) { AmazonTranslateClient client = new AmazonTranslateClient(AWSMobileClient.getInstance()); } @Override public void onError(final Exception e) { e.printStackTrace(); } });
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials
- The AWS credentials (access key ID and secret key)
to use when authenticating with AWS services.clientConfiguration
- The client configuration options controlling
how this client connects to AmazonTranslate (ex: proxy
settings, retry counts, etc.).public AmazonTranslateClient(AWSCredentialsProvider awsCredentialsProvider)
The client requests are authenticated using the AWSCredentials
provided by the AWSCredentialsProvider
. Static AWSCredentials can
be passed for quick testing. However, it is strongly recommended to use
Amazon Cognito vended temporary credentials for use in production. This
can be achieved by using AWSMobileClient
. Please see
https://aws-amplify.github.io/docs/android/authentication for
instructions on how to enable AWSMobileClient
.
AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() { @Override public void onResult(final UserStateDetails details) { AmazonTranslateClient client = new AmazonTranslateClient(AWSMobileClient.getInstance()); } @Override public void onError(final Exception e) { e.printStackTrace(); } });
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.public AmazonTranslateClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration)
The client requests are authenticated using the AWSCredentials
provided by the AWSCredentialsProvider
. Static AWSCredentials can
be passed for quick testing. However, it is strongly recommended to use
Amazon Cognito vended temporary credentials for use in production. This
can be achieved by using AWSMobileClient
. Please see
https://aws-amplify.github.io/docs/android/authentication for
instructions on how to enable AWSMobileClient
.
AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() { @Override public void onResult(final UserStateDetails details) { AmazonTranslateClient client = new AmazonTranslateClient(AWSMobileClient.getInstance()); } @Override public void onError(final Exception e) { e.printStackTrace(); } });
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.clientConfiguration
- The client configuration options controlling
how this client connects to AmazonTranslate (ex: proxy
settings, retry counts, etc.).@Deprecated public AmazonTranslateClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, com.amazonaws.metrics.RequestMetricCollector requestMetricCollector)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.clientConfiguration
- The client configuration options controlling
how this client connects to AmazonTranslate (ex: proxy
settings, retry counts, etc.).requestMetricCollector
- optional request metric collectorpublic AmazonTranslateClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, HttpClient httpClient)
The client requests are authenticated using the AWSCredentials
provided by the AWSCredentialsProvider
. Static AWSCredentials can
be passed for quick testing. However, it is strongly recommended to use
Amazon Cognito vended temporary credentials for use in production. This
can be achieved by using AWSMobileClient
. Please see
https://aws-amplify.github.io/docs/android/authentication for
instructions on how to enable AWSMobileClient
.
AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() { @Override public void onResult(final UserStateDetails details) { AmazonTranslateClient client = new AmazonTranslateClient(AWSMobileClient.getInstance()); } @Override public void onError(final Exception e) { e.printStackTrace(); } });
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.clientConfiguration
- The client configuration options controlling
how this client connects to AmazonTranslate (ex: proxy
settings, retry counts, etc.).httpClient
- A http clientpublic CreateParallelDataResult createParallelData(CreateParallelDataRequest createParallelDataRequest) throws AmazonServiceException, AmazonClientException
Creates a parallel data resource in Amazon Translate by importing an input file from Amazon S3. Parallel data files contain examples of source phrases and their translations from your translation memory. By adding parallel data, you can influence the style, tone, and word choice in your translation output.
createParallelData
in interface AmazonTranslate
createParallelDataRequest
- InvalidParameterValueException
InvalidRequestException
LimitExceededException
TooManyRequestsException
ConflictException
InternalServerException
AmazonClientException
- If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public DeleteParallelDataResult deleteParallelData(DeleteParallelDataRequest deleteParallelDataRequest) throws AmazonServiceException, AmazonClientException
Deletes a parallel data resource in Amazon Translate.
deleteParallelData
in interface AmazonTranslate
deleteParallelDataRequest
- ConcurrentModificationException
ResourceNotFoundException
TooManyRequestsException
InternalServerException
AmazonClientException
- If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public void deleteTerminology(DeleteTerminologyRequest deleteTerminologyRequest) throws AmazonServiceException, AmazonClientException
A synchronous action that deletes a custom terminology.
deleteTerminology
in interface AmazonTranslate
deleteTerminologyRequest
- ResourceNotFoundException
TooManyRequestsException
InvalidParameterValueException
InternalServerException
AmazonClientException
- If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public DescribeTextTranslationJobResult describeTextTranslationJob(DescribeTextTranslationJobRequest describeTextTranslationJobRequest) throws AmazonServiceException, AmazonClientException
Gets the properties associated with an asycnhronous batch translation job including name, ID, status, source and target languages, input/output S3 buckets, and so on.
describeTextTranslationJob
in interface AmazonTranslate
describeTextTranslationJobRequest
- ResourceNotFoundException
TooManyRequestsException
InternalServerException
AmazonClientException
- If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public GetParallelDataResult getParallelData(GetParallelDataRequest getParallelDataRequest) throws AmazonServiceException, AmazonClientException
Provides information about a parallel data resource.
getParallelData
in interface AmazonTranslate
getParallelDataRequest
- ResourceNotFoundException
InvalidParameterValueException
TooManyRequestsException
InternalServerException
AmazonClientException
- If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public GetTerminologyResult getTerminology(GetTerminologyRequest getTerminologyRequest) throws AmazonServiceException, AmazonClientException
Retrieves a custom terminology.
getTerminology
in interface AmazonTranslate
getTerminologyRequest
- ResourceNotFoundException
InvalidParameterValueException
TooManyRequestsException
InternalServerException
AmazonClientException
- If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public ImportTerminologyResult importTerminology(ImportTerminologyRequest importTerminologyRequest) throws AmazonServiceException, AmazonClientException
Creates or updates a custom terminology, depending on whether or not one already exists for the given terminology name. Importing a terminology with the same name as an existing one will merge the terminologies based on the chosen merge strategy. Currently, the only supported merge strategy is OVERWRITE, and so the imported terminology will overwrite an existing terminology of the same name.
If you import a terminology that overwrites an existing one, the new terminology take up to 10 minutes to fully propagate and be available for use in a translation due to cache policies with the DataPlane service that performs the translations.
importTerminology
in interface AmazonTranslate
importTerminologyRequest
- InvalidParameterValueException
LimitExceededException
TooManyRequestsException
InternalServerException
AmazonClientException
- If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public ListParallelDataResult listParallelData(ListParallelDataRequest listParallelDataRequest) throws AmazonServiceException, AmazonClientException
Provides a list of your parallel data resources in Amazon Translate.
listParallelData
in interface AmazonTranslate
listParallelDataRequest
- InvalidParameterValueException
TooManyRequestsException
InternalServerException
AmazonClientException
- If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public ListTerminologiesResult listTerminologies(ListTerminologiesRequest listTerminologiesRequest) throws AmazonServiceException, AmazonClientException
Provides a list of custom terminologies associated with your account.
listTerminologies
in interface AmazonTranslate
listTerminologiesRequest
- InvalidParameterValueException
TooManyRequestsException
InternalServerException
AmazonClientException
- If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public ListTextTranslationJobsResult listTextTranslationJobs(ListTextTranslationJobsRequest listTextTranslationJobsRequest) throws AmazonServiceException, AmazonClientException
Gets a list of the batch translation jobs that you have submitted.
listTextTranslationJobs
in interface AmazonTranslate
listTextTranslationJobsRequest
- InvalidRequestException
TooManyRequestsException
InvalidFilterException
InternalServerException
AmazonClientException
- If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public StartTextTranslationJobResult startTextTranslationJob(StartTextTranslationJobRequest startTextTranslationJobRequest) throws AmazonServiceException, AmazonClientException
Starts an asynchronous batch translation job. Batch translation jobs can be used to translate large volumes of text across multiple documents at once. For more information, see async.
Batch translation jobs can be described with the DescribeTextTranslationJob operation, listed with the ListTextTranslationJobs operation, and stopped with the StopTextTranslationJob operation.
Amazon Translate does not support batch translation of multiple source languages at once.
startTextTranslationJob
in interface AmazonTranslate
startTextTranslationJobRequest
- TooManyRequestsException
UnsupportedLanguagePairException
InvalidRequestException
ResourceNotFoundException
InternalServerException
AmazonClientException
- If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public StopTextTranslationJobResult stopTextTranslationJob(StopTextTranslationJobRequest stopTextTranslationJobRequest) throws AmazonServiceException, AmazonClientException
Stops an asynchronous batch translation job that is in progress.
If the job's state is IN_PROGRESS
, the job will be marked
for termination and put into the STOP_REQUESTED
state. If
the job completes before it can be stopped, it is put into the
COMPLETED
state. Otherwise, the job is put into the
STOPPED
state.
Asynchronous batch translation jobs are started with the
StartTextTranslationJob operation. You can use the
DescribeTextTranslationJob or ListTextTranslationJobs
operations to get a batch translation job's JobId
.
stopTextTranslationJob
in interface AmazonTranslate
stopTextTranslationJobRequest
- ResourceNotFoundException
TooManyRequestsException
InternalServerException
AmazonClientException
- If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public TranslateTextResult translateText(TranslateTextRequest translateTextRequest) throws AmazonServiceException, AmazonClientException
Translates input text from the source language to the target language. For a list of available languages and language codes, see what-is-languages.
translateText
in interface AmazonTranslate
translateTextRequest
- InvalidRequestException
TextSizeLimitExceededException
TooManyRequestsException
UnsupportedLanguagePairException
DetectedLanguageLowConfidenceException
ResourceNotFoundException
InternalServerException
ServiceUnavailableException
AmazonClientException
- If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.public UpdateParallelDataResult updateParallelData(UpdateParallelDataRequest updateParallelDataRequest) throws AmazonServiceException, AmazonClientException
Updates a previously created parallel data resource by importing a new input file from Amazon S3.
updateParallelData
in interface AmazonTranslate
updateParallelDataRequest
- ConcurrentModificationException
InvalidParameterValueException
InvalidRequestException
LimitExceededException
TooManyRequestsException
ConflictException
ResourceNotFoundException
InternalServerException
AmazonClientException
- If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException
- If an error response is returned by Amazon
Translate indicating either a problem with the data in the
request, or a server side issue.@Deprecated public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic information for an executed request, you should use this method to retrieve it as soon as possible after executing the request.
getCachedResponseMetadata
in interface AmazonTranslate
request
- The originally executed requestCopyright © 2018 Amazon Web Services, Inc. All Rights Reserved.