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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The SMTP envelope information of the email.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Envelope {
/// <p>The HELO used by the host from which the email was received.</p>
pub helo: ::std::option::Option<::std::string::String>,
/// <p>The RCPT FROM given by the host from which the email was received.</p>
pub from: ::std::option::Option<::std::string::String>,
/// <p>All SMTP TO entries given by the host from which the email was received.</p>
pub to: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl Envelope {
/// <p>The HELO used by the host from which the email was received.</p>
pub fn helo(&self) -> ::std::option::Option<&str> {
self.helo.as_deref()
}
/// <p>The RCPT FROM given by the host from which the email was received.</p>
pub fn from(&self) -> ::std::option::Option<&str> {
self.from.as_deref()
}
/// <p>All SMTP TO entries given by the host from which the email was received.</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.is_none()`.
pub fn to(&self) -> &[::std::string::String] {
self.to.as_deref().unwrap_or_default()
}
}
impl Envelope {
/// Creates a new builder-style object to manufacture [`Envelope`](crate::types::Envelope).
pub fn builder() -> crate::types::builders::EnvelopeBuilder {
crate::types::builders::EnvelopeBuilder::default()
}
}
/// A builder for [`Envelope`](crate::types::Envelope).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EnvelopeBuilder {
pub(crate) helo: ::std::option::Option<::std::string::String>,
pub(crate) from: ::std::option::Option<::std::string::String>,
pub(crate) to: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl EnvelopeBuilder {
/// <p>The HELO used by the host from which the email was received.</p>
pub fn helo(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.helo = ::std::option::Option::Some(input.into());
self
}
/// <p>The HELO used by the host from which the email was received.</p>
pub fn set_helo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.helo = input;
self
}
/// <p>The HELO used by the host from which the email was received.</p>
pub fn get_helo(&self) -> &::std::option::Option<::std::string::String> {
&self.helo
}
/// <p>The RCPT FROM given by the host from which the email was received.</p>
pub fn from(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.from = ::std::option::Option::Some(input.into());
self
}
/// <p>The RCPT FROM given by the host from which the email was received.</p>
pub fn set_from(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.from = input;
self
}
/// <p>The RCPT FROM given by the host from which the email was received.</p>
pub fn get_from(&self) -> &::std::option::Option<::std::string::String> {
&self.from
}
/// Appends an item to `to`.
///
/// To override the contents of this collection use [`set_to`](Self::set_to).
///
/// <p>All SMTP TO entries given by the host from which the email was received.</p>
pub fn to(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.to.unwrap_or_default();
v.push(input.into());
self.to = ::std::option::Option::Some(v);
self
}
/// <p>All SMTP TO entries given by the host from which the email was received.</p>
pub fn set_to(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.to = input;
self
}
/// <p>All SMTP TO entries given by the host from which the email was received.</p>
pub fn get_to(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.to
}
/// Consumes the builder and constructs a [`Envelope`](crate::types::Envelope).
pub fn build(self) -> crate::types::Envelope {
crate::types::Envelope {
helo: self.helo,
from: self.from,
to: self.to,
}
}
}