describeUsers method

Future<DescribeUsersResult> describeUsers({
  1. required AuthenticationType authenticationType,
  2. int? maxResults,
  3. String? nextToken,
})

Retrieves a list that describes one or more specified users in the user pool.

May throw ResourceNotFoundException. May throw InvalidParameterCombinationException.

Parameter authenticationType : The authentication type for the users in the user pool to describe. You must specify USERPOOL.

Parameter maxResults : The maximum size of each page of results.

Parameter nextToken : The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.

Implementation

Future<DescribeUsersResult> describeUsers({
  required AuthenticationType authenticationType,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(authenticationType, 'authenticationType');
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'PhotonAdminProxyService.DescribeUsers'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AuthenticationType': authenticationType.toValue(),
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return DescribeUsersResult.fromJson(jsonResponse.body);
}