Skip to content

delete_rule async

delete_rule(
    identifier: RuleIdentifier,
    *,
    config_overrides: Optional[AsyncrbinClientConfig] = None,
) -> DeleteRuleResponse

Deletes a Recycle Bin retention rule. For more information, see Delete Recycle Bin retention rules in the Amazon Elastic Compute Cloud User Guide.

Parameters:

  • identifier (RuleIdentifier) –

    The unique ID of the retention rule.

Raises:

Source code in docs_src/capo_rbin/_services/async_rbin.py
async def delete_rule(
    self,
    identifier: "capo_rbin.types.rule_identifier.RuleIdentifier",
    *,
    config_overrides: Optional[AsyncrbinClientConfig] = None,
) -> "capo_rbin.types.delete_rule_response.DeleteRuleResponse":
    """<p>Deletes a Recycle Bin retention rule. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recycle-bin-working-with-rules.html#recycle-bin-delete-rule"> Delete Recycle Bin retention rules</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>

    Args:
        identifier: <p>The unique ID of the retention rule.</p>

    Raises:
        capo_rbin.errors.conflict_exception.ConflictException: <p>The specified retention rule lock request can't be completed.</p>
        capo_rbin.errors.internal_server_exception.InternalServerException: <p>The service could not respond to the request due to an internal problem.</p>
        capo_rbin.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_rbin.errors.validation_exception.ValidationException: <p>One or more of the parameters in the request is not valid.</p>
        capo_rbin.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_rbin.types.delete_rule_request.DeleteRuleRequest]",
    ) -> AsyncOperationResponse[
        "capo_rbin.types.delete_rule_response.DeleteRuleResponse"
    ]:
        import capo_rbin._operations.amazon_recycle_bin.delete_rule

        (
            output,
            http_response,
        ) = await capo_rbin._operations.amazon_recycle_bin.delete_rule.async_delete_rule(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteRule")
    )
    input_: capo_rbin.types.delete_rule_request.DeleteRuleRequest = {
        "identifier": identifier
    }

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