createUser method

Future<CreateUserResponse> createUser({
  1. required String accountId,
  2. String? email,
  3. UserType? userType,
  4. String? username,
})

Creates a user under the specified Amazon Chime account.

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

Parameter accountId : The Amazon Chime account ID.

Parameter email : The user's email address.

Parameter userType : The user type.

Parameter username : The user name.

Implementation

Future<CreateUserResponse> createUser({
  required String accountId,
  String? email,
  UserType? userType,
  String? username,
}) async {
  ArgumentError.checkNotNull(accountId, 'accountId');
  final $payload = <String, dynamic>{
    if (email != null) 'Email': email,
    if (userType != null) 'UserType': userType.toValue(),
    if (username != null) 'Username': username,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/accounts/${Uri.encodeComponent(accountId)}/users?operation=create',
    exceptionFnMap: _exceptionFns,
  );
  return CreateUserResponse.fromJson(response);
}