aws_sdk_elasticbeanstalk/operation/terminate_environment/_terminate_environment_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Request to terminate an environment.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct TerminateEnvironmentInput {
7 /// <p>The ID of the environment to terminate.</p>
8 /// <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>
9 pub environment_id: ::std::option::Option<::std::string::String>,
10 /// <p>The name of the environment to terminate.</p>
11 /// <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>
12 pub environment_name: ::std::option::Option<::std::string::String>,
13 /// <p>Indicates whether the associated AWS resources should shut down when the environment is terminated:</p>
14 /// <ul>
15 /// <li>
16 /// <p><code>true</code>: The specified environment as well as the associated AWS resources, such as Auto Scaling group and LoadBalancer, are terminated.</p></li>
17 /// <li>
18 /// <p><code>false</code>: AWS Elastic Beanstalk resource management is removed from the environment, but the AWS resources continue to operate.</p></li>
19 /// </ul>
20 /// <p>For more information, see the <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/ug/"> AWS Elastic Beanstalk User Guide. </a></p>
21 /// <p>Default: <code>true</code></p>
22 /// <p>Valid Values: <code>true</code> | <code>false</code></p>
23 pub terminate_resources: ::std::option::Option<bool>,
24 /// <p>Terminates the target environment even if another environment in the same group is dependent on it.</p>
25 pub force_terminate: ::std::option::Option<bool>,
26}
27impl TerminateEnvironmentInput {
28 /// <p>The ID of the environment to terminate.</p>
29 /// <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>
30 pub fn environment_id(&self) -> ::std::option::Option<&str> {
31 self.environment_id.as_deref()
32 }
33 /// <p>The name of the environment to terminate.</p>
34 /// <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>
35 pub fn environment_name(&self) -> ::std::option::Option<&str> {
36 self.environment_name.as_deref()
37 }
38 /// <p>Indicates whether the associated AWS resources should shut down when the environment is terminated:</p>
39 /// <ul>
40 /// <li>
41 /// <p><code>true</code>: The specified environment as well as the associated AWS resources, such as Auto Scaling group and LoadBalancer, are terminated.</p></li>
42 /// <li>
43 /// <p><code>false</code>: AWS Elastic Beanstalk resource management is removed from the environment, but the AWS resources continue to operate.</p></li>
44 /// </ul>
45 /// <p>For more information, see the <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/ug/"> AWS Elastic Beanstalk User Guide. </a></p>
46 /// <p>Default: <code>true</code></p>
47 /// <p>Valid Values: <code>true</code> | <code>false</code></p>
48 pub fn terminate_resources(&self) -> ::std::option::Option<bool> {
49 self.terminate_resources
50 }
51 /// <p>Terminates the target environment even if another environment in the same group is dependent on it.</p>
52 pub fn force_terminate(&self) -> ::std::option::Option<bool> {
53 self.force_terminate
54 }
55}
56impl TerminateEnvironmentInput {
57 /// Creates a new builder-style object to manufacture [`TerminateEnvironmentInput`](crate::operation::terminate_environment::TerminateEnvironmentInput).
58 pub fn builder() -> crate::operation::terminate_environment::builders::TerminateEnvironmentInputBuilder {
59 crate::operation::terminate_environment::builders::TerminateEnvironmentInputBuilder::default()
60 }
61}
62
63/// A builder for [`TerminateEnvironmentInput`](crate::operation::terminate_environment::TerminateEnvironmentInput).
64#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
65#[non_exhaustive]
66pub struct TerminateEnvironmentInputBuilder {
67 pub(crate) environment_id: ::std::option::Option<::std::string::String>,
68 pub(crate) environment_name: ::std::option::Option<::std::string::String>,
69 pub(crate) terminate_resources: ::std::option::Option<bool>,
70 pub(crate) force_terminate: ::std::option::Option<bool>,
71}
72impl TerminateEnvironmentInputBuilder {
73 /// <p>The ID of the environment to terminate.</p>
74 /// <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>
75 pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 self.environment_id = ::std::option::Option::Some(input.into());
77 self
78 }
79 /// <p>The ID of the environment to terminate.</p>
80 /// <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>
81 pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82 self.environment_id = input;
83 self
84 }
85 /// <p>The ID of the environment to terminate.</p>
86 /// <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>
87 pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
88 &self.environment_id
89 }
90 /// <p>The name of the environment to terminate.</p>
91 /// <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>
92 pub fn environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
93 self.environment_name = ::std::option::Option::Some(input.into());
94 self
95 }
96 /// <p>The name of the environment to terminate.</p>
97 /// <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>
98 pub fn set_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99 self.environment_name = input;
100 self
101 }
102 /// <p>The name of the environment to terminate.</p>
103 /// <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>
104 pub fn get_environment_name(&self) -> &::std::option::Option<::std::string::String> {
105 &self.environment_name
106 }
107 /// <p>Indicates whether the associated AWS resources should shut down when the environment is terminated:</p>
108 /// <ul>
109 /// <li>
110 /// <p><code>true</code>: The specified environment as well as the associated AWS resources, such as Auto Scaling group and LoadBalancer, are terminated.</p></li>
111 /// <li>
112 /// <p><code>false</code>: AWS Elastic Beanstalk resource management is removed from the environment, but the AWS resources continue to operate.</p></li>
113 /// </ul>
114 /// <p>For more information, see the <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/ug/"> AWS Elastic Beanstalk User Guide. </a></p>
115 /// <p>Default: <code>true</code></p>
116 /// <p>Valid Values: <code>true</code> | <code>false</code></p>
117 pub fn terminate_resources(mut self, input: bool) -> Self {
118 self.terminate_resources = ::std::option::Option::Some(input);
119 self
120 }
121 /// <p>Indicates whether the associated AWS resources should shut down when the environment is terminated:</p>
122 /// <ul>
123 /// <li>
124 /// <p><code>true</code>: The specified environment as well as the associated AWS resources, such as Auto Scaling group and LoadBalancer, are terminated.</p></li>
125 /// <li>
126 /// <p><code>false</code>: AWS Elastic Beanstalk resource management is removed from the environment, but the AWS resources continue to operate.</p></li>
127 /// </ul>
128 /// <p>For more information, see the <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/ug/"> AWS Elastic Beanstalk User Guide. </a></p>
129 /// <p>Default: <code>true</code></p>
130 /// <p>Valid Values: <code>true</code> | <code>false</code></p>
131 pub fn set_terminate_resources(mut self, input: ::std::option::Option<bool>) -> Self {
132 self.terminate_resources = input;
133 self
134 }
135 /// <p>Indicates whether the associated AWS resources should shut down when the environment is terminated:</p>
136 /// <ul>
137 /// <li>
138 /// <p><code>true</code>: The specified environment as well as the associated AWS resources, such as Auto Scaling group and LoadBalancer, are terminated.</p></li>
139 /// <li>
140 /// <p><code>false</code>: AWS Elastic Beanstalk resource management is removed from the environment, but the AWS resources continue to operate.</p></li>
141 /// </ul>
142 /// <p>For more information, see the <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/ug/"> AWS Elastic Beanstalk User Guide. </a></p>
143 /// <p>Default: <code>true</code></p>
144 /// <p>Valid Values: <code>true</code> | <code>false</code></p>
145 pub fn get_terminate_resources(&self) -> &::std::option::Option<bool> {
146 &self.terminate_resources
147 }
148 /// <p>Terminates the target environment even if another environment in the same group is dependent on it.</p>
149 pub fn force_terminate(mut self, input: bool) -> Self {
150 self.force_terminate = ::std::option::Option::Some(input);
151 self
152 }
153 /// <p>Terminates the target environment even if another environment in the same group is dependent on it.</p>
154 pub fn set_force_terminate(mut self, input: ::std::option::Option<bool>) -> Self {
155 self.force_terminate = input;
156 self
157 }
158 /// <p>Terminates the target environment even if another environment in the same group is dependent on it.</p>
159 pub fn get_force_terminate(&self) -> &::std::option::Option<bool> {
160 &self.force_terminate
161 }
162 /// Consumes the builder and constructs a [`TerminateEnvironmentInput`](crate::operation::terminate_environment::TerminateEnvironmentInput).
163 pub fn build(
164 self,
165 ) -> ::std::result::Result<crate::operation::terminate_environment::TerminateEnvironmentInput, ::aws_smithy_types::error::operation::BuildError>
166 {
167 ::std::result::Result::Ok(crate::operation::terminate_environment::TerminateEnvironmentInput {
168 environment_id: self.environment_id,
169 environment_name: self.environment_name,
170 terminate_resources: self.terminate_resources,
171 force_terminate: self.force_terminate,
172 })
173 }
174}