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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetContactOutput {
    /// <p>The name of the contact list to which the contact belongs.</p>
    pub contact_list_name: ::std::option::Option<::std::string::String>,
    /// <p>The contact's email address.</p>
    pub email_address: ::std::option::Option<::std::string::String>,
    /// <p>The contact's preference for being opted-in to or opted-out of a topic.&gt;</p>
    pub topic_preferences: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>,
    /// <p>The default topic preferences applied to the contact.</p>
    pub topic_default_preferences: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>,
    /// <p>A boolean value status noting if the contact is unsubscribed from all contact list topics.</p>
    pub unsubscribe_all: bool,
    /// <p>The attribute data attached to a contact.</p>
    pub attributes_data: ::std::option::Option<::std::string::String>,
    /// <p>A timestamp noting when the contact was created.</p>
    pub created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>A timestamp noting the last time the contact's information was updated.</p>
    pub last_updated_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetContactOutput {
    /// <p>The name of the contact list to which the contact belongs.</p>
    pub fn contact_list_name(&self) -> ::std::option::Option<&str> {
        self.contact_list_name.as_deref()
    }
    /// <p>The contact's email address.</p>
    pub fn email_address(&self) -> ::std::option::Option<&str> {
        self.email_address.as_deref()
    }
    /// <p>The contact's preference for being opted-in to or opted-out of a topic.&gt;</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 `.topic_preferences.is_none()`.
    pub fn topic_preferences(&self) -> &[crate::types::TopicPreference] {
        self.topic_preferences.as_deref().unwrap_or_default()
    }
    /// <p>The default topic preferences applied to the contact.</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 `.topic_default_preferences.is_none()`.
    pub fn topic_default_preferences(&self) -> &[crate::types::TopicPreference] {
        self.topic_default_preferences.as_deref().unwrap_or_default()
    }
    /// <p>A boolean value status noting if the contact is unsubscribed from all contact list topics.</p>
    pub fn unsubscribe_all(&self) -> bool {
        self.unsubscribe_all
    }
    /// <p>The attribute data attached to a contact.</p>
    pub fn attributes_data(&self) -> ::std::option::Option<&str> {
        self.attributes_data.as_deref()
    }
    /// <p>A timestamp noting when the contact was created.</p>
    pub fn created_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_timestamp.as_ref()
    }
    /// <p>A timestamp noting the last time the contact's information was updated.</p>
    pub fn last_updated_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_updated_timestamp.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetContactOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetContactOutput {
    /// Creates a new builder-style object to manufacture [`GetContactOutput`](crate::operation::get_contact::GetContactOutput).
    pub fn builder() -> crate::operation::get_contact::builders::GetContactOutputBuilder {
        crate::operation::get_contact::builders::GetContactOutputBuilder::default()
    }
}

/// A builder for [`GetContactOutput`](crate::operation::get_contact::GetContactOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct GetContactOutputBuilder {
    pub(crate) contact_list_name: ::std::option::Option<::std::string::String>,
    pub(crate) email_address: ::std::option::Option<::std::string::String>,
    pub(crate) topic_preferences: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>,
    pub(crate) topic_default_preferences: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>,
    pub(crate) unsubscribe_all: ::std::option::Option<bool>,
    pub(crate) attributes_data: ::std::option::Option<::std::string::String>,
    pub(crate) created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_updated_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetContactOutputBuilder {
    /// <p>The name of the contact list to which the contact belongs.</p>
    pub fn contact_list_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.contact_list_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the contact list to which the contact belongs.</p>
    pub fn set_contact_list_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.contact_list_name = input;
        self
    }
    /// <p>The name of the contact list to which the contact belongs.</p>
    pub fn get_contact_list_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.contact_list_name
    }
    /// <p>The contact's email address.</p>
    pub fn email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.email_address = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The contact's email address.</p>
    pub fn set_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.email_address = input;
        self
    }
    /// <p>The contact's email address.</p>
    pub fn get_email_address(&self) -> &::std::option::Option<::std::string::String> {
        &self.email_address
    }
    /// Appends an item to `topic_preferences`.
    ///
    /// To override the contents of this collection use [`set_topic_preferences`](Self::set_topic_preferences).
    ///
    /// <p>The contact's preference for being opted-in to or opted-out of a topic.&gt;</p>
    pub fn topic_preferences(mut self, input: crate::types::TopicPreference) -> Self {
        let mut v = self.topic_preferences.unwrap_or_default();
        v.push(input);
        self.topic_preferences = ::std::option::Option::Some(v);
        self
    }
    /// <p>The contact's preference for being opted-in to or opted-out of a topic.&gt;</p>
    pub fn set_topic_preferences(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>) -> Self {
        self.topic_preferences = input;
        self
    }
    /// <p>The contact's preference for being opted-in to or opted-out of a topic.&gt;</p>
    pub fn get_topic_preferences(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>> {
        &self.topic_preferences
    }
    /// Appends an item to `topic_default_preferences`.
    ///
    /// To override the contents of this collection use [`set_topic_default_preferences`](Self::set_topic_default_preferences).
    ///
    /// <p>The default topic preferences applied to the contact.</p>
    pub fn topic_default_preferences(mut self, input: crate::types::TopicPreference) -> Self {
        let mut v = self.topic_default_preferences.unwrap_or_default();
        v.push(input);
        self.topic_default_preferences = ::std::option::Option::Some(v);
        self
    }
    /// <p>The default topic preferences applied to the contact.</p>
    pub fn set_topic_default_preferences(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>) -> Self {
        self.topic_default_preferences = input;
        self
    }
    /// <p>The default topic preferences applied to the contact.</p>
    pub fn get_topic_default_preferences(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>> {
        &self.topic_default_preferences
    }
    /// <p>A boolean value status noting if the contact is unsubscribed from all contact list topics.</p>
    pub fn unsubscribe_all(mut self, input: bool) -> Self {
        self.unsubscribe_all = ::std::option::Option::Some(input);
        self
    }
    /// <p>A boolean value status noting if the contact is unsubscribed from all contact list topics.</p>
    pub fn set_unsubscribe_all(mut self, input: ::std::option::Option<bool>) -> Self {
        self.unsubscribe_all = input;
        self
    }
    /// <p>A boolean value status noting if the contact is unsubscribed from all contact list topics.</p>
    pub fn get_unsubscribe_all(&self) -> &::std::option::Option<bool> {
        &self.unsubscribe_all
    }
    /// <p>The attribute data attached to a contact.</p>
    pub fn attributes_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.attributes_data = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The attribute data attached to a contact.</p>
    pub fn set_attributes_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.attributes_data = input;
        self
    }
    /// <p>The attribute data attached to a contact.</p>
    pub fn get_attributes_data(&self) -> &::std::option::Option<::std::string::String> {
        &self.attributes_data
    }
    /// <p>A timestamp noting when the contact was created.</p>
    pub fn created_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>A timestamp noting when the contact was created.</p>
    pub fn set_created_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_timestamp = input;
        self
    }
    /// <p>A timestamp noting when the contact was created.</p>
    pub fn get_created_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_timestamp
    }
    /// <p>A timestamp noting the last time the contact's information was updated.</p>
    pub fn last_updated_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_updated_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>A timestamp noting the last time the contact's information was updated.</p>
    pub fn set_last_updated_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_updated_timestamp = input;
        self
    }
    /// <p>A timestamp noting the last time the contact's information was updated.</p>
    pub fn get_last_updated_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_updated_timestamp
    }
    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 [`GetContactOutput`](crate::operation::get_contact::GetContactOutput).
    pub fn build(self) -> crate::operation::get_contact::GetContactOutput {
        crate::operation::get_contact::GetContactOutput {
            contact_list_name: self.contact_list_name,
            email_address: self.email_address,
            topic_preferences: self.topic_preferences,
            topic_default_preferences: self.topic_default_preferences,
            unsubscribe_all: self.unsubscribe_all.unwrap_or_default(),
            attributes_data: self.attributes_data,
            created_timestamp: self.created_timestamp,
            last_updated_timestamp: self.last_updated_timestamp,
            _request_id: self._request_id,
        }
    }
}