/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace Aws
{
namespace Http
{
class HttpClient;
class HttpClientFactory;
} // namespace Http
namespace Utils
{
template< typename R, typename E> class Outcome;
namespace Threading
{
class Executor;
} // namespace Threading
} // namespace Utils
namespace Auth
{
class AWSCredentials;
class AWSCredentialsProvider;
} // namespace Auth
namespace Client
{
class RetryStrategy;
} // namespace Client
namespace Polly
{
namespace Model
{
class DeleteLexiconRequest;
class DescribeVoicesRequest;
class GetLexiconRequest;
class GetSpeechSynthesisTaskRequest;
class ListLexiconsRequest;
class ListSpeechSynthesisTasksRequest;
class PutLexiconRequest;
class StartSpeechSynthesisTaskRequest;
class SynthesizeSpeechRequest;
typedef Aws::Utils::Outcome DeleteLexiconOutcome;
typedef Aws::Utils::Outcome DescribeVoicesOutcome;
typedef Aws::Utils::Outcome GetLexiconOutcome;
typedef Aws::Utils::Outcome GetSpeechSynthesisTaskOutcome;
typedef Aws::Utils::Outcome ListLexiconsOutcome;
typedef Aws::Utils::Outcome ListSpeechSynthesisTasksOutcome;
typedef Aws::Utils::Outcome PutLexiconOutcome;
typedef Aws::Utils::Outcome StartSpeechSynthesisTaskOutcome;
typedef Aws::Utils::Outcome SynthesizeSpeechOutcome;
typedef std::future DeleteLexiconOutcomeCallable;
typedef std::future DescribeVoicesOutcomeCallable;
typedef std::future GetLexiconOutcomeCallable;
typedef std::future GetSpeechSynthesisTaskOutcomeCallable;
typedef std::future ListLexiconsOutcomeCallable;
typedef std::future ListSpeechSynthesisTasksOutcomeCallable;
typedef std::future PutLexiconOutcomeCallable;
typedef std::future StartSpeechSynthesisTaskOutcomeCallable;
typedef std::future SynthesizeSpeechOutcomeCallable;
} // namespace Model
class PollyClient;
typedef std::function&) > DeleteLexiconResponseReceivedHandler;
typedef std::function&) > DescribeVoicesResponseReceivedHandler;
typedef std::function&) > GetLexiconResponseReceivedHandler;
typedef std::function&) > GetSpeechSynthesisTaskResponseReceivedHandler;
typedef std::function&) > ListLexiconsResponseReceivedHandler;
typedef std::function&) > ListSpeechSynthesisTasksResponseReceivedHandler;
typedef std::function&) > PutLexiconResponseReceivedHandler;
typedef std::function&) > StartSpeechSynthesisTaskResponseReceivedHandler;
typedef std::function&) > SynthesizeSpeechResponseReceivedHandler;
/**
* Amazon Polly is a web service that makes it easy to synthesize speech from
* text.
The Amazon Polly service provides API operations for synthesizing
* high-quality speech from plain text and Speech Synthesis Markup Language (SSML),
* along with managing pronunciations lexicons that enable you to get the best
* results for your application domain.
*/
class AWS_POLLY_API PollyClient : public Aws::Client::AWSJsonClient
{
public:
typedef Aws::Client::AWSJsonClient BASECLASS;
/**
* 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.
*/
PollyClient(const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::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.
*/
PollyClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::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
*/
PollyClient(const std::shared_ptr& credentialsProvider,
const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
virtual ~PollyClient();
/**
* Deletes the specified pronunciation lexicon stored in an AWS Region. A
* lexicon which has been deleted is not available for speech synthesis, nor is it
* possible to retrieve it using either the GetLexicon or
* ListLexicon APIs.
For more information, see Managing
* Lexicons.
See Also:
AWS
* API Reference
*/
virtual Model::DeleteLexiconOutcome DeleteLexicon(const Model::DeleteLexiconRequest& request) const;
/**
* Deletes the specified pronunciation lexicon stored in an AWS Region. A
* lexicon which has been deleted is not available for speech synthesis, nor is it
* possible to retrieve it using either the GetLexicon or
* ListLexicon APIs.
Deletes the specified pronunciation lexicon stored in an AWS Region. A
* lexicon which has been deleted is not available for speech synthesis, nor is it
* possible to retrieve it using either the GetLexicon or
* ListLexicon APIs.
& context = nullptr) const;
/**
* Returns the list of voices that are available for use when requesting speech
* synthesis. Each voice speaks a specified language, is either male or female, and
* is identified by an ID, which is the ASCII version of the voice name.
* When synthesizing speech ( SynthesizeSpeech ), you provide the
* voice ID for the voice you want from the list of voices returned by
* DescribeVoices.
For example, you want your news reader
* application to read news in a specific language, but giving a user the option to
* choose the voice. Using the DescribeVoices operation you can
* provide the user with a list of available voices to select from.
You can
* optionally specify a language code to filter the available voices. For example,
* if you specify en-US, the operation returns a list of all available
* US English voices.
This operation requires permissions to perform the
* polly:DescribeVoices action.
See Also:
AWS
* API Reference
*/
virtual Model::DescribeVoicesOutcome DescribeVoices(const Model::DescribeVoicesRequest& request) const;
/**
* Returns the list of voices that are available for use when requesting speech
* synthesis. Each voice speaks a specified language, is either male or female, and
* is identified by an ID, which is the ASCII version of the voice name.
* When synthesizing speech ( SynthesizeSpeech ), you provide the
* voice ID for the voice you want from the list of voices returned by
* DescribeVoices.
For example, you want your news reader
* application to read news in a specific language, but giving a user the option to
* choose the voice. Using the DescribeVoices operation you can
* provide the user with a list of available voices to select from.
You can
* optionally specify a language code to filter the available voices. For example,
* if you specify en-US, the operation returns a list of all available
* US English voices.
This operation requires permissions to perform the
* polly:DescribeVoices action.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::DescribeVoicesOutcomeCallable DescribeVoicesCallable(const Model::DescribeVoicesRequest& request) const;
/**
* Returns the list of voices that are available for use when requesting speech
* synthesis. Each voice speaks a specified language, is either male or female, and
* is identified by an ID, which is the ASCII version of the voice name.
* When synthesizing speech ( SynthesizeSpeech ), you provide the
* voice ID for the voice you want from the list of voices returned by
* DescribeVoices.
For example, you want your news reader
* application to read news in a specific language, but giving a user the option to
* choose the voice. Using the DescribeVoices operation you can
* provide the user with a list of available voices to select from.
You can
* optionally specify a language code to filter the available voices. For example,
* if you specify en-US, the operation returns a list of all available
* US English voices.
This operation requires permissions to perform the
* polly:DescribeVoices action.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void DescribeVoicesAsync(const Model::DescribeVoicesRequest& request, const DescribeVoicesResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Returns the content of the specified pronunciation lexicon stored in an AWS
* Region. For more information, see Managing
* Lexicons.
See Also:
AWS
* API Reference
*/
virtual Model::GetLexiconOutcome GetLexicon(const Model::GetLexiconRequest& request) const;
/**
* Returns the content of the specified pronunciation lexicon stored in an AWS
* Region. For more information, see Managing
* Lexicons.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::GetLexiconOutcomeCallable GetLexiconCallable(const Model::GetLexiconRequest& request) const;
/**
* Returns the content of the specified pronunciation lexicon stored in an AWS
* Region. For more information, see Managing
* Lexicons.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void GetLexiconAsync(const Model::GetLexiconRequest& request, const GetLexiconResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Retrieves a specific SpeechSynthesisTask object based on its TaskID. This
* object contains information about the given speech synthesis task, including the
* status of the task, and a link to the S3 bucket containing the output of the
* task.
See Also:
AWS
* API Reference
*/
virtual Model::GetSpeechSynthesisTaskOutcome GetSpeechSynthesisTask(const Model::GetSpeechSynthesisTaskRequest& request) const;
/**
* Retrieves a specific SpeechSynthesisTask object based on its TaskID. This
* object contains information about the given speech synthesis task, including the
* status of the task, and a link to the S3 bucket containing the output of the
* task.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::GetSpeechSynthesisTaskOutcomeCallable GetSpeechSynthesisTaskCallable(const Model::GetSpeechSynthesisTaskRequest& request) const;
/**
* Retrieves a specific SpeechSynthesisTask object based on its TaskID. This
* object contains information about the given speech synthesis task, including the
* status of the task, and a link to the S3 bucket containing the output of the
* task.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void GetSpeechSynthesisTaskAsync(const Model::GetSpeechSynthesisTaskRequest& request, const GetSpeechSynthesisTaskResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Returns a list of pronunciation lexicons stored in an AWS Region. For more
* information, see Managing
* Lexicons.
See Also:
AWS
* API Reference
*/
virtual Model::ListLexiconsOutcome ListLexicons(const Model::ListLexiconsRequest& request) const;
/**
* Returns a list of pronunciation lexicons stored in an AWS Region. For more
* information, see Managing
* Lexicons.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::ListLexiconsOutcomeCallable ListLexiconsCallable(const Model::ListLexiconsRequest& request) const;
/**
* Returns a list of pronunciation lexicons stored in an AWS Region. For more
* information, see Managing
* Lexicons.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void ListLexiconsAsync(const Model::ListLexiconsRequest& request, const ListLexiconsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Returns a list of SpeechSynthesisTask objects ordered by their creation date.
* This operation can filter the tasks by their status, for example, allowing users
* to list only tasks that are completed.
See Also:
AWS
* API Reference
*/
virtual Model::ListSpeechSynthesisTasksOutcome ListSpeechSynthesisTasks(const Model::ListSpeechSynthesisTasksRequest& request) const;
/**
* Returns a list of SpeechSynthesisTask objects ordered by their creation date.
* This operation can filter the tasks by their status, for example, allowing users
* to list only tasks that are completed.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::ListSpeechSynthesisTasksOutcomeCallable ListSpeechSynthesisTasksCallable(const Model::ListSpeechSynthesisTasksRequest& request) const;
/**
* Returns a list of SpeechSynthesisTask objects ordered by their creation date.
* This operation can filter the tasks by their status, for example, allowing users
* to list only tasks that are completed.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void ListSpeechSynthesisTasksAsync(const Model::ListSpeechSynthesisTasksRequest& request, const ListSpeechSynthesisTasksResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Stores a pronunciation lexicon in an AWS Region. If a lexicon with the same
* name already exists in the region, it is overwritten by the new lexicon. Lexicon
* operations have eventual consistency, therefore, it might take some time before
* the lexicon is available to the SynthesizeSpeech operation.
For more
* information, see Managing
* Lexicons.
See Also:
AWS
* API Reference
*/
virtual Model::PutLexiconOutcome PutLexicon(const Model::PutLexiconRequest& request) const;
/**
* Stores a pronunciation lexicon in an AWS Region. If a lexicon with the same
* name already exists in the region, it is overwritten by the new lexicon. Lexicon
* operations have eventual consistency, therefore, it might take some time before
* the lexicon is available to the SynthesizeSpeech operation.
For more
* information, see Managing
* Lexicons.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::PutLexiconOutcomeCallable PutLexiconCallable(const Model::PutLexiconRequest& request) const;
/**
* Stores a pronunciation lexicon in an AWS Region. If a lexicon with the same
* name already exists in the region, it is overwritten by the new lexicon. Lexicon
* operations have eventual consistency, therefore, it might take some time before
* the lexicon is available to the SynthesizeSpeech operation.
For more
* information, see Managing
* Lexicons.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void PutLexiconAsync(const Model::PutLexiconRequest& request, const PutLexiconResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Allows the creation of an asynchronous synthesis task, by starting a new
* SpeechSynthesisTask. This operation requires all the standard
* information needed for speech synthesis, plus the name of an Amazon S3 bucket
* for the service to store the output of the synthesis task and two optional
* parameters (OutputS3KeyPrefix and SnsTopicArn). Once the synthesis task is
* created, this operation will return a SpeechSynthesisTask object, which will
* include an identifier of this task as well as the current status.
See
* Also:
AWS
* API Reference
*/
virtual Model::StartSpeechSynthesisTaskOutcome StartSpeechSynthesisTask(const Model::StartSpeechSynthesisTaskRequest& request) const;
/**
* Allows the creation of an asynchronous synthesis task, by starting a new
* SpeechSynthesisTask. This operation requires all the standard
* information needed for speech synthesis, plus the name of an Amazon S3 bucket
* for the service to store the output of the synthesis task and two optional
* parameters (OutputS3KeyPrefix and SnsTopicArn). Once the synthesis task is
* created, this operation will return a SpeechSynthesisTask object, which will
* include an identifier of this task as well as the current status.
See
* Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::StartSpeechSynthesisTaskOutcomeCallable StartSpeechSynthesisTaskCallable(const Model::StartSpeechSynthesisTaskRequest& request) const;
/**
* Allows the creation of an asynchronous synthesis task, by starting a new
* SpeechSynthesisTask. This operation requires all the standard
* information needed for speech synthesis, plus the name of an Amazon S3 bucket
* for the service to store the output of the synthesis task and two optional
* parameters (OutputS3KeyPrefix and SnsTopicArn). Once the synthesis task is
* created, this operation will return a SpeechSynthesisTask object, which will
* include an identifier of this task as well as the current status.
See
* Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void StartSpeechSynthesisTaskAsync(const Model::StartSpeechSynthesisTaskRequest& request, const StartSpeechSynthesisTaskResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes. SSML input
* must be valid, well-formed SSML. Some alphabets might not be available with all
* the voices (for example, Cyrillic might not be read at all by English voices)
* unless phoneme mapping is used. For more information, see How
* it Works.
See Also:
AWS
* API Reference
*/
virtual Model::SynthesizeSpeechOutcome SynthesizeSpeech(const Model::SynthesizeSpeechRequest& request) const;
/**
* Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes. SSML input
* must be valid, well-formed SSML. Some alphabets might not be available with all
* the voices (for example, Cyrillic might not be read at all by English voices)
* unless phoneme mapping is used. For more information, see How
* it Works.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::SynthesizeSpeechOutcomeCallable SynthesizeSpeechCallable(const Model::SynthesizeSpeechRequest& request) const;
/**
* Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes. SSML input
* must be valid, well-formed SSML. Some alphabets might not be available with all
* the voices (for example, Cyrillic might not be read at all by English voices)
* unless phoneme mapping is used. For more information, see How
* it Works.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void SynthesizeSpeechAsync(const Model::SynthesizeSpeechRequest& request, const SynthesizeSpeechResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
void OverrideEndpoint(const Aws::String& endpoint);
private:
void init(const Aws::Client::ClientConfiguration& clientConfiguration);
void DeleteLexiconAsyncHelper(const Model::DeleteLexiconRequest& request, const DeleteLexiconResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void DescribeVoicesAsyncHelper(const Model::DescribeVoicesRequest& request, const DescribeVoicesResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void GetLexiconAsyncHelper(const Model::GetLexiconRequest& request, const GetLexiconResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void GetSpeechSynthesisTaskAsyncHelper(const Model::GetSpeechSynthesisTaskRequest& request, const GetSpeechSynthesisTaskResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void ListLexiconsAsyncHelper(const Model::ListLexiconsRequest& request, const ListLexiconsResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void ListSpeechSynthesisTasksAsyncHelper(const Model::ListSpeechSynthesisTasksRequest& request, const ListSpeechSynthesisTasksResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void PutLexiconAsyncHelper(const Model::PutLexiconRequest& request, const PutLexiconResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void StartSpeechSynthesisTaskAsyncHelper(const Model::StartSpeechSynthesisTaskRequest& request, const StartSpeechSynthesisTaskResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void SynthesizeSpeechAsyncHelper(const Model::SynthesizeSpeechRequest& request, const SynthesizeSpeechResponseReceivedHandler& handler, const std::shared_ptr& context) const;
Aws::String m_uri;
Aws::String m_configScheme;
std::shared_ptr m_executor;
};
} // namespace Polly
} // namespace Aws