aws_sdk_elasticbeanstalk/operation/update_environment/
_update_environment_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Request to update an environment.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateEnvironmentInput {
7    /// <p>The name of the application with which the environment is associated.</p>
8    pub application_name: ::std::option::Option<::std::string::String>,
9    /// <p>The ID of the environment to update.</p>
10    /// <p>If no environment with this ID exists, AWS Elastic Beanstalk returns an <code>InvalidParameterValue</code> error.</p>
11    /// <p>Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns <code>MissingRequiredParameter</code> error.</p>
12    pub environment_id: ::std::option::Option<::std::string::String>,
13    /// <p>The name of the environment to update. If no environment with this name exists, AWS Elastic Beanstalk returns an <code>InvalidParameterValue</code> error.</p>
14    /// <p>Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns <code>MissingRequiredParameter</code> error.</p>
15    pub environment_name: ::std::option::Option<::std::string::String>,
16    /// <p>The name of the group to which the target environment belongs. Specify a group name only if the environment's name is specified in an environment manifest and not with the environment name or environment ID parameters. See <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-cfg-manifest.html">Environment Manifest (env.yaml)</a> for details.</p>
17    pub group_name: ::std::option::Option<::std::string::String>,
18    /// <p>If this parameter is specified, AWS Elastic Beanstalk updates the description of this environment.</p>
19    pub description: ::std::option::Option<::std::string::String>,
20    /// <p>This specifies the tier to use to update the environment.</p>
21    /// <p>Condition: At this time, if you change the tier version, name, or type, AWS Elastic Beanstalk returns <code>InvalidParameterValue</code> error.</p>
22    pub tier: ::std::option::Option<crate::types::EnvironmentTier>,
23    /// <p>If this parameter is specified, AWS Elastic Beanstalk deploys the named application version to the environment. If no such application version is found, returns an <code>InvalidParameterValue</code> error.</p>
24    pub version_label: ::std::option::Option<::std::string::String>,
25    /// <p>If this parameter is specified, AWS Elastic Beanstalk deploys this configuration template to the environment. If no such configuration template is found, AWS Elastic Beanstalk returns an <code>InvalidParameterValue</code> error.</p>
26    pub template_name: ::std::option::Option<::std::string::String>,
27    /// <p>This specifies the platform version that the environment will run after the environment is updated.</p>
28    pub solution_stack_name: ::std::option::Option<::std::string::String>,
29    /// <p>The ARN of the platform, if used.</p>
30    pub platform_arn: ::std::option::Option<::std::string::String>,
31    /// <p>If specified, AWS Elastic Beanstalk updates the configuration set associated with the running environment and sets the specified configuration options to the requested value.</p>
32    pub option_settings: ::std::option::Option<::std::vec::Vec<crate::types::ConfigurationOptionSetting>>,
33    /// <p>A list of custom user-defined configuration options to remove from the configuration set for this environment.</p>
34    pub options_to_remove: ::std::option::Option<::std::vec::Vec<crate::types::OptionSpecification>>,
35}
36impl UpdateEnvironmentInput {
37    /// <p>The name of the application with which the environment is associated.</p>
38    pub fn application_name(&self) -> ::std::option::Option<&str> {
39        self.application_name.as_deref()
40    }
41    /// <p>The ID of the environment to update.</p>
42    /// <p>If no environment with this ID exists, AWS Elastic Beanstalk returns an <code>InvalidParameterValue</code> error.</p>
43    /// <p>Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns <code>MissingRequiredParameter</code> error.</p>
44    pub fn environment_id(&self) -> ::std::option::Option<&str> {
45        self.environment_id.as_deref()
46    }
47    /// <p>The name of the environment to update. If no environment with this name exists, AWS Elastic Beanstalk returns an <code>InvalidParameterValue</code> error.</p>
48    /// <p>Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns <code>MissingRequiredParameter</code> error.</p>
49    pub fn environment_name(&self) -> ::std::option::Option<&str> {
50        self.environment_name.as_deref()
51    }
52    /// <p>The name of the group to which the target environment belongs. Specify a group name only if the environment's name is specified in an environment manifest and not with the environment name or environment ID parameters. See <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-cfg-manifest.html">Environment Manifest (env.yaml)</a> for details.</p>
53    pub fn group_name(&self) -> ::std::option::Option<&str> {
54        self.group_name.as_deref()
55    }
56    /// <p>If this parameter is specified, AWS Elastic Beanstalk updates the description of this environment.</p>
57    pub fn description(&self) -> ::std::option::Option<&str> {
58        self.description.as_deref()
59    }
60    /// <p>This specifies the tier to use to update the environment.</p>
61    /// <p>Condition: At this time, if you change the tier version, name, or type, AWS Elastic Beanstalk returns <code>InvalidParameterValue</code> error.</p>
62    pub fn tier(&self) -> ::std::option::Option<&crate::types::EnvironmentTier> {
63        self.tier.as_ref()
64    }
65    /// <p>If this parameter is specified, AWS Elastic Beanstalk deploys the named application version to the environment. If no such application version is found, returns an <code>InvalidParameterValue</code> error.</p>
66    pub fn version_label(&self) -> ::std::option::Option<&str> {
67        self.version_label.as_deref()
68    }
69    /// <p>If this parameter is specified, AWS Elastic Beanstalk deploys this configuration template to the environment. If no such configuration template is found, AWS Elastic Beanstalk returns an <code>InvalidParameterValue</code> error.</p>
70    pub fn template_name(&self) -> ::std::option::Option<&str> {
71        self.template_name.as_deref()
72    }
73    /// <p>This specifies the platform version that the environment will run after the environment is updated.</p>
74    pub fn solution_stack_name(&self) -> ::std::option::Option<&str> {
75        self.solution_stack_name.as_deref()
76    }
77    /// <p>The ARN of the platform, if used.</p>
78    pub fn platform_arn(&self) -> ::std::option::Option<&str> {
79        self.platform_arn.as_deref()
80    }
81    /// <p>If specified, AWS Elastic Beanstalk updates the configuration set associated with the running environment and sets the specified configuration options to the requested value.</p>
82    ///
83    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.option_settings.is_none()`.
84    pub fn option_settings(&self) -> &[crate::types::ConfigurationOptionSetting] {
85        self.option_settings.as_deref().unwrap_or_default()
86    }
87    /// <p>A list of custom user-defined configuration options to remove from the configuration set for this environment.</p>
88    ///
89    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.options_to_remove.is_none()`.
90    pub fn options_to_remove(&self) -> &[crate::types::OptionSpecification] {
91        self.options_to_remove.as_deref().unwrap_or_default()
92    }
93}
94impl UpdateEnvironmentInput {
95    /// Creates a new builder-style object to manufacture [`UpdateEnvironmentInput`](crate::operation::update_environment::UpdateEnvironmentInput).
96    pub fn builder() -> crate::operation::update_environment::builders::UpdateEnvironmentInputBuilder {
97        crate::operation::update_environment::builders::UpdateEnvironmentInputBuilder::default()
98    }
99}
100
101/// A builder for [`UpdateEnvironmentInput`](crate::operation::update_environment::UpdateEnvironmentInput).
102#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
103#[non_exhaustive]
104pub struct UpdateEnvironmentInputBuilder {
105    pub(crate) application_name: ::std::option::Option<::std::string::String>,
106    pub(crate) environment_id: ::std::option::Option<::std::string::String>,
107    pub(crate) environment_name: ::std::option::Option<::std::string::String>,
108    pub(crate) group_name: ::std::option::Option<::std::string::String>,
109    pub(crate) description: ::std::option::Option<::std::string::String>,
110    pub(crate) tier: ::std::option::Option<crate::types::EnvironmentTier>,
111    pub(crate) version_label: ::std::option::Option<::std::string::String>,
112    pub(crate) template_name: ::std::option::Option<::std::string::String>,
113    pub(crate) solution_stack_name: ::std::option::Option<::std::string::String>,
114    pub(crate) platform_arn: ::std::option::Option<::std::string::String>,
115    pub(crate) option_settings: ::std::option::Option<::std::vec::Vec<crate::types::ConfigurationOptionSetting>>,
116    pub(crate) options_to_remove: ::std::option::Option<::std::vec::Vec<crate::types::OptionSpecification>>,
117}
118impl UpdateEnvironmentInputBuilder {
119    /// <p>The name of the application with which the environment is associated.</p>
120    pub fn application_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.application_name = ::std::option::Option::Some(input.into());
122        self
123    }
124    /// <p>The name of the application with which the environment is associated.</p>
125    pub fn set_application_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.application_name = input;
127        self
128    }
129    /// <p>The name of the application with which the environment is associated.</p>
130    pub fn get_application_name(&self) -> &::std::option::Option<::std::string::String> {
131        &self.application_name
132    }
133    /// <p>The ID of the environment to update.</p>
134    /// <p>If no environment with this ID exists, AWS Elastic Beanstalk returns an <code>InvalidParameterValue</code> error.</p>
135    /// <p>Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns <code>MissingRequiredParameter</code> error.</p>
136    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.environment_id = ::std::option::Option::Some(input.into());
138        self
139    }
140    /// <p>The ID of the environment to update.</p>
141    /// <p>If no environment with this ID exists, AWS Elastic Beanstalk returns an <code>InvalidParameterValue</code> error.</p>
142    /// <p>Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns <code>MissingRequiredParameter</code> error.</p>
143    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.environment_id = input;
145        self
146    }
147    /// <p>The ID of the environment to update.</p>
148    /// <p>If no environment with this ID exists, AWS Elastic Beanstalk returns an <code>InvalidParameterValue</code> error.</p>
149    /// <p>Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns <code>MissingRequiredParameter</code> error.</p>
150    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
151        &self.environment_id
152    }
153    /// <p>The name of the environment to update. If no environment with this name exists, AWS Elastic Beanstalk returns an <code>InvalidParameterValue</code> error.</p>
154    /// <p>Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns <code>MissingRequiredParameter</code> error.</p>
155    pub fn environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156        self.environment_name = ::std::option::Option::Some(input.into());
157        self
158    }
159    /// <p>The name of the environment to update. If no environment with this name exists, AWS Elastic Beanstalk returns an <code>InvalidParameterValue</code> error.</p>
160    /// <p>Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns <code>MissingRequiredParameter</code> error.</p>
161    pub fn set_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162        self.environment_name = input;
163        self
164    }
165    /// <p>The name of the environment to update. If no environment with this name exists, AWS Elastic Beanstalk returns an <code>InvalidParameterValue</code> error.</p>
166    /// <p>Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns <code>MissingRequiredParameter</code> error.</p>
167    pub fn get_environment_name(&self) -> &::std::option::Option<::std::string::String> {
168        &self.environment_name
169    }
170    /// <p>The name of the group to which the target environment belongs. Specify a group name only if the environment's name is specified in an environment manifest and not with the environment name or environment ID parameters. See <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-cfg-manifest.html">Environment Manifest (env.yaml)</a> for details.</p>
171    pub fn group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.group_name = ::std::option::Option::Some(input.into());
173        self
174    }
175    /// <p>The name of the group to which the target environment belongs. Specify a group name only if the environment's name is specified in an environment manifest and not with the environment name or environment ID parameters. See <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-cfg-manifest.html">Environment Manifest (env.yaml)</a> for details.</p>
176    pub fn set_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.group_name = input;
178        self
179    }
180    /// <p>The name of the group to which the target environment belongs. Specify a group name only if the environment's name is specified in an environment manifest and not with the environment name or environment ID parameters. See <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-cfg-manifest.html">Environment Manifest (env.yaml)</a> for details.</p>
181    pub fn get_group_name(&self) -> &::std::option::Option<::std::string::String> {
182        &self.group_name
183    }
184    /// <p>If this parameter is specified, AWS Elastic Beanstalk updates the description of this environment.</p>
185    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186        self.description = ::std::option::Option::Some(input.into());
187        self
188    }
189    /// <p>If this parameter is specified, AWS Elastic Beanstalk updates the description of this environment.</p>
190    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191        self.description = input;
192        self
193    }
194    /// <p>If this parameter is specified, AWS Elastic Beanstalk updates the description of this environment.</p>
195    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
196        &self.description
197    }
198    /// <p>This specifies the tier to use to update the environment.</p>
199    /// <p>Condition: At this time, if you change the tier version, name, or type, AWS Elastic Beanstalk returns <code>InvalidParameterValue</code> error.</p>
200    pub fn tier(mut self, input: crate::types::EnvironmentTier) -> Self {
201        self.tier = ::std::option::Option::Some(input);
202        self
203    }
204    /// <p>This specifies the tier to use to update the environment.</p>
205    /// <p>Condition: At this time, if you change the tier version, name, or type, AWS Elastic Beanstalk returns <code>InvalidParameterValue</code> error.</p>
206    pub fn set_tier(mut self, input: ::std::option::Option<crate::types::EnvironmentTier>) -> Self {
207        self.tier = input;
208        self
209    }
210    /// <p>This specifies the tier to use to update the environment.</p>
211    /// <p>Condition: At this time, if you change the tier version, name, or type, AWS Elastic Beanstalk returns <code>InvalidParameterValue</code> error.</p>
212    pub fn get_tier(&self) -> &::std::option::Option<crate::types::EnvironmentTier> {
213        &self.tier
214    }
215    /// <p>If this parameter is specified, AWS Elastic Beanstalk deploys the named application version to the environment. If no such application version is found, returns an <code>InvalidParameterValue</code> error.</p>
216    pub fn version_label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
217        self.version_label = ::std::option::Option::Some(input.into());
218        self
219    }
220    /// <p>If this parameter is specified, AWS Elastic Beanstalk deploys the named application version to the environment. If no such application version is found, returns an <code>InvalidParameterValue</code> error.</p>
221    pub fn set_version_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
222        self.version_label = input;
223        self
224    }
225    /// <p>If this parameter is specified, AWS Elastic Beanstalk deploys the named application version to the environment. If no such application version is found, returns an <code>InvalidParameterValue</code> error.</p>
226    pub fn get_version_label(&self) -> &::std::option::Option<::std::string::String> {
227        &self.version_label
228    }
229    /// <p>If this parameter is specified, AWS Elastic Beanstalk deploys this configuration template to the environment. If no such configuration template is found, AWS Elastic Beanstalk returns an <code>InvalidParameterValue</code> error.</p>
230    pub fn template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
231        self.template_name = ::std::option::Option::Some(input.into());
232        self
233    }
234    /// <p>If this parameter is specified, AWS Elastic Beanstalk deploys this configuration template to the environment. If no such configuration template is found, AWS Elastic Beanstalk returns an <code>InvalidParameterValue</code> error.</p>
235    pub fn set_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
236        self.template_name = input;
237        self
238    }
239    /// <p>If this parameter is specified, AWS Elastic Beanstalk deploys this configuration template to the environment. If no such configuration template is found, AWS Elastic Beanstalk returns an <code>InvalidParameterValue</code> error.</p>
240    pub fn get_template_name(&self) -> &::std::option::Option<::std::string::String> {
241        &self.template_name
242    }
243    /// <p>This specifies the platform version that the environment will run after the environment is updated.</p>
244    pub fn solution_stack_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
245        self.solution_stack_name = ::std::option::Option::Some(input.into());
246        self
247    }
248    /// <p>This specifies the platform version that the environment will run after the environment is updated.</p>
249    pub fn set_solution_stack_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
250        self.solution_stack_name = input;
251        self
252    }
253    /// <p>This specifies the platform version that the environment will run after the environment is updated.</p>
254    pub fn get_solution_stack_name(&self) -> &::std::option::Option<::std::string::String> {
255        &self.solution_stack_name
256    }
257    /// <p>The ARN of the platform, if used.</p>
258    pub fn platform_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
259        self.platform_arn = ::std::option::Option::Some(input.into());
260        self
261    }
262    /// <p>The ARN of the platform, if used.</p>
263    pub fn set_platform_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
264        self.platform_arn = input;
265        self
266    }
267    /// <p>The ARN of the platform, if used.</p>
268    pub fn get_platform_arn(&self) -> &::std::option::Option<::std::string::String> {
269        &self.platform_arn
270    }
271    /// Appends an item to `option_settings`.
272    ///
273    /// To override the contents of this collection use [`set_option_settings`](Self::set_option_settings).
274    ///
275    /// <p>If specified, AWS Elastic Beanstalk updates the configuration set associated with the running environment and sets the specified configuration options to the requested value.</p>
276    pub fn option_settings(mut self, input: crate::types::ConfigurationOptionSetting) -> Self {
277        let mut v = self.option_settings.unwrap_or_default();
278        v.push(input);
279        self.option_settings = ::std::option::Option::Some(v);
280        self
281    }
282    /// <p>If specified, AWS Elastic Beanstalk updates the configuration set associated with the running environment and sets the specified configuration options to the requested value.</p>
283    pub fn set_option_settings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ConfigurationOptionSetting>>) -> Self {
284        self.option_settings = input;
285        self
286    }
287    /// <p>If specified, AWS Elastic Beanstalk updates the configuration set associated with the running environment and sets the specified configuration options to the requested value.</p>
288    pub fn get_option_settings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ConfigurationOptionSetting>> {
289        &self.option_settings
290    }
291    /// Appends an item to `options_to_remove`.
292    ///
293    /// To override the contents of this collection use [`set_options_to_remove`](Self::set_options_to_remove).
294    ///
295    /// <p>A list of custom user-defined configuration options to remove from the configuration set for this environment.</p>
296    pub fn options_to_remove(mut self, input: crate::types::OptionSpecification) -> Self {
297        let mut v = self.options_to_remove.unwrap_or_default();
298        v.push(input);
299        self.options_to_remove = ::std::option::Option::Some(v);
300        self
301    }
302    /// <p>A list of custom user-defined configuration options to remove from the configuration set for this environment.</p>
303    pub fn set_options_to_remove(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OptionSpecification>>) -> Self {
304        self.options_to_remove = input;
305        self
306    }
307    /// <p>A list of custom user-defined configuration options to remove from the configuration set for this environment.</p>
308    pub fn get_options_to_remove(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OptionSpecification>> {
309        &self.options_to_remove
310    }
311    /// Consumes the builder and constructs a [`UpdateEnvironmentInput`](crate::operation::update_environment::UpdateEnvironmentInput).
312    pub fn build(
313        self,
314    ) -> ::std::result::Result<crate::operation::update_environment::UpdateEnvironmentInput, ::aws_smithy_types::error::operation::BuildError> {
315        ::std::result::Result::Ok(crate::operation::update_environment::UpdateEnvironmentInput {
316            application_name: self.application_name,
317            environment_id: self.environment_id,
318            environment_name: self.environment_name,
319            group_name: self.group_name,
320            description: self.description,
321            tier: self.tier,
322            version_label: self.version_label,
323            template_name: self.template_name,
324            solution_stack_name: self.solution_stack_name,
325            platform_arn: self.platform_arn,
326            option_settings: self.option_settings,
327            options_to_remove: self.options_to_remove,
328        })
329    }
330}