listCapacityReservations method

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

Lists the capacity reservations for the current account.

May throw InternalServerException. May throw InvalidRequestException.

Parameter maxResults : Specifies the maximum number of results to return.

Parameter nextToken : A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated.

Implementation

Future<ListCapacityReservationsOutput> listCapacityReservations({
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonAthena.ListCapacityReservations'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListCapacityReservationsOutput.fromJson(jsonResponse.body);
}