aws-sdk-notifications 1.45.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 RegisterNotificationHubOutput {
    /// <p>The Region of the <code>NotificationHub</code>.</p>
    pub notification_hub_region: ::std::string::String,
    /// <p>Provides additional information about the current <code>NotificationConfiguration</code> status information.</p>
    pub status_summary: ::std::option::Option<crate::types::NotificationHubStatusSummary>,
    /// <p>The date the resource was created.</p>
    pub creation_time: ::aws_smithy_types::DateTime,
    /// <p>The date the resource was last activated.</p>
    pub last_activation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl RegisterNotificationHubOutput {
    /// <p>The Region of the <code>NotificationHub</code>.</p>
    pub fn notification_hub_region(&self) -> &str {
        use std::ops::Deref;
        self.notification_hub_region.deref()
    }
    /// <p>Provides additional information about the current <code>NotificationConfiguration</code> status information.</p>
    pub fn status_summary(&self) -> ::std::option::Option<&crate::types::NotificationHubStatusSummary> {
        self.status_summary.as_ref()
    }
    /// <p>The date the resource was created.</p>
    pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
        &self.creation_time
    }
    /// <p>The date the resource was last activated.</p>
    pub fn last_activation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_activation_time.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for RegisterNotificationHubOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl RegisterNotificationHubOutput {
    /// Creates a new builder-style object to manufacture [`RegisterNotificationHubOutput`](crate::operation::register_notification_hub::RegisterNotificationHubOutput).
    pub fn builder() -> crate::operation::register_notification_hub::builders::RegisterNotificationHubOutputBuilder {
        crate::operation::register_notification_hub::builders::RegisterNotificationHubOutputBuilder::default()
    }
}

/// A builder for [`RegisterNotificationHubOutput`](crate::operation::register_notification_hub::RegisterNotificationHubOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RegisterNotificationHubOutputBuilder {
    pub(crate) notification_hub_region: ::std::option::Option<::std::string::String>,
    pub(crate) status_summary: ::std::option::Option<crate::types::NotificationHubStatusSummary>,
    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_activation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl RegisterNotificationHubOutputBuilder {
    /// <p>The Region of the <code>NotificationHub</code>.</p>
    /// This field is required.
    pub fn notification_hub_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.notification_hub_region = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Region of the <code>NotificationHub</code>.</p>
    pub fn set_notification_hub_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.notification_hub_region = input;
        self
    }
    /// <p>The Region of the <code>NotificationHub</code>.</p>
    pub fn get_notification_hub_region(&self) -> &::std::option::Option<::std::string::String> {
        &self.notification_hub_region
    }
    /// <p>Provides additional information about the current <code>NotificationConfiguration</code> status information.</p>
    /// This field is required.
    pub fn status_summary(mut self, input: crate::types::NotificationHubStatusSummary) -> Self {
        self.status_summary = ::std::option::Option::Some(input);
        self
    }
    /// <p>Provides additional information about the current <code>NotificationConfiguration</code> status information.</p>
    pub fn set_status_summary(mut self, input: ::std::option::Option<crate::types::NotificationHubStatusSummary>) -> Self {
        self.status_summary = input;
        self
    }
    /// <p>Provides additional information about the current <code>NotificationConfiguration</code> status information.</p>
    pub fn get_status_summary(&self) -> &::std::option::Option<crate::types::NotificationHubStatusSummary> {
        &self.status_summary
    }
    /// <p>The date the resource was created.</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 date the resource was created.</p>
    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_time = input;
        self
    }
    /// <p>The date the resource was created.</p>
    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_time
    }
    /// <p>The date the resource was last activated.</p>
    pub fn last_activation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_activation_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date the resource was last activated.</p>
    pub fn set_last_activation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_activation_time = input;
        self
    }
    /// <p>The date the resource was last activated.</p>
    pub fn get_last_activation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_activation_time
    }
    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 [`RegisterNotificationHubOutput`](crate::operation::register_notification_hub::RegisterNotificationHubOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`notification_hub_region`](crate::operation::register_notification_hub::builders::RegisterNotificationHubOutputBuilder::notification_hub_region)
    /// - [`creation_time`](crate::operation::register_notification_hub::builders::RegisterNotificationHubOutputBuilder::creation_time)
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::register_notification_hub::RegisterNotificationHubOutput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::register_notification_hub::RegisterNotificationHubOutput {
            notification_hub_region: self.notification_hub_region.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "notification_hub_region",
                    "notification_hub_region was not specified but it is required when building RegisterNotificationHubOutput",
                )
            })?,
            status_summary: self.status_summary,
            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 RegisterNotificationHubOutput",
                )
            })?,
            last_activation_time: self.last_activation_time,
            _request_id: self._request_id,
        })
    }
}