aws-sdk-mailmanager 1.79.0

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

/// <p>The relay resource that can be used as a rule to relay receiving emails to the destination relay server.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Relay {
    /// <p>The unique relay identifier.</p>
    pub relay_id: ::std::option::Option<::std::string::String>,
    /// <p>The unique relay name.</p>
    pub relay_name: ::std::option::Option<::std::string::String>,
    /// <p>The timestamp of when the relay was last modified.</p>
    pub last_modified_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl Relay {
    /// <p>The unique relay identifier.</p>
    pub fn relay_id(&self) -> ::std::option::Option<&str> {
        self.relay_id.as_deref()
    }
    /// <p>The unique relay name.</p>
    pub fn relay_name(&self) -> ::std::option::Option<&str> {
        self.relay_name.as_deref()
    }
    /// <p>The timestamp of when the relay was last modified.</p>
    pub fn last_modified_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_modified_timestamp.as_ref()
    }
}
impl Relay {
    /// Creates a new builder-style object to manufacture [`Relay`](crate::types::Relay).
    pub fn builder() -> crate::types::builders::RelayBuilder {
        crate::types::builders::RelayBuilder::default()
    }
}

/// A builder for [`Relay`](crate::types::Relay).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RelayBuilder {
    pub(crate) relay_id: ::std::option::Option<::std::string::String>,
    pub(crate) relay_name: ::std::option::Option<::std::string::String>,
    pub(crate) last_modified_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl RelayBuilder {
    /// <p>The unique relay identifier.</p>
    pub fn relay_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.relay_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique relay identifier.</p>
    pub fn set_relay_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.relay_id = input;
        self
    }
    /// <p>The unique relay identifier.</p>
    pub fn get_relay_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.relay_id
    }
    /// <p>The unique relay name.</p>
    pub fn relay_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.relay_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique relay name.</p>
    pub fn set_relay_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.relay_name = input;
        self
    }
    /// <p>The unique relay name.</p>
    pub fn get_relay_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.relay_name
    }
    /// <p>The timestamp of when the relay was last modified.</p>
    pub fn last_modified_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_modified_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp of when the relay was last modified.</p>
    pub fn set_last_modified_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_modified_timestamp = input;
        self
    }
    /// <p>The timestamp of when the relay was last modified.</p>
    pub fn get_last_modified_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_modified_timestamp
    }
    /// Consumes the builder and constructs a [`Relay`](crate::types::Relay).
    pub fn build(self) -> crate::types::Relay {
        crate::types::Relay {
            relay_id: self.relay_id,
            relay_name: self.relay_name,
            last_modified_timestamp: self.last_modified_timestamp,
        }
    }
}