aws-sdk-backupexternal 1.0.0

AWS SDK for AWS Backup External
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// Contains a notification about an appliance or node.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Notification {
    /// The notification message.
    pub message: ::std::string::String,
}
impl Notification {
    /// The notification message.
    pub fn message(&self) -> &str {
        use std::ops::Deref;
        self.message.deref()
    }
}
impl Notification {
    /// Creates a new builder-style object to manufacture [`Notification`](crate::types::Notification).
    pub fn builder() -> crate::types::builders::NotificationBuilder {
        crate::types::builders::NotificationBuilder::default()
    }
}

/// A builder for [`Notification`](crate::types::Notification).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct NotificationBuilder {
    pub(crate) message: ::std::option::Option<::std::string::String>,
}
impl NotificationBuilder {
    /// The notification message.
    /// This field is required.
    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.message = ::std::option::Option::Some(input.into());
        self
    }
    /// The notification message.
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.message = input;
        self
    }
    /// The notification message.
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.message
    }
    /// Consumes the builder and constructs a [`Notification`](crate::types::Notification).
    /// This method will fail if any of the following fields are not set:
    /// - [`message`](crate::types::builders::NotificationBuilder::message)
    pub fn build(self) -> ::std::result::Result<crate::types::Notification, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Notification {
            message: self.message.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "message",
                    "message was not specified but it is required when building Notification",
                )
            })?,
        })
    }
}