aws_sdk_b2bi/operation/update_capability/
_update_capability_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, ::std::fmt::Debug)]
5pub struct UpdateCapabilityOutput {
6    /// <p>Returns a system-assigned unique identifier for the capability.</p>
7    pub capability_id: ::std::string::String,
8    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
9    pub capability_arn: ::std::string::String,
10    /// <p>Returns the name of the capability, used to identify it.</p>
11    pub name: ::std::string::String,
12    /// <p>Returns the type of the capability. Currently, only <code>edi</code> is supported.</p>
13    pub r#type: crate::types::CapabilityType,
14    /// <p>Returns a structure that contains the details for a capability.</p>
15    pub configuration: ::std::option::Option<crate::types::CapabilityConfiguration>,
16    /// <p>Returns one or more locations in Amazon S3, each specifying an EDI document that can be used with this capability. Each item contains the name of the bucket and the key, to identify the document's location.</p>
17    pub instructions_documents: ::std::option::Option<::std::vec::Vec<crate::types::S3Location>>,
18    /// <p>Returns a timestamp for creation date and time of the capability.</p>
19    pub created_at: ::aws_smithy_types::DateTime,
20    /// <p>Returns a timestamp for last time the capability was modified.</p>
21    pub modified_at: ::std::option::Option<::aws_smithy_types::DateTime>,
22    _request_id: Option<String>,
23}
24impl UpdateCapabilityOutput {
25    /// <p>Returns a system-assigned unique identifier for the capability.</p>
26    pub fn capability_id(&self) -> &str {
27        use std::ops::Deref;
28        self.capability_id.deref()
29    }
30    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
31    pub fn capability_arn(&self) -> &str {
32        use std::ops::Deref;
33        self.capability_arn.deref()
34    }
35    /// <p>Returns the name of the capability, used to identify it.</p>
36    pub fn name(&self) -> &str {
37        use std::ops::Deref;
38        self.name.deref()
39    }
40    /// <p>Returns the type of the capability. Currently, only <code>edi</code> is supported.</p>
41    pub fn r#type(&self) -> &crate::types::CapabilityType {
42        &self.r#type
43    }
44    /// <p>Returns a structure that contains the details for a capability.</p>
45    pub fn configuration(&self) -> ::std::option::Option<&crate::types::CapabilityConfiguration> {
46        self.configuration.as_ref()
47    }
48    /// <p>Returns one or more locations in Amazon S3, each specifying an EDI document that can be used with this capability. Each item contains the name of the bucket and the key, to identify the document's location.</p>
49    ///
50    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.instructions_documents.is_none()`.
51    pub fn instructions_documents(&self) -> &[crate::types::S3Location] {
52        self.instructions_documents.as_deref().unwrap_or_default()
53    }
54    /// <p>Returns a timestamp for creation date and time of the capability.</p>
55    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
56        &self.created_at
57    }
58    /// <p>Returns a timestamp for last time the capability was modified.</p>
59    pub fn modified_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
60        self.modified_at.as_ref()
61    }
62}
63impl ::aws_types::request_id::RequestId for UpdateCapabilityOutput {
64    fn request_id(&self) -> Option<&str> {
65        self._request_id.as_deref()
66    }
67}
68impl UpdateCapabilityOutput {
69    /// Creates a new builder-style object to manufacture [`UpdateCapabilityOutput`](crate::operation::update_capability::UpdateCapabilityOutput).
70    pub fn builder() -> crate::operation::update_capability::builders::UpdateCapabilityOutputBuilder {
71        crate::operation::update_capability::builders::UpdateCapabilityOutputBuilder::default()
72    }
73}
74
75/// A builder for [`UpdateCapabilityOutput`](crate::operation::update_capability::UpdateCapabilityOutput).
76#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
77#[non_exhaustive]
78pub struct UpdateCapabilityOutputBuilder {
79    pub(crate) capability_id: ::std::option::Option<::std::string::String>,
80    pub(crate) capability_arn: ::std::option::Option<::std::string::String>,
81    pub(crate) name: ::std::option::Option<::std::string::String>,
82    pub(crate) r#type: ::std::option::Option<crate::types::CapabilityType>,
83    pub(crate) configuration: ::std::option::Option<crate::types::CapabilityConfiguration>,
84    pub(crate) instructions_documents: ::std::option::Option<::std::vec::Vec<crate::types::S3Location>>,
85    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
86    pub(crate) modified_at: ::std::option::Option<::aws_smithy_types::DateTime>,
87    _request_id: Option<String>,
88}
89impl UpdateCapabilityOutputBuilder {
90    /// <p>Returns a system-assigned unique identifier for the capability.</p>
91    /// This field is required.
92    pub fn capability_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
93        self.capability_id = ::std::option::Option::Some(input.into());
94        self
95    }
96    /// <p>Returns a system-assigned unique identifier for the capability.</p>
97    pub fn set_capability_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
98        self.capability_id = input;
99        self
100    }
101    /// <p>Returns a system-assigned unique identifier for the capability.</p>
102    pub fn get_capability_id(&self) -> &::std::option::Option<::std::string::String> {
103        &self.capability_id
104    }
105    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
106    /// This field is required.
107    pub fn capability_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108        self.capability_arn = ::std::option::Option::Some(input.into());
109        self
110    }
111    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
112    pub fn set_capability_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113        self.capability_arn = input;
114        self
115    }
116    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
117    pub fn get_capability_arn(&self) -> &::std::option::Option<::std::string::String> {
118        &self.capability_arn
119    }
120    /// <p>Returns the name of the capability, used to identify it.</p>
121    /// This field is required.
122    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.name = ::std::option::Option::Some(input.into());
124        self
125    }
126    /// <p>Returns the name of the capability, used to identify it.</p>
127    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.name = input;
129        self
130    }
131    /// <p>Returns the name of the capability, used to identify it.</p>
132    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
133        &self.name
134    }
135    /// <p>Returns the type of the capability. Currently, only <code>edi</code> is supported.</p>
136    /// This field is required.
137    pub fn r#type(mut self, input: crate::types::CapabilityType) -> Self {
138        self.r#type = ::std::option::Option::Some(input);
139        self
140    }
141    /// <p>Returns the type of the capability. Currently, only <code>edi</code> is supported.</p>
142    pub fn set_type(mut self, input: ::std::option::Option<crate::types::CapabilityType>) -> Self {
143        self.r#type = input;
144        self
145    }
146    /// <p>Returns the type of the capability. Currently, only <code>edi</code> is supported.</p>
147    pub fn get_type(&self) -> &::std::option::Option<crate::types::CapabilityType> {
148        &self.r#type
149    }
150    /// <p>Returns a structure that contains the details for a capability.</p>
151    /// This field is required.
152    pub fn configuration(mut self, input: crate::types::CapabilityConfiguration) -> Self {
153        self.configuration = ::std::option::Option::Some(input);
154        self
155    }
156    /// <p>Returns a structure that contains the details for a capability.</p>
157    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::CapabilityConfiguration>) -> Self {
158        self.configuration = input;
159        self
160    }
161    /// <p>Returns a structure that contains the details for a capability.</p>
162    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::CapabilityConfiguration> {
163        &self.configuration
164    }
165    /// Appends an item to `instructions_documents`.
166    ///
167    /// To override the contents of this collection use [`set_instructions_documents`](Self::set_instructions_documents).
168    ///
169    /// <p>Returns one or more locations in Amazon S3, each specifying an EDI document that can be used with this capability. Each item contains the name of the bucket and the key, to identify the document's location.</p>
170    pub fn instructions_documents(mut self, input: crate::types::S3Location) -> Self {
171        let mut v = self.instructions_documents.unwrap_or_default();
172        v.push(input);
173        self.instructions_documents = ::std::option::Option::Some(v);
174        self
175    }
176    /// <p>Returns one or more locations in Amazon S3, each specifying an EDI document that can be used with this capability. Each item contains the name of the bucket and the key, to identify the document's location.</p>
177    pub fn set_instructions_documents(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::S3Location>>) -> Self {
178        self.instructions_documents = input;
179        self
180    }
181    /// <p>Returns one or more locations in Amazon S3, each specifying an EDI document that can be used with this capability. Each item contains the name of the bucket and the key, to identify the document's location.</p>
182    pub fn get_instructions_documents(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::S3Location>> {
183        &self.instructions_documents
184    }
185    /// <p>Returns a timestamp for creation date and time of the capability.</p>
186    /// This field is required.
187    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
188        self.created_at = ::std::option::Option::Some(input);
189        self
190    }
191    /// <p>Returns a timestamp for creation date and time of the capability.</p>
192    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
193        self.created_at = input;
194        self
195    }
196    /// <p>Returns a timestamp for creation date and time of the capability.</p>
197    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
198        &self.created_at
199    }
200    /// <p>Returns a timestamp for last time the capability was modified.</p>
201    pub fn modified_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
202        self.modified_at = ::std::option::Option::Some(input);
203        self
204    }
205    /// <p>Returns a timestamp for last time the capability was modified.</p>
206    pub fn set_modified_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
207        self.modified_at = input;
208        self
209    }
210    /// <p>Returns a timestamp for last time the capability was modified.</p>
211    pub fn get_modified_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
212        &self.modified_at
213    }
214    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
215        self._request_id = Some(request_id.into());
216        self
217    }
218
219    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
220        self._request_id = request_id;
221        self
222    }
223    /// Consumes the builder and constructs a [`UpdateCapabilityOutput`](crate::operation::update_capability::UpdateCapabilityOutput).
224    /// This method will fail if any of the following fields are not set:
225    /// - [`capability_id`](crate::operation::update_capability::builders::UpdateCapabilityOutputBuilder::capability_id)
226    /// - [`capability_arn`](crate::operation::update_capability::builders::UpdateCapabilityOutputBuilder::capability_arn)
227    /// - [`name`](crate::operation::update_capability::builders::UpdateCapabilityOutputBuilder::name)
228    /// - [`r#type`](crate::operation::update_capability::builders::UpdateCapabilityOutputBuilder::type)
229    /// - [`created_at`](crate::operation::update_capability::builders::UpdateCapabilityOutputBuilder::created_at)
230    pub fn build(
231        self,
232    ) -> ::std::result::Result<crate::operation::update_capability::UpdateCapabilityOutput, ::aws_smithy_types::error::operation::BuildError> {
233        ::std::result::Result::Ok(crate::operation::update_capability::UpdateCapabilityOutput {
234            capability_id: self.capability_id.ok_or_else(|| {
235                ::aws_smithy_types::error::operation::BuildError::missing_field(
236                    "capability_id",
237                    "capability_id was not specified but it is required when building UpdateCapabilityOutput",
238                )
239            })?,
240            capability_arn: self.capability_arn.ok_or_else(|| {
241                ::aws_smithy_types::error::operation::BuildError::missing_field(
242                    "capability_arn",
243                    "capability_arn was not specified but it is required when building UpdateCapabilityOutput",
244                )
245            })?,
246            name: self.name.ok_or_else(|| {
247                ::aws_smithy_types::error::operation::BuildError::missing_field(
248                    "name",
249                    "name was not specified but it is required when building UpdateCapabilityOutput",
250                )
251            })?,
252            r#type: self.r#type.ok_or_else(|| {
253                ::aws_smithy_types::error::operation::BuildError::missing_field(
254                    "r#type",
255                    "r#type was not specified but it is required when building UpdateCapabilityOutput",
256                )
257            })?,
258            configuration: self.configuration,
259            instructions_documents: self.instructions_documents,
260            created_at: self.created_at.ok_or_else(|| {
261                ::aws_smithy_types::error::operation::BuildError::missing_field(
262                    "created_at",
263                    "created_at was not specified but it is required when building UpdateCapabilityOutput",
264                )
265            })?,
266            modified_at: self.modified_at,
267            _request_id: self._request_id,
268        })
269    }
270}