aws-sdk-notifications 1.54.0

AWS SDK for AWS User Notifications
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::list_notification_events::_list_notification_events_input::ListNotificationEventsInputBuilder;

pub use crate::operation::list_notification_events::_list_notification_events_output::ListNotificationEventsOutputBuilder;

impl crate::operation::list_notification_events::builders::ListNotificationEventsInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::list_notification_events::ListNotificationEventsOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::list_notification_events::ListNotificationEventsError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.list_notification_events();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `ListNotificationEvents`.
///
/// <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>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct ListNotificationEventsFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::list_notification_events::builders::ListNotificationEventsInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::list_notification_events::ListNotificationEventsOutput,
        crate::operation::list_notification_events::ListNotificationEventsError,
    > for ListNotificationEventsFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::list_notification_events::ListNotificationEventsOutput,
            crate::operation::list_notification_events::ListNotificationEventsError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl ListNotificationEventsFluentBuilder {
    /// Creates a new `ListNotificationEventsFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the ListNotificationEvents as a reference.
    pub fn as_input(&self) -> &crate::operation::list_notification_events::builders::ListNotificationEventsInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::list_notification_events::ListNotificationEventsOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::list_notification_events::ListNotificationEventsError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::list_notification_events::ListNotificationEvents::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::list_notification_events::ListNotificationEvents::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::list_notification_events::ListNotificationEventsOutput,
        crate::operation::list_notification_events::ListNotificationEventsError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// Create a paginator for this request
    ///
    /// Paginators are used by calling [`send().await`](crate::operation::list_notification_events::paginator::ListNotificationEventsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
    pub fn into_paginator(self) -> crate::operation::list_notification_events::paginator::ListNotificationEventsPaginator {
        crate::operation::list_notification_events::paginator::ListNotificationEventsPaginator::new(self.handle, self.inner)
    }
    /// <p>The earliest time of events to return from this call.</p>
    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.inner = self.inner.start_time(input);
        self
    }
    /// <p>The earliest time of events to return from this call.</p>
    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.inner = self.inner.set_start_time(input);
        self
    }
    /// <p>The earliest time of events to return from this call.</p>
    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        self.inner.get_start_time()
    }
    /// <p>Latest time of events to return from this call.</p>
    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.inner = self.inner.end_time(input);
        self
    }
    /// <p>Latest time of events to return from this call.</p>
    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.inner = self.inner.set_end_time(input);
        self
    }
    /// <p>Latest time of events to return from this call.</p>
    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        self.inner.get_end_time()
    }
    /// <p>The locale code of the language used for the retrieved <code>NotificationEvent</code>. The default locale is English <code>(en_US)</code>.</p>
    pub fn locale(mut self, input: crate::types::LocaleCode) -> Self {
        self.inner = self.inner.locale(input);
        self
    }
    /// <p>The locale code of the language used for the retrieved <code>NotificationEvent</code>. The default locale is English <code>(en_US)</code>.</p>
    pub fn set_locale(mut self, input: ::std::option::Option<crate::types::LocaleCode>) -> Self {
        self.inner = self.inner.set_locale(input);
        self
    }
    /// <p>The locale code of the language used for the retrieved <code>NotificationEvent</code>. The default locale is English <code>(en_US)</code>.</p>
    pub fn get_locale(&self) -> &::std::option::Option<crate::types::LocaleCode> {
        self.inner.get_locale()
    }
    /// <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>
    pub fn source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.source(input.into());
        self
    }
    /// <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>
    pub fn set_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_source(input);
        self
    }
    /// <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>
    pub fn get_source(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_source()
    }
    /// <p>Include aggregated child events in the result.</p>
    pub fn include_child_events(mut self, input: bool) -> Self {
        self.inner = self.inner.include_child_events(input);
        self
    }
    /// <p>Include aggregated child events in the result.</p>
    pub fn set_include_child_events(mut self, input: ::std::option::Option<bool>) -> Self {
        self.inner = self.inner.set_include_child_events(input);
        self
    }
    /// <p>Include aggregated child events in the result.</p>
    pub fn get_include_child_events(&self) -> &::std::option::Option<bool> {
        self.inner.get_include_child_events()
    }
    /// <p>The Amazon Resource Name (ARN) of the <code>aggregatedNotificationEventArn</code> to match.</p>
    pub fn aggregate_notification_event_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.aggregate_notification_event_arn(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the <code>aggregatedNotificationEventArn</code> to match.</p>
    pub fn set_aggregate_notification_event_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_aggregate_notification_event_arn(input);
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the <code>aggregatedNotificationEventArn</code> to match.</p>
    pub fn get_aggregate_notification_event_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_aggregate_notification_event_arn()
    }
    /// <p>The maximum number of results to be returned in this call. Defaults to 20.</p>
    pub fn max_results(mut self, input: i32) -> Self {
        self.inner = self.inner.max_results(input);
        self
    }
    /// <p>The maximum number of results to be returned in this call. Defaults to 20.</p>
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_max_results(input);
        self
    }
    /// <p>The maximum number of results to be returned in this call. Defaults to 20.</p>
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
        self.inner.get_max_results()
    }
    /// <p>The start token for paginated calls. Retrieved from the response of a previous <code>ListEventRules</code> call. Next token uses Base64 encoding.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.next_token(input.into());
        self
    }
    /// <p>The start token for paginated calls. Retrieved from the response of a previous <code>ListEventRules</code> call. Next token uses Base64 encoding.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_next_token(input);
        self
    }
    /// <p>The start token for paginated calls. Retrieved from the response of a previous <code>ListEventRules</code> call. Next token uses Base64 encoding.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_next_token()
    }
    /// <p>The unique identifier of the organizational unit used to filter notification events.</p>
    pub fn organizational_unit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.organizational_unit_id(input.into());
        self
    }
    /// <p>The unique identifier of the organizational unit used to filter notification events.</p>
    pub fn set_organizational_unit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_organizational_unit_id(input);
        self
    }
    /// <p>The unique identifier of the organizational unit used to filter notification events.</p>
    pub fn get_organizational_unit_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_organizational_unit_id()
    }
}