aws_sdk_b2bi/operation/create_capability/
_create_capability_input.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 CreateCapabilityInput {
6    /// <p>Specifies the name of the capability, used to identify it.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>Specifies the type of the capability. Currently, only <code>edi</code> is supported.</p>
9    pub r#type: ::std::option::Option<crate::types::CapabilityType>,
10    /// <p>Specifies a structure that contains the details for a capability.</p>
11    pub configuration: ::std::option::Option<crate::types::CapabilityConfiguration>,
12    /// <p>Specifies 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>
13    pub instructions_documents: ::std::option::Option<::std::vec::Vec<crate::types::S3Location>>,
14    /// <p>Reserved for future use.</p>
15    pub client_token: ::std::option::Option<::std::string::String>,
16    /// <p>Specifies the key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to resources (capabilities, partnerships, and so on) for any purpose.</p>
17    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
18}
19impl CreateCapabilityInput {
20    /// <p>Specifies the name of the capability, used to identify it.</p>
21    pub fn name(&self) -> ::std::option::Option<&str> {
22        self.name.as_deref()
23    }
24    /// <p>Specifies the type of the capability. Currently, only <code>edi</code> is supported.</p>
25    pub fn r#type(&self) -> ::std::option::Option<&crate::types::CapabilityType> {
26        self.r#type.as_ref()
27    }
28    /// <p>Specifies a structure that contains the details for a capability.</p>
29    pub fn configuration(&self) -> ::std::option::Option<&crate::types::CapabilityConfiguration> {
30        self.configuration.as_ref()
31    }
32    /// <p>Specifies 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>
33    ///
34    /// 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()`.
35    pub fn instructions_documents(&self) -> &[crate::types::S3Location] {
36        self.instructions_documents.as_deref().unwrap_or_default()
37    }
38    /// <p>Reserved for future use.</p>
39    pub fn client_token(&self) -> ::std::option::Option<&str> {
40        self.client_token.as_deref()
41    }
42    /// <p>Specifies the key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to resources (capabilities, partnerships, and so on) for any purpose.</p>
43    ///
44    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
45    pub fn tags(&self) -> &[crate::types::Tag] {
46        self.tags.as_deref().unwrap_or_default()
47    }
48}
49impl CreateCapabilityInput {
50    /// Creates a new builder-style object to manufacture [`CreateCapabilityInput`](crate::operation::create_capability::CreateCapabilityInput).
51    pub fn builder() -> crate::operation::create_capability::builders::CreateCapabilityInputBuilder {
52        crate::operation::create_capability::builders::CreateCapabilityInputBuilder::default()
53    }
54}
55
56/// A builder for [`CreateCapabilityInput`](crate::operation::create_capability::CreateCapabilityInput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct CreateCapabilityInputBuilder {
60    pub(crate) name: ::std::option::Option<::std::string::String>,
61    pub(crate) r#type: ::std::option::Option<crate::types::CapabilityType>,
62    pub(crate) configuration: ::std::option::Option<crate::types::CapabilityConfiguration>,
63    pub(crate) instructions_documents: ::std::option::Option<::std::vec::Vec<crate::types::S3Location>>,
64    pub(crate) client_token: ::std::option::Option<::std::string::String>,
65    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
66}
67impl CreateCapabilityInputBuilder {
68    /// <p>Specifies the name of the capability, used to identify it.</p>
69    /// This field is required.
70    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71        self.name = ::std::option::Option::Some(input.into());
72        self
73    }
74    /// <p>Specifies the name of the capability, used to identify it.</p>
75    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.name = input;
77        self
78    }
79    /// <p>Specifies the name of the capability, used to identify it.</p>
80    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
81        &self.name
82    }
83    /// <p>Specifies the type of the capability. Currently, only <code>edi</code> is supported.</p>
84    /// This field is required.
85    pub fn r#type(mut self, input: crate::types::CapabilityType) -> Self {
86        self.r#type = ::std::option::Option::Some(input);
87        self
88    }
89    /// <p>Specifies the type of the capability. Currently, only <code>edi</code> is supported.</p>
90    pub fn set_type(mut self, input: ::std::option::Option<crate::types::CapabilityType>) -> Self {
91        self.r#type = input;
92        self
93    }
94    /// <p>Specifies the type of the capability. Currently, only <code>edi</code> is supported.</p>
95    pub fn get_type(&self) -> &::std::option::Option<crate::types::CapabilityType> {
96        &self.r#type
97    }
98    /// <p>Specifies a structure that contains the details for a capability.</p>
99    /// This field is required.
100    pub fn configuration(mut self, input: crate::types::CapabilityConfiguration) -> Self {
101        self.configuration = ::std::option::Option::Some(input);
102        self
103    }
104    /// <p>Specifies a structure that contains the details for a capability.</p>
105    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::CapabilityConfiguration>) -> Self {
106        self.configuration = input;
107        self
108    }
109    /// <p>Specifies a structure that contains the details for a capability.</p>
110    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::CapabilityConfiguration> {
111        &self.configuration
112    }
113    /// Appends an item to `instructions_documents`.
114    ///
115    /// To override the contents of this collection use [`set_instructions_documents`](Self::set_instructions_documents).
116    ///
117    /// <p>Specifies 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>
118    pub fn instructions_documents(mut self, input: crate::types::S3Location) -> Self {
119        let mut v = self.instructions_documents.unwrap_or_default();
120        v.push(input);
121        self.instructions_documents = ::std::option::Option::Some(v);
122        self
123    }
124    /// <p>Specifies 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>
125    pub fn set_instructions_documents(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::S3Location>>) -> Self {
126        self.instructions_documents = input;
127        self
128    }
129    /// <p>Specifies 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>
130    pub fn get_instructions_documents(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::S3Location>> {
131        &self.instructions_documents
132    }
133    /// <p>Reserved for future use.</p>
134    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.client_token = ::std::option::Option::Some(input.into());
136        self
137    }
138    /// <p>Reserved for future use.</p>
139    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.client_token = input;
141        self
142    }
143    /// <p>Reserved for future use.</p>
144    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
145        &self.client_token
146    }
147    /// Appends an item to `tags`.
148    ///
149    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
150    ///
151    /// <p>Specifies the key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to resources (capabilities, partnerships, and so on) for any purpose.</p>
152    pub fn tags(mut self, input: crate::types::Tag) -> Self {
153        let mut v = self.tags.unwrap_or_default();
154        v.push(input);
155        self.tags = ::std::option::Option::Some(v);
156        self
157    }
158    /// <p>Specifies the key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to resources (capabilities, partnerships, and so on) for any purpose.</p>
159    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
160        self.tags = input;
161        self
162    }
163    /// <p>Specifies the key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to resources (capabilities, partnerships, and so on) for any purpose.</p>
164    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
165        &self.tags
166    }
167    /// Consumes the builder and constructs a [`CreateCapabilityInput`](crate::operation::create_capability::CreateCapabilityInput).
168    pub fn build(
169        self,
170    ) -> ::std::result::Result<crate::operation::create_capability::CreateCapabilityInput, ::aws_smithy_types::error::operation::BuildError> {
171        ::std::result::Result::Ok(crate::operation::create_capability::CreateCapabilityInput {
172            name: self.name,
173            r#type: self.r#type,
174            configuration: self.configuration,
175            instructions_documents: self.instructions_documents,
176            client_token: self.client_token,
177            tags: self.tags,
178        })
179    }
180}