Skip to content

delete_dataset async

delete_dataset(
    identity_pool_id: IdentityPoolId,
    identity_id: IdentityId,
    dataset_name: DatasetName,
    *,
    config_overrides: Optional[AsyncCognitoSyncClientConfig] = None,
) -> DeleteDatasetResponse

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.

Parameters:

  • identity_pool_id (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.

  • identity_id (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.

  • dataset_name (DatasetName) –

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

Raises:

Source code in docs_src/capo_cognito_sync/_services/async_cognito_sync.py
async def delete_dataset(
    self,
    identity_pool_id: "capo_cognito_sync.types.identity_pool_id.IdentityPoolId",
    identity_id: "capo_cognito_sync.types.identity_id.IdentityId",
    dataset_name: "capo_cognito_sync.types.dataset_name.DatasetName",
    *,
    config_overrides: Optional[AsyncCognitoSyncClientConfig] = None,
) -> "capo_cognito_sync.types.delete_dataset_response.DeleteDatasetResponse":
    """<p>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.</p> <p>This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.</p>

    Args:
        identity_pool_id: 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.
        identity_id: 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.
        dataset_name: A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).

    Raises:
        capo_cognito_sync.errors.internal_error_exception.InternalErrorException: Indicates an internal service error.
        capo_cognito_sync.errors.invalid_parameter_exception.InvalidParameterException: Thrown when a request parameter does not comply with the associated constraints.
        capo_cognito_sync.errors.not_authorized_exception.NotAuthorizedException: Thrown when a user is not authorized to access the requested resource.
        capo_cognito_sync.errors.resource_conflict_exception.ResourceConflictException: Thrown if an update can't be applied because the resource was changed by another call and this would result in a conflict.
        capo_cognito_sync.errors.resource_not_found_exception.ResourceNotFoundException: Thrown if the resource doesn't exist.
        capo_cognito_sync.errors.too_many_requests_exception.TooManyRequestsException: Thrown if the request is throttled.
        capo_cognito_sync.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cognito_sync.types.delete_dataset_request.DeleteDatasetRequest]",
    ) -> AsyncOperationResponse[
        "capo_cognito_sync.types.delete_dataset_response.DeleteDatasetResponse"
    ]:
        import capo_cognito_sync._operations.aws_cognito_sync_service.delete_dataset

        (
            output,
            http_response,
        ) = await capo_cognito_sync._operations.aws_cognito_sync_service.delete_dataset.async_delete_dataset(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteDataset")
    )
    input_: capo_cognito_sync.types.delete_dataset_request.DeleteDatasetRequest = {
        "identity_pool_id": identity_pool_id,
        "identity_id": identity_id,
        "dataset_name": dataset_name,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output