Skip to content

delete_protection async

delete_protection(
    protection_id: ProtectionId,
    *,
    config_overrides: Optional[AsyncShieldClientConfig] = None,
) -> DeleteProtectionResponse

Deletes an Shield Advanced Protection.

Parameters:

Raises:

  • InternalErrorException –

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

  • OptimisticLockException –

    Exception that indicates that the resource state has been modified by another client. Retrieve the resource and then retry your request.

  • 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_protection(
    self,
    protection_id: "capo_shield.types.protection_id.ProtectionId",
    *,
    config_overrides: Optional[AsyncShieldClientConfig] = None,
) -> "capo_shield.types.delete_protection_response.DeleteProtectionResponse":
    """<p>Deletes an Shield Advanced <a>Protection</a>.</p>

    Args:
        protection_id: <p>The unique identifier (ID) for the <a>Protection</a> object to be deleted.</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.optimistic_lock_exception.OptimisticLockException: <p>Exception that indicates that the resource state has been modified by another client. Retrieve the resource and then retry your request.</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_protection_request.DeleteProtectionRequest]",
    ) -> AsyncOperationResponse[
        "capo_shield.types.delete_protection_response.DeleteProtectionResponse"
    ]:
        import capo_shield._operations.aws_shield_20160616.delete_protection

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteProtection")
    )
    input_: capo_shield.types.delete_protection_request.DeleteProtectionRequest = {
        "protection_id": protection_id
    }

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