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