listUserPoolReplicas method

Future<ListUserPoolReplicasResponse> listUserPoolReplicas({
  1. required String userPoolId,
  2. String? nextToken,
})

Lists all replicas for a user pool, including both primary and secondary replicas. We recommend using pagination to ensure that the operation returns quickly and successfully.

Learn more

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

Parameter userPoolId : The ID of the user pool for which to list replicas.

Parameter nextToken : A pagination token for retrieving the next page of results. If this parameter is omitted, the operation returns the first page of results.

Implementation

Future<ListUserPoolReplicasResponse> listUserPoolReplicas({
  required String userPoolId,
  String? nextToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSCognitoIdentityProviderService.ListUserPoolReplicas'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'UserPoolId': userPoolId,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListUserPoolReplicasResponse.fromJson(jsonResponse.body);
}