listDevices method

Future<ListDevicesResponse> listDevices({
  1. required String accessToken,
  2. int? limit,
  3. String? paginationToken,
})

Lists the devices.

May throw InvalidParameterException. May throw ResourceNotFoundException. May throw NotAuthorizedException. May throw InvalidUserPoolConfigurationException. May throw TooManyRequestsException. May throw PasswordResetRequiredException. May throw UserNotFoundException. May throw UserNotConfirmedException. May throw InternalErrorException.

Parameter accessToken : The access tokens for the request to list devices.

Parameter limit : The limit of the device request.

Parameter paginationToken : The pagination token for the list request.

Implementation

Future<ListDevicesResponse> listDevices({
  required String accessToken,
  int? limit,
  String? paginationToken,
}) async {
  ArgumentError.checkNotNull(accessToken, 'accessToken');
  _s.validateNumRange(
    'limit',
    limit,
    0,
    60,
  );
  _s.validateStringLength(
    'paginationToken',
    paginationToken,
    1,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSCognitoIdentityProviderService.ListDevices'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AccessToken': accessToken,
      if (limit != null) 'Limit': limit,
      if (paginationToken != null) 'PaginationToken': paginationToken,
    },
  );

  return ListDevicesResponse.fromJson(jsonResponse.body);
}