listIdentityPools method

Future<ListIdentityPoolsResponse> listIdentityPools({
  1. required int maxResults,
  2. String? nextToken,
})

Lists all of the Cognito identity pools registered for your account.

You must use Amazon Web Services developer credentials to call this operation.

May throw InternalErrorException. May throw InvalidParameterException. May throw NotAuthorizedException. May throw ResourceNotFoundException. May throw TooManyRequestsException.

Parameter maxResults : The maximum number of identities to return.

Parameter nextToken : A pagination token.

Implementation

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

  return ListIdentityPoolsResponse.fromJson(jsonResponse.body);
}