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/notifications.py
| def update_event_rule(
self,
arn: "capo_notifications.types.event_rule_arn.EventRuleArn",
*,
config_overrides: Optional[NotificationsClientConfig] = 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.
"""
def _handler(
req: "OperationRequest[capo_notifications.types.update_event_rule_request.UpdateEventRuleRequest]",
) -> OperationResponse[
"capo_notifications.types.update_event_rule_response.UpdateEventRuleResponse"
]:
import capo_notifications._operations.notifications.update_event_rule
output, http_response = (
capo_notifications._operations.notifications.update_event_rule.update_event_rule(
req.options, req.input
)
)
return OperationResponse(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 = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|