aws-sdk-ses 1.95.0

AWS SDK for Amazon Simple Email Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Represents the destination of the message, consisting of To:, CC:, and BCC: fields.</p><note>
/// <p>Amazon SES does not support the SMTPUTF8 extension, as described in <a href="https://tools.ietf.org/html/rfc6531">RFC6531</a>. For this reason, the email address string must be 7-bit ASCII. If you want to send to or from email addresses that contain Unicode characters in the domain part of an address, you must encode the domain using Punycode. Punycode is not permitted in the local part of the email address (the part before the @ sign) nor in the "friendly from" name. If you want to use Unicode characters in the "friendly from" name, you must encode the "friendly from" name using MIME encoded-word syntax, as described in <a href="https://docs.aws.amazon.com/ses/latest/dg/send-email-raw.html">Sending raw email using the Amazon SES API</a>. For more information about Punycode, see <a href="http://tools.ietf.org/html/rfc3492">RFC 3492</a>.</p>
/// </note>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Destination {
    /// <p>The recipients to place on the To: line of the message.</p>
    pub to_addresses: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The recipients to place on the CC: line of the message.</p>
    pub cc_addresses: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The recipients to place on the BCC: line of the message.</p>
    pub bcc_addresses: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl Destination {
    /// <p>The recipients to place on the To: line of the message.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.to_addresses.is_none()`.
    pub fn to_addresses(&self) -> &[::std::string::String] {
        self.to_addresses.as_deref().unwrap_or_default()
    }
    /// <p>The recipients to place on the CC: line of the message.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.cc_addresses.is_none()`.
    pub fn cc_addresses(&self) -> &[::std::string::String] {
        self.cc_addresses.as_deref().unwrap_or_default()
    }
    /// <p>The recipients to place on the BCC: line of the message.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.bcc_addresses.is_none()`.
    pub fn bcc_addresses(&self) -> &[::std::string::String] {
        self.bcc_addresses.as_deref().unwrap_or_default()
    }
}
impl Destination {
    /// Creates a new builder-style object to manufacture [`Destination`](crate::types::Destination).
    pub fn builder() -> crate::types::builders::DestinationBuilder {
        crate::types::builders::DestinationBuilder::default()
    }
}

/// A builder for [`Destination`](crate::types::Destination).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DestinationBuilder {
    pub(crate) to_addresses: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) cc_addresses: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) bcc_addresses: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl DestinationBuilder {
    /// Appends an item to `to_addresses`.
    ///
    /// To override the contents of this collection use [`set_to_addresses`](Self::set_to_addresses).
    ///
    /// <p>The recipients to place on the To: line of the message.</p>
    pub fn to_addresses(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.to_addresses.unwrap_or_default();
        v.push(input.into());
        self.to_addresses = ::std::option::Option::Some(v);
        self
    }
    /// <p>The recipients to place on the To: line of the message.</p>
    pub fn set_to_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.to_addresses = input;
        self
    }
    /// <p>The recipients to place on the To: line of the message.</p>
    pub fn get_to_addresses(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.to_addresses
    }
    /// Appends an item to `cc_addresses`.
    ///
    /// To override the contents of this collection use [`set_cc_addresses`](Self::set_cc_addresses).
    ///
    /// <p>The recipients to place on the CC: line of the message.</p>
    pub fn cc_addresses(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.cc_addresses.unwrap_or_default();
        v.push(input.into());
        self.cc_addresses = ::std::option::Option::Some(v);
        self
    }
    /// <p>The recipients to place on the CC: line of the message.</p>
    pub fn set_cc_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.cc_addresses = input;
        self
    }
    /// <p>The recipients to place on the CC: line of the message.</p>
    pub fn get_cc_addresses(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.cc_addresses
    }
    /// Appends an item to `bcc_addresses`.
    ///
    /// To override the contents of this collection use [`set_bcc_addresses`](Self::set_bcc_addresses).
    ///
    /// <p>The recipients to place on the BCC: line of the message.</p>
    pub fn bcc_addresses(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.bcc_addresses.unwrap_or_default();
        v.push(input.into());
        self.bcc_addresses = ::std::option::Option::Some(v);
        self
    }
    /// <p>The recipients to place on the BCC: line of the message.</p>
    pub fn set_bcc_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.bcc_addresses = input;
        self
    }
    /// <p>The recipients to place on the BCC: line of the message.</p>
    pub fn get_bcc_addresses(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.bcc_addresses
    }
    /// Consumes the builder and constructs a [`Destination`](crate::types::Destination).
    pub fn build(self) -> crate::types::Destination {
        crate::types::Destination {
            to_addresses: self.to_addresses,
            cc_addresses: self.cc_addresses,
            bcc_addresses: self.bcc_addresses,
        }
    }
}