listLedgers method
Returns an array of ledger summaries that are associated with the current AWS account and Region.
This action returns a maximum of 100 items and is paginated so that you
can retrieve all the items by calling ListLedgers
multiple
times.
Parameter maxResults
:
The maximum number of results to return in a single
ListLedgers
request. (The actual number of results returned
might be fewer.)
Parameter nextToken
:
A pagination token, indicating that you want to retrieve the next page of
results. If you received a value for NextToken
in the
response from a previous ListLedgers
call, then you should
use that value as input here.
Implementation
Future<ListLedgersResponse> listLedgers({
int? maxResults,
String? nextToken,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
_s.validateStringLength(
'nextToken',
nextToken,
4,
1024,
);
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: '/ledgers',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListLedgersResponse.fromJson(response);
}