listBrokers method

Future<ListBrokersResponse> listBrokers({
  1. int? maxResults,
  2. String? nextToken,
})

Returns a list of all brokers.

May throw BadRequestException. May throw InternalServerErrorException. May throw ForbiddenException.

Parameter maxResults : The maximum number of brokers that Amazon MQ can return per page (20 by default). This value must be an integer from 5 to 100.

Parameter nextToken : The token that specifies the next page of results Amazon MQ should return. To request the first page, leave nextToken empty.

Implementation

Future<ListBrokersResponse> listBrokers({
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/v1/brokers',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListBrokersResponse.fromJson(response);
}