Skip to content

unsubscribe_from_dataset async

unsubscribe_from_dataset(
    identity_pool_id: IdentityPoolId,
    identity_id: IdentityId,
    dataset_name: DatasetName,
    device_id: DeviceId,
    *,
    config_overrides: Optional[AsyncCognitoSyncClientConfig] = None,
) -> UnsubscribeFromDatasetResponse

Unsubscribes from receiving notifications when a dataset is modified by another device.

This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.

UnsubscribeFromDataset The following examples have been edited for readability. POST / HTTP/1.1 CONTENT-TYPE: application/json X-AMZ-REQUESTSUPERTRACE: true X-AMZN-REQUESTID: 676896d6-14ca-45b1-8029-6d36b10a077e X-AMZ-TARGET: com.amazonaws.cognito.sync.model.AWSCognitoSyncService.UnsubscribeFromDataset HOST: cognito-sync.us-east-1.amazonaws.com X-AMZ-DATE: 20141004T195446Z X-AMZ-SECURITY-TOKEN: AUTHORIZATION: AWS4-HMAC-SHA256 Credential=, SignedHeaders=content-type;content-length;host;x-amz-date;x-amz-target, Signature= { "Operation": "com.amazonaws.cognito.sync.model#UnsubscribeFromDataset", "Service": "com.amazonaws.cognito.sync.model#AWSCognitoSyncService", "Input": { "IdentityPoolId": "ID_POOL_ID", "IdentityId": "IDENTITY_ID", "DatasetName": "Rufus", "DeviceId": "5cd28fbe-dd83-47ab-9f83-19093a5fb014" } } 1.1 200 OK x-amzn-requestid: 676896d6-14ca-45b1-8029-6d36b10a077e date: Sat, 04 Oct 2014 19:54:46 GMT content-type: application/json content-length: 103 { "Output": { "__type": "com.amazonaws.cognito.sync.model#UnsubscribeFromDatasetResponse" }, "Version": "1.0" }

Parameters:

  • identity_pool_id (IdentityPoolId) –

    A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. The ID of the pool to which this identity belongs.

  • identity_id (IdentityId) –

    Unique ID for this identity.

  • dataset_name (DatasetName) –

    The name of the dataset from which to unsubcribe.

  • device_id (DeviceId) –

    The unique ID generated for this device by Cognito.

Raises:

Source code in docs_src/capo_cognito_sync/_services/async_cognito_sync.py
async def unsubscribe_from_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",
    device_id: "capo_cognito_sync.types.device_id.DeviceId",
    *,
    config_overrides: Optional[AsyncCognitoSyncClientConfig] = None,
) -> "capo_cognito_sync.types.unsubscribe_from_dataset_response.UnsubscribeFromDatasetResponse":
    """<p>Unsubscribes from receiving notifications when a dataset is modified by another device.</p><p>This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.</p> <examples> <example> <name>UnsubscribeFromDataset</name> <description>The following examples have been edited for readability.</description> <request> POST / HTTP/1.1 CONTENT-TYPE: application/json X-AMZ-REQUESTSUPERTRACE: true X-AMZN-REQUESTID: 676896d6-14ca-45b1-8029-6d36b10a077e X-AMZ-TARGET: com.amazonaws.cognito.sync.model.AWSCognitoSyncService.UnsubscribeFromDataset HOST: cognito-sync.us-east-1.amazonaws.com X-AMZ-DATE: 20141004T195446Z X-AMZ-SECURITY-TOKEN: <securitytoken> AUTHORIZATION: AWS4-HMAC-SHA256 Credential=<credential>, SignedHeaders=content-type;content-length;host;x-amz-date;x-amz-target, Signature=<signature> { "Operation": "com.amazonaws.cognito.sync.model#UnsubscribeFromDataset", "Service": "com.amazonaws.cognito.sync.model#AWSCognitoSyncService", "Input": { "IdentityPoolId": "ID_POOL_ID", "IdentityId": "IDENTITY_ID", "DatasetName": "Rufus", "DeviceId": "5cd28fbe-dd83-47ab-9f83-19093a5fb014" } } </request> <response> 1.1 200 OK x-amzn-requestid: 676896d6-14ca-45b1-8029-6d36b10a077e date: Sat, 04 Oct 2014 19:54:46 GMT content-type: application/json content-length: 103 { "Output": { "__type": "com.amazonaws.cognito.sync.model#UnsubscribeFromDatasetResponse" }, "Version": "1.0" } </response> </example> </examples>

    Args:
        identity_pool_id: <p>A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. The ID of the pool to which this identity belongs.</p>
        identity_id: <p>Unique ID for this identity.</p>
        dataset_name: <p>The name of the dataset from which to unsubcribe.</p>
        device_id: <p>The unique ID generated for this device by Cognito.</p>

    Raises:
        capo_cognito_sync.errors.internal_error_exception.InternalErrorException: Indicates an internal service error.
        capo_cognito_sync.errors.invalid_configuration_exception.InvalidConfigurationException
        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_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.unsubscribe_from_dataset_request.UnsubscribeFromDatasetRequest]",
    ) -> AsyncOperationResponse[
        "capo_cognito_sync.types.unsubscribe_from_dataset_response.UnsubscribeFromDatasetResponse"
    ]:
        import capo_cognito_sync._operations.aws_cognito_sync_service.unsubscribe_from_dataset

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UnsubscribeFromDataset")
    )
    input_: capo_cognito_sync.types.unsubscribe_from_dataset_request.UnsubscribeFromDatasetRequest = {
        "identity_pool_id": identity_pool_id,
        "identity_id": identity_id,
        "dataset_name": dataset_name,
        "device_id": device_id,
    }

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