deleteDataset method

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

Deletes the specific dataset. The dataset will be deleted permanently, and the action can't be undone. Datasets that this dataset was merged with will no longer report the merge. Any subsequent operation on this dataset will result in a ResourceNotFoundException.

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. May throw ResourceConflictException.

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<DeleteDatasetResponse> deleteDataset({
  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: 'DELETE',
    requestUri:
        '/identitypools/${Uri.encodeComponent(identityPoolId)}/identities/${Uri.encodeComponent(identityId)}/datasets/${Uri.encodeComponent(datasetName)}',
    exceptionFnMap: _exceptionFns,
  );
  return DeleteDatasetResponse.fromJson(response);
}