createRoomMembership method
Adds a member to a chat room in an Amazon Chime Enterprise account. A member can be either a user or a bot. The member role designates whether the member is a chat room administrator or a general chat room member.
May throw BadRequestException.
May throw ConflictException.
May throw ForbiddenException.
May throw NotFoundException.
May throw ResourceLimitExceededException.
May throw ServiceFailureException.
May throw ServiceUnavailableException.
May throw ThrottledClientException.
May throw UnauthorizedClientException.
Parameter accountId :
The Amazon Chime account ID.
Parameter memberId :
The Amazon Chime member ID (user ID or bot ID).
Parameter roomId :
The room ID.
Parameter role :
The role of the member.
Implementation
Future<CreateRoomMembershipResponse> createRoomMembership({
required String accountId,
required String memberId,
required String roomId,
RoomMembershipRole? role,
}) async {
final $payload = <String, dynamic>{
'MemberId': memberId,
if (role != null) 'Role': role.value,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/accounts/${Uri.encodeComponent(accountId)}/rooms/${Uri.encodeComponent(roomId)}/memberships',
exceptionFnMap: _exceptionFns,
);
return CreateRoomMembershipResponse.fromJson(response);
}