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