aws_sdk_b2bi/operation/get_profile/
_get_profile_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)]
5pub struct GetProfileOutput {
6    /// <p>Returns the unique, system-generated identifier for the profile.</p>
7    pub profile_id: ::std::string::String,
8    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
9    pub profile_arn: ::std::string::String,
10    /// <p>Returns the name of the profile, used to identify it.</p>
11    pub name: ::std::string::String,
12    /// <p>Returns the email address associated with this customer profile.</p>
13    pub email: ::std::option::Option<::std::string::String>,
14    /// <p>Returns the phone number associated with the profile.</p>
15    pub phone: ::std::string::String,
16    /// <p>Returns the name for the business associated with this profile.</p>
17    pub business_name: ::std::string::String,
18    /// <p>Returns whether or not logging is enabled for this profile.</p>
19    pub logging: ::std::option::Option<crate::types::Logging>,
20    /// <p>Returns the name of the logging group.</p>
21    pub log_group_name: ::std::option::Option<::std::string::String>,
22    /// <p>Returns a timestamp for creation date and time of the transformer.</p>
23    pub created_at: ::aws_smithy_types::DateTime,
24    /// <p>Returns a timestamp for last time the profile was modified.</p>
25    pub modified_at: ::std::option::Option<::aws_smithy_types::DateTime>,
26    _request_id: Option<String>,
27}
28impl GetProfileOutput {
29    /// <p>Returns the unique, system-generated identifier for the profile.</p>
30    pub fn profile_id(&self) -> &str {
31        use std::ops::Deref;
32        self.profile_id.deref()
33    }
34    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
35    pub fn profile_arn(&self) -> &str {
36        use std::ops::Deref;
37        self.profile_arn.deref()
38    }
39    /// <p>Returns the name of the profile, used to identify it.</p>
40    pub fn name(&self) -> &str {
41        use std::ops::Deref;
42        self.name.deref()
43    }
44    /// <p>Returns the email address associated with this customer profile.</p>
45    pub fn email(&self) -> ::std::option::Option<&str> {
46        self.email.as_deref()
47    }
48    /// <p>Returns the phone number associated with the profile.</p>
49    pub fn phone(&self) -> &str {
50        use std::ops::Deref;
51        self.phone.deref()
52    }
53    /// <p>Returns the name for the business associated with this profile.</p>
54    pub fn business_name(&self) -> &str {
55        use std::ops::Deref;
56        self.business_name.deref()
57    }
58    /// <p>Returns whether or not logging is enabled for this profile.</p>
59    pub fn logging(&self) -> ::std::option::Option<&crate::types::Logging> {
60        self.logging.as_ref()
61    }
62    /// <p>Returns the name of the logging group.</p>
63    pub fn log_group_name(&self) -> ::std::option::Option<&str> {
64        self.log_group_name.as_deref()
65    }
66    /// <p>Returns a timestamp for creation date and time of the transformer.</p>
67    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
68        &self.created_at
69    }
70    /// <p>Returns a timestamp for last time the profile was modified.</p>
71    pub fn modified_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
72        self.modified_at.as_ref()
73    }
74}
75impl ::std::fmt::Debug for GetProfileOutput {
76    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
77        let mut formatter = f.debug_struct("GetProfileOutput");
78        formatter.field("profile_id", &self.profile_id);
79        formatter.field("profile_arn", &self.profile_arn);
80        formatter.field("name", &self.name);
81        formatter.field("email", &"*** Sensitive Data Redacted ***");
82        formatter.field("phone", &"*** Sensitive Data Redacted ***");
83        formatter.field("business_name", &self.business_name);
84        formatter.field("logging", &self.logging);
85        formatter.field("log_group_name", &self.log_group_name);
86        formatter.field("created_at", &self.created_at);
87        formatter.field("modified_at", &self.modified_at);
88        formatter.field("_request_id", &self._request_id);
89        formatter.finish()
90    }
91}
92impl ::aws_types::request_id::RequestId for GetProfileOutput {
93    fn request_id(&self) -> Option<&str> {
94        self._request_id.as_deref()
95    }
96}
97impl GetProfileOutput {
98    /// Creates a new builder-style object to manufacture [`GetProfileOutput`](crate::operation::get_profile::GetProfileOutput).
99    pub fn builder() -> crate::operation::get_profile::builders::GetProfileOutputBuilder {
100        crate::operation::get_profile::builders::GetProfileOutputBuilder::default()
101    }
102}
103
104/// A builder for [`GetProfileOutput`](crate::operation::get_profile::GetProfileOutput).
105#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
106#[non_exhaustive]
107pub struct GetProfileOutputBuilder {
108    pub(crate) profile_id: ::std::option::Option<::std::string::String>,
109    pub(crate) profile_arn: ::std::option::Option<::std::string::String>,
110    pub(crate) name: ::std::option::Option<::std::string::String>,
111    pub(crate) email: ::std::option::Option<::std::string::String>,
112    pub(crate) phone: ::std::option::Option<::std::string::String>,
113    pub(crate) business_name: ::std::option::Option<::std::string::String>,
114    pub(crate) logging: ::std::option::Option<crate::types::Logging>,
115    pub(crate) log_group_name: ::std::option::Option<::std::string::String>,
116    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
117    pub(crate) modified_at: ::std::option::Option<::aws_smithy_types::DateTime>,
118    _request_id: Option<String>,
119}
120impl GetProfileOutputBuilder {
121    /// <p>Returns the unique, system-generated identifier for the profile.</p>
122    /// This field is required.
123    pub fn profile_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.profile_id = ::std::option::Option::Some(input.into());
125        self
126    }
127    /// <p>Returns the unique, system-generated identifier for the profile.</p>
128    pub fn set_profile_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.profile_id = input;
130        self
131    }
132    /// <p>Returns the unique, system-generated identifier for the profile.</p>
133    pub fn get_profile_id(&self) -> &::std::option::Option<::std::string::String> {
134        &self.profile_id
135    }
136    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
137    /// This field is required.
138    pub fn profile_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.profile_arn = ::std::option::Option::Some(input.into());
140        self
141    }
142    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
143    pub fn set_profile_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.profile_arn = input;
145        self
146    }
147    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
148    pub fn get_profile_arn(&self) -> &::std::option::Option<::std::string::String> {
149        &self.profile_arn
150    }
151    /// <p>Returns the name of the profile, used to identify it.</p>
152    /// This field is required.
153    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.name = ::std::option::Option::Some(input.into());
155        self
156    }
157    /// <p>Returns the name of the profile, used to identify it.</p>
158    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.name = input;
160        self
161    }
162    /// <p>Returns the name of the profile, used to identify it.</p>
163    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
164        &self.name
165    }
166    /// <p>Returns the email address associated with this customer profile.</p>
167    pub fn email(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168        self.email = ::std::option::Option::Some(input.into());
169        self
170    }
171    /// <p>Returns the email address associated with this customer profile.</p>
172    pub fn set_email(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173        self.email = input;
174        self
175    }
176    /// <p>Returns the email address associated with this customer profile.</p>
177    pub fn get_email(&self) -> &::std::option::Option<::std::string::String> {
178        &self.email
179    }
180    /// <p>Returns the phone number associated with the profile.</p>
181    /// This field is required.
182    pub fn phone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.phone = ::std::option::Option::Some(input.into());
184        self
185    }
186    /// <p>Returns the phone number associated with the profile.</p>
187    pub fn set_phone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.phone = input;
189        self
190    }
191    /// <p>Returns the phone number associated with the profile.</p>
192    pub fn get_phone(&self) -> &::std::option::Option<::std::string::String> {
193        &self.phone
194    }
195    /// <p>Returns the name for the business associated with this profile.</p>
196    /// This field is required.
197    pub fn business_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198        self.business_name = ::std::option::Option::Some(input.into());
199        self
200    }
201    /// <p>Returns the name for the business associated with this profile.</p>
202    pub fn set_business_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203        self.business_name = input;
204        self
205    }
206    /// <p>Returns the name for the business associated with this profile.</p>
207    pub fn get_business_name(&self) -> &::std::option::Option<::std::string::String> {
208        &self.business_name
209    }
210    /// <p>Returns whether or not logging is enabled for this profile.</p>
211    pub fn logging(mut self, input: crate::types::Logging) -> Self {
212        self.logging = ::std::option::Option::Some(input);
213        self
214    }
215    /// <p>Returns whether or not logging is enabled for this profile.</p>
216    pub fn set_logging(mut self, input: ::std::option::Option<crate::types::Logging>) -> Self {
217        self.logging = input;
218        self
219    }
220    /// <p>Returns whether or not logging is enabled for this profile.</p>
221    pub fn get_logging(&self) -> &::std::option::Option<crate::types::Logging> {
222        &self.logging
223    }
224    /// <p>Returns the name of the logging group.</p>
225    pub fn log_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
226        self.log_group_name = ::std::option::Option::Some(input.into());
227        self
228    }
229    /// <p>Returns the name of the logging group.</p>
230    pub fn set_log_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
231        self.log_group_name = input;
232        self
233    }
234    /// <p>Returns the name of the logging group.</p>
235    pub fn get_log_group_name(&self) -> &::std::option::Option<::std::string::String> {
236        &self.log_group_name
237    }
238    /// <p>Returns a timestamp for creation date and time of the transformer.</p>
239    /// This field is required.
240    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
241        self.created_at = ::std::option::Option::Some(input);
242        self
243    }
244    /// <p>Returns a timestamp for creation date and time of the transformer.</p>
245    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
246        self.created_at = input;
247        self
248    }
249    /// <p>Returns a timestamp for creation date and time of the transformer.</p>
250    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
251        &self.created_at
252    }
253    /// <p>Returns a timestamp for last time the profile was modified.</p>
254    pub fn modified_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
255        self.modified_at = ::std::option::Option::Some(input);
256        self
257    }
258    /// <p>Returns a timestamp for last time the profile was modified.</p>
259    pub fn set_modified_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
260        self.modified_at = input;
261        self
262    }
263    /// <p>Returns a timestamp for last time the profile was modified.</p>
264    pub fn get_modified_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
265        &self.modified_at
266    }
267    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
268        self._request_id = Some(request_id.into());
269        self
270    }
271
272    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
273        self._request_id = request_id;
274        self
275    }
276    /// Consumes the builder and constructs a [`GetProfileOutput`](crate::operation::get_profile::GetProfileOutput).
277    /// This method will fail if any of the following fields are not set:
278    /// - [`profile_id`](crate::operation::get_profile::builders::GetProfileOutputBuilder::profile_id)
279    /// - [`profile_arn`](crate::operation::get_profile::builders::GetProfileOutputBuilder::profile_arn)
280    /// - [`name`](crate::operation::get_profile::builders::GetProfileOutputBuilder::name)
281    /// - [`phone`](crate::operation::get_profile::builders::GetProfileOutputBuilder::phone)
282    /// - [`business_name`](crate::operation::get_profile::builders::GetProfileOutputBuilder::business_name)
283    /// - [`created_at`](crate::operation::get_profile::builders::GetProfileOutputBuilder::created_at)
284    pub fn build(self) -> ::std::result::Result<crate::operation::get_profile::GetProfileOutput, ::aws_smithy_types::error::operation::BuildError> {
285        ::std::result::Result::Ok(crate::operation::get_profile::GetProfileOutput {
286            profile_id: self.profile_id.ok_or_else(|| {
287                ::aws_smithy_types::error::operation::BuildError::missing_field(
288                    "profile_id",
289                    "profile_id was not specified but it is required when building GetProfileOutput",
290                )
291            })?,
292            profile_arn: self.profile_arn.ok_or_else(|| {
293                ::aws_smithy_types::error::operation::BuildError::missing_field(
294                    "profile_arn",
295                    "profile_arn was not specified but it is required when building GetProfileOutput",
296                )
297            })?,
298            name: self.name.ok_or_else(|| {
299                ::aws_smithy_types::error::operation::BuildError::missing_field(
300                    "name",
301                    "name was not specified but it is required when building GetProfileOutput",
302                )
303            })?,
304            email: self.email,
305            phone: self.phone.ok_or_else(|| {
306                ::aws_smithy_types::error::operation::BuildError::missing_field(
307                    "phone",
308                    "phone was not specified but it is required when building GetProfileOutput",
309                )
310            })?,
311            business_name: self.business_name.ok_or_else(|| {
312                ::aws_smithy_types::error::operation::BuildError::missing_field(
313                    "business_name",
314                    "business_name was not specified but it is required when building GetProfileOutput",
315                )
316            })?,
317            logging: self.logging,
318            log_group_name: self.log_group_name,
319            created_at: self.created_at.ok_or_else(|| {
320                ::aws_smithy_types::error::operation::BuildError::missing_field(
321                    "created_at",
322                    "created_at was not specified but it is required when building GetProfileOutput",
323                )
324            })?,
325            modified_at: self.modified_at,
326            _request_id: self._request_id,
327        })
328    }
329}
330impl ::std::fmt::Debug for GetProfileOutputBuilder {
331    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
332        let mut formatter = f.debug_struct("GetProfileOutputBuilder");
333        formatter.field("profile_id", &self.profile_id);
334        formatter.field("profile_arn", &self.profile_arn);
335        formatter.field("name", &self.name);
336        formatter.field("email", &"*** Sensitive Data Redacted ***");
337        formatter.field("phone", &"*** Sensitive Data Redacted ***");
338        formatter.field("business_name", &self.business_name);
339        formatter.field("logging", &self.logging);
340        formatter.field("log_group_name", &self.log_group_name);
341        formatter.field("created_at", &self.created_at);
342        formatter.field("modified_at", &self.modified_at);
343        formatter.field("_request_id", &self._request_id);
344        formatter.finish()
345    }
346}