aws_sdk_appconfig/operation/create_extension/_create_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 CreateExtensionInput {
6 /// <p>A name for the extension. Each extension name in your account must be unique. Extension versions use the same name.</p>
7 pub name: ::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>The parameters accepted by the extension. You specify parameter values when you associate the extension to an AppConfig resource by using the <code>CreateExtensionAssociation</code> API action. For Lambda extension actions, these parameters are included in the Lambda request object.</p>
13 pub parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Parameter>>,
14 /// <p>Adds one or more tags for the specified extension. Tags are metadata that help you categorize resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value, both of which you define.</p>
15 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16 /// <p>You can omit this field when you create an extension. When you create a new version, specify the most recent current version number. For example, you create version 3, enter 2 for this field.</p>
17 pub latest_version_number: ::std::option::Option<i32>,
18}
19impl CreateExtensionInput {
20 /// <p>A name for the extension. Each extension name in your account must be unique. Extension versions use the same name.</p>
21 pub fn name(&self) -> ::std::option::Option<&str> {
22 self.name.as_deref()
23 }
24 /// <p>Information about the extension.</p>
25 pub fn description(&self) -> ::std::option::Option<&str> {
26 self.description.as_deref()
27 }
28 /// <p>The actions defined in the extension.</p>
29 pub fn actions(&self) -> ::std::option::Option<&::std::collections::HashMap<crate::types::ActionPoint, ::std::vec::Vec<crate::types::Action>>> {
30 self.actions.as_ref()
31 }
32 /// <p>The parameters accepted by the extension. You specify parameter values when you associate the extension to an AppConfig resource by using the <code>CreateExtensionAssociation</code> API action. For Lambda extension actions, these parameters are included in the Lambda request object.</p>
33 pub fn parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::Parameter>> {
34 self.parameters.as_ref()
35 }
36 /// <p>Adds one or more tags for the specified extension. Tags are metadata that help you categorize resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value, both of which you define.</p>
37 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
38 self.tags.as_ref()
39 }
40 /// <p>You can omit this field when you create an extension. When you create a new version, specify the most recent current version number. For example, you create version 3, enter 2 for this field.</p>
41 pub fn latest_version_number(&self) -> ::std::option::Option<i32> {
42 self.latest_version_number
43 }
44}
45impl CreateExtensionInput {
46 /// Creates a new builder-style object to manufacture [`CreateExtensionInput`](crate::operation::create_extension::CreateExtensionInput).
47 pub fn builder() -> crate::operation::create_extension::builders::CreateExtensionInputBuilder {
48 crate::operation::create_extension::builders::CreateExtensionInputBuilder::default()
49 }
50}
51
52/// A builder for [`CreateExtensionInput`](crate::operation::create_extension::CreateExtensionInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct CreateExtensionInputBuilder {
56 pub(crate) name: ::std::option::Option<::std::string::String>,
57 pub(crate) description: ::std::option::Option<::std::string::String>,
58 pub(crate) actions: ::std::option::Option<::std::collections::HashMap<crate::types::ActionPoint, ::std::vec::Vec<crate::types::Action>>>,
59 pub(crate) parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Parameter>>,
60 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
61 pub(crate) latest_version_number: ::std::option::Option<i32>,
62}
63impl CreateExtensionInputBuilder {
64 /// <p>A name for the extension. Each extension name in your account must be unique. Extension versions use the same name.</p>
65 /// This field is required.
66 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 self.name = ::std::option::Option::Some(input.into());
68 self
69 }
70 /// <p>A name for the extension. Each extension name in your account must be unique. Extension versions use the same name.</p>
71 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72 self.name = input;
73 self
74 }
75 /// <p>A name for the extension. Each extension name in your account must be unique. Extension versions use the same name.</p>
76 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
77 &self.name
78 }
79 /// <p>Information about the extension.</p>
80 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81 self.description = ::std::option::Option::Some(input.into());
82 self
83 }
84 /// <p>Information about the extension.</p>
85 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86 self.description = input;
87 self
88 }
89 /// <p>Information about the extension.</p>
90 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
91 &self.description
92 }
93 /// Adds a key-value pair to `actions`.
94 ///
95 /// To override the contents of this collection use [`set_actions`](Self::set_actions).
96 ///
97 /// <p>The actions defined in the extension.</p>
98 pub fn actions(mut self, k: crate::types::ActionPoint, v: ::std::vec::Vec<crate::types::Action>) -> Self {
99 let mut hash_map = self.actions.unwrap_or_default();
100 hash_map.insert(k, v);
101 self.actions = ::std::option::Option::Some(hash_map);
102 self
103 }
104 /// <p>The actions defined in the extension.</p>
105 pub fn set_actions(
106 mut self,
107 input: ::std::option::Option<::std::collections::HashMap<crate::types::ActionPoint, ::std::vec::Vec<crate::types::Action>>>,
108 ) -> Self {
109 self.actions = input;
110 self
111 }
112 /// <p>The actions defined in the extension.</p>
113 pub fn get_actions(
114 &self,
115 ) -> &::std::option::Option<::std::collections::HashMap<crate::types::ActionPoint, ::std::vec::Vec<crate::types::Action>>> {
116 &self.actions
117 }
118 /// Adds a key-value pair to `parameters`.
119 ///
120 /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
121 ///
122 /// <p>The parameters accepted by the extension. You specify parameter values when you associate the extension to an AppConfig resource by using the <code>CreateExtensionAssociation</code> API action. For Lambda extension actions, these parameters are included in the Lambda request object.</p>
123 pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::Parameter) -> Self {
124 let mut hash_map = self.parameters.unwrap_or_default();
125 hash_map.insert(k.into(), v);
126 self.parameters = ::std::option::Option::Some(hash_map);
127 self
128 }
129 /// <p>The parameters accepted by the extension. You specify parameter values when you associate the extension to an AppConfig resource by using the <code>CreateExtensionAssociation</code> API action. For Lambda extension actions, these parameters are included in the Lambda request object.</p>
130 pub fn set_parameters(
131 mut self,
132 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Parameter>>,
133 ) -> Self {
134 self.parameters = input;
135 self
136 }
137 /// <p>The parameters accepted by the extension. You specify parameter values when you associate the extension to an AppConfig resource by using the <code>CreateExtensionAssociation</code> API action. For Lambda extension actions, these parameters are included in the Lambda request object.</p>
138 pub fn get_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Parameter>> {
139 &self.parameters
140 }
141 /// Adds a key-value pair to `tags`.
142 ///
143 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
144 ///
145 /// <p>Adds one or more tags for the specified extension. Tags are metadata that help you categorize resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value, both of which you define.</p>
146 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
147 let mut hash_map = self.tags.unwrap_or_default();
148 hash_map.insert(k.into(), v.into());
149 self.tags = ::std::option::Option::Some(hash_map);
150 self
151 }
152 /// <p>Adds one or more tags for the specified extension. Tags are metadata that help you categorize resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value, both of which you define.</p>
153 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
154 self.tags = input;
155 self
156 }
157 /// <p>Adds one or more tags for the specified extension. Tags are metadata that help you categorize resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value, both of which you define.</p>
158 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
159 &self.tags
160 }
161 /// <p>You can omit this field when you create an extension. When you create a new version, specify the most recent current version number. For example, you create version 3, enter 2 for this field.</p>
162 pub fn latest_version_number(mut self, input: i32) -> Self {
163 self.latest_version_number = ::std::option::Option::Some(input);
164 self
165 }
166 /// <p>You can omit this field when you create an extension. When you create a new version, specify the most recent current version number. For example, you create version 3, enter 2 for this field.</p>
167 pub fn set_latest_version_number(mut self, input: ::std::option::Option<i32>) -> Self {
168 self.latest_version_number = input;
169 self
170 }
171 /// <p>You can omit this field when you create an extension. When you create a new version, specify the most recent current version number. For example, you create version 3, enter 2 for this field.</p>
172 pub fn get_latest_version_number(&self) -> &::std::option::Option<i32> {
173 &self.latest_version_number
174 }
175 /// Consumes the builder and constructs a [`CreateExtensionInput`](crate::operation::create_extension::CreateExtensionInput).
176 pub fn build(
177 self,
178 ) -> ::std::result::Result<crate::operation::create_extension::CreateExtensionInput, ::aws_smithy_types::error::operation::BuildError> {
179 ::std::result::Result::Ok(crate::operation::create_extension::CreateExtensionInput {
180 name: self.name,
181 description: self.description,
182 actions: self.actions,
183 parameters: self.parameters,
184 tags: self.tags,
185 latest_version_number: self.latest_version_number,
186 })
187 }
188}