Returns a specified NotificationEvent.
User Notifications stores notifications in the individual Regions you register as notification hubs and the Region of the source event rule. GetNotificationEvent only returns notifications stored in the same Region in which the action is called. User Notifications doesn't backfill notifications to new Regions selected as notification hubs. For this reason, we recommend that you make calls in your oldest registered notification hub. For more information, see Notification hubs in the Amazon Web Services User Notifications User Guide.
Parameters:
-
arn
(NotificationEventArn)
–
The Amazon Resource Name (ARN) of the NotificationEvent to return.
-
locale
(Optional[LocaleCode], default:
None
)
–
The locale code of the language used for the retrieved NotificationEvent. The default locale is English en_US.
Raises:
Source code in docs_src/capo_notifications/_services/async_notifications.py
| async def get_notification_event(
self,
arn: "capo_notifications.types.notification_event_arn.NotificationEventArn",
*,
config_overrides: Optional[AsyncNotificationsClientConfig] = None,
locale: Optional["capo_notifications.types.locale_code.LocaleCode"] = None,
) -> "capo_notifications.types.get_notification_event_response.GetNotificationEventResponse":
"""<p>Returns a specified <code>NotificationEvent</code>.</p> <important> <p>User Notifications stores notifications in the individual Regions you register as notification hubs and the Region of the source event rule. <code>GetNotificationEvent</code> only returns notifications stored in the same Region in which the action is called. User Notifications doesn't backfill notifications to new Regions selected as notification hubs. For this reason, we recommend that you make calls in your oldest registered notification hub. For more information, see <a href="https://docs.aws.amazon.com/notifications/latest/userguide/notification-hubs.html">Notification hubs</a> in the <i>Amazon Web Services User Notifications User Guide</i>.</p> </important>
Args:
arn: <p>The Amazon Resource Name (ARN) of the <code>NotificationEvent</code> to return.</p>
locale: <p>The locale code of the language used for the retrieved <code>NotificationEvent</code>. The default locale is English <code>en_US</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.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.get_notification_event_request.GetNotificationEventRequest]",
) -> AsyncOperationResponse[
"capo_notifications.types.get_notification_event_response.GetNotificationEventResponse"
]:
import capo_notifications._operations.notifications.get_notification_event
(
output,
http_response,
) = await capo_notifications._operations.notifications.get_notification_event.async_get_notification_event(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetNotificationEvent")
)
input_: capo_notifications.types.get_notification_event_request.GetNotificationEventRequest = {
"arn": arn
}
if locale is not None:
input_["locale"] = locale
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|