createRoom method
Creates a room that allows clients to connect and pass messages.
May throw AccessDeniedException.
May throw ConflictException.
May throw PendingVerification.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ValidationException.
Parameter loggingConfigurationIdentifiers :
Array of logging-configuration identifiers attached to the room.
Parameter maximumMessageLength :
Maximum number of characters in a single message. Messages are expected to
be UTF-8 encoded and this limit applies specifically to rune/code-point
count, not number of bytes. Default: 500.
Parameter maximumMessageRatePerSecond :
Maximum number of messages per second that can be sent to the room (by all
clients). Default: 10.
Parameter messageReviewHandler :
Configuration information for optional review of messages.
Parameter name :
Room name. The value does not need to be unique.
Parameter tags :
Tags to attach to the resource. Array of maps, each of the form
string:string (key:value). See Best
practices and strategies in Tagging Amazon Web Services Resources
and Tag Editor for details, including restrictions that apply to tags
and "Tag naming limits and requirements"; Amazon IVS Chat has no
constraints beyond what is documented there.
Implementation
Future<CreateRoomResponse> createRoom({
List<String>? loggingConfigurationIdentifiers,
int? maximumMessageLength,
int? maximumMessageRatePerSecond,
MessageReviewHandler? messageReviewHandler,
String? name,
Map<String, String>? tags,
}) async {
_s.validateNumRange(
'maximumMessageLength',
maximumMessageLength,
1,
500,
);
_s.validateNumRange(
'maximumMessageRatePerSecond',
maximumMessageRatePerSecond,
1,
100,
);
final $payload = <String, dynamic>{
if (loggingConfigurationIdentifiers != null)
'loggingConfigurationIdentifiers': loggingConfigurationIdentifiers,
if (maximumMessageLength != null)
'maximumMessageLength': maximumMessageLength,
if (maximumMessageRatePerSecond != null)
'maximumMessageRatePerSecond': maximumMessageRatePerSecond,
if (messageReviewHandler != null)
'messageReviewHandler': messageReviewHandler,
if (name != null) 'name': name,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/CreateRoom',
exceptionFnMap: _exceptionFns,
);
return CreateRoomResponse.fromJson(response);
}