/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include namespace Aws { namespace Translate { /** *

Provides translation of the input content from the source language to the * target language.

*/ class AWS_TRANSLATE_API TranslateClient : public Aws::Client::AWSJsonClient, public Aws::Client::ClientWithAsyncTemplateMethods { public: typedef Aws::Client::AWSJsonClient BASECLASS; static const char* SERVICE_NAME; static const char* ALLOCATION_TAG; typedef TranslateClientConfiguration ClientConfigurationType; typedef TranslateEndpointProvider EndpointProviderType; /** * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ TranslateClient(const Aws::Translate::TranslateClientConfiguration& clientConfiguration = Aws::Translate::TranslateClientConfiguration(), std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG)); /** * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ TranslateClient(const Aws::Auth::AWSCredentials& credentials, std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG), const Aws::Translate::TranslateClientConfiguration& clientConfiguration = Aws::Translate::TranslateClientConfiguration()); /** * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied, * the default http client factory will be used */ TranslateClient(const std::shared_ptr& credentialsProvider, std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG), const Aws::Translate::TranslateClientConfiguration& clientConfiguration = Aws::Translate::TranslateClientConfiguration()); /* Legacy constructors due deprecation */ /** * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ TranslateClient(const Aws::Client::ClientConfiguration& clientConfiguration); /** * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ TranslateClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration); /** * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied, * the default http client factory will be used */ TranslateClient(const std::shared_ptr& credentialsProvider, const Aws::Client::ClientConfiguration& clientConfiguration); /* End of legacy constructors due deprecation */ virtual ~TranslateClient(); /** *

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.

See * Also:

AWS * API Reference

*/ virtual Model::CreateParallelDataOutcome CreateParallelData(const Model::CreateParallelDataRequest& request) const; /** * A Callable wrapper for CreateParallelData that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::CreateParallelDataOutcomeCallable CreateParallelDataCallable(const CreateParallelDataRequestT& request) const { return SubmitCallable(&TranslateClient::CreateParallelData, request); } /** * An Async wrapper for CreateParallelData that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void CreateParallelDataAsync(const CreateParallelDataRequestT& request, const CreateParallelDataResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::CreateParallelData, request, handler, context); } /** *

Deletes a parallel data resource in Amazon Translate.

See * Also:

AWS * API Reference

*/ virtual Model::DeleteParallelDataOutcome DeleteParallelData(const Model::DeleteParallelDataRequest& request) const; /** * A Callable wrapper for DeleteParallelData that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::DeleteParallelDataOutcomeCallable DeleteParallelDataCallable(const DeleteParallelDataRequestT& request) const { return SubmitCallable(&TranslateClient::DeleteParallelData, request); } /** * An Async wrapper for DeleteParallelData that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void DeleteParallelDataAsync(const DeleteParallelDataRequestT& request, const DeleteParallelDataResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::DeleteParallelData, request, handler, context); } /** *

A synchronous action that deletes a custom terminology.

See * Also:

AWS * API Reference

*/ virtual Model::DeleteTerminologyOutcome DeleteTerminology(const Model::DeleteTerminologyRequest& request) const; /** * A Callable wrapper for DeleteTerminology that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::DeleteTerminologyOutcomeCallable DeleteTerminologyCallable(const DeleteTerminologyRequestT& request) const { return SubmitCallable(&TranslateClient::DeleteTerminology, request); } /** * An Async wrapper for DeleteTerminology that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void DeleteTerminologyAsync(const DeleteTerminologyRequestT& request, const DeleteTerminologyResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::DeleteTerminology, request, handler, context); } /** *

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.

See Also:

AWS * API Reference

*/ virtual Model::DescribeTextTranslationJobOutcome DescribeTextTranslationJob(const Model::DescribeTextTranslationJobRequest& request) const; /** * A Callable wrapper for DescribeTextTranslationJob that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::DescribeTextTranslationJobOutcomeCallable DescribeTextTranslationJobCallable(const DescribeTextTranslationJobRequestT& request) const { return SubmitCallable(&TranslateClient::DescribeTextTranslationJob, request); } /** * An Async wrapper for DescribeTextTranslationJob that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void DescribeTextTranslationJobAsync(const DescribeTextTranslationJobRequestT& request, const DescribeTextTranslationJobResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::DescribeTextTranslationJob, request, handler, context); } /** *

Provides information about a parallel data resource.

See Also:

* AWS * API Reference

*/ virtual Model::GetParallelDataOutcome GetParallelData(const Model::GetParallelDataRequest& request) const; /** * A Callable wrapper for GetParallelData that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::GetParallelDataOutcomeCallable GetParallelDataCallable(const GetParallelDataRequestT& request) const { return SubmitCallable(&TranslateClient::GetParallelData, request); } /** * An Async wrapper for GetParallelData that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void GetParallelDataAsync(const GetParallelDataRequestT& request, const GetParallelDataResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::GetParallelData, request, handler, context); } /** *

Retrieves a custom terminology.

See Also:

AWS * API Reference

*/ virtual Model::GetTerminologyOutcome GetTerminology(const Model::GetTerminologyRequest& request) const; /** * A Callable wrapper for GetTerminology that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::GetTerminologyOutcomeCallable GetTerminologyCallable(const GetTerminologyRequestT& request) const { return SubmitCallable(&TranslateClient::GetTerminology, request); } /** * An Async wrapper for GetTerminology that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void GetTerminologyAsync(const GetTerminologyRequestT& request, const GetTerminologyResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::GetTerminology, request, handler, context); } /** *

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.

See Also:

AWS * API Reference

*/ virtual Model::ImportTerminologyOutcome ImportTerminology(const Model::ImportTerminologyRequest& request) const; /** * A Callable wrapper for ImportTerminology that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::ImportTerminologyOutcomeCallable ImportTerminologyCallable(const ImportTerminologyRequestT& request) const { return SubmitCallable(&TranslateClient::ImportTerminology, request); } /** * An Async wrapper for ImportTerminology that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void ImportTerminologyAsync(const ImportTerminologyRequestT& request, const ImportTerminologyResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::ImportTerminology, request, handler, context); } /** *

Provides a list of languages (RFC-5646 codes and names) that Amazon Translate * supports.

See Also:

AWS * API Reference

*/ virtual Model::ListLanguagesOutcome ListLanguages(const Model::ListLanguagesRequest& request) const; /** * A Callable wrapper for ListLanguages that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::ListLanguagesOutcomeCallable ListLanguagesCallable(const ListLanguagesRequestT& request) const { return SubmitCallable(&TranslateClient::ListLanguages, request); } /** * An Async wrapper for ListLanguages that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void ListLanguagesAsync(const ListLanguagesRequestT& request, const ListLanguagesResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::ListLanguages, request, handler, context); } /** *

Provides a list of your parallel data resources in Amazon * Translate.

See Also:

AWS * API Reference

*/ virtual Model::ListParallelDataOutcome ListParallelData(const Model::ListParallelDataRequest& request) const; /** * A Callable wrapper for ListParallelData that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::ListParallelDataOutcomeCallable ListParallelDataCallable(const ListParallelDataRequestT& request) const { return SubmitCallable(&TranslateClient::ListParallelData, request); } /** * An Async wrapper for ListParallelData that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void ListParallelDataAsync(const ListParallelDataRequestT& request, const ListParallelDataResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::ListParallelData, request, handler, context); } /** *

Lists all tags associated with a given Amazon Translate resource. For more * information, see Tagging * your resources.

See Also:

AWS * API Reference

*/ virtual Model::ListTagsForResourceOutcome ListTagsForResource(const Model::ListTagsForResourceRequest& request) const; /** * A Callable wrapper for ListTagsForResource that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::ListTagsForResourceOutcomeCallable ListTagsForResourceCallable(const ListTagsForResourceRequestT& request) const { return SubmitCallable(&TranslateClient::ListTagsForResource, request); } /** * An Async wrapper for ListTagsForResource that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void ListTagsForResourceAsync(const ListTagsForResourceRequestT& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::ListTagsForResource, request, handler, context); } /** *

Provides a list of custom terminologies associated with your * account.

See Also:

AWS * API Reference

*/ virtual Model::ListTerminologiesOutcome ListTerminologies(const Model::ListTerminologiesRequest& request) const; /** * A Callable wrapper for ListTerminologies that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::ListTerminologiesOutcomeCallable ListTerminologiesCallable(const ListTerminologiesRequestT& request) const { return SubmitCallable(&TranslateClient::ListTerminologies, request); } /** * An Async wrapper for ListTerminologies that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void ListTerminologiesAsync(const ListTerminologiesRequestT& request, const ListTerminologiesResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::ListTerminologies, request, handler, context); } /** *

Gets a list of the batch translation jobs that you have * submitted.

See Also:

AWS * API Reference

*/ virtual Model::ListTextTranslationJobsOutcome ListTextTranslationJobs(const Model::ListTextTranslationJobsRequest& request) const; /** * A Callable wrapper for ListTextTranslationJobs that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::ListTextTranslationJobsOutcomeCallable ListTextTranslationJobsCallable(const ListTextTranslationJobsRequestT& request) const { return SubmitCallable(&TranslateClient::ListTextTranslationJobs, request); } /** * An Async wrapper for ListTextTranslationJobs that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void ListTextTranslationJobsAsync(const ListTextTranslationJobsRequestT& request, const ListTextTranslationJobsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::ListTextTranslationJobs, request, handler, context); } /** *

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.

See Also:

AWS * API Reference

*/ virtual Model::StartTextTranslationJobOutcome StartTextTranslationJob(const Model::StartTextTranslationJobRequest& request) const; /** * A Callable wrapper for StartTextTranslationJob that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::StartTextTranslationJobOutcomeCallable StartTextTranslationJobCallable(const StartTextTranslationJobRequestT& request) const { return SubmitCallable(&TranslateClient::StartTextTranslationJob, request); } /** * An Async wrapper for StartTextTranslationJob that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void StartTextTranslationJobAsync(const StartTextTranslationJobRequestT& request, const StartTextTranslationJobResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::StartTextTranslationJob, request, handler, context); } /** *

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.

See Also:

* AWS * API Reference

*/ virtual Model::StopTextTranslationJobOutcome StopTextTranslationJob(const Model::StopTextTranslationJobRequest& request) const; /** * A Callable wrapper for StopTextTranslationJob that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::StopTextTranslationJobOutcomeCallable StopTextTranslationJobCallable(const StopTextTranslationJobRequestT& request) const { return SubmitCallable(&TranslateClient::StopTextTranslationJob, request); } /** * An Async wrapper for StopTextTranslationJob that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void StopTextTranslationJobAsync(const StopTextTranslationJobRequestT& request, const StopTextTranslationJobResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::StopTextTranslationJob, request, handler, context); } /** *

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.

See Also:

AWS * API Reference

*/ virtual Model::TagResourceOutcome TagResource(const Model::TagResourceRequest& request) const; /** * A Callable wrapper for TagResource that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::TagResourceOutcomeCallable TagResourceCallable(const TagResourceRequestT& request) const { return SubmitCallable(&TranslateClient::TagResource, request); } /** * An Async wrapper for TagResource that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void TagResourceAsync(const TagResourceRequestT& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::TagResource, request, handler, context); } /** *

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.

See Also:

AWS * API Reference

*/ virtual Model::TranslateDocumentOutcome TranslateDocument(const Model::TranslateDocumentRequest& request) const; /** * A Callable wrapper for TranslateDocument that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::TranslateDocumentOutcomeCallable TranslateDocumentCallable(const TranslateDocumentRequestT& request) const { return SubmitCallable(&TranslateClient::TranslateDocument, request); } /** * An Async wrapper for TranslateDocument that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void TranslateDocumentAsync(const TranslateDocumentRequestT& request, const TranslateDocumentResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::TranslateDocument, request, handler, context); } /** *

Translates input text from the source language to the target language. For a * list of available languages and language codes, see Supported * languages.

See Also:

AWS * API Reference

*/ virtual Model::TranslateTextOutcome TranslateText(const Model::TranslateTextRequest& request) const; /** * A Callable wrapper for TranslateText that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::TranslateTextOutcomeCallable TranslateTextCallable(const TranslateTextRequestT& request) const { return SubmitCallable(&TranslateClient::TranslateText, request); } /** * An Async wrapper for TranslateText that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void TranslateTextAsync(const TranslateTextRequestT& request, const TranslateTextResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::TranslateText, request, handler, context); } /** *

Removes a specific tag associated with an Amazon Translate resource. For more * information, see Tagging * your resources.

See Also:

AWS * API Reference

*/ virtual Model::UntagResourceOutcome UntagResource(const Model::UntagResourceRequest& request) const; /** * A Callable wrapper for UntagResource that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::UntagResourceOutcomeCallable UntagResourceCallable(const UntagResourceRequestT& request) const { return SubmitCallable(&TranslateClient::UntagResource, request); } /** * An Async wrapper for UntagResource that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void UntagResourceAsync(const UntagResourceRequestT& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::UntagResource, request, handler, context); } /** *

Updates a previously created parallel data resource by importing a new input * file from Amazon S3.

See Also:

AWS * API Reference

*/ virtual Model::UpdateParallelDataOutcome UpdateParallelData(const Model::UpdateParallelDataRequest& request) const; /** * A Callable wrapper for UpdateParallelData that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::UpdateParallelDataOutcomeCallable UpdateParallelDataCallable(const UpdateParallelDataRequestT& request) const { return SubmitCallable(&TranslateClient::UpdateParallelData, request); } /** * An Async wrapper for UpdateParallelData that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void UpdateParallelDataAsync(const UpdateParallelDataRequestT& request, const UpdateParallelDataResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&TranslateClient::UpdateParallelData, request, handler, context); } void OverrideEndpoint(const Aws::String& endpoint); std::shared_ptr& accessEndpointProvider(); private: friend class Aws::Client::ClientWithAsyncTemplateMethods; void init(const TranslateClientConfiguration& clientConfiguration); TranslateClientConfiguration m_clientConfiguration; std::shared_ptr m_executor; std::shared_ptr m_endpointProvider; }; } // namespace Translate } // namespace Aws