listRooms method

Future<ListRoomsResponse> listRooms({
  1. required String accountId,
  2. int? maxResults,
  3. String? memberId,
  4. String? nextToken,
})

Lists the room details for the specified Amazon Chime Enterprise account. Optionally, filter the results by a member ID (user ID or bot ID) to see a list of rooms that the member belongs to.

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

Parameter accountId : The Amazon Chime account ID.

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

Parameter memberId : The member ID (user ID or bot ID).

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

Implementation

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