amazonka-ivschat-2.0: Amazon Interactive Video Service Chat SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.IVSChat.CreateChatToken

Description

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.

Synopsis

Creating a Request

data CreateChatToken Source #

See: newCreateChatToken smart constructor.

Constructors

CreateChatToken' 

Fields

  • attributes :: Maybe (HashMap Text Text)

    Application-provided attributes to encode into the token and attach to a chat session. Map keys and values can contain UTF-8 encoded text. The maximum length of this field is 1 KB total.

  • capabilities :: Maybe [ChatTokenCapability]

    Set of capabilities that the user is allowed to perform in the room. Default: None (the capability to view messages is implicitly included in all requests).

  • sessionDurationInMinutes :: Maybe Natural

    Session duration (in minutes), after which the session expires. Default: 60 (1 hour).

  • roomIdentifier :: Text

    Identifier of the room that the client is trying to access. Currently this must be an ARN.

  • userId :: Text

    Application-provided ID that uniquely identifies the user associated with this token. This can be any UTF-8 encoded text.

Instances

Instances details
ToJSON CreateChatToken Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

ToHeaders CreateChatToken Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

ToPath CreateChatToken Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

ToQuery CreateChatToken Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

AWSRequest CreateChatToken Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

Associated Types

type AWSResponse CreateChatToken #

Generic CreateChatToken Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

Associated Types

type Rep CreateChatToken :: Type -> Type #

Read CreateChatToken Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

Show CreateChatToken Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

NFData CreateChatToken Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

Methods

rnf :: CreateChatToken -> () #

Eq CreateChatToken Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

Hashable CreateChatToken Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

type AWSResponse CreateChatToken Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

type Rep CreateChatToken Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

type Rep CreateChatToken = D1 ('MetaData "CreateChatToken" "Amazonka.IVSChat.CreateChatToken" "amazonka-ivschat-2.0-AB4QlCKEEGt4izEWjWKMb2" 'False) (C1 ('MetaCons "CreateChatToken'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "attributes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (HashMap Text Text))) :*: S1 ('MetaSel ('Just "capabilities") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [ChatTokenCapability]))) :*: (S1 ('MetaSel ('Just "sessionDurationInMinutes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)) :*: (S1 ('MetaSel ('Just "roomIdentifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "userId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))

newCreateChatToken Source #

Create a value of CreateChatToken with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:attributes:CreateChatToken', createChatToken_attributes - Application-provided attributes to encode into the token and attach to a chat session. Map keys and values can contain UTF-8 encoded text. The maximum length of this field is 1 KB total.

$sel:capabilities:CreateChatToken', createChatToken_capabilities - Set of capabilities that the user is allowed to perform in the room. Default: None (the capability to view messages is implicitly included in all requests).

$sel:sessionDurationInMinutes:CreateChatToken', createChatToken_sessionDurationInMinutes - Session duration (in minutes), after which the session expires. Default: 60 (1 hour).

$sel:roomIdentifier:CreateChatToken', createChatToken_roomIdentifier - Identifier of the room that the client is trying to access. Currently this must be an ARN.

$sel:userId:CreateChatToken', createChatToken_userId - Application-provided ID that uniquely identifies the user associated with this token. This can be any UTF-8 encoded text.

Request Lenses

createChatToken_attributes :: Lens' CreateChatToken (Maybe (HashMap Text Text)) Source #

Application-provided attributes to encode into the token and attach to a chat session. Map keys and values can contain UTF-8 encoded text. The maximum length of this field is 1 KB total.

createChatToken_capabilities :: Lens' CreateChatToken (Maybe [ChatTokenCapability]) Source #

Set of capabilities that the user is allowed to perform in the room. Default: None (the capability to view messages is implicitly included in all requests).

createChatToken_sessionDurationInMinutes :: Lens' CreateChatToken (Maybe Natural) Source #

Session duration (in minutes), after which the session expires. Default: 60 (1 hour).

createChatToken_roomIdentifier :: Lens' CreateChatToken Text Source #

Identifier of the room that the client is trying to access. Currently this must be an ARN.

createChatToken_userId :: Lens' CreateChatToken Text Source #

Application-provided ID that uniquely identifies the user associated with this token. This can be any UTF-8 encoded text.

Destructuring the Response

data CreateChatTokenResponse Source #

See: newCreateChatTokenResponse smart constructor.

Constructors

CreateChatTokenResponse' 

Fields

  • sessionExpirationTime :: Maybe ISO8601

    Time after which an end user's session is no longer valid. This is an ISO 8601 timestamp; note that this is returned as a string.

  • token :: Maybe Text

    The issued client token, encrypted.

  • tokenExpirationTime :: Maybe ISO8601

    Time after which the token is no longer valid and cannot be used to connect to a room. This is an ISO 8601 timestamp; /note that this is returned as a string/.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic CreateChatTokenResponse Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

Associated Types

type Rep CreateChatTokenResponse :: Type -> Type #

Read CreateChatTokenResponse Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

Show CreateChatTokenResponse Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

NFData CreateChatTokenResponse Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

Methods

rnf :: CreateChatTokenResponse -> () #

Eq CreateChatTokenResponse Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

type Rep CreateChatTokenResponse Source # 
Instance details

Defined in Amazonka.IVSChat.CreateChatToken

type Rep CreateChatTokenResponse = D1 ('MetaData "CreateChatTokenResponse" "Amazonka.IVSChat.CreateChatToken" "amazonka-ivschat-2.0-AB4QlCKEEGt4izEWjWKMb2" 'False) (C1 ('MetaCons "CreateChatTokenResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "sessionExpirationTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ISO8601)) :*: S1 ('MetaSel ('Just "token") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "tokenExpirationTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ISO8601)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

newCreateChatTokenResponse Source #

Create a value of CreateChatTokenResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:sessionExpirationTime:CreateChatTokenResponse', createChatTokenResponse_sessionExpirationTime - Time after which an end user's session is no longer valid. This is an ISO 8601 timestamp; note that this is returned as a string.

$sel:token:CreateChatTokenResponse', createChatTokenResponse_token - The issued client token, encrypted.

$sel:tokenExpirationTime:CreateChatTokenResponse', createChatTokenResponse_tokenExpirationTime - Time after which the token is no longer valid and cannot be used to connect to a room. This is an ISO 8601 timestamp; /note that this is returned as a string/.

$sel:httpStatus:CreateChatTokenResponse', createChatTokenResponse_httpStatus - The response's http status code.

Response Lenses

createChatTokenResponse_sessionExpirationTime :: Lens' CreateChatTokenResponse (Maybe UTCTime) Source #

Time after which an end user's session is no longer valid. This is an ISO 8601 timestamp; note that this is returned as a string.

createChatTokenResponse_tokenExpirationTime :: Lens' CreateChatTokenResponse (Maybe UTCTime) Source #

Time after which the token is no longer valid and cannot be used to connect to a room. This is an ISO 8601 timestamp; /note that this is returned as a string/.