Skip to content

update_automation_rule_v2 async

update_automation_rule_v2(
    identifier: NonEmptyString,
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    rule_status: Optional[RuleStatusV2] = None,
    rule_order: Optional[RuleOrderValueV2] = None,
    description: Optional[NonEmptyString] = None,
    rule_name: Optional[NonEmptyString] = None,
    criteria: Optional[Criteria] = None,
    actions: Optional[AutomationRulesActionListV2] = None,
) -> UpdateAutomationRuleV2Response

Updates a V2 automation rule.

Parameters:

Raises:

Source code in docs_src/capo_securityhub/_services/async_security_hub.py
async def update_automation_rule_v2(
    self,
    identifier: "capo_securityhub.types.non_empty_string.NonEmptyString",
    *,
    config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
    rule_status: Optional[
        "capo_securityhub.types.rule_status_v2.RuleStatusV2"
    ] = None,
    rule_order: Optional[
        "capo_securityhub.types.rule_order_value_v2.RuleOrderValueV2"
    ] = None,
    description: Optional[
        "capo_securityhub.types.non_empty_string.NonEmptyString"
    ] = None,
    rule_name: Optional[
        "capo_securityhub.types.non_empty_string.NonEmptyString"
    ] = None,
    criteria: Optional["capo_securityhub.types.criteria.Criteria"] = None,
    actions: Optional[
        "capo_securityhub.types.automation_rules_action_list_v2.AutomationRulesActionListV2"
    ] = None,
) -> "capo_securityhub.types.update_automation_rule_v2_response.UpdateAutomationRuleV2Response":
    """<p>Updates a V2 automation rule.</p>

    Args:
        identifier: <p>The ARN of the automation rule.</p>
        rule_status: <p>The status of the automation rule.</p>
        rule_order: <p>Represents a value for the rule priority.</p>
        description: <p>A description of the automation rule.</p>
        rule_name: <p>The name of the automation rule.</p>
        criteria: <p>The filtering type and configuration of the automation rule.</p>
        actions: <p>A list of actions to be performed when the rule criteria is met.</p>

    Raises:
        capo_securityhub.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action specified in the request.</p>
        capo_securityhub.errors.conflict_exception.ConflictException: <p>The request causes conflict with the current state of the service resource.</p>
        capo_securityhub.errors.internal_server_exception.InternalServerException: <p> The request has failed due to an internal failure of the service. </p>
        capo_securityhub.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was rejected because we can't find the specified resource.</p>
        capo_securityhub.errors.throttling_exception.ThrottlingException: <p> The limit on the number of requests per second was exceeded. </p>
        capo_securityhub.errors.validation_exception.ValidationException: <p>The request has failed validation because it's missing required fields or has invalid inputs.</p>
        capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityhub.types.update_automation_rule_v2_request.UpdateAutomationRuleV2Request]",
    ) -> AsyncOperationResponse[
        "capo_securityhub.types.update_automation_rule_v2_response.UpdateAutomationRuleV2Response"
    ]:
        import capo_securityhub._operations.security_hub_api_service.update_automation_rule_v2

        (
            output,
            http_response,
        ) = await capo_securityhub._operations.security_hub_api_service.update_automation_rule_v2.async_update_automation_rule_v2(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateAutomationRuleV2")
    )
    input_: capo_securityhub.types.update_automation_rule_v2_request.UpdateAutomationRuleV2Request = {
        "identifier": identifier
    }
    if rule_status is not None:
        input_["rule_status"] = rule_status
    if rule_order is not None:
        input_["rule_order"] = rule_order
    if description is not None:
        input_["description"] = description
    if rule_name is not None:
        input_["rule_name"] = rule_name
    if criteria is not None:
        input_["criteria"] = criteria
    if actions is not None:
        input_["actions"] = actions

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