Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- data CreateChatToken = CreateChatToken' {}
- newCreateChatToken :: Text -> Text -> CreateChatToken
- createChatToken_attributes :: Lens' CreateChatToken (Maybe (HashMap Text Text))
- createChatToken_capabilities :: Lens' CreateChatToken (Maybe [ChatTokenCapability])
- createChatToken_sessionDurationInMinutes :: Lens' CreateChatToken (Maybe Natural)
- createChatToken_roomIdentifier :: Lens' CreateChatToken Text
- createChatToken_userId :: Lens' CreateChatToken Text
- data CreateChatTokenResponse = CreateChatTokenResponse' {}
- newCreateChatTokenResponse :: Int -> CreateChatTokenResponse
- createChatTokenResponse_sessionExpirationTime :: Lens' CreateChatTokenResponse (Maybe UTCTime)
- createChatTokenResponse_token :: Lens' CreateChatTokenResponse (Maybe Text)
- createChatTokenResponse_tokenExpirationTime :: Lens' CreateChatTokenResponse (Maybe UTCTime)
- createChatTokenResponse_httpStatus :: Lens' CreateChatTokenResponse Int
Creating a Request
data CreateChatToken Source #
See: newCreateChatToken
smart constructor.
CreateChatToken' | |
|
Instances
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.
CreateChatTokenResponse' | |
|
Instances
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_token :: Lens' CreateChatTokenResponse (Maybe Text) Source #
The issued client token, encrypted.
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/.
createChatTokenResponse_httpStatus :: Lens' CreateChatTokenResponse Int Source #
The response's http status code.