createRoom method
Creates a chat room for the specified Amazon Chime Enterprise account.
May throw NotFoundException. May throw BadRequestException. May throw ForbiddenException. May throw UnauthorizedClientException. May throw ResourceLimitExceededException. May throw ThrottledClientException. May throw ServiceUnavailableException. May throw ServiceFailureException.
Parameter accountId
:
The Amazon Chime account ID.
Parameter name
:
The room name.
Parameter clientRequestToken
:
The idempotency token for the request.
Implementation
Future<CreateRoomResponse> createRoom({
required String accountId,
required String name,
String? clientRequestToken,
}) async {
ArgumentError.checkNotNull(accountId, 'accountId');
ArgumentError.checkNotNull(name, 'name');
_s.validateStringLength(
'clientRequestToken',
clientRequestToken,
2,
64,
);
final $payload = <String, dynamic>{
'Name': name,
'ClientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/accounts/${Uri.encodeComponent(accountId)}/rooms',
exceptionFnMap: _exceptionFns,
);
return CreateRoomResponse.fromJson(response);
}