aws_sdk_sesv2/operation/get_contact/
_get_contact_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetContactOutput {
6 pub contact_list_name: ::std::option::Option<::std::string::String>,
8 pub email_address: ::std::option::Option<::std::string::String>,
10 pub topic_preferences: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>,
12 pub topic_default_preferences: ::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>>,
14 pub unsubscribe_all: bool,
16 pub attributes_data: ::std::option::Option<::std::string::String>,
18 pub created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
20 pub last_updated_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
22 _request_id: Option<String>,
23}
24impl GetContactOutput {
25 pub fn contact_list_name(&self) -> ::std::option::Option<&str> {
27 self.contact_list_name.as_deref()
28 }
29 pub fn email_address(&self) -> ::std::option::Option<&str> {
31 self.email_address.as_deref()
32 }
33 pub fn topic_preferences(&self) -> &[crate::types::TopicPreference] {
37 self.topic_preferences.as_deref().unwrap_or_default()
38 }
39 pub fn topic_default_preferences(&self) -> &[crate::types::TopicPreference] {
43 self.topic_default_preferences.as_deref().unwrap_or_default()
44 }
45 pub fn unsubscribe_all(&self) -> bool {
47 self.unsubscribe_all
48 }
49 pub fn attributes_data(&self) -> ::std::option::Option<&str> {
51 self.attributes_data.as_deref()
52 }
53 pub fn created_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
55 self.created_timestamp.as_ref()
56 }
57 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 pub fn builder() -> crate::operation::get_contact::builders::GetContactOutputBuilder {
70 crate::operation::get_contact::builders::GetContactOutputBuilder::default()
71 }
72}
73
74#[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 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 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 pub fn get_contact_list_name(&self) -> &::std::option::Option<::std::string::String> {
101 &self.contact_list_name
102 }
103 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 pub fn set_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110 self.email_address = input;
111 self
112 }
113 pub fn get_email_address(&self) -> &::std::option::Option<::std::string::String> {
115 &self.email_address
116 }
117 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 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 pub fn get_topic_preferences(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>> {
135 &self.topic_preferences
136 }
137 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 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 pub fn get_topic_default_preferences(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TopicPreference>> {
155 &self.topic_default_preferences
156 }
157 pub fn unsubscribe_all(mut self, input: bool) -> Self {
159 self.unsubscribe_all = ::std::option::Option::Some(input);
160 self
161 }
162 pub fn set_unsubscribe_all(mut self, input: ::std::option::Option<bool>) -> Self {
164 self.unsubscribe_all = input;
165 self
166 }
167 pub fn get_unsubscribe_all(&self) -> &::std::option::Option<bool> {
169 &self.unsubscribe_all
170 }
171 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 pub fn set_attributes_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178 self.attributes_data = input;
179 self
180 }
181 pub fn get_attributes_data(&self) -> &::std::option::Option<::std::string::String> {
183 &self.attributes_data
184 }
185 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 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 pub fn get_created_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
197 &self.created_timestamp
198 }
199 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 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 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 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}