aws_sdk_b2bi/operation/create_partnership/
_create_partnership_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreatePartnershipOutput {
6 pub profile_id: ::std::string::String,
8 pub partnership_id: ::std::string::String,
10 pub partnership_arn: ::std::string::String,
12 pub name: ::std::option::Option<::std::string::String>,
14 pub email: ::std::option::Option<::std::string::String>,
16 pub phone: ::std::option::Option<::std::string::String>,
18 pub capabilities: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
20 pub capability_options: ::std::option::Option<crate::types::CapabilityOptions>,
22 pub trading_partner_id: ::std::option::Option<::std::string::String>,
24 pub created_at: ::aws_smithy_types::DateTime,
26 _request_id: Option<String>,
27}
28impl CreatePartnershipOutput {
29 pub fn profile_id(&self) -> &str {
31 use std::ops::Deref;
32 self.profile_id.deref()
33 }
34 pub fn partnership_id(&self) -> &str {
36 use std::ops::Deref;
37 self.partnership_id.deref()
38 }
39 pub fn partnership_arn(&self) -> &str {
41 use std::ops::Deref;
42 self.partnership_arn.deref()
43 }
44 pub fn name(&self) -> ::std::option::Option<&str> {
46 self.name.as_deref()
47 }
48 pub fn email(&self) -> ::std::option::Option<&str> {
50 self.email.as_deref()
51 }
52 pub fn phone(&self) -> ::std::option::Option<&str> {
54 self.phone.as_deref()
55 }
56 pub fn capabilities(&self) -> &[::std::string::String] {
60 self.capabilities.as_deref().unwrap_or_default()
61 }
62 pub fn capability_options(&self) -> ::std::option::Option<&crate::types::CapabilityOptions> {
64 self.capability_options.as_ref()
65 }
66 pub fn trading_partner_id(&self) -> ::std::option::Option<&str> {
68 self.trading_partner_id.as_deref()
69 }
70 pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
72 &self.created_at
73 }
74}
75impl ::std::fmt::Debug for CreatePartnershipOutput {
76 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
77 let mut formatter = f.debug_struct("CreatePartnershipOutput");
78 formatter.field("profile_id", &self.profile_id);
79 formatter.field("partnership_id", &self.partnership_id);
80 formatter.field("partnership_arn", &self.partnership_arn);
81 formatter.field("name", &self.name);
82 formatter.field("email", &"*** Sensitive Data Redacted ***");
83 formatter.field("phone", &"*** Sensitive Data Redacted ***");
84 formatter.field("capabilities", &self.capabilities);
85 formatter.field("capability_options", &self.capability_options);
86 formatter.field("trading_partner_id", &self.trading_partner_id);
87 formatter.field("created_at", &self.created_at);
88 formatter.field("_request_id", &self._request_id);
89 formatter.finish()
90 }
91}
92impl ::aws_types::request_id::RequestId for CreatePartnershipOutput {
93 fn request_id(&self) -> Option<&str> {
94 self._request_id.as_deref()
95 }
96}
97impl CreatePartnershipOutput {
98 pub fn builder() -> crate::operation::create_partnership::builders::CreatePartnershipOutputBuilder {
100 crate::operation::create_partnership::builders::CreatePartnershipOutputBuilder::default()
101 }
102}
103
104#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
106#[non_exhaustive]
107pub struct CreatePartnershipOutputBuilder {
108 pub(crate) profile_id: ::std::option::Option<::std::string::String>,
109 pub(crate) partnership_id: ::std::option::Option<::std::string::String>,
110 pub(crate) partnership_arn: ::std::option::Option<::std::string::String>,
111 pub(crate) name: ::std::option::Option<::std::string::String>,
112 pub(crate) email: ::std::option::Option<::std::string::String>,
113 pub(crate) phone: ::std::option::Option<::std::string::String>,
114 pub(crate) capabilities: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
115 pub(crate) capability_options: ::std::option::Option<crate::types::CapabilityOptions>,
116 pub(crate) trading_partner_id: ::std::option::Option<::std::string::String>,
117 pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
118 _request_id: Option<String>,
119}
120impl CreatePartnershipOutputBuilder {
121 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 pub fn set_profile_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129 self.profile_id = input;
130 self
131 }
132 pub fn get_profile_id(&self) -> &::std::option::Option<::std::string::String> {
134 &self.profile_id
135 }
136 pub fn partnership_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139 self.partnership_id = ::std::option::Option::Some(input.into());
140 self
141 }
142 pub fn set_partnership_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144 self.partnership_id = input;
145 self
146 }
147 pub fn get_partnership_id(&self) -> &::std::option::Option<::std::string::String> {
149 &self.partnership_id
150 }
151 pub fn partnership_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154 self.partnership_arn = ::std::option::Option::Some(input.into());
155 self
156 }
157 pub fn set_partnership_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159 self.partnership_arn = input;
160 self
161 }
162 pub fn get_partnership_arn(&self) -> &::std::option::Option<::std::string::String> {
164 &self.partnership_arn
165 }
166 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168 self.name = ::std::option::Option::Some(input.into());
169 self
170 }
171 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173 self.name = input;
174 self
175 }
176 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
178 &self.name
179 }
180 pub fn email(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
182 self.email = ::std::option::Option::Some(input.into());
183 self
184 }
185 pub fn set_email(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
187 self.email = input;
188 self
189 }
190 pub fn get_email(&self) -> &::std::option::Option<::std::string::String> {
192 &self.email
193 }
194 pub fn phone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
196 self.phone = ::std::option::Option::Some(input.into());
197 self
198 }
199 pub fn set_phone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201 self.phone = input;
202 self
203 }
204 pub fn get_phone(&self) -> &::std::option::Option<::std::string::String> {
206 &self.phone
207 }
208 pub fn capabilities(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
214 let mut v = self.capabilities.unwrap_or_default();
215 v.push(input.into());
216 self.capabilities = ::std::option::Option::Some(v);
217 self
218 }
219 pub fn set_capabilities(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
221 self.capabilities = input;
222 self
223 }
224 pub fn get_capabilities(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
226 &self.capabilities
227 }
228 pub fn capability_options(mut self, input: crate::types::CapabilityOptions) -> Self {
230 self.capability_options = ::std::option::Option::Some(input);
231 self
232 }
233 pub fn set_capability_options(mut self, input: ::std::option::Option<crate::types::CapabilityOptions>) -> Self {
235 self.capability_options = input;
236 self
237 }
238 pub fn get_capability_options(&self) -> &::std::option::Option<crate::types::CapabilityOptions> {
240 &self.capability_options
241 }
242 pub fn trading_partner_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
244 self.trading_partner_id = ::std::option::Option::Some(input.into());
245 self
246 }
247 pub fn set_trading_partner_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
249 self.trading_partner_id = input;
250 self
251 }
252 pub fn get_trading_partner_id(&self) -> &::std::option::Option<::std::string::String> {
254 &self.trading_partner_id
255 }
256 pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
259 self.created_at = ::std::option::Option::Some(input);
260 self
261 }
262 pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
264 self.created_at = input;
265 self
266 }
267 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
269 &self.created_at
270 }
271 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
272 self._request_id = Some(request_id.into());
273 self
274 }
275
276 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
277 self._request_id = request_id;
278 self
279 }
280 pub fn build(
287 self,
288 ) -> ::std::result::Result<crate::operation::create_partnership::CreatePartnershipOutput, ::aws_smithy_types::error::operation::BuildError> {
289 ::std::result::Result::Ok(crate::operation::create_partnership::CreatePartnershipOutput {
290 profile_id: self.profile_id.ok_or_else(|| {
291 ::aws_smithy_types::error::operation::BuildError::missing_field(
292 "profile_id",
293 "profile_id was not specified but it is required when building CreatePartnershipOutput",
294 )
295 })?,
296 partnership_id: self.partnership_id.ok_or_else(|| {
297 ::aws_smithy_types::error::operation::BuildError::missing_field(
298 "partnership_id",
299 "partnership_id was not specified but it is required when building CreatePartnershipOutput",
300 )
301 })?,
302 partnership_arn: self.partnership_arn.ok_or_else(|| {
303 ::aws_smithy_types::error::operation::BuildError::missing_field(
304 "partnership_arn",
305 "partnership_arn was not specified but it is required when building CreatePartnershipOutput",
306 )
307 })?,
308 name: self.name,
309 email: self.email,
310 phone: self.phone,
311 capabilities: self.capabilities,
312 capability_options: self.capability_options,
313 trading_partner_id: self.trading_partner_id,
314 created_at: self.created_at.ok_or_else(|| {
315 ::aws_smithy_types::error::operation::BuildError::missing_field(
316 "created_at",
317 "created_at was not specified but it is required when building CreatePartnershipOutput",
318 )
319 })?,
320 _request_id: self._request_id,
321 })
322 }
323}
324impl ::std::fmt::Debug for CreatePartnershipOutputBuilder {
325 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
326 let mut formatter = f.debug_struct("CreatePartnershipOutputBuilder");
327 formatter.field("profile_id", &self.profile_id);
328 formatter.field("partnership_id", &self.partnership_id);
329 formatter.field("partnership_arn", &self.partnership_arn);
330 formatter.field("name", &self.name);
331 formatter.field("email", &"*** Sensitive Data Redacted ***");
332 formatter.field("phone", &"*** Sensitive Data Redacted ***");
333 formatter.field("capabilities", &self.capabilities);
334 formatter.field("capability_options", &self.capability_options);
335 formatter.field("trading_partner_id", &self.trading_partner_id);
336 formatter.field("created_at", &self.created_at);
337 formatter.field("_request_id", &self._request_id);
338 formatter.finish()
339 }
340}