aws_sdk_sesv2/operation/get_contact/
_get_contact_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetContactOutput {
6    /// <p>The name of the contact list to which the contact belongs.</p>
7    pub contact_list_name: ::std::option::Option<::std::string::String>,
8    /// <p>The contact's email address.</p>
9    pub email_address: ::std::option::Option<::std::string::String>,
10    /// <p>The contact's preference for being opted-in to or opted-out of a topic.&gt;</p>
11    pub topic_preferences: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>,
12    /// <p>The default topic preferences applied to the contact.</p>
13    pub topic_default_preferences: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>,
14    /// <p>A boolean value status noting if the contact is unsubscribed from all contact list topics.</p>
15    pub unsubscribe_all: bool,
16    /// <p>The attribute data attached to a contact.</p>
17    pub attributes_data: ::std::option::Option<::std::string::String>,
18    /// <p>A timestamp noting when the contact was created.</p>
19    pub created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
20    /// <p>A timestamp noting the last time the contact's information was updated.</p>
21    pub last_updated_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
22    _request_id: Option<String>,
23}
24impl GetContactOutput {
25    /// <p>The name of the contact list to which the contact belongs.</p>
26    pub fn contact_list_name(&self) -> ::std::option::Option<&str> {
27        self.contact_list_name.as_deref()
28    }
29    /// <p>The contact's email address.</p>
30    pub fn email_address(&self) -> ::std::option::Option<&str> {
31        self.email_address.as_deref()
32    }
33    /// <p>The contact's preference for being opted-in to or opted-out of a topic.&gt;</p>
34    ///
35    /// 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()`.
36    pub fn topic_preferences(&self) -> &[crate::types::TopicPreference] {
37        self.topic_preferences.as_deref().unwrap_or_default()
38    }
39    /// <p>The default topic preferences applied to the contact.</p>
40    ///
41    /// 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()`.
42    pub fn topic_default_preferences(&self) -> &[crate::types::TopicPreference] {
43        self.topic_default_preferences.as_deref().unwrap_or_default()
44    }
45    /// <p>A boolean value status noting if the contact is unsubscribed from all contact list topics.</p>
46    pub fn unsubscribe_all(&self) -> bool {
47        self.unsubscribe_all
48    }
49    /// <p>The attribute data attached to a contact.</p>
50    pub fn attributes_data(&self) -> ::std::option::Option<&str> {
51        self.attributes_data.as_deref()
52    }
53    /// <p>A timestamp noting when the contact was created.</p>
54    pub fn created_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
55        self.created_timestamp.as_ref()
56    }
57    /// <p>A timestamp noting the last time the contact's information was updated.</p>
58    pub fn last_updated_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
59        self.last_updated_timestamp.as_ref()
60    }
61}
62impl ::aws_types::request_id::RequestId for GetContactOutput {
63    fn request_id(&self) -> Option<&str> {
64        self._request_id.as_deref()
65    }
66}
67impl GetContactOutput {
68    /// Creates a new builder-style object to manufacture [`GetContactOutput`](crate::operation::get_contact::GetContactOutput).
69    pub fn builder() -> crate::operation::get_contact::builders::GetContactOutputBuilder {
70        crate::operation::get_contact::builders::GetContactOutputBuilder::default()
71    }
72}
73
74/// A builder for [`GetContactOutput`](crate::operation::get_contact::GetContactOutput).
75#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
76#[non_exhaustive]
77pub struct GetContactOutputBuilder {
78    pub(crate) contact_list_name: ::std::option::Option<::std::string::String>,
79    pub(crate) email_address: ::std::option::Option<::std::string::String>,
80    pub(crate) topic_preferences: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>,
81    pub(crate) topic_default_preferences: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>,
82    pub(crate) unsubscribe_all: ::std::option::Option<bool>,
83    pub(crate) attributes_data: ::std::option::Option<::std::string::String>,
84    pub(crate) created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
85    pub(crate) last_updated_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
86    _request_id: Option<String>,
87}
88impl GetContactOutputBuilder {
89    /// <p>The name of the contact list to which the contact belongs.</p>
90    pub fn contact_list_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.contact_list_name = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The name of the contact list to which the contact belongs.</p>
95    pub fn set_contact_list_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.contact_list_name = input;
97        self
98    }
99    /// <p>The name of the contact list to which the contact belongs.</p>
100    pub fn get_contact_list_name(&self) -> &::std::option::Option<::std::string::String> {
101        &self.contact_list_name
102    }
103    /// <p>The contact's email address.</p>
104    pub fn email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.email_address = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>The contact's email address.</p>
109    pub fn set_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.email_address = input;
111        self
112    }
113    /// <p>The contact's email address.</p>
114    pub fn get_email_address(&self) -> &::std::option::Option<::std::string::String> {
115        &self.email_address
116    }
117    /// Appends an item to `topic_preferences`.
118    ///
119    /// To override the contents of this collection use [`set_topic_preferences`](Self::set_topic_preferences).
120    ///
121    /// <p>The contact's preference for being opted-in to or opted-out of a topic.&gt;</p>
122    pub fn topic_preferences(mut self, input: crate::types::TopicPreference) -> Self {
123        let mut v = self.topic_preferences.unwrap_or_default();
124        v.push(input);
125        self.topic_preferences = ::std::option::Option::Some(v);
126        self
127    }
128    /// <p>The contact's preference for being opted-in to or opted-out of a topic.&gt;</p>
129    pub fn set_topic_preferences(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>) -> Self {
130        self.topic_preferences = input;
131        self
132    }
133    /// <p>The contact's preference for being opted-in to or opted-out of a topic.&gt;</p>
134    pub fn get_topic_preferences(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>> {
135        &self.topic_preferences
136    }
137    /// Appends an item to `topic_default_preferences`.
138    ///
139    /// To override the contents of this collection use [`set_topic_default_preferences`](Self::set_topic_default_preferences).
140    ///
141    /// <p>The default topic preferences applied to the contact.</p>
142    pub fn topic_default_preferences(mut self, input: crate::types::TopicPreference) -> Self {
143        let mut v = self.topic_default_preferences.unwrap_or_default();
144        v.push(input);
145        self.topic_default_preferences = ::std::option::Option::Some(v);
146        self
147    }
148    /// <p>The default topic preferences applied to the contact.</p>
149    pub fn set_topic_default_preferences(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>) -> Self {
150        self.topic_default_preferences = input;
151        self
152    }
153    /// <p>The default topic preferences applied to the contact.</p>
154    pub fn get_topic_default_preferences(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>> {
155        &self.topic_default_preferences
156    }
157    /// <p>A boolean value status noting if the contact is unsubscribed from all contact list topics.</p>
158    pub fn unsubscribe_all(mut self, input: bool) -> Self {
159        self.unsubscribe_all = ::std::option::Option::Some(input);
160        self
161    }
162    /// <p>A boolean value status noting if the contact is unsubscribed from all contact list topics.</p>
163    pub fn set_unsubscribe_all(mut self, input: ::std::option::Option<bool>) -> Self {
164        self.unsubscribe_all = input;
165        self
166    }
167    /// <p>A boolean value status noting if the contact is unsubscribed from all contact list topics.</p>
168    pub fn get_unsubscribe_all(&self) -> &::std::option::Option<bool> {
169        &self.unsubscribe_all
170    }
171    /// <p>The attribute data attached to a contact.</p>
172    pub fn attributes_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.attributes_data = ::std::option::Option::Some(input.into());
174        self
175    }
176    /// <p>The attribute data attached to a contact.</p>
177    pub fn set_attributes_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.attributes_data = input;
179        self
180    }
181    /// <p>The attribute data attached to a contact.</p>
182    pub fn get_attributes_data(&self) -> &::std::option::Option<::std::string::String> {
183        &self.attributes_data
184    }
185    /// <p>A timestamp noting when the contact was created.</p>
186    pub fn created_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
187        self.created_timestamp = ::std::option::Option::Some(input);
188        self
189    }
190    /// <p>A timestamp noting when the contact was created.</p>
191    pub fn set_created_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
192        self.created_timestamp = input;
193        self
194    }
195    /// <p>A timestamp noting when the contact was created.</p>
196    pub fn get_created_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
197        &self.created_timestamp
198    }
199    /// <p>A timestamp noting the last time the contact's information was updated.</p>
200    pub fn last_updated_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
201        self.last_updated_timestamp = ::std::option::Option::Some(input);
202        self
203    }
204    /// <p>A timestamp noting the last time the contact's information was updated.</p>
205    pub fn set_last_updated_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
206        self.last_updated_timestamp = input;
207        self
208    }
209    /// <p>A timestamp noting the last time the contact's information was updated.</p>
210    pub fn get_last_updated_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
211        &self.last_updated_timestamp
212    }
213    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
214        self._request_id = Some(request_id.into());
215        self
216    }
217
218    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
219        self._request_id = request_id;
220        self
221    }
222    /// Consumes the builder and constructs a [`GetContactOutput`](crate::operation::get_contact::GetContactOutput).
223    pub fn build(self) -> crate::operation::get_contact::GetContactOutput {
224        crate::operation::get_contact::GetContactOutput {
225            contact_list_name: self.contact_list_name,
226            email_address: self.email_address,
227            topic_preferences: self.topic_preferences,
228            topic_default_preferences: self.topic_default_preferences,
229            unsubscribe_all: self.unsubscribe_all.unwrap_or_default(),
230            attributes_data: self.attributes_data,
231            created_timestamp: self.created_timestamp,
232            last_updated_timestamp: self.last_updated_timestamp,
233            _request_id: self._request_id,
234        }
235    }
236}