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.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetNotificationEventOutput {
    /// <p>The ARN of the resource.</p>
    pub arn: ::std::string::String,
    /// <p>The ARN of the <code>NotificationConfiguration</code>.</p>
    pub notification_configuration_arn: ::std::string::String,
    /// <p>The creation time of the <code>NotificationEvent</code>.</p>
    pub creation_time: ::aws_smithy_types::DateTime,
    /// <p>The content of the <code>NotificationEvent</code>.</p>
    pub content: ::std::option::Option<crate::types::NotificationEventSchema>,
    _request_id: Option<String>,
}
impl GetNotificationEventOutput {
    /// <p>The ARN of the resource.</p>
    pub fn arn(&self) -> &str {
        use std::ops::Deref;
        self.arn.deref()
    }
    /// <p>The ARN of the <code>NotificationConfiguration</code>.</p>
    pub fn notification_configuration_arn(&self) -> &str {
        use std::ops::Deref;
        self.notification_configuration_arn.deref()
    }
    /// <p>The creation time of the <code>NotificationEvent</code>.</p>
    pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
        &self.creation_time
    }
    /// <p>The content of the <code>NotificationEvent</code>.</p>
    pub fn content(&self) -> ::std::option::Option<&crate::types::NotificationEventSchema> {
        self.content.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetNotificationEventOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetNotificationEventOutput {
    /// Creates a new builder-style object to manufacture [`GetNotificationEventOutput`](crate::operation::get_notification_event::GetNotificationEventOutput).
    pub fn builder() -> crate::operation::get_notification_event::builders::GetNotificationEventOutputBuilder {
        crate::operation::get_notification_event::builders::GetNotificationEventOutputBuilder::default()
    }
}

/// A builder for [`GetNotificationEventOutput`](crate::operation::get_notification_event::GetNotificationEventOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetNotificationEventOutputBuilder {
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) notification_configuration_arn: ::std::option::Option<::std::string::String>,
    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) content: ::std::option::Option<crate::types::NotificationEventSchema>,
    _request_id: Option<String>,
}
impl GetNotificationEventOutputBuilder {
    /// <p>The ARN of the resource.</p>
    /// This field is required.
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the resource.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The ARN of the resource.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The ARN of the <code>NotificationConfiguration</code>.</p>
    /// This field is required.
    pub fn notification_configuration_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.notification_configuration_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the <code>NotificationConfiguration</code>.</p>
    pub fn set_notification_configuration_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.notification_configuration_arn = input;
        self
    }
    /// <p>The ARN of the <code>NotificationConfiguration</code>.</p>
    pub fn get_notification_configuration_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.notification_configuration_arn
    }
    /// <p>The creation time of the <code>NotificationEvent</code>.</p>
    /// This field is required.
    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The creation time of the <code>NotificationEvent</code>.</p>
    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_time = input;
        self
    }
    /// <p>The creation time of the <code>NotificationEvent</code>.</p>
    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_time
    }
    /// <p>The content of the <code>NotificationEvent</code>.</p>
    /// This field is required.
    pub fn content(mut self, input: crate::types::NotificationEventSchema) -> Self {
        self.content = ::std::option::Option::Some(input);
        self
    }
    /// <p>The content of the <code>NotificationEvent</code>.</p>
    pub fn set_content(mut self, input: ::std::option::Option<crate::types::NotificationEventSchema>) -> Self {
        self.content = input;
        self
    }
    /// <p>The content of the <code>NotificationEvent</code>.</p>
    pub fn get_content(&self) -> &::std::option::Option<crate::types::NotificationEventSchema> {
        &self.content
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetNotificationEventOutput`](crate::operation::get_notification_event::GetNotificationEventOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`arn`](crate::operation::get_notification_event::builders::GetNotificationEventOutputBuilder::arn)
    /// - [`notification_configuration_arn`](crate::operation::get_notification_event::builders::GetNotificationEventOutputBuilder::notification_configuration_arn)
    /// - [`creation_time`](crate::operation::get_notification_event::builders::GetNotificationEventOutputBuilder::creation_time)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_notification_event::GetNotificationEventOutput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::get_notification_event::GetNotificationEventOutput {
            arn: self.arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "arn",
                    "arn was not specified but it is required when building GetNotificationEventOutput",
                )
            })?,
            notification_configuration_arn: self.notification_configuration_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "notification_configuration_arn",
                    "notification_configuration_arn was not specified but it is required when building GetNotificationEventOutput",
                )
            })?,
            creation_time: self.creation_time.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "creation_time",
                    "creation_time was not specified but it is required when building GetNotificationEventOutput",
                )
            })?,
            content: self.content,
            _request_id: self._request_id,
        })
    }
}