aws_sdk_sesv2/operation/get_message_insights/
_get_message_insights_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
6pub struct GetMessageInsightsOutput {
7 pub message_id: ::std::option::Option<::std::string::String>,
9 pub from_email_address: ::std::option::Option<::std::string::String>,
11 pub subject: ::std::option::Option<::std::string::String>,
13 pub email_tags: ::std::option::Option<::std::vec::Vec<crate::types::MessageTag>>,
15 pub insights: ::std::option::Option<::std::vec::Vec<crate::types::EmailInsights>>,
17 _request_id: Option<String>,
18}
19impl GetMessageInsightsOutput {
20 pub fn message_id(&self) -> ::std::option::Option<&str> {
22 self.message_id.as_deref()
23 }
24 pub fn from_email_address(&self) -> ::std::option::Option<&str> {
26 self.from_email_address.as_deref()
27 }
28 pub fn subject(&self) -> ::std::option::Option<&str> {
30 self.subject.as_deref()
31 }
32 pub fn email_tags(&self) -> &[crate::types::MessageTag] {
36 self.email_tags.as_deref().unwrap_or_default()
37 }
38 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 pub fn builder() -> crate::operation::get_message_insights::builders::GetMessageInsightsOutputBuilder {
65 crate::operation::get_message_insights::builders::GetMessageInsightsOutputBuilder::default()
66 }
67}
68
69#[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 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 pub fn set_message_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88 self.message_id = input;
89 self
90 }
91 pub fn get_message_id(&self) -> &::std::option::Option<::std::string::String> {
93 &self.message_id
94 }
95 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 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 pub fn get_from_email_address(&self) -> &::std::option::Option<::std::string::String> {
107 &self.from_email_address
108 }
109 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 pub fn set_subject(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116 self.subject = input;
117 self
118 }
119 pub fn get_subject(&self) -> &::std::option::Option<::std::string::String> {
121 &self.subject
122 }
123 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 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 pub fn get_email_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MessageTag>> {
141 &self.email_tags
142 }
143 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 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 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 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}