1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Information about a message.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct GetMessageInsightsOutput {
    /// <p>A unique identifier for the message.</p>
    pub message_id: ::std::option::Option<::std::string::String>,
    /// <p>The from address used to send the message.</p>
    pub from_email_address: ::std::option::Option<::std::string::String>,
    /// <p>The subject line of the message.</p>
    pub subject: ::std::option::Option<::std::string::String>,
    /// <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>
    pub email_tags: ::std::option::Option<::std::vec::Vec<crate::types::MessageTag>>,
    /// <p>A set of insights associated with the message.</p>
    pub insights: ::std::option::Option<::std::vec::Vec<crate::types::EmailInsights>>,
    _request_id: Option<String>,
}
impl GetMessageInsightsOutput {
    /// <p>A unique identifier for the message.</p>
    pub fn message_id(&self) -> ::std::option::Option<&str> {
        self.message_id.as_deref()
    }
    /// <p>The from address used to send the message.</p>
    pub fn from_email_address(&self) -> ::std::option::Option<&str> {
        self.from_email_address.as_deref()
    }
    /// <p>The subject line of the message.</p>
    pub fn subject(&self) -> ::std::option::Option<&str> {
        self.subject.as_deref()
    }
    /// <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>
    ///
    /// 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()`.
    pub fn email_tags(&self) -> &[crate::types::MessageTag] {
        self.email_tags.as_deref().unwrap_or_default()
    }
    /// <p>A set of insights associated with the message.</p>
    ///
    /// 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()`.
    pub fn insights(&self) -> &[crate::types::EmailInsights] {
        self.insights.as_deref().unwrap_or_default()
    }
}
impl ::std::fmt::Debug for GetMessageInsightsOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetMessageInsightsOutput");
        formatter.field("message_id", &self.message_id);
        formatter.field("from_email_address", &"*** Sensitive Data Redacted ***");
        formatter.field("subject", &"*** Sensitive Data Redacted ***");
        formatter.field("email_tags", &self.email_tags);
        formatter.field("insights", &self.insights);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for GetMessageInsightsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetMessageInsightsOutput {
    /// Creates a new builder-style object to manufacture [`GetMessageInsightsOutput`](crate::operation::get_message_insights::GetMessageInsightsOutput).
    pub fn builder() -> crate::operation::get_message_insights::builders::GetMessageInsightsOutputBuilder {
        crate::operation::get_message_insights::builders::GetMessageInsightsOutputBuilder::default()
    }
}

/// A builder for [`GetMessageInsightsOutput`](crate::operation::get_message_insights::GetMessageInsightsOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
pub struct GetMessageInsightsOutputBuilder {
    pub(crate) message_id: ::std::option::Option<::std::string::String>,
    pub(crate) from_email_address: ::std::option::Option<::std::string::String>,
    pub(crate) subject: ::std::option::Option<::std::string::String>,
    pub(crate) email_tags: ::std::option::Option<::std::vec::Vec<crate::types::MessageTag>>,
    pub(crate) insights: ::std::option::Option<::std::vec::Vec<crate::types::EmailInsights>>,
    _request_id: Option<String>,
}
impl GetMessageInsightsOutputBuilder {
    /// <p>A unique identifier for the message.</p>
    pub fn message_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.message_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique identifier for the message.</p>
    pub fn set_message_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.message_id = input;
        self
    }
    /// <p>A unique identifier for the message.</p>
    pub fn get_message_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.message_id
    }
    /// <p>The from address used to send the message.</p>
    pub fn from_email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.from_email_address = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The from address used to send the message.</p>
    pub fn set_from_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.from_email_address = input;
        self
    }
    /// <p>The from address used to send the message.</p>
    pub fn get_from_email_address(&self) -> &::std::option::Option<::std::string::String> {
        &self.from_email_address
    }
    /// <p>The subject line of the message.</p>
    pub fn subject(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.subject = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The subject line of the message.</p>
    pub fn set_subject(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.subject = input;
        self
    }
    /// <p>The subject line of the message.</p>
    pub fn get_subject(&self) -> &::std::option::Option<::std::string::String> {
        &self.subject
    }
    /// Appends an item to `email_tags`.
    ///
    /// To override the contents of this collection use [`set_email_tags`](Self::set_email_tags).
    ///
    /// <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>
    pub fn email_tags(mut self, input: crate::types::MessageTag) -> Self {
        let mut v = self.email_tags.unwrap_or_default();
        v.push(input);
        self.email_tags = ::std::option::Option::Some(v);
        self
    }
    /// <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>
    pub fn set_email_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MessageTag>>) -> Self {
        self.email_tags = input;
        self
    }
    /// <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>
    pub fn get_email_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MessageTag>> {
        &self.email_tags
    }
    /// Appends an item to `insights`.
    ///
    /// To override the contents of this collection use [`set_insights`](Self::set_insights).
    ///
    /// <p>A set of insights associated with the message.</p>
    pub fn insights(mut self, input: crate::types::EmailInsights) -> Self {
        let mut v = self.insights.unwrap_or_default();
        v.push(input);
        self.insights = ::std::option::Option::Some(v);
        self
    }
    /// <p>A set of insights associated with the message.</p>
    pub fn set_insights(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EmailInsights>>) -> Self {
        self.insights = input;
        self
    }
    /// <p>A set of insights associated with the message.</p>
    pub fn get_insights(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EmailInsights>> {
        &self.insights
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetMessageInsightsOutput`](crate::operation::get_message_insights::GetMessageInsightsOutput).
    pub fn build(self) -> crate::operation::get_message_insights::GetMessageInsightsOutput {
        crate::operation::get_message_insights::GetMessageInsightsOutput {
            message_id: self.message_id,
            from_email_address: self.from_email_address,
            subject: self.subject,
            email_tags: self.email_tags,
            insights: self.insights,
            _request_id: self._request_id,
        }
    }
}
impl ::std::fmt::Debug for GetMessageInsightsOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetMessageInsightsOutputBuilder");
        formatter.field("message_id", &self.message_id);
        formatter.field("from_email_address", &"*** Sensitive Data Redacted ***");
        formatter.field("subject", &"*** Sensitive Data Redacted ***");
        formatter.field("email_tags", &self.email_tags);
        formatter.field("insights", &self.insights);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}