aws_sdk_ses/operation/send_bounce/_send_bounce_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents a request to send a bounce message to the sender of an email you received through Amazon SES.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SendBounceInput {
7 /// <p>The message ID of the message to be bounced.</p>
8 pub original_message_id: ::std::option::Option<::std::string::String>,
9 /// <p>The address to use in the "From" header of the bounce message. This must be an identity that you have verified with Amazon SES.</p>
10 pub bounce_sender: ::std::option::Option<::std::string::String>,
11 /// <p>Human-readable text for the bounce message to explain the failure. If not specified, the text is auto-generated based on the bounced recipient information.</p>
12 pub explanation: ::std::option::Option<::std::string::String>,
13 /// <p>Message-related DSN fields. If not specified, Amazon SES chooses the values.</p>
14 pub message_dsn: ::std::option::Option<crate::types::MessageDsn>,
15 /// <p>A list of recipients of the bounced message, including the information required to create the Delivery Status Notifications (DSNs) for the recipients. You must specify at least one <code>BouncedRecipientInfo</code> in the list.</p>
16 pub bounced_recipient_info_list: ::std::option::Option<::std::vec::Vec<crate::types::BouncedRecipientInfo>>,
17 /// <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 address in the "From" header of the bounce. For more information about sending authorization, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
18 pub bounce_sender_arn: ::std::option::Option<::std::string::String>,
19}
20impl SendBounceInput {
21 /// <p>The message ID of the message to be bounced.</p>
22 pub fn original_message_id(&self) -> ::std::option::Option<&str> {
23 self.original_message_id.as_deref()
24 }
25 /// <p>The address to use in the "From" header of the bounce message. This must be an identity that you have verified with Amazon SES.</p>
26 pub fn bounce_sender(&self) -> ::std::option::Option<&str> {
27 self.bounce_sender.as_deref()
28 }
29 /// <p>Human-readable text for the bounce message to explain the failure. If not specified, the text is auto-generated based on the bounced recipient information.</p>
30 pub fn explanation(&self) -> ::std::option::Option<&str> {
31 self.explanation.as_deref()
32 }
33 /// <p>Message-related DSN fields. If not specified, Amazon SES chooses the values.</p>
34 pub fn message_dsn(&self) -> ::std::option::Option<&crate::types::MessageDsn> {
35 self.message_dsn.as_ref()
36 }
37 /// <p>A list of recipients of the bounced message, including the information required to create the Delivery Status Notifications (DSNs) for the recipients. You must specify at least one <code>BouncedRecipientInfo</code> in the list.</p>
38 ///
39 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.bounced_recipient_info_list.is_none()`.
40 pub fn bounced_recipient_info_list(&self) -> &[crate::types::BouncedRecipientInfo] {
41 self.bounced_recipient_info_list.as_deref().unwrap_or_default()
42 }
43 /// <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 address in the "From" header of the bounce. For more information about sending authorization, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
44 pub fn bounce_sender_arn(&self) -> ::std::option::Option<&str> {
45 self.bounce_sender_arn.as_deref()
46 }
47}
48impl SendBounceInput {
49 /// Creates a new builder-style object to manufacture [`SendBounceInput`](crate::operation::send_bounce::SendBounceInput).
50 pub fn builder() -> crate::operation::send_bounce::builders::SendBounceInputBuilder {
51 crate::operation::send_bounce::builders::SendBounceInputBuilder::default()
52 }
53}
54
55/// A builder for [`SendBounceInput`](crate::operation::send_bounce::SendBounceInput).
56#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
57#[non_exhaustive]
58pub struct SendBounceInputBuilder {
59 pub(crate) original_message_id: ::std::option::Option<::std::string::String>,
60 pub(crate) bounce_sender: ::std::option::Option<::std::string::String>,
61 pub(crate) explanation: ::std::option::Option<::std::string::String>,
62 pub(crate) message_dsn: ::std::option::Option<crate::types::MessageDsn>,
63 pub(crate) bounced_recipient_info_list: ::std::option::Option<::std::vec::Vec<crate::types::BouncedRecipientInfo>>,
64 pub(crate) bounce_sender_arn: ::std::option::Option<::std::string::String>,
65}
66impl SendBounceInputBuilder {
67 /// <p>The message ID of the message to be bounced.</p>
68 /// This field is required.
69 pub fn original_message_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70 self.original_message_id = ::std::option::Option::Some(input.into());
71 self
72 }
73 /// <p>The message ID of the message to be bounced.</p>
74 pub fn set_original_message_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75 self.original_message_id = input;
76 self
77 }
78 /// <p>The message ID of the message to be bounced.</p>
79 pub fn get_original_message_id(&self) -> &::std::option::Option<::std::string::String> {
80 &self.original_message_id
81 }
82 /// <p>The address to use in the "From" header of the bounce message. This must be an identity that you have verified with Amazon SES.</p>
83 /// This field is required.
84 pub fn bounce_sender(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85 self.bounce_sender = ::std::option::Option::Some(input.into());
86 self
87 }
88 /// <p>The address to use in the "From" header of the bounce message. This must be an identity that you have verified with Amazon SES.</p>
89 pub fn set_bounce_sender(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90 self.bounce_sender = input;
91 self
92 }
93 /// <p>The address to use in the "From" header of the bounce message. This must be an identity that you have verified with Amazon SES.</p>
94 pub fn get_bounce_sender(&self) -> &::std::option::Option<::std::string::String> {
95 &self.bounce_sender
96 }
97 /// <p>Human-readable text for the bounce message to explain the failure. If not specified, the text is auto-generated based on the bounced recipient information.</p>
98 pub fn explanation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99 self.explanation = ::std::option::Option::Some(input.into());
100 self
101 }
102 /// <p>Human-readable text for the bounce message to explain the failure. If not specified, the text is auto-generated based on the bounced recipient information.</p>
103 pub fn set_explanation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104 self.explanation = input;
105 self
106 }
107 /// <p>Human-readable text for the bounce message to explain the failure. If not specified, the text is auto-generated based on the bounced recipient information.</p>
108 pub fn get_explanation(&self) -> &::std::option::Option<::std::string::String> {
109 &self.explanation
110 }
111 /// <p>Message-related DSN fields. If not specified, Amazon SES chooses the values.</p>
112 pub fn message_dsn(mut self, input: crate::types::MessageDsn) -> Self {
113 self.message_dsn = ::std::option::Option::Some(input);
114 self
115 }
116 /// <p>Message-related DSN fields. If not specified, Amazon SES chooses the values.</p>
117 pub fn set_message_dsn(mut self, input: ::std::option::Option<crate::types::MessageDsn>) -> Self {
118 self.message_dsn = input;
119 self
120 }
121 /// <p>Message-related DSN fields. If not specified, Amazon SES chooses the values.</p>
122 pub fn get_message_dsn(&self) -> &::std::option::Option<crate::types::MessageDsn> {
123 &self.message_dsn
124 }
125 /// Appends an item to `bounced_recipient_info_list`.
126 ///
127 /// To override the contents of this collection use [`set_bounced_recipient_info_list`](Self::set_bounced_recipient_info_list).
128 ///
129 /// <p>A list of recipients of the bounced message, including the information required to create the Delivery Status Notifications (DSNs) for the recipients. You must specify at least one <code>BouncedRecipientInfo</code> in the list.</p>
130 pub fn bounced_recipient_info_list(mut self, input: crate::types::BouncedRecipientInfo) -> Self {
131 let mut v = self.bounced_recipient_info_list.unwrap_or_default();
132 v.push(input);
133 self.bounced_recipient_info_list = ::std::option::Option::Some(v);
134 self
135 }
136 /// <p>A list of recipients of the bounced message, including the information required to create the Delivery Status Notifications (DSNs) for the recipients. You must specify at least one <code>BouncedRecipientInfo</code> in the list.</p>
137 pub fn set_bounced_recipient_info_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BouncedRecipientInfo>>) -> Self {
138 self.bounced_recipient_info_list = input;
139 self
140 }
141 /// <p>A list of recipients of the bounced message, including the information required to create the Delivery Status Notifications (DSNs) for the recipients. You must specify at least one <code>BouncedRecipientInfo</code> in the list.</p>
142 pub fn get_bounced_recipient_info_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BouncedRecipientInfo>> {
143 &self.bounced_recipient_info_list
144 }
145 /// <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 address in the "From" header of the bounce. For more information about sending authorization, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
146 pub fn bounce_sender_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147 self.bounce_sender_arn = ::std::option::Option::Some(input.into());
148 self
149 }
150 /// <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 address in the "From" header of the bounce. For more information about sending authorization, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
151 pub fn set_bounce_sender_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152 self.bounce_sender_arn = input;
153 self
154 }
155 /// <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 address in the "From" header of the bounce. For more information about sending authorization, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
156 pub fn get_bounce_sender_arn(&self) -> &::std::option::Option<::std::string::String> {
157 &self.bounce_sender_arn
158 }
159 /// Consumes the builder and constructs a [`SendBounceInput`](crate::operation::send_bounce::SendBounceInput).
160 pub fn build(self) -> ::std::result::Result<crate::operation::send_bounce::SendBounceInput, ::aws_smithy_types::error::operation::BuildError> {
161 ::std::result::Result::Ok(crate::operation::send_bounce::SendBounceInput {
162 original_message_id: self.original_message_id,
163 bounce_sender: self.bounce_sender,
164 explanation: self.explanation,
165 message_dsn: self.message_dsn,
166 bounced_recipient_info_list: self.bounced_recipient_info_list,
167 bounce_sender_arn: self.bounce_sender_arn,
168 })
169 }
170}