describeIdentityUsage method

Future<DescribeIdentityUsageResponse> describeIdentityUsage({
  1. required String identityId,
  2. required String identityPoolId,
})

Gets usage information for an identity, including number of datasets and data usage.

This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.

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

Parameter identityId : A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.

Parameter identityPoolId : A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.

Implementation

Future<DescribeIdentityUsageResponse> describeIdentityUsage({
  required String identityId,
  required String identityPoolId,
}) async {
  ArgumentError.checkNotNull(identityId, 'identityId');
  _s.validateStringLength(
    'identityId',
    identityId,
    1,
    55,
    isRequired: true,
  );
  ArgumentError.checkNotNull(identityPoolId, 'identityPoolId');
  _s.validateStringLength(
    'identityPoolId',
    identityPoolId,
    1,
    55,
    isRequired: true,
  );
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/identitypools/${Uri.encodeComponent(identityPoolId)}/identities/${Uri.encodeComponent(identityId)}',
    exceptionFnMap: _exceptionFns,
  );
  return DescribeIdentityUsageResponse.fromJson(response);
}