Skip to content

list_notification_events async

list_notification_events(
    *,
    config_overrides: Optional[AsyncNotificationsClientConfig] = None,
    start_time: Optional[datetime] = None,
    end_time: Optional[datetime] = None,
    locale: Optional[LocaleCode] = None,
    source: Optional[Source] = None,
    include_child_events: Optional[bool] = None,
    aggregate_notification_event_arn: Optional[NotificationEventArn] = None,
    max_results: Optional[int] = None,
    next_token: Optional[NextToken] = None,
    organizational_unit_id: Optional[OrganizationalUnitId] = None,
) -> ListNotificationEventsResponse

Returns a list of NotificationEvents according to specified filters, in reverse chronological order (newest first).

User Notifications stores notifications in the individual Regions you register as notification hubs and the Region of the source event rule. ListNotificationEvents 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:

  • start_time (Optional[datetime], default: None ) –

    The earliest time of events to return from this call.

  • end_time (Optional[datetime], default: None ) –

    Latest time of events to return from this call.

  • locale (Optional[LocaleCode], default: None ) –

    The locale code of the language used for the retrieved NotificationEvent. The default locale is English (en_US).

  • source (Optional[Source], default: None ) –

    The matched event source.

    Must match one of the valid EventBridge sources. Only Amazon Web Services service sourced events are supported. For example, aws.ec2 and aws.cloudwatch. For more information, see Event delivery from Amazon Web Services services in the Amazon EventBridge User Guide.

  • include_child_events (Optional[bool], default: None ) –

    Include aggregated child events in the result.

  • aggregate_notification_event_arn (Optional[NotificationEventArn], default: None ) –

    The Amazon Resource Name (ARN) of the aggregatedNotificationEventArn to match.

  • max_results (Optional[int], default: None ) –

    The maximum number of results to be returned in this call. Defaults to 20.

  • next_token (Optional[NextToken], default: None ) –

    The start token for paginated calls. Retrieved from the response of a previous ListEventRules call. Next token uses Base64 encoding.

  • organizational_unit_id (Optional[OrganizationalUnitId], default: None ) –

    The unique identifier of the organizational unit used to filter notification events.

Raises:

Source code in docs_src/capo_notifications/_services/async_notifications.py
async def list_notification_events(
    self,
    *,
    config_overrides: Optional[AsyncNotificationsClientConfig] = None,
    start_time: Optional[datetime.datetime] = None,
    end_time: Optional[datetime.datetime] = None,
    locale: Optional["capo_notifications.types.locale_code.LocaleCode"] = None,
    source: Optional["capo_notifications.types.source.Source"] = None,
    include_child_events: Optional[bool] = None,
    aggregate_notification_event_arn: Optional[
        "capo_notifications.types.notification_event_arn.NotificationEventArn"
    ] = None,
    max_results: Optional[int] = None,
    next_token: Optional["capo_notifications.types.next_token.NextToken"] = None,
    organizational_unit_id: Optional[
        "capo_notifications.types.organizational_unit_id.OrganizationalUnitId"
    ] = None,
) -> "capo_notifications.types.list_notification_events_response.ListNotificationEventsResponse":
    """<p>Returns a list of <code>NotificationEvents</code> according to specified filters, in reverse chronological order (newest first).</p> <important> <p>User Notifications stores notifications in the individual Regions you register as notification hubs and the Region of the source event rule. ListNotificationEvents 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:
        start_time: <p>The earliest time of events to return from this call.</p>
        end_time: <p>Latest time of events to return from this call.</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>
        source: <p>The matched event source.</p> <p>Must match one of the valid EventBridge sources. Only Amazon Web Services service sourced events are supported. For example, <code>aws.ec2</code> and <code>aws.cloudwatch</code>. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level">Event delivery from Amazon Web Services services</a> in the <i>Amazon EventBridge User Guide</i>.</p>
        include_child_events: <p>Include aggregated child events in the result.</p>
        aggregate_notification_event_arn: <p>The Amazon Resource Name (ARN) of the <code>aggregatedNotificationEventArn</code> to match.</p>
        max_results: <p>The maximum number of results to be returned in this call. Defaults to 20.</p>
        next_token: <p>The start token for paginated calls. Retrieved from the response of a previous <code>ListEventRules</code> call. Next token uses Base64 encoding.</p>
        organizational_unit_id: <p>The unique identifier of the organizational unit used to filter notification events.</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.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.list_notification_events_request.ListNotificationEventsRequest]",
    ) -> AsyncOperationResponse[
        "capo_notifications.types.list_notification_events_response.ListNotificationEventsResponse"
    ]:
        import capo_notifications._operations.notifications.list_notification_events

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListNotificationEvents")
    )
    input_: capo_notifications.types.list_notification_events_request.ListNotificationEventsRequest = {}
    if start_time is not None:
        input_["start_time"] = start_time
    if end_time is not None:
        input_["end_time"] = end_time
    if locale is not None:
        input_["locale"] = locale
    if source is not None:
        input_["source"] = source
    if include_child_events is not None:
        input_["include_child_events"] = include_child_events
    if aggregate_notification_event_arn is not None:
        input_["aggregate_notification_event_arn"] = (
            aggregate_notification_event_arn
        )
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if organizational_unit_id is not None:
        input_["organizational_unit_id"] = organizational_unit_id

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