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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A request to send an email message.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SendEmailInput {
/// <p>The email address that you want to use as the "From" address for the email. The address that you specify has to be verified.</p>
pub from_email_address: ::std::option::Option<::std::string::String>,
/// <p>An object that contains the recipients of the email message.</p>
pub destination: ::std::option::Option<crate::types::Destination>,
/// <p>The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address receives the reply.</p>
pub reply_to_addresses: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>The address that Amazon Pinpoint should send bounce and complaint notifications to.</p>
pub feedback_forwarding_email_address: ::std::option::Option<::std::string::String>,
/// <p>An object that contains the body of the message. You can send either a Simple message or a Raw message.</p>
pub content: ::std::option::Option<crate::types::EmailContent>,
/// <p>A list of tags, in the form of name/value pairs, to apply to an email that you send using the <code>SendEmail</code> operation. Tags correspond to characteristics of the email that you define, so that you can publish email sending events.</p>
pub email_tags: ::std::option::Option<::std::vec::Vec<crate::types::MessageTag>>,
/// <p>The name of the configuration set that you want to use when sending the email.</p>
pub configuration_set_name: ::std::option::Option<::std::string::String>,
}
impl SendEmailInput {
/// <p>The email address that you want to use as the "From" address for the email. The address that you specify has to be verified.</p>
pub fn from_email_address(&self) -> ::std::option::Option<&str> {
self.from_email_address.as_deref()
}
/// <p>An object that contains the recipients of the email message.</p>
pub fn destination(&self) -> ::std::option::Option<&crate::types::Destination> {
self.destination.as_ref()
}
/// <p>The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address receives the reply.</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 `.reply_to_addresses.is_none()`.
pub fn reply_to_addresses(&self) -> &[::std::string::String] {
self.reply_to_addresses.as_deref().unwrap_or_default()
}
/// <p>The address that Amazon Pinpoint should send bounce and complaint notifications to.</p>
pub fn feedback_forwarding_email_address(&self) -> ::std::option::Option<&str> {
self.feedback_forwarding_email_address.as_deref()
}
/// <p>An object that contains the body of the message. You can send either a Simple message or a Raw message.</p>
pub fn content(&self) -> ::std::option::Option<&crate::types::EmailContent> {
self.content.as_ref()
}
/// <p>A list of tags, in the form of name/value pairs, to apply to an email that you send using the <code>SendEmail</code> operation. Tags correspond to characteristics of the email that you define, so that you can publish email sending events.</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 `.email_tags.is_none()`.
pub fn email_tags(&self) -> &[crate::types::MessageTag] {
self.email_tags.as_deref().unwrap_or_default()
}
/// <p>The name of the configuration set that you want to use when sending the email.</p>
pub fn configuration_set_name(&self) -> ::std::option::Option<&str> {
self.configuration_set_name.as_deref()
}
}
impl SendEmailInput {
/// Creates a new builder-style object to manufacture [`SendEmailInput`](crate::operation::send_email::SendEmailInput).
pub fn builder() -> crate::operation::send_email::builders::SendEmailInputBuilder {
crate::operation::send_email::builders::SendEmailInputBuilder::default()
}
}
/// A builder for [`SendEmailInput`](crate::operation::send_email::SendEmailInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SendEmailInputBuilder {
pub(crate) from_email_address: ::std::option::Option<::std::string::String>,
pub(crate) destination: ::std::option::Option<crate::types::Destination>,
pub(crate) reply_to_addresses: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) feedback_forwarding_email_address: ::std::option::Option<::std::string::String>,
pub(crate) content: ::std::option::Option<crate::types::EmailContent>,
pub(crate) email_tags: ::std::option::Option<::std::vec::Vec<crate::types::MessageTag>>,
pub(crate) configuration_set_name: ::std::option::Option<::std::string::String>,
}
impl SendEmailInputBuilder {
/// <p>The email address that you want to use as the "From" address for the email. The address that you specify has to be verified.</p>
pub fn from_email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.from_email_address = ::std::option::Option::Some(input.into());
self
}
/// <p>The email address that you want to use as the "From" address for the email. The address that you specify has to be verified.</p>
pub fn set_from_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.from_email_address = input;
self
}
/// <p>The email address that you want to use as the "From" address for the email. The address that you specify has to be verified.</p>
pub fn get_from_email_address(&self) -> &::std::option::Option<::std::string::String> {
&self.from_email_address
}
/// <p>An object that contains the recipients of the email message.</p>
/// This field is required.
pub fn destination(mut self, input: crate::types::Destination) -> Self {
self.destination = ::std::option::Option::Some(input);
self
}
/// <p>An object that contains the recipients of the email message.</p>
pub fn set_destination(mut self, input: ::std::option::Option<crate::types::Destination>) -> Self {
self.destination = input;
self
}
/// <p>An object that contains the recipients of the email message.</p>
pub fn get_destination(&self) -> &::std::option::Option<crate::types::Destination> {
&self.destination
}
/// Appends an item to `reply_to_addresses`.
///
/// To override the contents of this collection use [`set_reply_to_addresses`](Self::set_reply_to_addresses).
///
/// <p>The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address receives the reply.</p>
pub fn reply_to_addresses(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.reply_to_addresses.unwrap_or_default();
v.push(input.into());
self.reply_to_addresses = ::std::option::Option::Some(v);
self
}
/// <p>The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address receives the reply.</p>
pub fn set_reply_to_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.reply_to_addresses = input;
self
}
/// <p>The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address receives the reply.</p>
pub fn get_reply_to_addresses(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.reply_to_addresses
}
/// <p>The address that Amazon Pinpoint should send bounce and complaint notifications to.</p>
pub fn feedback_forwarding_email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.feedback_forwarding_email_address = ::std::option::Option::Some(input.into());
self
}
/// <p>The address that Amazon Pinpoint should send bounce and complaint notifications to.</p>
pub fn set_feedback_forwarding_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.feedback_forwarding_email_address = input;
self
}
/// <p>The address that Amazon Pinpoint should send bounce and complaint notifications to.</p>
pub fn get_feedback_forwarding_email_address(&self) -> &::std::option::Option<::std::string::String> {
&self.feedback_forwarding_email_address
}
/// <p>An object that contains the body of the message. You can send either a Simple message or a Raw message.</p>
/// This field is required.
pub fn content(mut self, input: crate::types::EmailContent) -> Self {
self.content = ::std::option::Option::Some(input);
self
}
/// <p>An object that contains the body of the message. You can send either a Simple message or a Raw message.</p>
pub fn set_content(mut self, input: ::std::option::Option<crate::types::EmailContent>) -> Self {
self.content = input;
self
}
/// <p>An object that contains the body of the message. You can send either a Simple message or a Raw message.</p>
pub fn get_content(&self) -> &::std::option::Option<crate::types::EmailContent> {
&self.content
}
/// Appends an item to `email_tags`.
///
/// To override the contents of this collection use [`set_email_tags`](Self::set_email_tags).
///
/// <p>A list of tags, in the form of name/value pairs, to apply to an email that you send using the <code>SendEmail</code> operation. Tags correspond to characteristics of the email that you define, so that you can publish email sending events.</p>
pub fn email_tags(mut self, input: crate::types::MessageTag) -> Self {
let mut v = self.email_tags.unwrap_or_default();
v.push(input);
self.email_tags = ::std::option::Option::Some(v);
self
}
/// <p>A list of tags, in the form of name/value pairs, to apply to an email that you send using the <code>SendEmail</code> operation. Tags correspond to characteristics of the email that you define, so that you can publish email sending events.</p>
pub fn set_email_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MessageTag>>) -> Self {
self.email_tags = input;
self
}
/// <p>A list of tags, in the form of name/value pairs, to apply to an email that you send using the <code>SendEmail</code> operation. Tags correspond to characteristics of the email that you define, so that you can publish email sending events.</p>
pub fn get_email_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MessageTag>> {
&self.email_tags
}
/// <p>The name of the configuration set that you want to use when sending the email.</p>
pub fn configuration_set_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.configuration_set_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the configuration set that you want to use when sending the email.</p>
pub fn set_configuration_set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.configuration_set_name = input;
self
}
/// <p>The name of the configuration set that you want to use when sending the email.</p>
pub fn get_configuration_set_name(&self) -> &::std::option::Option<::std::string::String> {
&self.configuration_set_name
}
/// Consumes the builder and constructs a [`SendEmailInput`](crate::operation::send_email::SendEmailInput).
pub fn build(self) -> ::std::result::Result<crate::operation::send_email::SendEmailInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::send_email::SendEmailInput {
from_email_address: self.from_email_address,
destination: self.destination,
reply_to_addresses: self.reply_to_addresses,
feedback_forwarding_email_address: self.feedback_forwarding_email_address,
content: self.content,
email_tags: self.email_tags,
configuration_set_name: self.configuration_set_name,
})
}
}