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