aws_sdk_sesv2/operation/get_message_insights/
_get_message_insights_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Information about a message.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
6pub struct GetMessageInsightsOutput {
7    /// <p>A unique identifier for the message.</p>
8    pub message_id: ::std::option::Option<::std::string::String>,
9    /// <p>The from address used to send the message.</p>
10    pub from_email_address: ::std::option::Option<::std::string::String>,
11    /// <p>The subject line of the message.</p>
12    pub subject: ::std::option::Option<::std::string::String>,
13    /// <p>A list of tags, in the form of name/value pairs, that were applied to the email you sent, along with Amazon SES <a href="https://docs.aws.amazon.com/ses/latest/dg/monitor-using-event-publishing.html">Auto-Tags</a>.</p>
14    pub email_tags: ::std::option::Option<::std::vec::Vec<crate::types::MessageTag>>,
15    /// <p>A set of insights associated with the message.</p>
16    pub insights: ::std::option::Option<::std::vec::Vec<crate::types::EmailInsights>>,
17    _request_id: Option<String>,
18}
19impl GetMessageInsightsOutput {
20    /// <p>A unique identifier for the message.</p>
21    pub fn message_id(&self) -> ::std::option::Option<&str> {
22        self.message_id.as_deref()
23    }
24    /// <p>The from address used to send the message.</p>
25    pub fn from_email_address(&self) -> ::std::option::Option<&str> {
26        self.from_email_address.as_deref()
27    }
28    /// <p>The subject line of the message.</p>
29    pub fn subject(&self) -> ::std::option::Option<&str> {
30        self.subject.as_deref()
31    }
32    /// <p>A list of tags, in the form of name/value pairs, that were applied to the email you sent, along with Amazon SES <a href="https://docs.aws.amazon.com/ses/latest/dg/monitor-using-event-publishing.html">Auto-Tags</a>.</p>
33    ///
34    /// 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()`.
35    pub fn email_tags(&self) -> &[crate::types::MessageTag] {
36        self.email_tags.as_deref().unwrap_or_default()
37    }
38    /// <p>A set of insights associated with the message.</p>
39    ///
40    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.insights.is_none()`.
41    pub fn insights(&self) -> &[crate::types::EmailInsights] {
42        self.insights.as_deref().unwrap_or_default()
43    }
44}
45impl ::std::fmt::Debug for GetMessageInsightsOutput {
46    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
47        let mut formatter = f.debug_struct("GetMessageInsightsOutput");
48        formatter.field("message_id", &self.message_id);
49        formatter.field("from_email_address", &"*** Sensitive Data Redacted ***");
50        formatter.field("subject", &"*** Sensitive Data Redacted ***");
51        formatter.field("email_tags", &self.email_tags);
52        formatter.field("insights", &self.insights);
53        formatter.field("_request_id", &self._request_id);
54        formatter.finish()
55    }
56}
57impl ::aws_types::request_id::RequestId for GetMessageInsightsOutput {
58    fn request_id(&self) -> Option<&str> {
59        self._request_id.as_deref()
60    }
61}
62impl GetMessageInsightsOutput {
63    /// Creates a new builder-style object to manufacture [`GetMessageInsightsOutput`](crate::operation::get_message_insights::GetMessageInsightsOutput).
64    pub fn builder() -> crate::operation::get_message_insights::builders::GetMessageInsightsOutputBuilder {
65        crate::operation::get_message_insights::builders::GetMessageInsightsOutputBuilder::default()
66    }
67}
68
69/// A builder for [`GetMessageInsightsOutput`](crate::operation::get_message_insights::GetMessageInsightsOutput).
70#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
71#[non_exhaustive]
72pub struct GetMessageInsightsOutputBuilder {
73    pub(crate) message_id: ::std::option::Option<::std::string::String>,
74    pub(crate) from_email_address: ::std::option::Option<::std::string::String>,
75    pub(crate) subject: ::std::option::Option<::std::string::String>,
76    pub(crate) email_tags: ::std::option::Option<::std::vec::Vec<crate::types::MessageTag>>,
77    pub(crate) insights: ::std::option::Option<::std::vec::Vec<crate::types::EmailInsights>>,
78    _request_id: Option<String>,
79}
80impl GetMessageInsightsOutputBuilder {
81    /// <p>A unique identifier for the message.</p>
82    pub fn message_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.message_id = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>A unique identifier for the message.</p>
87    pub fn set_message_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.message_id = input;
89        self
90    }
91    /// <p>A unique identifier for the message.</p>
92    pub fn get_message_id(&self) -> &::std::option::Option<::std::string::String> {
93        &self.message_id
94    }
95    /// <p>The from address used to send the message.</p>
96    pub fn from_email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.from_email_address = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>The from address used to send the message.</p>
101    pub fn set_from_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.from_email_address = input;
103        self
104    }
105    /// <p>The from address used to send the message.</p>
106    pub fn get_from_email_address(&self) -> &::std::option::Option<::std::string::String> {
107        &self.from_email_address
108    }
109    /// <p>The subject line of the message.</p>
110    pub fn subject(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.subject = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>The subject line of the message.</p>
115    pub fn set_subject(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.subject = input;
117        self
118    }
119    /// <p>The subject line of the message.</p>
120    pub fn get_subject(&self) -> &::std::option::Option<::std::string::String> {
121        &self.subject
122    }
123    /// Appends an item to `email_tags`.
124    ///
125    /// To override the contents of this collection use [`set_email_tags`](Self::set_email_tags).
126    ///
127    /// <p>A list of tags, in the form of name/value pairs, that were applied to the email you sent, along with Amazon SES <a href="https://docs.aws.amazon.com/ses/latest/dg/monitor-using-event-publishing.html">Auto-Tags</a>.</p>
128    pub fn email_tags(mut self, input: crate::types::MessageTag) -> Self {
129        let mut v = self.email_tags.unwrap_or_default();
130        v.push(input);
131        self.email_tags = ::std::option::Option::Some(v);
132        self
133    }
134    /// <p>A list of tags, in the form of name/value pairs, that were applied to the email you sent, along with Amazon SES <a href="https://docs.aws.amazon.com/ses/latest/dg/monitor-using-event-publishing.html">Auto-Tags</a>.</p>
135    pub fn set_email_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MessageTag>>) -> Self {
136        self.email_tags = input;
137        self
138    }
139    /// <p>A list of tags, in the form of name/value pairs, that were applied to the email you sent, along with Amazon SES <a href="https://docs.aws.amazon.com/ses/latest/dg/monitor-using-event-publishing.html">Auto-Tags</a>.</p>
140    pub fn get_email_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MessageTag>> {
141        &self.email_tags
142    }
143    /// Appends an item to `insights`.
144    ///
145    /// To override the contents of this collection use [`set_insights`](Self::set_insights).
146    ///
147    /// <p>A set of insights associated with the message.</p>
148    pub fn insights(mut self, input: crate::types::EmailInsights) -> Self {
149        let mut v = self.insights.unwrap_or_default();
150        v.push(input);
151        self.insights = ::std::option::Option::Some(v);
152        self
153    }
154    /// <p>A set of insights associated with the message.</p>
155    pub fn set_insights(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EmailInsights>>) -> Self {
156        self.insights = input;
157        self
158    }
159    /// <p>A set of insights associated with the message.</p>
160    pub fn get_insights(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EmailInsights>> {
161        &self.insights
162    }
163    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
164        self._request_id = Some(request_id.into());
165        self
166    }
167
168    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
169        self._request_id = request_id;
170        self
171    }
172    /// Consumes the builder and constructs a [`GetMessageInsightsOutput`](crate::operation::get_message_insights::GetMessageInsightsOutput).
173    pub fn build(self) -> crate::operation::get_message_insights::GetMessageInsightsOutput {
174        crate::operation::get_message_insights::GetMessageInsightsOutput {
175            message_id: self.message_id,
176            from_email_address: self.from_email_address,
177            subject: self.subject,
178            email_tags: self.email_tags,
179            insights: self.insights,
180            _request_id: self._request_id,
181        }
182    }
183}
184impl ::std::fmt::Debug for GetMessageInsightsOutputBuilder {
185    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
186        let mut formatter = f.debug_struct("GetMessageInsightsOutputBuilder");
187        formatter.field("message_id", &self.message_id);
188        formatter.field("from_email_address", &"*** Sensitive Data Redacted ***");
189        formatter.field("subject", &"*** Sensitive Data Redacted ***");
190        formatter.field("email_tags", &self.email_tags);
191        formatter.field("insights", &self.insights);
192        formatter.field("_request_id", &self._request_id);
193        formatter.finish()
194    }
195}