updateRoomMembership method

Future<UpdateRoomMembershipResponse> updateRoomMembership({
  1. required String accountId,
  2. required String memberId,
  3. required String roomId,
  4. RoomMembershipRole? role,
})

Updates room membership details, such as the member role, for a room in an Amazon Chime Enterprise account. The member role designates whether the member is a chat room administrator or a general chat room member. The member role can be updated only for user IDs.

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

Parameter accountId : The Amazon Chime account ID.

Parameter memberId : The member ID.

Parameter roomId : The room ID.

Parameter role : The role of the member.

Implementation

Future<UpdateRoomMembershipResponse> updateRoomMembership({
  required String accountId,
  required String memberId,
  required String roomId,
  RoomMembershipRole? role,
}) async {
  ArgumentError.checkNotNull(accountId, 'accountId');
  ArgumentError.checkNotNull(memberId, 'memberId');
  ArgumentError.checkNotNull(roomId, 'roomId');
  final $payload = <String, dynamic>{
    if (role != null) 'Role': role.toValue(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/accounts/${Uri.encodeComponent(accountId)}/rooms/${Uri.encodeComponent(roomId)}/memberships/${Uri.encodeComponent(memberId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateRoomMembershipResponse.fromJson(response);
}