aws_sdk_b2bi/operation/create_partnership/
_create_partnership_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 CreatePartnershipOutput {
6    /// <p>Returns the unique, system-generated identifier for the profile connected to this partnership.</p>
7    pub profile_id: ::std::string::String,
8    /// <p>Returns the unique, system-generated identifier for a partnership.</p>
9    pub partnership_id: ::std::string::String,
10    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
11    pub partnership_arn: ::std::string::String,
12    /// <p>Returns a descriptive name for the partnership.</p>
13    pub name: ::std::option::Option<::std::string::String>,
14    /// <p>Returns the email address associated with this trading partner.</p>
15    pub email: ::std::option::Option<::std::string::String>,
16    /// <p>Returns the phone number associated with the partnership.</p>
17    pub phone: ::std::option::Option<::std::string::String>,
18    /// <p>Returns one or more capabilities associated with this partnership.</p>
19    pub capabilities: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
20    /// <p>Returns the structure that contains the details for the associated capabilities.</p>
21    pub capability_options: ::std::option::Option<crate::types::CapabilityOptions>,
22    /// <p>Returns the unique, system-generated identifier for a trading partner.</p>
23    pub trading_partner_id: ::std::option::Option<::std::string::String>,
24    /// <p>Returns a timestamp for creation date and time of the partnership.</p>
25    pub created_at: ::aws_smithy_types::DateTime,
26    _request_id: Option<String>,
27}
28impl CreatePartnershipOutput {
29    /// <p>Returns the unique, system-generated identifier for the profile connected to this partnership.</p>
30    pub fn profile_id(&self) -> &str {
31        use std::ops::Deref;
32        self.profile_id.deref()
33    }
34    /// <p>Returns the unique, system-generated identifier for a partnership.</p>
35    pub fn partnership_id(&self) -> &str {
36        use std::ops::Deref;
37        self.partnership_id.deref()
38    }
39    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
40    pub fn partnership_arn(&self) -> &str {
41        use std::ops::Deref;
42        self.partnership_arn.deref()
43    }
44    /// <p>Returns a descriptive name for the partnership.</p>
45    pub fn name(&self) -> ::std::option::Option<&str> {
46        self.name.as_deref()
47    }
48    /// <p>Returns the email address associated with this trading partner.</p>
49    pub fn email(&self) -> ::std::option::Option<&str> {
50        self.email.as_deref()
51    }
52    /// <p>Returns the phone number associated with the partnership.</p>
53    pub fn phone(&self) -> ::std::option::Option<&str> {
54        self.phone.as_deref()
55    }
56    /// <p>Returns one or more capabilities associated with this partnership.</p>
57    ///
58    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.capabilities.is_none()`.
59    pub fn capabilities(&self) -> &[::std::string::String] {
60        self.capabilities.as_deref().unwrap_or_default()
61    }
62    /// <p>Returns the structure that contains the details for the associated capabilities.</p>
63    pub fn capability_options(&self) -> ::std::option::Option<&crate::types::CapabilityOptions> {
64        self.capability_options.as_ref()
65    }
66    /// <p>Returns the unique, system-generated identifier for a trading partner.</p>
67    pub fn trading_partner_id(&self) -> ::std::option::Option<&str> {
68        self.trading_partner_id.as_deref()
69    }
70    /// <p>Returns a timestamp for creation date and time of the partnership.</p>
71    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    /// Creates a new builder-style object to manufacture [`CreatePartnershipOutput`](crate::operation::create_partnership::CreatePartnershipOutput).
99    pub fn builder() -> crate::operation::create_partnership::builders::CreatePartnershipOutputBuilder {
100        crate::operation::create_partnership::builders::CreatePartnershipOutputBuilder::default()
101    }
102}
103
104/// A builder for [`CreatePartnershipOutput`](crate::operation::create_partnership::CreatePartnershipOutput).
105#[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    /// <p>Returns the unique, system-generated identifier for the profile connected to this partnership.</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 connected to this partnership.</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 connected to this partnership.</p>
133    pub fn get_profile_id(&self) -> &::std::option::Option<::std::string::String> {
134        &self.profile_id
135    }
136    /// <p>Returns the unique, system-generated identifier for a partnership.</p>
137    /// This field is required.
138    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    /// <p>Returns the unique, system-generated identifier for a partnership.</p>
143    pub fn set_partnership_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.partnership_id = input;
145        self
146    }
147    /// <p>Returns the unique, system-generated identifier for a partnership.</p>
148    pub fn get_partnership_id(&self) -> &::std::option::Option<::std::string::String> {
149        &self.partnership_id
150    }
151    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
152    /// This field is required.
153    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    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
158    pub fn set_partnership_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.partnership_arn = input;
160        self
161    }
162    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
163    pub fn get_partnership_arn(&self) -> &::std::option::Option<::std::string::String> {
164        &self.partnership_arn
165    }
166    /// <p>Returns a descriptive name for the partnership.</p>
167    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    /// <p>Returns a descriptive name for the partnership.</p>
172    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173        self.name = input;
174        self
175    }
176    /// <p>Returns a descriptive name for the partnership.</p>
177    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
178        &self.name
179    }
180    /// <p>Returns the email address associated with this trading partner.</p>
181    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    /// <p>Returns the email address associated with this trading partner.</p>
186    pub fn set_email(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
187        self.email = input;
188        self
189    }
190    /// <p>Returns the email address associated with this trading partner.</p>
191    pub fn get_email(&self) -> &::std::option::Option<::std::string::String> {
192        &self.email
193    }
194    /// <p>Returns the phone number associated with the partnership.</p>
195    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    /// <p>Returns the phone number associated with the partnership.</p>
200    pub fn set_phone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201        self.phone = input;
202        self
203    }
204    /// <p>Returns the phone number associated with the partnership.</p>
205    pub fn get_phone(&self) -> &::std::option::Option<::std::string::String> {
206        &self.phone
207    }
208    /// Appends an item to `capabilities`.
209    ///
210    /// To override the contents of this collection use [`set_capabilities`](Self::set_capabilities).
211    ///
212    /// <p>Returns one or more capabilities associated with this partnership.</p>
213    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    /// <p>Returns one or more capabilities associated with this partnership.</p>
220    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    /// <p>Returns one or more capabilities associated with this partnership.</p>
225    pub fn get_capabilities(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
226        &self.capabilities
227    }
228    /// <p>Returns the structure that contains the details for the associated capabilities.</p>
229    pub fn capability_options(mut self, input: crate::types::CapabilityOptions) -> Self {
230        self.capability_options = ::std::option::Option::Some(input);
231        self
232    }
233    /// <p>Returns the structure that contains the details for the associated capabilities.</p>
234    pub fn set_capability_options(mut self, input: ::std::option::Option<crate::types::CapabilityOptions>) -> Self {
235        self.capability_options = input;
236        self
237    }
238    /// <p>Returns the structure that contains the details for the associated capabilities.</p>
239    pub fn get_capability_options(&self) -> &::std::option::Option<crate::types::CapabilityOptions> {
240        &self.capability_options
241    }
242    /// <p>Returns the unique, system-generated identifier for a trading partner.</p>
243    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    /// <p>Returns the unique, system-generated identifier for a trading partner.</p>
248    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    /// <p>Returns the unique, system-generated identifier for a trading partner.</p>
253    pub fn get_trading_partner_id(&self) -> &::std::option::Option<::std::string::String> {
254        &self.trading_partner_id
255    }
256    /// <p>Returns a timestamp for creation date and time of the partnership.</p>
257    /// This field is required.
258    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    /// <p>Returns a timestamp for creation date and time of the partnership.</p>
263    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    /// <p>Returns a timestamp for creation date and time of the partnership.</p>
268    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    /// Consumes the builder and constructs a [`CreatePartnershipOutput`](crate::operation::create_partnership::CreatePartnershipOutput).
281    /// This method will fail if any of the following fields are not set:
282    /// - [`profile_id`](crate::operation::create_partnership::builders::CreatePartnershipOutputBuilder::profile_id)
283    /// - [`partnership_id`](crate::operation::create_partnership::builders::CreatePartnershipOutputBuilder::partnership_id)
284    /// - [`partnership_arn`](crate::operation::create_partnership::builders::CreatePartnershipOutputBuilder::partnership_arn)
285    /// - [`created_at`](crate::operation::create_partnership::builders::CreatePartnershipOutputBuilder::created_at)
286    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}