listIdentityProviders method
Lists information about all identity providers for a user pool.
May throw InvalidParameterException. May throw ResourceNotFoundException. May throw NotAuthorizedException. May throw TooManyRequestsException. May throw InternalErrorException.
Parameter userPoolId
:
The user pool ID.
Parameter maxResults
:
The maximum number of identity providers to return.
Parameter nextToken
:
A pagination token.
Implementation
Future<ListIdentityProvidersResponse> listIdentityProviders({
required String userPoolId,
int? maxResults,
String? nextToken,
}) async {
ArgumentError.checkNotNull(userPoolId, 'userPoolId');
_s.validateStringLength(
'userPoolId',
userPoolId,
1,
55,
isRequired: true,
);
_s.validateNumRange(
'maxResults',
maxResults,
0,
60,
);
_s.validateStringLength(
'nextToken',
nextToken,
1,
1152921504606846976,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSCognitoIdentityProviderService.ListIdentityProviders'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'UserPoolId': userPoolId,
if (maxResults != null) 'MaxResults': maxResults,
if (nextToken != null) 'NextToken': nextToken,
},
);
return ListIdentityProvidersResponse.fromJson(jsonResponse.body);
}