Skip to content

delete_subscription async

delete_subscription(
    *, config_overrides: Optional[AsyncShieldClientConfig] = None
) -> DeleteSubscriptionResponse

Removes Shield Advanced from an account. Shield Advanced requires a 1-year subscription commitment. You cannot delete a subscription prior to the completion of that commitment.

Raises:

  • InternalErrorException –

    Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.

  • LockedSubscriptionException –

    You are trying to update a subscription that has not yet completed the 1-year commitment. You can change the AutoRenew parameter during the last 30 days of your subscription. This exception indicates that you are attempting to change AutoRenew prior to that period.

  • ResourceNotFoundException –

    Exception indicating the specified resource does not exist. If available, this exception includes details in additional properties.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_shield/_services/async_shield.py
async def delete_subscription(
    self, *, config_overrides: Optional[AsyncShieldClientConfig] = None
) -> "capo_shield.types.delete_subscription_response.DeleteSubscriptionResponse":
    """<p>Removes Shield Advanced from an account. Shield Advanced requires a 1-year subscription commitment. You cannot delete a subscription prior to the completion of that commitment. </p>

    Raises:
        capo_shield.errors.internal_error_exception.InternalErrorException: <p>Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.</p>
        capo_shield.errors.locked_subscription_exception.LockedSubscriptionException: <p>You are trying to update a subscription that has not yet completed the 1-year commitment. You can change the <code>AutoRenew</code> parameter during the last 30 days of your subscription. This exception indicates that you are attempting to change <code>AutoRenew</code> prior to that period.</p>
        capo_shield.errors.resource_not_found_exception.ResourceNotFoundException: <p>Exception indicating the specified resource does not exist. If available, this exception includes details in additional properties. </p>
        capo_shield.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_shield.types.delete_subscription_request.DeleteSubscriptionRequest]",
    ) -> AsyncOperationResponse[
        "capo_shield.types.delete_subscription_response.DeleteSubscriptionResponse"
    ]:
        import capo_shield._operations.aws_shield_20160616.delete_subscription

        (
            output,
            http_response,
        ) = await capo_shield._operations.aws_shield_20160616.delete_subscription.async_delete_subscription(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteSubscription")
    )
    input_: capo_shield.types.delete_subscription_request.DeleteSubscriptionRequest = {}

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