Skip to content

unlock_rule

unlock_rule(
    identifier: RuleIdentifier, *, config_overrides: Optional[rbinClientConfig] = None
) -> UnlockRuleResponse

Unlocks a retention rule. After a retention rule is unlocked, it can be modified or deleted only after the unlock delay period expires.

Parameters:

  • identifier (RuleIdentifier) –

    The unique ID of the retention rule.

Raises:

Source code in docs_src/capo_rbin/_services/rbin.py
def unlock_rule(
    self,
    identifier: "capo_rbin.types.rule_identifier.RuleIdentifier",
    *,
    config_overrides: Optional[rbinClientConfig] = None,
) -> "capo_rbin.types.unlock_rule_response.UnlockRuleResponse":
    """<p>Unlocks a retention rule. After a retention rule is unlocked, it can be modified or deleted only after the unlock delay period expires.</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.
    """

    def _handler(
        req: "OperationRequest[capo_rbin.types.unlock_rule_request.UnlockRuleRequest]",
    ) -> OperationResponse[
        "capo_rbin.types.unlock_rule_response.UnlockRuleResponse"
    ]:
        import capo_rbin._operations.amazon_recycle_bin.unlock_rule

        output, http_response = (
            capo_rbin._operations.amazon_recycle_bin.unlock_rule.unlock_rule(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UnlockRule")
    )
    input_: capo_rbin.types.unlock_rule_request.UnlockRuleRequest = {
        "identifier": identifier
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output