describeDataset method

Future<DescribeDatasetResponse> describeDataset({
  1. required String datasetName,
  2. required String identityId,
  3. required String identityPoolId,
})

Gets meta data about a dataset by identity and dataset name. With Amazon Cognito Sync, each identity has access only to its own data. Thus, the credentials used to make this API call need to have access to the identity data.

This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials. You should use Cognito Identity credentials to make this API call.

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

Parameter datasetName : A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).

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<DescribeDatasetResponse> describeDataset({
  required String datasetName,
  required String identityId,
  required String identityPoolId,
}) async {
  ArgumentError.checkNotNull(datasetName, 'datasetName');
  _s.validateStringLength(
    'datasetName',
    datasetName,
    1,
    128,
    isRequired: true,
  );
  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)}/datasets/${Uri.encodeComponent(datasetName)}',
    exceptionFnMap: _exceptionFns,
  );
  return DescribeDatasetResponse.fromJson(response);
}