listFleets method

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

Retrieves a list of fleets for the current account and Region.

May throw UnauthorizedException. May throw InternalServerErrorException. May throw InvalidRequestException. May throw TooManyRequestsException.

Parameter maxResults : The maximum number of results to be included in the next page.

Parameter nextToken : The pagination token used to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.

Implementation

Future<ListFleetsResponse> listFleets({
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1152921504606846976,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    4096,
  );
  final $payload = <String, dynamic>{
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/listFleets',
    exceptionFnMap: _exceptionFns,
  );
  return ListFleetsResponse.fromJson(response);
}