/** * 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 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 ConnectParticipant { namespace Model { class CreateParticipantConnectionRequest; class DisconnectParticipantRequest; class GetTranscriptRequest; class SendEventRequest; class SendMessageRequest; typedef Aws::Utils::Outcome CreateParticipantConnectionOutcome; typedef Aws::Utils::Outcome DisconnectParticipantOutcome; typedef Aws::Utils::Outcome GetTranscriptOutcome; typedef Aws::Utils::Outcome SendEventOutcome; typedef Aws::Utils::Outcome SendMessageOutcome; typedef std::future CreateParticipantConnectionOutcomeCallable; typedef std::future DisconnectParticipantOutcomeCallable; typedef std::future GetTranscriptOutcomeCallable; typedef std::future SendEventOutcomeCallable; typedef std::future SendMessageOutcomeCallable; } // namespace Model class ConnectParticipantClient; typedef std::function&) > CreateParticipantConnectionResponseReceivedHandler; typedef std::function&) > DisconnectParticipantResponseReceivedHandler; typedef std::function&) > GetTranscriptResponseReceivedHandler; typedef std::function&) > SendEventResponseReceivedHandler; typedef std::function&) > SendMessageResponseReceivedHandler; /** *

Amazon Connect is a cloud-based contact center solution that makes it easy to * set up and manage a customer contact center and provide reliable customer * engagement at any scale.

Amazon Connect enables customer contacts through * voice or chat.

The APIs described here are used by chat participants, * such as agents and customers.

*/ class AWS_CONNECTPARTICIPANT_API ConnectParticipantClient : 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. */ ConnectParticipantClient(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. */ ConnectParticipantClient(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 */ ConnectParticipantClient(const std::shared_ptr& credentialsProvider, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration()); virtual ~ConnectParticipantClient(); /** *

Creates the participant's connection. Note that ParticipantToken is used for * invoking this API instead of ConnectionToken.

The participant token is * valid for the lifetime of the participant – until the they are part of a * contact.

The response URL for WEBSOCKET Type has a connect * expiry timeout of 100s. Clients must manually connect to the returned websocket * URL and subscribe to the desired topic.

For chat, you need to publish * the following on the established websocket connection:

* {"topic":"aws/subscribe","content":{"topics":["aws/chat"]}}

*

Upon websocket URL expiry, as specified in the response ConnectionExpiry * parameter, clients need to call this API again to obtain a new websocket URL and * perform the same steps as before.

See Also:

AWS * API Reference

*/ virtual Model::CreateParticipantConnectionOutcome CreateParticipantConnection(const Model::CreateParticipantConnectionRequest& request) const; /** *

Creates the participant's connection. Note that ParticipantToken is used for * invoking this API instead of ConnectionToken.

The participant token is * valid for the lifetime of the participant – until the they are part of a * contact.

The response URL for WEBSOCKET Type has a connect * expiry timeout of 100s. Clients must manually connect to the returned websocket * URL and subscribe to the desired topic.

For chat, you need to publish * the following on the established websocket connection:

* {"topic":"aws/subscribe","content":{"topics":["aws/chat"]}}

*

Upon websocket URL expiry, as specified in the response ConnectionExpiry * parameter, clients need to call this API again to obtain a new websocket URL and * perform the same steps as before.

See Also:

AWS * API Reference

* * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CreateParticipantConnectionOutcomeCallable CreateParticipantConnectionCallable(const Model::CreateParticipantConnectionRequest& request) const; /** *

Creates the participant's connection. Note that ParticipantToken is used for * invoking this API instead of ConnectionToken.

The participant token is * valid for the lifetime of the participant – until the they are part of a * contact.

The response URL for WEBSOCKET Type has a connect * expiry timeout of 100s. Clients must manually connect to the returned websocket * URL and subscribe to the desired topic.

For chat, you need to publish * the following on the established websocket connection:

* {"topic":"aws/subscribe","content":{"topics":["aws/chat"]}}

*

Upon websocket URL expiry, as specified in the response ConnectionExpiry * parameter, clients need to call this API again to obtain a new websocket URL and * perform the same steps as before.

See Also:

AWS * API Reference

* * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CreateParticipantConnectionAsync(const Model::CreateParticipantConnectionRequest& request, const CreateParticipantConnectionResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const; /** *

Disconnects a participant. Note that ConnectionToken is used for invoking * this API instead of ParticipantToken.

See Also:

AWS * API Reference

*/ virtual Model::DisconnectParticipantOutcome DisconnectParticipant(const Model::DisconnectParticipantRequest& request) const; /** *

Disconnects a participant. Note that ConnectionToken is used for invoking * this API instead of ParticipantToken.

See Also:

AWS * API Reference

* * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DisconnectParticipantOutcomeCallable DisconnectParticipantCallable(const Model::DisconnectParticipantRequest& request) const; /** *

Disconnects a participant. Note that ConnectionToken is used for invoking * this API instead of ParticipantToken.

See Also:

AWS * API Reference

* * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DisconnectParticipantAsync(const Model::DisconnectParticipantRequest& request, const DisconnectParticipantResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const; /** *

Retrieves a transcript of the session. Note that ConnectionToken is used for * invoking this API instead of ParticipantToken.

See Also:

AWS * API Reference

*/ virtual Model::GetTranscriptOutcome GetTranscript(const Model::GetTranscriptRequest& request) const; /** *

Retrieves a transcript of the session. Note that ConnectionToken is used for * invoking this API instead of ParticipantToken.

See Also:

AWS * API Reference

* * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetTranscriptOutcomeCallable GetTranscriptCallable(const Model::GetTranscriptRequest& request) const; /** *

Retrieves a transcript of the session. Note that ConnectionToken is used for * invoking this API instead of ParticipantToken.

See Also:

AWS * API Reference

* * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetTranscriptAsync(const Model::GetTranscriptRequest& request, const GetTranscriptResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const; /** *

Sends an event. Note that ConnectionToken is used for invoking this API * instead of ParticipantToken.

See Also:

AWS * API Reference

*/ virtual Model::SendEventOutcome SendEvent(const Model::SendEventRequest& request) const; /** *

Sends an event. Note that ConnectionToken is used for invoking this API * instead of ParticipantToken.

See Also:

AWS * API Reference

* * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::SendEventOutcomeCallable SendEventCallable(const Model::SendEventRequest& request) const; /** *

Sends an event. Note that ConnectionToken is used for invoking this API * instead of ParticipantToken.

See Also:

AWS * API Reference

* * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void SendEventAsync(const Model::SendEventRequest& request, const SendEventResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const; /** *

Sends a message. Note that ConnectionToken is used for invoking this API * instead of ParticipantToken.

See Also:

AWS * API Reference

*/ virtual Model::SendMessageOutcome SendMessage(const Model::SendMessageRequest& request) const; /** *

Sends a message. Note that ConnectionToken is used for invoking this API * instead of ParticipantToken.

See Also:

AWS * API Reference

* * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::SendMessageOutcomeCallable SendMessageCallable(const Model::SendMessageRequest& request) const; /** *

Sends a message. Note that ConnectionToken is used for invoking this API * instead of ParticipantToken.

See Also:

AWS * API Reference

* * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void SendMessageAsync(const Model::SendMessageRequest& request, const SendMessageResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const; void OverrideEndpoint(const Aws::String& endpoint); private: void init(const Aws::Client::ClientConfiguration& clientConfiguration); void CreateParticipantConnectionAsyncHelper(const Model::CreateParticipantConnectionRequest& request, const CreateParticipantConnectionResponseReceivedHandler& handler, const std::shared_ptr& context) const; void DisconnectParticipantAsyncHelper(const Model::DisconnectParticipantRequest& request, const DisconnectParticipantResponseReceivedHandler& handler, const std::shared_ptr& context) const; void GetTranscriptAsyncHelper(const Model::GetTranscriptRequest& request, const GetTranscriptResponseReceivedHandler& handler, const std::shared_ptr& context) const; void SendEventAsyncHelper(const Model::SendEventRequest& request, const SendEventResponseReceivedHandler& handler, const std::shared_ptr& context) const; void SendMessageAsyncHelper(const Model::SendMessageRequest& request, const SendMessageResponseReceivedHandler& handler, const std::shared_ptr& context) const; Aws::String m_uri; Aws::String m_configScheme; std::shared_ptr m_executor; }; } // namespace ConnectParticipant } // namespace Aws