/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.translate; import javax.annotation.Generated; import com.amazonaws.*; import com.amazonaws.regions.*; import com.amazonaws.services.translate.model.*; /** * Interface for accessing Amazon Translate. *
* Note: Do not directly implement this interface, new methods are added to it regularly. Extend from * {@link com.amazonaws.services.translate.AbstractAmazonTranslate} instead. *
**
* Provides translation of the input content from the source language to the target language. *
*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public interface AmazonTranslate { /** * The region metadata service name for computing region endpoints. You can use this value to retrieve metadata * (such as supported regions) of the service. * * @see RegionUtils#getRegionsForService(String) */ String ENDPOINT_PREFIX = "translate"; /** ** Creates a parallel data resource in Amazon Translate by importing an input file from Amazon S3. Parallel data * files contain examples that show how you want segments of text to be translated. By adding parallel data, you can * influence the style, tone, and word choice in your translation output. *
* * @param createParallelDataRequest * @return Result of the CreateParallelData operation returned by the service. * @throws InvalidParameterValueException * The value of the parameter is not valid. Review the value of the parameter you are using to correct it, * and then retry your operation. * @throws InvalidRequestException * The request that you made is not valid. Check your request to determine why it's not valid and then retry * the request. * @throws LimitExceededException * The specified limit has been exceeded. Review your request and retry it with a quantity below the stated * limit. * @throws TooManyRequestsException * You have made too many requests within a short period of time. Wait for a short time and then try your * request again. * @throws TooManyTagsException * You have added too many tags to this resource. The maximum is 50 tags. * @throws ConflictException * There was a conflict processing the request. Try your request again. * @throws ConcurrentModificationException * Another modification is being made. That modification must complete before you can make your change. * @throws InternalServerException * An internal server error occurred. Retry your request. * @sample AmazonTranslate.CreateParallelData * @see AWS * API Documentation */ CreateParallelDataResult createParallelData(CreateParallelDataRequest createParallelDataRequest); /** ** Deletes a parallel data resource in Amazon Translate. *
* * @param deleteParallelDataRequest * @return Result of the DeleteParallelData operation returned by the service. * @throws ConcurrentModificationException * Another modification is being made. That modification must complete before you can make your change. * @throws ResourceNotFoundException * The resource you are looking for has not been found. Review the resource you're looking for and see if a * different resource will accomplish your needs before retrying the revised request. * @throws TooManyRequestsException * You have made too many requests within a short period of time. Wait for a short time and then try your * request again. * @throws InternalServerException * An internal server error occurred. Retry your request. * @sample AmazonTranslate.DeleteParallelData * @see AWS * API Documentation */ DeleteParallelDataResult deleteParallelData(DeleteParallelDataRequest deleteParallelDataRequest); /** ** A synchronous action that deletes a custom terminology. *
* * @param deleteTerminologyRequest * @return Result of the DeleteTerminology operation returned by the service. * @throws ResourceNotFoundException * The resource you are looking for has not been found. Review the resource you're looking for and see if a * different resource will accomplish your needs before retrying the revised request. * @throws TooManyRequestsException * You have made too many requests within a short period of time. Wait for a short time and then try your * request again. * @throws InvalidParameterValueException * The value of the parameter is not valid. Review the value of the parameter you are using to correct it, * and then retry your operation. * @throws InternalServerException * An internal server error occurred. Retry your request. * @sample AmazonTranslate.DeleteTerminology * @see AWS * API Documentation */ DeleteTerminologyResult deleteTerminology(DeleteTerminologyRequest deleteTerminologyRequest); /** ** 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. *
* * @param describeTextTranslationJobRequest * @return Result of the DescribeTextTranslationJob operation returned by the service. * @throws ResourceNotFoundException * The resource you are looking for has not been found. Review the resource you're looking for and see if a * different resource will accomplish your needs before retrying the revised request. * @throws TooManyRequestsException * You have made too many requests within a short period of time. Wait for a short time and then try your * request again. * @throws InternalServerException * An internal server error occurred. Retry your request. * @sample AmazonTranslate.DescribeTextTranslationJob * @see AWS API Documentation */ DescribeTextTranslationJobResult describeTextTranslationJob(DescribeTextTranslationJobRequest describeTextTranslationJobRequest); /** ** Provides information about a parallel data resource. *
* * @param getParallelDataRequest * @return Result of the GetParallelData operation returned by the service. * @throws ResourceNotFoundException * The resource you are looking for has not been found. Review the resource you're looking for and see if a * different resource will accomplish your needs before retrying the revised request. * @throws InvalidParameterValueException * The value of the parameter is not valid. Review the value of the parameter you are using to correct it, * and then retry your operation. * @throws TooManyRequestsException * You have made too many requests within a short period of time. Wait for a short time and then try your * request again. * @throws InternalServerException * An internal server error occurred. Retry your request. * @sample AmazonTranslate.GetParallelData * @see AWS API * Documentation */ GetParallelDataResult getParallelData(GetParallelDataRequest getParallelDataRequest); /** ** Retrieves a custom terminology. *
* * @param getTerminologyRequest * @return Result of the GetTerminology operation returned by the service. * @throws ResourceNotFoundException * The resource you are looking for has not been found. Review the resource you're looking for and see if a * different resource will accomplish your needs before retrying the revised request. * @throws InvalidParameterValueException * The value of the parameter is not valid. Review the value of the parameter you are using to correct it, * and then retry your operation. * @throws TooManyRequestsException * You have made too many requests within a short period of time. Wait for a short time and then try your * request again. * @throws InternalServerException * An internal server error occurred. Retry your request. * @sample AmazonTranslate.GetTerminology * @see AWS API * Documentation */ GetTerminologyResult getTerminology(GetTerminologyRequest getTerminologyRequest); /** ** Creates or updates a custom terminology, depending on whether 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. The only supported merge strategy is OVERWRITE, where the imported terminology overwrites the * existing terminology of the same name. *
** If you import a terminology that overwrites an existing one, the new terminology takes up to 10 minutes to fully * propagate. After that, translations have access to the new terminology. *
* * @param importTerminologyRequest * @return Result of the ImportTerminology operation returned by the service. * @throws InvalidParameterValueException * The value of the parameter is not valid. Review the value of the parameter you are using to correct it, * and then retry your operation. * @throws LimitExceededException * The specified limit has been exceeded. Review your request and retry it with a quantity below the stated * limit. * @throws TooManyRequestsException * You have made too many requests within a short period of time. Wait for a short time and then try your * request again. * @throws TooManyTagsException * You have added too many tags to this resource. The maximum is 50 tags. * @throws ConcurrentModificationException * Another modification is being made. That modification must complete before you can make your change. * @throws InternalServerException * An internal server error occurred. Retry your request. * @sample AmazonTranslate.ImportTerminology * @see AWS * API Documentation */ ImportTerminologyResult importTerminology(ImportTerminologyRequest importTerminologyRequest); /** ** Provides a list of languages (RFC-5646 codes and names) that Amazon Translate supports. *
* * @param listLanguagesRequest * @return Result of the ListLanguages operation returned by the service. * @throws InvalidParameterValueException * The value of the parameter is not valid. Review the value of the parameter you are using to correct it, * and then retry your operation. * @throws TooManyRequestsException * You have made too many requests within a short period of time. Wait for a short time and then try your * request again. * @throws UnsupportedDisplayLanguageCodeException * Requested display language code is not supported. * @throws InternalServerException * An internal server error occurred. Retry your request. * @sample AmazonTranslate.ListLanguages * @see AWS API * Documentation */ ListLanguagesResult listLanguages(ListLanguagesRequest listLanguagesRequest); /** ** Provides a list of your parallel data resources in Amazon Translate. *
* * @param listParallelDataRequest * @return Result of the ListParallelData operation returned by the service. * @throws InvalidParameterValueException * The value of the parameter is not valid. Review the value of the parameter you are using to correct it, * and then retry your operation. * @throws TooManyRequestsException * You have made too many requests within a short period of time. Wait for a short time and then try your * request again. * @throws InternalServerException * An internal server error occurred. Retry your request. * @sample AmazonTranslate.ListParallelData * @see AWS API * Documentation */ ListParallelDataResult listParallelData(ListParallelDataRequest listParallelDataRequest); /** ** Lists all tags associated with a given Amazon Translate resource. For more information, see Tagging your resources. *
* * @param listTagsForResourceRequest * @return Result of the ListTagsForResource operation returned by the service. * @throws InvalidParameterValueException * The value of the parameter is not valid. Review the value of the parameter you are using to correct it, * and then retry your operation. * @throws ResourceNotFoundException * The resource you are looking for has not been found. Review the resource you're looking for and see if a * different resource will accomplish your needs before retrying the revised request. * @throws InternalServerException * An internal server error occurred. Retry your request. * @sample AmazonTranslate.ListTagsForResource * @see AWS * API Documentation */ ListTagsForResourceResult listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest); /** ** Provides a list of custom terminologies associated with your account. *
* * @param listTerminologiesRequest * @return Result of the ListTerminologies operation returned by the service. * @throws InvalidParameterValueException * The value of the parameter is not valid. Review the value of the parameter you are using to correct it, * and then retry your operation. * @throws TooManyRequestsException * You have made too many requests within a short period of time. Wait for a short time and then try your * request again. * @throws InternalServerException * An internal server error occurred. Retry your request. * @sample AmazonTranslate.ListTerminologies * @see AWS * API Documentation */ ListTerminologiesResult listTerminologies(ListTerminologiesRequest listTerminologiesRequest); /** ** Gets a list of the batch translation jobs that you have submitted. *
* * @param listTextTranslationJobsRequest * @return Result of the ListTextTranslationJobs operation returned by the service. * @throws InvalidRequestException * The request that you made is not valid. Check your request to determine why it's not valid and then retry * the request. * @throws TooManyRequestsException * You have made too many requests within a short period of time. Wait for a short time and then try your * request again. * @throws InvalidFilterException * The filter specified for the operation is not valid. Specify a different filter. * @throws InternalServerException * An internal server error occurred. Retry your request. * @sample AmazonTranslate.ListTextTranslationJobs * @see AWS API Documentation */ ListTextTranslationJobsResult listTextTranslationJobs(ListTextTranslationJobsRequest listTextTranslationJobsRequest); /** *
* Starts an asynchronous batch translation job. Use batch translation jobs to translate large volumes of text
* across multiple documents at once. For batch translation, you can input documents with different source languages
* (specify auto
as the source language). You can specify one or more target languages. Batch
* translation translates each input document into each of the target languages. For more information, see Asynchronous batch processing.
*
* Batch translation jobs can be described with the DescribeTextTranslationJob operation, listed with the * ListTextTranslationJobs operation, and stopped with the StopTextTranslationJob operation. *
* * @param startTextTranslationJobRequest * @return Result of the StartTextTranslationJob operation returned by the service. * @throws TooManyRequestsException * You have made too many requests within a short period of time. Wait for a short time and then try your * request again. * @throws UnsupportedLanguagePairException * Amazon Translate does not support translation from the language of the source text into the requested * target language. For more information, see Supported languages. * @throws InvalidRequestException * The request that you made is not valid. Check your request to determine why it's not valid and then retry * the request. * @throws ResourceNotFoundException * The resource you are looking for has not been found. Review the resource you're looking for and see if a * different resource will accomplish your needs before retrying the revised request. * @throws InvalidParameterValueException * The value of the parameter is not valid. Review the value of the parameter you are using to correct it, * and then retry your operation. * @throws InternalServerException * An internal server error occurred. Retry your request. * @sample AmazonTranslate.StartTextTranslationJob * @see AWS API Documentation */ StartTextTranslationJobResult startTextTranslationJob(StartTextTranslationJobRequest startTextTranslationJobRequest); /** ** 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
.
*
* Associates a specific tag with a resource. A tag is a key-value pair that adds as a metadata to a resource. For * more information, see Tagging your * resources. *
* * @param tagResourceRequest * @return Result of the TagResource operation returned by the service. * @throws InvalidParameterValueException * The value of the parameter is not valid. Review the value of the parameter you are using to correct it, * and then retry your operation. * @throws ConcurrentModificationException * Another modification is being made. That modification must complete before you can make your change. * @throws ResourceNotFoundException * The resource you are looking for has not been found. Review the resource you're looking for and see if a * different resource will accomplish your needs before retrying the revised request. * @throws TooManyTagsException * You have added too many tags to this resource. The maximum is 50 tags. * @throws InternalServerException * An internal server error occurred. Retry your request. * @sample AmazonTranslate.TagResource * @see AWS API * Documentation */ TagResourceResult tagResource(TagResourceRequest tagResourceRequest); /** *
* Translates the input document from the source language to the target language. This synchronous operation
* supports plain text or HTML for the input document. TranslateDocument
supports translations from
* English to any supported language, and from any supported language to English. Therefore, specify either the
* source language code or the target language code as “en” (English).
*
* TranslateDocument
does not support language auto-detection.
*
* If you set the Formality
parameter, the request will fail if the target language does not support
* formality. For a list of target languages that support formality, see Setting
* formality.
*
* Translates input text from the source language to the target language. For a list of available languages and * language codes, see Supported * languages. *
* * @param translateTextRequest * @return Result of the TranslateText operation returned by the service. * @throws InvalidRequestException * The request that you made is not valid. Check your request to determine why it's not valid and then retry * the request. * @throws TextSizeLimitExceededException * The size of the text you submitted exceeds the size limit. Reduce the size of the text or use a smaller * document and then retry your request. * @throws TooManyRequestsException * You have made too many requests within a short period of time. Wait for a short time and then try your * request again. * @throws UnsupportedLanguagePairException * Amazon Translate does not support translation from the language of the source text into the requested * target language. For more information, see Supported languages. * @throws 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. * @throws ResourceNotFoundException * The resource you are looking for has not been found. Review the resource you're looking for and see if a * different resource will accomplish your needs before retrying the revised request. * @throws InternalServerException * An internal server error occurred. Retry your request. * @throws ServiceUnavailableException * The Amazon Translate service is temporarily unavailable. Wait a bit and then retry your request. * @sample AmazonTranslate.TranslateText * @see AWS API * Documentation */ TranslateTextResult translateText(TranslateTextRequest translateTextRequest); /** ** Removes a specific tag associated with an Amazon Translate resource. For more information, see Tagging your resources. *
* * @param untagResourceRequest * @return Result of the UntagResource operation returned by the service. * @throws InvalidParameterValueException * The value of the parameter is not valid. Review the value of the parameter you are using to correct it, * and then retry your operation. * @throws ConcurrentModificationException * Another modification is being made. That modification must complete before you can make your change. * @throws ResourceNotFoundException * The resource you are looking for has not been found. Review the resource you're looking for and see if a * different resource will accomplish your needs before retrying the revised request. * @throws InternalServerException * An internal server error occurred. Retry your request. * @sample AmazonTranslate.UntagResource * @see AWS API * Documentation */ UntagResourceResult untagResource(UntagResourceRequest untagResourceRequest); /** ** Updates a previously created parallel data resource by importing a new input file from Amazon S3. *
* * @param updateParallelDataRequest * @return Result of the UpdateParallelData operation returned by the service. * @throws ConcurrentModificationException * Another modification is being made. That modification must complete before you can make your change. * @throws InvalidParameterValueException * The value of the parameter is not valid. Review the value of the parameter you are using to correct it, * and then retry your operation. * @throws InvalidRequestException * The request that you made is not valid. Check your request to determine why it's not valid and then retry * the request. * @throws LimitExceededException * The specified limit has been exceeded. Review your request and retry it with a quantity below the stated * limit. * @throws TooManyRequestsException * You have made too many requests within a short period of time. Wait for a short time and then try your * request again. * @throws ConflictException * There was a conflict processing the request. Try your request again. * @throws ResourceNotFoundException * The resource you are looking for has not been found. Review the resource you're looking for and see if a * different resource will accomplish your needs before retrying the revised request. * @throws InternalServerException * An internal server error occurred. Retry your request. * @sample AmazonTranslate.UpdateParallelData * @see AWS * API Documentation */ UpdateParallelDataResult updateParallelData(UpdateParallelDataRequest updateParallelDataRequest); /** * Shuts down this client object, releasing any resources that might be held open. This is an optional method, and * callers are not expected to call it, but can if they want to explicitly release any open resources. Once a client * has been shutdown, it should not be used to make any more requests. */ void shutdown(); /** * Returns additional metadata for a previously executed successful request, typically used for debugging issues * where a service isn't acting as expected. This data isn't considered part of the result data returned by an * operation, so it's available through this separate, diagnostic interface. ** 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 a request. * * @param request * The originally executed request. * * @return The response metadata for the specified request, or null if none is available. */ ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request); }