Deletes a subscription. If the subscription requires authentication for deletion, only the owner of the subscription or the topic's owner can unsubscribe, and an Amazon Web Services signature is required. If the Unsubscribe call does not require authentication and the requester is not the subscription owner, a final cancellation message is delivered to the endpoint, so that the endpoint owner can easily resubscribe to the topic if the Unsubscribe request was unintended.
This action is throttled at 100 transactions per second (TPS).
Parameters:
-
subscription_arn
(subscriptionARN)
–
The ARN of the subscription to be deleted.
Raises:
Source code in docs_src/capo_sns/_services/async_sns.py
| async def unsubscribe(
self,
subscription_arn: "capo_sns.types.subscription_arn.subscriptionARN",
*,
config_overrides: Optional[AsyncSNSClientConfig] = None,
) -> None:
"""<p>Deletes a subscription. If the subscription requires authentication for deletion, only the owner of the subscription or the topic's owner can unsubscribe, and an Amazon Web Services signature is required. If the <code>Unsubscribe</code> call does not require authentication and the requester is not the subscription owner, a final cancellation message is delivered to the endpoint, so that the endpoint owner can easily resubscribe to the topic if the <code>Unsubscribe</code> request was unintended.</p> <p>This action is throttled at 100 transactions per second (TPS).</p>
Args:
subscription_arn: <p>The ARN of the subscription to be deleted.</p>
Raises:
capo_sns.errors.authorization_error_exception.AuthorizationErrorException: <p>Indicates that the user has been denied access to the requested resource.</p>
capo_sns.errors.internal_error_exception.InternalErrorException: <p>Indicates an internal service error.</p>
capo_sns.errors.invalid_parameter_exception.InvalidParameterException: <p>Indicates that a request parameter does not comply with the associated constraints.</p>
capo_sns.errors.invalid_security_exception.InvalidSecurityException: <p>The credential signature isn't valid. You must use an HTTPS endpoint and sign your request using Signature Version 4.</p>
capo_sns.errors.not_found_exception.NotFoundException: <p>Indicates that the requested resource does not exist.</p>
capo_sns.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_sns.types.unsubscribe_input.UnsubscribeInput]",
) -> AsyncOperationResponse[None]:
import capo_sns._operations.amazon_simple_notification_service.unsubscribe
(
output,
http_response,
) = await capo_sns._operations.amazon_simple_notification_service.unsubscribe.async_unsubscribe(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("Unsubscribe")
)
input_: capo_sns.types.unsubscribe_input.UnsubscribeInput = {
"subscription_arn": subscription_arn
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|