listRoomMemberships method

Future<ListRoomMembershipsResponse> listRoomMemberships({
  1. required String accountId,
  2. required String roomId,
  3. int? maxResults,
  4. String? nextToken,
})

Lists the membership details for the specified room in an Amazon Chime Enterprise account, such as the members' IDs, email addresses, and names.

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

Parameter accountId : The Amazon Chime account ID.

Parameter roomId : The room ID.

Parameter maxResults : The maximum number of results to return in a single call.

Parameter nextToken : The token to use to retrieve the next page of results.

Implementation

Future<ListRoomMembershipsResponse> listRoomMemberships({
  required String accountId,
  required String roomId,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    99,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'max-results': [maxResults.toString()],
    if (nextToken != null) 'next-token': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/accounts/${Uri.encodeComponent(accountId)}/rooms/${Uri.encodeComponent(roomId)}/memberships',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListRoomMembershipsResponse.fromJson(response);
}