aws_sdk_pinpointemail/operation/put_email_identity_mail_from_attributes/_put_email_identity_mail_from_attributes_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A request to configure the custom MAIL FROM domain for a verified identity.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PutEmailIdentityMailFromAttributesInput {
7 /// <p>The verified email identity that you want to set up the custom MAIL FROM domain for.</p>
8 pub email_identity: ::std::option::Option<::std::string::String>,
9 /// <p>The custom MAIL FROM domain that you want the verified identity to use. The MAIL FROM domain must meet the following criteria:</p>
10 /// <ul>
11 /// <li>
12 /// <p>It has to be a subdomain of the verified identity.</p></li>
13 /// <li>
14 /// <p>It can't be used to receive email.</p></li>
15 /// <li>
16 /// <p>It can't be used in a "From" address if the MAIL FROM domain is a destination for feedback forwarding emails.</p></li>
17 /// </ul>
18 pub mail_from_domain: ::std::option::Option<::std::string::String>,
19 /// <p>The action that you want Amazon Pinpoint to take if it can't read the required MX record when you send an email. When you set this value to <code>UseDefaultValue</code>, Amazon Pinpoint uses <i>amazonses.com</i> as the MAIL FROM domain. When you set this value to <code>RejectMessage</code>, Amazon Pinpoint returns a <code>MailFromDomainNotVerified</code> error, and doesn't attempt to deliver the email.</p>
20 /// <p>These behaviors are taken when the custom MAIL FROM domain configuration is in the <code>Pending</code>, <code>Failed</code>, and <code>TemporaryFailure</code> states.</p>
21 pub behavior_on_mx_failure: ::std::option::Option<crate::types::BehaviorOnMxFailure>,
22}
23impl PutEmailIdentityMailFromAttributesInput {
24 /// <p>The verified email identity that you want to set up the custom MAIL FROM domain for.</p>
25 pub fn email_identity(&self) -> ::std::option::Option<&str> {
26 self.email_identity.as_deref()
27 }
28 /// <p>The custom MAIL FROM domain that you want the verified identity to use. The MAIL FROM domain must meet the following criteria:</p>
29 /// <ul>
30 /// <li>
31 /// <p>It has to be a subdomain of the verified identity.</p></li>
32 /// <li>
33 /// <p>It can't be used to receive email.</p></li>
34 /// <li>
35 /// <p>It can't be used in a "From" address if the MAIL FROM domain is a destination for feedback forwarding emails.</p></li>
36 /// </ul>
37 pub fn mail_from_domain(&self) -> ::std::option::Option<&str> {
38 self.mail_from_domain.as_deref()
39 }
40 /// <p>The action that you want Amazon Pinpoint to take if it can't read the required MX record when you send an email. When you set this value to <code>UseDefaultValue</code>, Amazon Pinpoint uses <i>amazonses.com</i> as the MAIL FROM domain. When you set this value to <code>RejectMessage</code>, Amazon Pinpoint returns a <code>MailFromDomainNotVerified</code> error, and doesn't attempt to deliver the email.</p>
41 /// <p>These behaviors are taken when the custom MAIL FROM domain configuration is in the <code>Pending</code>, <code>Failed</code>, and <code>TemporaryFailure</code> states.</p>
42 pub fn behavior_on_mx_failure(&self) -> ::std::option::Option<&crate::types::BehaviorOnMxFailure> {
43 self.behavior_on_mx_failure.as_ref()
44 }
45}
46impl PutEmailIdentityMailFromAttributesInput {
47 /// Creates a new builder-style object to manufacture [`PutEmailIdentityMailFromAttributesInput`](crate::operation::put_email_identity_mail_from_attributes::PutEmailIdentityMailFromAttributesInput).
48 pub fn builder() -> crate::operation::put_email_identity_mail_from_attributes::builders::PutEmailIdentityMailFromAttributesInputBuilder {
49 crate::operation::put_email_identity_mail_from_attributes::builders::PutEmailIdentityMailFromAttributesInputBuilder::default()
50 }
51}
52
53/// A builder for [`PutEmailIdentityMailFromAttributesInput`](crate::operation::put_email_identity_mail_from_attributes::PutEmailIdentityMailFromAttributesInput).
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct PutEmailIdentityMailFromAttributesInputBuilder {
57 pub(crate) email_identity: ::std::option::Option<::std::string::String>,
58 pub(crate) mail_from_domain: ::std::option::Option<::std::string::String>,
59 pub(crate) behavior_on_mx_failure: ::std::option::Option<crate::types::BehaviorOnMxFailure>,
60}
61impl PutEmailIdentityMailFromAttributesInputBuilder {
62 /// <p>The verified email identity that you want to set up the custom MAIL FROM domain for.</p>
63 /// This field is required.
64 pub fn email_identity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
65 self.email_identity = ::std::option::Option::Some(input.into());
66 self
67 }
68 /// <p>The verified email identity that you want to set up the custom MAIL FROM domain for.</p>
69 pub fn set_email_identity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
70 self.email_identity = input;
71 self
72 }
73 /// <p>The verified email identity that you want to set up the custom MAIL FROM domain for.</p>
74 pub fn get_email_identity(&self) -> &::std::option::Option<::std::string::String> {
75 &self.email_identity
76 }
77 /// <p>The custom MAIL FROM domain that you want the verified identity to use. The MAIL FROM domain must meet the following criteria:</p>
78 /// <ul>
79 /// <li>
80 /// <p>It has to be a subdomain of the verified identity.</p></li>
81 /// <li>
82 /// <p>It can't be used to receive email.</p></li>
83 /// <li>
84 /// <p>It can't be used in a "From" address if the MAIL FROM domain is a destination for feedback forwarding emails.</p></li>
85 /// </ul>
86 pub fn mail_from_domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87 self.mail_from_domain = ::std::option::Option::Some(input.into());
88 self
89 }
90 /// <p>The custom MAIL FROM domain that you want the verified identity to use. The MAIL FROM domain must meet the following criteria:</p>
91 /// <ul>
92 /// <li>
93 /// <p>It has to be a subdomain of the verified identity.</p></li>
94 /// <li>
95 /// <p>It can't be used to receive email.</p></li>
96 /// <li>
97 /// <p>It can't be used in a "From" address if the MAIL FROM domain is a destination for feedback forwarding emails.</p></li>
98 /// </ul>
99 pub fn set_mail_from_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100 self.mail_from_domain = input;
101 self
102 }
103 /// <p>The custom MAIL FROM domain that you want the verified identity to use. The MAIL FROM domain must meet the following criteria:</p>
104 /// <ul>
105 /// <li>
106 /// <p>It has to be a subdomain of the verified identity.</p></li>
107 /// <li>
108 /// <p>It can't be used to receive email.</p></li>
109 /// <li>
110 /// <p>It can't be used in a "From" address if the MAIL FROM domain is a destination for feedback forwarding emails.</p></li>
111 /// </ul>
112 pub fn get_mail_from_domain(&self) -> &::std::option::Option<::std::string::String> {
113 &self.mail_from_domain
114 }
115 /// <p>The action that you want Amazon Pinpoint to take if it can't read the required MX record when you send an email. When you set this value to <code>UseDefaultValue</code>, Amazon Pinpoint uses <i>amazonses.com</i> as the MAIL FROM domain. When you set this value to <code>RejectMessage</code>, Amazon Pinpoint returns a <code>MailFromDomainNotVerified</code> error, and doesn't attempt to deliver the email.</p>
116 /// <p>These behaviors are taken when the custom MAIL FROM domain configuration is in the <code>Pending</code>, <code>Failed</code>, and <code>TemporaryFailure</code> states.</p>
117 pub fn behavior_on_mx_failure(mut self, input: crate::types::BehaviorOnMxFailure) -> Self {
118 self.behavior_on_mx_failure = ::std::option::Option::Some(input);
119 self
120 }
121 /// <p>The action that you want Amazon Pinpoint to take if it can't read the required MX record when you send an email. When you set this value to <code>UseDefaultValue</code>, Amazon Pinpoint uses <i>amazonses.com</i> as the MAIL FROM domain. When you set this value to <code>RejectMessage</code>, Amazon Pinpoint returns a <code>MailFromDomainNotVerified</code> error, and doesn't attempt to deliver the email.</p>
122 /// <p>These behaviors are taken when the custom MAIL FROM domain configuration is in the <code>Pending</code>, <code>Failed</code>, and <code>TemporaryFailure</code> states.</p>
123 pub fn set_behavior_on_mx_failure(mut self, input: ::std::option::Option<crate::types::BehaviorOnMxFailure>) -> Self {
124 self.behavior_on_mx_failure = input;
125 self
126 }
127 /// <p>The action that you want Amazon Pinpoint to take if it can't read the required MX record when you send an email. When you set this value to <code>UseDefaultValue</code>, Amazon Pinpoint uses <i>amazonses.com</i> as the MAIL FROM domain. When you set this value to <code>RejectMessage</code>, Amazon Pinpoint returns a <code>MailFromDomainNotVerified</code> error, and doesn't attempt to deliver the email.</p>
128 /// <p>These behaviors are taken when the custom MAIL FROM domain configuration is in the <code>Pending</code>, <code>Failed</code>, and <code>TemporaryFailure</code> states.</p>
129 pub fn get_behavior_on_mx_failure(&self) -> &::std::option::Option<crate::types::BehaviorOnMxFailure> {
130 &self.behavior_on_mx_failure
131 }
132 /// Consumes the builder and constructs a [`PutEmailIdentityMailFromAttributesInput`](crate::operation::put_email_identity_mail_from_attributes::PutEmailIdentityMailFromAttributesInput).
133 pub fn build(
134 self,
135 ) -> ::std::result::Result<
136 crate::operation::put_email_identity_mail_from_attributes::PutEmailIdentityMailFromAttributesInput,
137 ::aws_smithy_types::error::operation::BuildError,
138 > {
139 ::std::result::Result::Ok(
140 crate::operation::put_email_identity_mail_from_attributes::PutEmailIdentityMailFromAttributesInput {
141 email_identity: self.email_identity,
142 mail_from_domain: self.mail_from_domain,
143 behavior_on_mx_failure: self.behavior_on_mx_failure,
144 },
145 )
146 }
147}