1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An object that describes the recipients for an email.</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 <i>local part</i> of a destination email address (the part of the email address that precedes the @ sign) may only contain <a href="https://en.wikipedia.org/wiki/Email_address#Local-part">7-bit ASCII characters</a>. If the <i>domain part</i> of an address (the part after the @ sign) contains non-ASCII characters, they must be encoded using Punycode, as described in <a href="https://tools.ietf.org/html/rfc3492.html">RFC3492</a>.</p>
/// </note>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Destination {
/// <p>An array that contains the email addresses of the "To" recipients for the email.</p>
pub to_addresses: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>An array that contains the email addresses of the "CC" (carbon copy) recipients for the email.</p>
pub cc_addresses: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>An array that contains the email addresses of the "BCC" (blind carbon copy) recipients for the email.</p>
pub bcc_addresses: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl Destination {
/// <p>An array that contains the email addresses of the "To" recipients for the email.</p>
pub fn to_addresses(&self) -> ::std::option::Option<&[::std::string::String]> {
self.to_addresses.as_deref()
}
/// <p>An array that contains the email addresses of the "CC" (carbon copy) recipients for the email.</p>
pub fn cc_addresses(&self) -> ::std::option::Option<&[::std::string::String]> {
self.cc_addresses.as_deref()
}
/// <p>An array that contains the email addresses of the "BCC" (blind carbon copy) recipients for the email.</p>
pub fn bcc_addresses(&self) -> ::std::option::Option<&[::std::string::String]> {
self.bcc_addresses.as_deref()
}
}
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).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
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>An array that contains the email addresses of the "To" recipients for the email.</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>An array that contains the email addresses of the "To" recipients for the email.</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>An array that contains the email addresses of the "To" recipients for the email.</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>An array that contains the email addresses of the "CC" (carbon copy) recipients for the email.</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>An array that contains the email addresses of the "CC" (carbon copy) recipients for the email.</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>An array that contains the email addresses of the "CC" (carbon copy) recipients for the email.</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>An array that contains the email addresses of the "BCC" (blind carbon copy) recipients for the email.</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>An array that contains the email addresses of the "BCC" (blind carbon copy) recipients for the email.</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>An array that contains the email addresses of the "BCC" (blind carbon copy) recipients for the email.</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,
}
}
}