createBot method

Future<CreateBotResponse> createBot({
  1. required String accountId,
  2. required String displayName,
  3. String? domain,
})

Creates a bot for an Amazon Chime Enterprise account.

May throw ServiceUnavailableException. May throw ServiceFailureException. May throw ForbiddenException. May throw BadRequestException. May throw UnauthorizedClientException. May throw ResourceLimitExceededException. May throw NotFoundException. May throw ThrottledClientException.

Parameter accountId : The Amazon Chime account ID.

Parameter displayName : The bot display name.

Parameter domain : The domain of the Amazon Chime Enterprise account.

Implementation

Future<CreateBotResponse> createBot({
  required String accountId,
  required String displayName,
  String? domain,
}) async {
  ArgumentError.checkNotNull(accountId, 'accountId');
  ArgumentError.checkNotNull(displayName, 'displayName');
  final $payload = <String, dynamic>{
    'DisplayName': displayName,
    if (domain != null) 'Domain': domain,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/accounts/${Uri.encodeComponent(accountId)}/bots',
    exceptionFnMap: _exceptionFns,
  );
  return CreateBotResponse.fromJson(response);
}