batchCreateRoomMembership method

Future<BatchCreateRoomMembershipResponse> batchCreateRoomMembership({
  1. required String accountId,
  2. required List<MembershipItem> membershipItemList,
  3. required String roomId,
})

Adds up to 50 members to a chat room in an Amazon Chime Enterprise account. Members can be either users or bots. The member role designates whether the member is a chat room administrator or a general chat room member.

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 membershipItemList : The list of membership items.

Parameter roomId : The room ID.

Implementation

Future<BatchCreateRoomMembershipResponse> batchCreateRoomMembership({
  required String accountId,
  required List<MembershipItem> membershipItemList,
  required String roomId,
}) async {
  ArgumentError.checkNotNull(accountId, 'accountId');
  ArgumentError.checkNotNull(membershipItemList, 'membershipItemList');
  ArgumentError.checkNotNull(roomId, 'roomId');
  final $payload = <String, dynamic>{
    'MembershipItemList': membershipItemList,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/accounts/${Uri.encodeComponent(accountId)}/rooms/${Uri.encodeComponent(roomId)}/memberships?operation=batch-create',
    exceptionFnMap: _exceptionFns,
  );
  return BatchCreateRoomMembershipResponse.fromJson(response);
}