aws_sdk_sesv2/operation/send_bulk_email/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::send_bulk_email::_send_bulk_email_output::SendBulkEmailOutputBuilder;
3
4pub use crate::operation::send_bulk_email::_send_bulk_email_input::SendBulkEmailInputBuilder;
5
6impl crate::operation::send_bulk_email::builders::SendBulkEmailInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::send_bulk_email::SendBulkEmailOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::send_bulk_email::SendBulkEmailError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.send_bulk_email();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `SendBulkEmail`.
24///
25/// <p>Composes an email message to multiple destinations.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct SendBulkEmailFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::send_bulk_email::builders::SendBulkEmailInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::send_bulk_email::SendBulkEmailOutput,
35        crate::operation::send_bulk_email::SendBulkEmailError,
36    > for SendBulkEmailFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::send_bulk_email::SendBulkEmailOutput,
44            crate::operation::send_bulk_email::SendBulkEmailError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl SendBulkEmailFluentBuilder {
51    /// Creates a new `SendBulkEmailFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the SendBulkEmail as a reference.
60    pub fn as_input(&self) -> &crate::operation::send_bulk_email::builders::SendBulkEmailInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::send_bulk_email::SendBulkEmailOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::send_bulk_email::SendBulkEmailError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::send_bulk_email::SendBulkEmail::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::send_bulk_email::SendBulkEmail::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::send_bulk_email::SendBulkEmailOutput,
97        crate::operation::send_bulk_email::SendBulkEmailError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The email address to use as the "From" address for the email. The address that you specify has to be verified.</p>
112    pub fn from_email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.from_email_address(input.into());
114        self
115    }
116    /// <p>The email address to use as the "From" address for the email. The address that you specify has to be verified.</p>
117    pub fn set_from_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_from_email_address(input);
119        self
120    }
121    /// <p>The email address to use as the "From" address for the email. The address that you specify has to be verified.</p>
122    pub fn get_from_email_address(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_from_email_address()
124    }
125    /// <p>This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the email address specified in the <code>FromEmailAddress</code> parameter.</p>
126    /// <p>For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to use sender@example.com, then you would specify the <code>FromEmailAddressIdentityArn</code> to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the <code>FromEmailAddress</code> to be sender@example.com.</p>
127    /// <p>For more information about sending authorization, see the <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
128    pub fn from_email_address_identity_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.from_email_address_identity_arn(input.into());
130        self
131    }
132    /// <p>This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the email address specified in the <code>FromEmailAddress</code> parameter.</p>
133    /// <p>For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to use sender@example.com, then you would specify the <code>FromEmailAddressIdentityArn</code> to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the <code>FromEmailAddress</code> to be sender@example.com.</p>
134    /// <p>For more information about sending authorization, see the <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
135    pub fn set_from_email_address_identity_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_from_email_address_identity_arn(input);
137        self
138    }
139    /// <p>This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the email address specified in the <code>FromEmailAddress</code> parameter.</p>
140    /// <p>For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to use sender@example.com, then you would specify the <code>FromEmailAddressIdentityArn</code> to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the <code>FromEmailAddress</code> to be sender@example.com.</p>
141    /// <p>For more information about sending authorization, see the <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
142    pub fn get_from_email_address_identity_arn(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_from_email_address_identity_arn()
144    }
145    ///
146    /// Appends an item to `ReplyToAddresses`.
147    ///
148    /// To override the contents of this collection use [`set_reply_to_addresses`](Self::set_reply_to_addresses).
149    ///
150    /// <p>The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address receives the reply.</p>
151    pub fn reply_to_addresses(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152        self.inner = self.inner.reply_to_addresses(input.into());
153        self
154    }
155    /// <p>The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address receives the reply.</p>
156    pub fn set_reply_to_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
157        self.inner = self.inner.set_reply_to_addresses(input);
158        self
159    }
160    /// <p>The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address receives the reply.</p>
161    pub fn get_reply_to_addresses(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
162        self.inner.get_reply_to_addresses()
163    }
164    /// <p>The address that you want bounce and complaint notifications to be sent to.</p>
165    pub fn feedback_forwarding_email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166        self.inner = self.inner.feedback_forwarding_email_address(input.into());
167        self
168    }
169    /// <p>The address that you want bounce and complaint notifications to be sent to.</p>
170    pub fn set_feedback_forwarding_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171        self.inner = self.inner.set_feedback_forwarding_email_address(input);
172        self
173    }
174    /// <p>The address that you want bounce and complaint notifications to be sent to.</p>
175    pub fn get_feedback_forwarding_email_address(&self) -> &::std::option::Option<::std::string::String> {
176        self.inner.get_feedback_forwarding_email_address()
177    }
178    /// <p>This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the email address specified in the <code>FeedbackForwardingEmailAddress</code> parameter.</p>
179    /// <p>For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to use feedback@example.com, then you would specify the <code>FeedbackForwardingEmailAddressIdentityArn</code> to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the <code>FeedbackForwardingEmailAddress</code> to be feedback@example.com.</p>
180    /// <p>For more information about sending authorization, see the <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
181    pub fn feedback_forwarding_email_address_identity_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
182        self.inner = self.inner.feedback_forwarding_email_address_identity_arn(input.into());
183        self
184    }
185    /// <p>This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the email address specified in the <code>FeedbackForwardingEmailAddress</code> parameter.</p>
186    /// <p>For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to use feedback@example.com, then you would specify the <code>FeedbackForwardingEmailAddressIdentityArn</code> to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the <code>FeedbackForwardingEmailAddress</code> to be feedback@example.com.</p>
187    /// <p>For more information about sending authorization, see the <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
188    pub fn set_feedback_forwarding_email_address_identity_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189        self.inner = self.inner.set_feedback_forwarding_email_address_identity_arn(input);
190        self
191    }
192    /// <p>This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the email address specified in the <code>FeedbackForwardingEmailAddress</code> parameter.</p>
193    /// <p>For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to use feedback@example.com, then you would specify the <code>FeedbackForwardingEmailAddressIdentityArn</code> to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the <code>FeedbackForwardingEmailAddress</code> to be feedback@example.com.</p>
194    /// <p>For more information about sending authorization, see the <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
195    pub fn get_feedback_forwarding_email_address_identity_arn(&self) -> &::std::option::Option<::std::string::String> {
196        self.inner.get_feedback_forwarding_email_address_identity_arn()
197    }
198    ///
199    /// Appends an item to `DefaultEmailTags`.
200    ///
201    /// To override the contents of this collection use [`set_default_email_tags`](Self::set_default_email_tags).
202    ///
203    /// <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>
204    pub fn default_email_tags(mut self, input: crate::types::MessageTag) -> Self {
205        self.inner = self.inner.default_email_tags(input);
206        self
207    }
208    /// <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>
209    pub fn set_default_email_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MessageTag>>) -> Self {
210        self.inner = self.inner.set_default_email_tags(input);
211        self
212    }
213    /// <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>
214    pub fn get_default_email_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MessageTag>> {
215        self.inner.get_default_email_tags()
216    }
217    /// <p>An object that contains the body of the message. You can specify a template message.</p>
218    pub fn default_content(mut self, input: crate::types::BulkEmailContent) -> Self {
219        self.inner = self.inner.default_content(input);
220        self
221    }
222    /// <p>An object that contains the body of the message. You can specify a template message.</p>
223    pub fn set_default_content(mut self, input: ::std::option::Option<crate::types::BulkEmailContent>) -> Self {
224        self.inner = self.inner.set_default_content(input);
225        self
226    }
227    /// <p>An object that contains the body of the message. You can specify a template message.</p>
228    pub fn get_default_content(&self) -> &::std::option::Option<crate::types::BulkEmailContent> {
229        self.inner.get_default_content()
230    }
231    ///
232    /// Appends an item to `BulkEmailEntries`.
233    ///
234    /// To override the contents of this collection use [`set_bulk_email_entries`](Self::set_bulk_email_entries).
235    ///
236    /// <p>The list of bulk email entry objects.</p>
237    pub fn bulk_email_entries(mut self, input: crate::types::BulkEmailEntry) -> Self {
238        self.inner = self.inner.bulk_email_entries(input);
239        self
240    }
241    /// <p>The list of bulk email entry objects.</p>
242    pub fn set_bulk_email_entries(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BulkEmailEntry>>) -> Self {
243        self.inner = self.inner.set_bulk_email_entries(input);
244        self
245    }
246    /// <p>The list of bulk email entry objects.</p>
247    pub fn get_bulk_email_entries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BulkEmailEntry>> {
248        self.inner.get_bulk_email_entries()
249    }
250    /// <p>The name of the configuration set to use when sending the email.</p>
251    pub fn configuration_set_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
252        self.inner = self.inner.configuration_set_name(input.into());
253        self
254    }
255    /// <p>The name of the configuration set to use when sending the email.</p>
256    pub fn set_configuration_set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
257        self.inner = self.inner.set_configuration_set_name(input);
258        self
259    }
260    /// <p>The name of the configuration set to use when sending the email.</p>
261    pub fn get_configuration_set_name(&self) -> &::std::option::Option<::std::string::String> {
262        self.inner.get_configuration_set_name()
263    }
264    /// <p>The ID of the multi-region endpoint (global-endpoint).</p>
265    pub fn endpoint_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
266        self.inner = self.inner.endpoint_id(input.into());
267        self
268    }
269    /// <p>The ID of the multi-region endpoint (global-endpoint).</p>
270    pub fn set_endpoint_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
271        self.inner = self.inner.set_endpoint_id(input);
272        self
273    }
274    /// <p>The ID of the multi-region endpoint (global-endpoint).</p>
275    pub fn get_endpoint_id(&self) -> &::std::option::Option<::std::string::String> {
276        self.inner.get_endpoint_id()
277    }
278    /// <p>The name of the tenant through which this bulk email will be sent.</p><note>
279    /// <p>The email sending operation will only succeed if all referenced resources (identities, configuration sets, and templates) are associated with this tenant.</p>
280    /// </note>
281    pub fn tenant_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
282        self.inner = self.inner.tenant_name(input.into());
283        self
284    }
285    /// <p>The name of the tenant through which this bulk email will be sent.</p><note>
286    /// <p>The email sending operation will only succeed if all referenced resources (identities, configuration sets, and templates) are associated with this tenant.</p>
287    /// </note>
288    pub fn set_tenant_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
289        self.inner = self.inner.set_tenant_name(input);
290        self
291    }
292    /// <p>The name of the tenant through which this bulk email will be sent.</p><note>
293    /// <p>The email sending operation will only succeed if all referenced resources (identities, configuration sets, and templates) are associated with this tenant.</p>
294    /// </note>
295    pub fn get_tenant_name(&self) -> &::std::option::Option<::std::string::String> {
296        self.inner.get_tenant_name()
297    }
298}