Skip to content

update_event_rule async

update_event_rule(
    arn: EventRuleArn,
    *,
    config_overrides: Optional[AsyncNotificationsClientConfig] = None,
    event_pattern: Optional[EventRuleEventPattern] = None,
    regions: Optional[Regions] = None,
) -> UpdateEventRuleResponse

Updates an existing EventRule.

Parameters:

  • arn (EventRuleArn) –

    The Amazon Resource Name (ARN) to use to update the EventRule.

  • event_pattern (Optional[EventRuleEventPattern], default: None ) –

    An additional event pattern used to further filter the events this EventRule receives.

    For more information, see Amazon EventBridge event patterns in the Amazon EventBridge User Guide.

  • regions (Optional[Regions], default: None ) –

    A list of Amazon Web Services Regions that sends events to this EventRule.

Raises:

Source code in docs_src/capo_notifications/_services/async_notifications.py
async def update_event_rule(
    self,
    arn: "capo_notifications.types.event_rule_arn.EventRuleArn",
    *,
    config_overrides: Optional[AsyncNotificationsClientConfig] = None,
    event_pattern: Optional[
        "capo_notifications.types.event_rule_event_pattern.EventRuleEventPattern"
    ] = None,
    regions: Optional["capo_notifications.types.regions.Regions"] = None,
) -> "capo_notifications.types.update_event_rule_response.UpdateEventRuleResponse":
    """<p>Updates an existing <code>EventRule</code>.</p>

    Args:
        arn: <p>The Amazon Resource Name (ARN) to use to update the <code>EventRule</code>.</p>
        event_pattern: <p>An additional event pattern used to further filter the events this <code>EventRule</code> receives.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html">Amazon EventBridge event patterns</a> in the <i>Amazon EventBridge User Guide.</i> </p>
        regions: <p>A list of Amazon Web Services Regions that sends events to this <code>EventRule</code>.</p>

    Raises:
        capo_notifications.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
        capo_notifications.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state.</p>
        capo_notifications.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_notifications.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist. </p>
        capo_notifications.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling. </p>
        capo_notifications.errors.validation_exception.ValidationException: <p>This exception is thrown when the notification event fails validation.</p>
        capo_notifications.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_notifications.types.update_event_rule_request.UpdateEventRuleRequest]",
    ) -> AsyncOperationResponse[
        "capo_notifications.types.update_event_rule_response.UpdateEventRuleResponse"
    ]:
        import capo_notifications._operations.notifications.update_event_rule

        (
            output,
            http_response,
        ) = await capo_notifications._operations.notifications.update_event_rule.async_update_event_rule(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateEventRule")
    )
    input_: capo_notifications.types.update_event_rule_request.UpdateEventRuleRequest = {
        "arn": arn
    }
    if event_pattern is not None:
        input_["event_pattern"] = event_pattern
    if regions is not None:
        input_["regions"] = regions

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