aws_sdk_b2bi/operation/update_capability/
_update_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 UpdateCapabilityInput {
6    /// <p>Specifies a system-assigned unique identifier for the capability.</p>
7    pub capability_id: ::std::option::Option<::std::string::String>,
8    /// <p>Specifies a new name for the capability, to replace the existing name.</p>
9    pub name: ::std::option::Option<::std::string::String>,
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}
15impl UpdateCapabilityInput {
16    /// <p>Specifies a system-assigned unique identifier for the capability.</p>
17    pub fn capability_id(&self) -> ::std::option::Option<&str> {
18        self.capability_id.as_deref()
19    }
20    /// <p>Specifies a new name for the capability, to replace the existing name.</p>
21    pub fn name(&self) -> ::std::option::Option<&str> {
22        self.name.as_deref()
23    }
24    /// <p>Specifies a structure that contains the details for a capability.</p>
25    pub fn configuration(&self) -> ::std::option::Option<&crate::types::CapabilityConfiguration> {
26        self.configuration.as_ref()
27    }
28    /// <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>
29    ///
30    /// 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()`.
31    pub fn instructions_documents(&self) -> &[crate::types::S3Location] {
32        self.instructions_documents.as_deref().unwrap_or_default()
33    }
34}
35impl UpdateCapabilityInput {
36    /// Creates a new builder-style object to manufacture [`UpdateCapabilityInput`](crate::operation::update_capability::UpdateCapabilityInput).
37    pub fn builder() -> crate::operation::update_capability::builders::UpdateCapabilityInputBuilder {
38        crate::operation::update_capability::builders::UpdateCapabilityInputBuilder::default()
39    }
40}
41
42/// A builder for [`UpdateCapabilityInput`](crate::operation::update_capability::UpdateCapabilityInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct UpdateCapabilityInputBuilder {
46    pub(crate) capability_id: ::std::option::Option<::std::string::String>,
47    pub(crate) name: ::std::option::Option<::std::string::String>,
48    pub(crate) configuration: ::std::option::Option<crate::types::CapabilityConfiguration>,
49    pub(crate) instructions_documents: ::std::option::Option<::std::vec::Vec<crate::types::S3Location>>,
50}
51impl UpdateCapabilityInputBuilder {
52    /// <p>Specifies a system-assigned unique identifier for the capability.</p>
53    /// This field is required.
54    pub fn capability_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.capability_id = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>Specifies a system-assigned unique identifier for the capability.</p>
59    pub fn set_capability_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.capability_id = input;
61        self
62    }
63    /// <p>Specifies a system-assigned unique identifier for the capability.</p>
64    pub fn get_capability_id(&self) -> &::std::option::Option<::std::string::String> {
65        &self.capability_id
66    }
67    /// <p>Specifies a new name for the capability, to replace the existing name.</p>
68    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.name = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>Specifies a new name for the capability, to replace the existing name.</p>
73    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.name = input;
75        self
76    }
77    /// <p>Specifies a new name for the capability, to replace the existing name.</p>
78    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
79        &self.name
80    }
81    /// <p>Specifies a structure that contains the details for a capability.</p>
82    pub fn configuration(mut self, input: crate::types::CapabilityConfiguration) -> Self {
83        self.configuration = ::std::option::Option::Some(input);
84        self
85    }
86    /// <p>Specifies a structure that contains the details for a capability.</p>
87    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::CapabilityConfiguration>) -> Self {
88        self.configuration = input;
89        self
90    }
91    /// <p>Specifies a structure that contains the details for a capability.</p>
92    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::CapabilityConfiguration> {
93        &self.configuration
94    }
95    /// Appends an item to `instructions_documents`.
96    ///
97    /// To override the contents of this collection use [`set_instructions_documents`](Self::set_instructions_documents).
98    ///
99    /// <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>
100    pub fn instructions_documents(mut self, input: crate::types::S3Location) -> Self {
101        let mut v = self.instructions_documents.unwrap_or_default();
102        v.push(input);
103        self.instructions_documents = ::std::option::Option::Some(v);
104        self
105    }
106    /// <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>
107    pub fn set_instructions_documents(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::S3Location>>) -> Self {
108        self.instructions_documents = input;
109        self
110    }
111    /// <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>
112    pub fn get_instructions_documents(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::S3Location>> {
113        &self.instructions_documents
114    }
115    /// Consumes the builder and constructs a [`UpdateCapabilityInput`](crate::operation::update_capability::UpdateCapabilityInput).
116    pub fn build(
117        self,
118    ) -> ::std::result::Result<crate::operation::update_capability::UpdateCapabilityInput, ::aws_smithy_types::error::operation::BuildError> {
119        ::std::result::Result::Ok(crate::operation::update_capability::UpdateCapabilityInput {
120            capability_id: self.capability_id,
121            name: self.name,
122            configuration: self.configuration,
123            instructions_documents: self.instructions_documents,
124        })
125    }
126}