aws_sdk_b2bi/operation/create_profile/
_create_profile_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateProfileOutput {
6 pub profile_id: ::std::string::String,
8 pub profile_arn: ::std::string::String,
10 pub name: ::std::string::String,
12 pub business_name: ::std::string::String,
14 pub phone: ::std::string::String,
16 pub email: ::std::option::Option<::std::string::String>,
18 pub logging: ::std::option::Option<crate::types::Logging>,
20 pub log_group_name: ::std::option::Option<::std::string::String>,
22 pub created_at: ::aws_smithy_types::DateTime,
24 _request_id: Option<String>,
25}
26impl CreateProfileOutput {
27 pub fn profile_id(&self) -> &str {
29 use std::ops::Deref;
30 self.profile_id.deref()
31 }
32 pub fn profile_arn(&self) -> &str {
34 use std::ops::Deref;
35 self.profile_arn.deref()
36 }
37 pub fn name(&self) -> &str {
39 use std::ops::Deref;
40 self.name.deref()
41 }
42 pub fn business_name(&self) -> &str {
44 use std::ops::Deref;
45 self.business_name.deref()
46 }
47 pub fn phone(&self) -> &str {
49 use std::ops::Deref;
50 self.phone.deref()
51 }
52 pub fn email(&self) -> ::std::option::Option<&str> {
54 self.email.as_deref()
55 }
56 pub fn logging(&self) -> ::std::option::Option<&crate::types::Logging> {
58 self.logging.as_ref()
59 }
60 pub fn log_group_name(&self) -> ::std::option::Option<&str> {
62 self.log_group_name.as_deref()
63 }
64 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 pub fn builder() -> crate::operation::create_profile::builders::CreateProfileOutputBuilder {
93 crate::operation::create_profile::builders::CreateProfileOutputBuilder::default()
94 }
95}
96
97#[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 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 pub fn set_profile_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.profile_id = input;
122 self
123 }
124 pub fn get_profile_id(&self) -> &::std::option::Option<::std::string::String> {
126 &self.profile_id
127 }
128 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 pub fn set_profile_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.profile_arn = input;
137 self
138 }
139 pub fn get_profile_arn(&self) -> &::std::option::Option<::std::string::String> {
141 &self.profile_arn
142 }
143 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151 self.name = input;
152 self
153 }
154 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
156 &self.name
157 }
158 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 pub fn set_business_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166 self.business_name = input;
167 self
168 }
169 pub fn get_business_name(&self) -> &::std::option::Option<::std::string::String> {
171 &self.business_name
172 }
173 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 pub fn set_phone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181 self.phone = input;
182 self
183 }
184 pub fn get_phone(&self) -> &::std::option::Option<::std::string::String> {
186 &self.phone
187 }
188 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 pub fn set_email(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195 self.email = input;
196 self
197 }
198 pub fn get_email(&self) -> &::std::option::Option<::std::string::String> {
200 &self.email
201 }
202 pub fn logging(mut self, input: crate::types::Logging) -> Self {
204 self.logging = ::std::option::Option::Some(input);
205 self
206 }
207 pub fn set_logging(mut self, input: ::std::option::Option<crate::types::Logging>) -> Self {
209 self.logging = input;
210 self
211 }
212 pub fn get_logging(&self) -> &::std::option::Option<crate::types::Logging> {
214 &self.logging
215 }
216 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 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 pub fn get_log_group_name(&self) -> &::std::option::Option<::std::string::String> {
228 &self.log_group_name
229 }
230 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 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 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 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}