aws_sdk_appconfig/operation/update_extension/
_update_extension_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 UpdateExtensionInput {
6    /// <p>The name, the ID, or the Amazon Resource Name (ARN) of the extension.</p>
7    pub extension_identifier: ::std::option::Option<::std::string::String>,
8    /// <p>Information about the extension.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The actions defined in the extension.</p>
11    pub actions: ::std::option::Option<::std::collections::HashMap<crate::types::ActionPoint, ::std::vec::Vec<crate::types::Action>>>,
12    /// <p>One or more parameters for the actions called by the extension.</p>
13    pub parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Parameter>>,
14    /// <p>The extension version number.</p>
15    pub version_number: ::std::option::Option<i32>,
16}
17impl UpdateExtensionInput {
18    /// <p>The name, the ID, or the Amazon Resource Name (ARN) of the extension.</p>
19    pub fn extension_identifier(&self) -> ::std::option::Option<&str> {
20        self.extension_identifier.as_deref()
21    }
22    /// <p>Information about the extension.</p>
23    pub fn description(&self) -> ::std::option::Option<&str> {
24        self.description.as_deref()
25    }
26    /// <p>The actions defined in the extension.</p>
27    pub fn actions(&self) -> ::std::option::Option<&::std::collections::HashMap<crate::types::ActionPoint, ::std::vec::Vec<crate::types::Action>>> {
28        self.actions.as_ref()
29    }
30    /// <p>One or more parameters for the actions called by the extension.</p>
31    pub fn parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::Parameter>> {
32        self.parameters.as_ref()
33    }
34    /// <p>The extension version number.</p>
35    pub fn version_number(&self) -> ::std::option::Option<i32> {
36        self.version_number
37    }
38}
39impl UpdateExtensionInput {
40    /// Creates a new builder-style object to manufacture [`UpdateExtensionInput`](crate::operation::update_extension::UpdateExtensionInput).
41    pub fn builder() -> crate::operation::update_extension::builders::UpdateExtensionInputBuilder {
42        crate::operation::update_extension::builders::UpdateExtensionInputBuilder::default()
43    }
44}
45
46/// A builder for [`UpdateExtensionInput`](crate::operation::update_extension::UpdateExtensionInput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct UpdateExtensionInputBuilder {
50    pub(crate) extension_identifier: ::std::option::Option<::std::string::String>,
51    pub(crate) description: ::std::option::Option<::std::string::String>,
52    pub(crate) actions: ::std::option::Option<::std::collections::HashMap<crate::types::ActionPoint, ::std::vec::Vec<crate::types::Action>>>,
53    pub(crate) parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Parameter>>,
54    pub(crate) version_number: ::std::option::Option<i32>,
55}
56impl UpdateExtensionInputBuilder {
57    /// <p>The name, the ID, or the Amazon Resource Name (ARN) of the extension.</p>
58    /// This field is required.
59    pub fn extension_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.extension_identifier = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The name, the ID, or the Amazon Resource Name (ARN) of the extension.</p>
64    pub fn set_extension_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.extension_identifier = input;
66        self
67    }
68    /// <p>The name, the ID, or the Amazon Resource Name (ARN) of the extension.</p>
69    pub fn get_extension_identifier(&self) -> &::std::option::Option<::std::string::String> {
70        &self.extension_identifier
71    }
72    /// <p>Information about the extension.</p>
73    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.description = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// <p>Information about the extension.</p>
78    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.description = input;
80        self
81    }
82    /// <p>Information about the extension.</p>
83    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
84        &self.description
85    }
86    /// Adds a key-value pair to `actions`.
87    ///
88    /// To override the contents of this collection use [`set_actions`](Self::set_actions).
89    ///
90    /// <p>The actions defined in the extension.</p>
91    pub fn actions(mut self, k: crate::types::ActionPoint, v: ::std::vec::Vec<crate::types::Action>) -> Self {
92        let mut hash_map = self.actions.unwrap_or_default();
93        hash_map.insert(k, v);
94        self.actions = ::std::option::Option::Some(hash_map);
95        self
96    }
97    /// <p>The actions defined in the extension.</p>
98    pub fn set_actions(
99        mut self,
100        input: ::std::option::Option<::std::collections::HashMap<crate::types::ActionPoint, ::std::vec::Vec<crate::types::Action>>>,
101    ) -> Self {
102        self.actions = input;
103        self
104    }
105    /// <p>The actions defined in the extension.</p>
106    pub fn get_actions(
107        &self,
108    ) -> &::std::option::Option<::std::collections::HashMap<crate::types::ActionPoint, ::std::vec::Vec<crate::types::Action>>> {
109        &self.actions
110    }
111    /// Adds a key-value pair to `parameters`.
112    ///
113    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
114    ///
115    /// <p>One or more parameters for the actions called by the extension.</p>
116    pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::Parameter) -> Self {
117        let mut hash_map = self.parameters.unwrap_or_default();
118        hash_map.insert(k.into(), v);
119        self.parameters = ::std::option::Option::Some(hash_map);
120        self
121    }
122    /// <p>One or more parameters for the actions called by the extension.</p>
123    pub fn set_parameters(
124        mut self,
125        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Parameter>>,
126    ) -> Self {
127        self.parameters = input;
128        self
129    }
130    /// <p>One or more parameters for the actions called by the extension.</p>
131    pub fn get_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Parameter>> {
132        &self.parameters
133    }
134    /// <p>The extension version number.</p>
135    pub fn version_number(mut self, input: i32) -> Self {
136        self.version_number = ::std::option::Option::Some(input);
137        self
138    }
139    /// <p>The extension version number.</p>
140    pub fn set_version_number(mut self, input: ::std::option::Option<i32>) -> Self {
141        self.version_number = input;
142        self
143    }
144    /// <p>The extension version number.</p>
145    pub fn get_version_number(&self) -> &::std::option::Option<i32> {
146        &self.version_number
147    }
148    /// Consumes the builder and constructs a [`UpdateExtensionInput`](crate::operation::update_extension::UpdateExtensionInput).
149    pub fn build(
150        self,
151    ) -> ::std::result::Result<crate::operation::update_extension::UpdateExtensionInput, ::aws_smithy_types::error::operation::BuildError> {
152        ::std::result::Result::Ok(crate::operation::update_extension::UpdateExtensionInput {
153            extension_identifier: self.extension_identifier,
154            description: self.description,
155            actions: self.actions,
156            parameters: self.parameters,
157            version_number: self.version_number,
158        })
159    }
160}