/** * 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 ivschat { /** *

Introduction

The Amazon IVS Chat control-plane API enables * you to create and manage Amazon IVS Chat resources. You also need to integrate * with the * Amazon IVS Chat Messaging API, to enable users to interact with chat rooms * in real time.

The API is an AWS regional service. For a list of supported * regions and Amazon IVS Chat HTTPS service endpoints, see the Amazon IVS Chat * information on the Amazon IVS * page in the AWS General Reference.

Notes on * terminology:

  • You create service applications using the * Amazon IVS Chat API. We refer to these as applications.

  • *

    You create front-end client applications (browser and Android/iOS apps) using * the Amazon IVS Chat Messaging API. We refer to these as clients.

    *

Resources

The following resources are part of * Amazon IVS Chat:

  • LoggingConfiguration — A configuration * that allows customers to store and record sent messages in a chat room. See the * Logging Configuration endpoints for more information.

  • * Room — The central Amazon IVS Chat resource through which clients connect * to and exchange chat messages. See the Room endpoints for more information.

    *

Tagging

A tag is a metadata label that you * assign to an AWS resource. A tag comprises a key and a value, both * set by you. For example, you might set a tag as topic:nature to * label a particular video category. See Tagging * AWS Resources for more information, including restrictions that apply to * tags and "Tag naming limits and requirements"; Amazon IVS Chat has no * service-specific constraints beyond what is documented there.

Tags can * help you identify and organize your AWS resources. For example, you can use the * same tag for different resources to indicate that they are related. You can also * use tags to manage access (see Access * Tags).

The Amazon IVS Chat API has these tag-related endpoints: * TagResource, UntagResource, and ListTagsForResource. The * following resource supports tagging: Room.

At most 50 tags can be applied * to a resource.

API Access Security

Your Amazon IVS Chat * applications (service applications and clients) must be authenticated and * authorized to access Amazon IVS Chat resources. Note the differences between * these concepts:

  • Authentication is about verifying * identity. Requests to the Amazon IVS Chat API must be signed to verify your * identity.

  • Authorization is about granting permissions. * Your IAM roles need to have permissions for Amazon IVS Chat API requests.

    *

Users (viewers) connect to a room using secure access tokens that * you create using the CreateChatToken endpoint through the AWS SDK. You * call CreateChatToken for every user’s chat session, passing identity and * authorization information about the user.

Signing API Requests *

HTTP API requests must be signed with an AWS SigV4 signature using your * AWS security credentials. The AWS Command Line Interface (CLI) and the AWS SDKs * take care of signing the underlying API calls for you. However, if your * application calls the Amazon IVS Chat HTTP API directly, it’s your * responsibility to sign the requests.

You generate a signature using valid * AWS credentials for an IAM role that has permission to perform the requested * action. For example, DeleteMessage requests must be made using an IAM role that * has the ivschat:DeleteMessage permission.

For more * information:

Amazon Resource Names (ARNs)

ARNs * uniquely identify AWS resources. An ARN is required when you need to specify a * resource unambiguously across all of AWS, such as in IAM policies and API calls. * For more information, see Amazon * Resource Names in the AWS General Reference.

Messaging * Endpoints

  • DeleteMessage — Sends an event to a * specific room which directs clients to delete a specific message; that is, * unrender it from view and delete it from the client’s chat history. This event’s * EventName is aws:DELETE_MESSAGE. This replicates the * * DeleteMessage WebSocket operation in the Amazon IVS Chat Messaging API.

    *
  • DisconnectUser — Disconnects all connections using a * specified user ID from a room. This replicates the * DisconnectUser WebSocket operation in the Amazon IVS Chat Messaging API.

    *
  • SendEvent — Sends an event to a room. Use this within your * application’s business logic to send events to clients of a room; e.g., to * notify clients to change the way the chat UI is rendered.

* Chat Token Endpoint

  • CreateChatToken — Creates * an encrypted token that is used by a chat participant to establish an individual * WebSocket chat connection to a room. When the token is used to connect to chat, * the connection is valid for the session duration specified in the request. The * token becomes invalid at the token-expiration timestamp included in the * response.

Room Endpoints

  • * CreateRoom — Creates a room that allows clients to connect and pass * messages.

  • DeleteRoom — Deletes the specified room.

    *
  • GetRoom — Gets the specified room.

  • * ListRooms — Gets summary information about all your rooms in the AWS * region where the API request is processed.

  • UpdateRoom * — Updates a room’s configuration.

Logging Configuration * Endpoints

Tags Endpoints

  • * ListTagsForResource — Gets information about AWS tags for the specified * ARN.

  • TagResource — Adds or updates tags for the AWS * resource with the specified ARN.

  • UntagResource — * Removes tags from the resource with the specified ARN.

All * the above are HTTP operations. There is a separate messaging API for * managing Chat resources; see the * Amazon IVS Chat Messaging API Reference.

*/ class AWS_IVSCHAT_API IvschatClient : 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 IvschatClientConfiguration ClientConfigurationType; typedef IvschatEndpointProvider 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. */ IvschatClient(const Aws::ivschat::IvschatClientConfiguration& clientConfiguration = Aws::ivschat::IvschatClientConfiguration(), 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. */ IvschatClient(const Aws::Auth::AWSCredentials& credentials, std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG), const Aws::ivschat::IvschatClientConfiguration& clientConfiguration = Aws::ivschat::IvschatClientConfiguration()); /** * 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 */ IvschatClient(const std::shared_ptr& credentialsProvider, std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG), const Aws::ivschat::IvschatClientConfiguration& clientConfiguration = Aws::ivschat::IvschatClientConfiguration()); /* 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. */ IvschatClient(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. */ IvschatClient(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 */ IvschatClient(const std::shared_ptr& credentialsProvider, const Aws::Client::ClientConfiguration& clientConfiguration); /* End of legacy constructors due deprecation */ virtual ~IvschatClient(); /** *

Creates an encrypted token that is used by a chat participant to establish an * individual WebSocket chat connection to a room. When the token is used to * connect to chat, the connection is valid for the session duration specified in * the request. The token becomes invalid at the token-expiration timestamp * included in the response.

Use the capabilities field to * permit an end user to send messages or moderate a room.

The * attributes field securely attaches structured data to the chat * session; the data is included within each message sent by the end user and * received by other participants in the room. Common use cases for attributes * include passing end-user profile data like an icon, display name, colors, * badges, and other display features.

Encryption keys are owned by Amazon * IVS Chat and never used directly by your application.

See Also:

* AWS * API Reference

*/ virtual Model::CreateChatTokenOutcome CreateChatToken(const Model::CreateChatTokenRequest& request) const; /** * A Callable wrapper for CreateChatToken that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::CreateChatTokenOutcomeCallable CreateChatTokenCallable(const CreateChatTokenRequestT& request) const { return SubmitCallable(&IvschatClient::CreateChatToken, request); } /** * An Async wrapper for CreateChatToken that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void CreateChatTokenAsync(const CreateChatTokenRequestT& request, const CreateChatTokenResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&IvschatClient::CreateChatToken, request, handler, context); } /** *

Creates a logging configuration that allows clients to store and record sent * messages.

See Also:

AWS * API Reference

*/ virtual Model::CreateLoggingConfigurationOutcome CreateLoggingConfiguration(const Model::CreateLoggingConfigurationRequest& request) const; /** * A Callable wrapper for CreateLoggingConfiguration that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::CreateLoggingConfigurationOutcomeCallable CreateLoggingConfigurationCallable(const CreateLoggingConfigurationRequestT& request) const { return SubmitCallable(&IvschatClient::CreateLoggingConfiguration, request); } /** * An Async wrapper for CreateLoggingConfiguration that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void CreateLoggingConfigurationAsync(const CreateLoggingConfigurationRequestT& request, const CreateLoggingConfigurationResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&IvschatClient::CreateLoggingConfiguration, request, handler, context); } /** *

Creates a room that allows clients to connect and pass * messages.

See Also:

AWS * API Reference

*/ virtual Model::CreateRoomOutcome CreateRoom(const Model::CreateRoomRequest& request) const; /** * A Callable wrapper for CreateRoom that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::CreateRoomOutcomeCallable CreateRoomCallable(const CreateRoomRequestT& request) const { return SubmitCallable(&IvschatClient::CreateRoom, request); } /** * An Async wrapper for CreateRoom that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void CreateRoomAsync(const CreateRoomRequestT& request, const CreateRoomResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&IvschatClient::CreateRoom, request, handler, context); } /** *

Deletes the specified logging configuration.

See Also:

AWS * API Reference

*/ virtual Model::DeleteLoggingConfigurationOutcome DeleteLoggingConfiguration(const Model::DeleteLoggingConfigurationRequest& request) const; /** * A Callable wrapper for DeleteLoggingConfiguration that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::DeleteLoggingConfigurationOutcomeCallable DeleteLoggingConfigurationCallable(const DeleteLoggingConfigurationRequestT& request) const { return SubmitCallable(&IvschatClient::DeleteLoggingConfiguration, request); } /** * An Async wrapper for DeleteLoggingConfiguration that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void DeleteLoggingConfigurationAsync(const DeleteLoggingConfigurationRequestT& request, const DeleteLoggingConfigurationResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&IvschatClient::DeleteLoggingConfiguration, request, handler, context); } /** *

Sends an event to a specific room which directs clients to delete a specific * message; that is, unrender it from view and delete it from the client’s chat * history. This event’s EventName is aws:DELETE_MESSAGE. * This replicates the * DeleteMessage WebSocket operation in the Amazon IVS Chat Messaging * API.

See Also:

AWS * API Reference

*/ virtual Model::DeleteMessageOutcome DeleteMessage(const Model::DeleteMessageRequest& request) const; /** * A Callable wrapper for DeleteMessage that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::DeleteMessageOutcomeCallable DeleteMessageCallable(const DeleteMessageRequestT& request) const { return SubmitCallable(&IvschatClient::DeleteMessage, request); } /** * An Async wrapper for DeleteMessage that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void DeleteMessageAsync(const DeleteMessageRequestT& request, const DeleteMessageResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&IvschatClient::DeleteMessage, request, handler, context); } /** *

Deletes the specified room.

See Also:

AWS * API Reference

*/ virtual Model::DeleteRoomOutcome DeleteRoom(const Model::DeleteRoomRequest& request) const; /** * A Callable wrapper for DeleteRoom that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::DeleteRoomOutcomeCallable DeleteRoomCallable(const DeleteRoomRequestT& request) const { return SubmitCallable(&IvschatClient::DeleteRoom, request); } /** * An Async wrapper for DeleteRoom that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void DeleteRoomAsync(const DeleteRoomRequestT& request, const DeleteRoomResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&IvschatClient::DeleteRoom, request, handler, context); } /** *

Disconnects all connections using a specified user ID from a room. This * replicates the * DisconnectUser WebSocket operation in the Amazon IVS Chat Messaging * API.

See Also:

AWS * API Reference

*/ virtual Model::DisconnectUserOutcome DisconnectUser(const Model::DisconnectUserRequest& request) const; /** * A Callable wrapper for DisconnectUser that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::DisconnectUserOutcomeCallable DisconnectUserCallable(const DisconnectUserRequestT& request) const { return SubmitCallable(&IvschatClient::DisconnectUser, request); } /** * An Async wrapper for DisconnectUser that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void DisconnectUserAsync(const DisconnectUserRequestT& request, const DisconnectUserResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&IvschatClient::DisconnectUser, request, handler, context); } /** *

Gets the specified logging configuration.

See Also:

AWS * API Reference

*/ virtual Model::GetLoggingConfigurationOutcome GetLoggingConfiguration(const Model::GetLoggingConfigurationRequest& request) const; /** * A Callable wrapper for GetLoggingConfiguration that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::GetLoggingConfigurationOutcomeCallable GetLoggingConfigurationCallable(const GetLoggingConfigurationRequestT& request) const { return SubmitCallable(&IvschatClient::GetLoggingConfiguration, request); } /** * An Async wrapper for GetLoggingConfiguration that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void GetLoggingConfigurationAsync(const GetLoggingConfigurationRequestT& request, const GetLoggingConfigurationResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&IvschatClient::GetLoggingConfiguration, request, handler, context); } /** *

Gets the specified room.

See Also:

AWS API * Reference

*/ virtual Model::GetRoomOutcome GetRoom(const Model::GetRoomRequest& request) const; /** * A Callable wrapper for GetRoom that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::GetRoomOutcomeCallable GetRoomCallable(const GetRoomRequestT& request) const { return SubmitCallable(&IvschatClient::GetRoom, request); } /** * An Async wrapper for GetRoom that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void GetRoomAsync(const GetRoomRequestT& request, const GetRoomResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&IvschatClient::GetRoom, request, handler, context); } /** *

Gets summary information about all your logging configurations in the AWS * region where the API request is processed.

See Also:

AWS * API Reference

*/ virtual Model::ListLoggingConfigurationsOutcome ListLoggingConfigurations(const Model::ListLoggingConfigurationsRequest& request) const; /** * A Callable wrapper for ListLoggingConfigurations that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::ListLoggingConfigurationsOutcomeCallable ListLoggingConfigurationsCallable(const ListLoggingConfigurationsRequestT& request) const { return SubmitCallable(&IvschatClient::ListLoggingConfigurations, request); } /** * An Async wrapper for ListLoggingConfigurations that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void ListLoggingConfigurationsAsync(const ListLoggingConfigurationsRequestT& request, const ListLoggingConfigurationsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&IvschatClient::ListLoggingConfigurations, request, handler, context); } /** *

Gets summary information about all your rooms in the AWS region where the API * request is processed. Results are sorted in descending order of * updateTime.

See Also:

AWS * API Reference

*/ virtual Model::ListRoomsOutcome ListRooms(const Model::ListRoomsRequest& request) const; /** * A Callable wrapper for ListRooms that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::ListRoomsOutcomeCallable ListRoomsCallable(const ListRoomsRequestT& request) const { return SubmitCallable(&IvschatClient::ListRooms, request); } /** * An Async wrapper for ListRooms that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void ListRoomsAsync(const ListRoomsRequestT& request, const ListRoomsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&IvschatClient::ListRooms, request, handler, context); } /** *

Gets information about AWS tags for the specified ARN.

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(&IvschatClient::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(&IvschatClient::ListTagsForResource, request, handler, context); } /** *

Sends an event to a room. Use this within your application’s business logic * to send events to clients of a room; e.g., to notify clients to change the way * the chat UI is rendered.

See Also:

AWS * API Reference

*/ virtual Model::SendEventOutcome SendEvent(const Model::SendEventRequest& request) const; /** * A Callable wrapper for SendEvent that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::SendEventOutcomeCallable SendEventCallable(const SendEventRequestT& request) const { return SubmitCallable(&IvschatClient::SendEvent, request); } /** * An Async wrapper for SendEvent that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void SendEventAsync(const SendEventRequestT& request, const SendEventResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&IvschatClient::SendEvent, request, handler, context); } /** *

Adds or updates tags for the AWS resource with the specified * ARN.

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(&IvschatClient::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(&IvschatClient::TagResource, request, handler, context); } /** *

Removes tags from the resource with the specified ARN.

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(&IvschatClient::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(&IvschatClient::UntagResource, request, handler, context); } /** *

Updates a specified logging configuration.

See Also:

AWS * API Reference

*/ virtual Model::UpdateLoggingConfigurationOutcome UpdateLoggingConfiguration(const Model::UpdateLoggingConfigurationRequest& request) const; /** * A Callable wrapper for UpdateLoggingConfiguration that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::UpdateLoggingConfigurationOutcomeCallable UpdateLoggingConfigurationCallable(const UpdateLoggingConfigurationRequestT& request) const { return SubmitCallable(&IvschatClient::UpdateLoggingConfiguration, request); } /** * An Async wrapper for UpdateLoggingConfiguration that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void UpdateLoggingConfigurationAsync(const UpdateLoggingConfigurationRequestT& request, const UpdateLoggingConfigurationResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&IvschatClient::UpdateLoggingConfiguration, request, handler, context); } /** *

Updates a room’s configuration.

See Also:

AWS * API Reference

*/ virtual Model::UpdateRoomOutcome UpdateRoom(const Model::UpdateRoomRequest& request) const; /** * A Callable wrapper for UpdateRoom that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::UpdateRoomOutcomeCallable UpdateRoomCallable(const UpdateRoomRequestT& request) const { return SubmitCallable(&IvschatClient::UpdateRoom, request); } /** * An Async wrapper for UpdateRoom that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void UpdateRoomAsync(const UpdateRoomRequestT& request, const UpdateRoomResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&IvschatClient::UpdateRoom, request, handler, context); } void OverrideEndpoint(const Aws::String& endpoint); std::shared_ptr& accessEndpointProvider(); private: friend class Aws::Client::ClientWithAsyncTemplateMethods; void init(const IvschatClientConfiguration& clientConfiguration); IvschatClientConfiguration m_clientConfiguration; std::shared_ptr m_executor; std::shared_ptr m_endpointProvider; }; } // namespace ivschat } // namespace Aws