aws_sdk_elasticbeanstalk/operation/terminate_environment/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::terminate_environment::_terminate_environment_output::TerminateEnvironmentOutputBuilder;
3
4pub use crate::operation::terminate_environment::_terminate_environment_input::TerminateEnvironmentInputBuilder;
5
6impl crate::operation::terminate_environment::builders::TerminateEnvironmentInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::terminate_environment::TerminateEnvironmentOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::terminate_environment::TerminateEnvironmentError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.terminate_environment();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `TerminateEnvironment`.
24///
25/// <p>Terminates the specified environment.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct TerminateEnvironmentFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::terminate_environment::builders::TerminateEnvironmentInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::terminate_environment::TerminateEnvironmentOutput,
35        crate::operation::terminate_environment::TerminateEnvironmentError,
36    > for TerminateEnvironmentFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::terminate_environment::TerminateEnvironmentOutput,
44            crate::operation::terminate_environment::TerminateEnvironmentError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl TerminateEnvironmentFluentBuilder {
51    /// Creates a new `TerminateEnvironmentFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the TerminateEnvironment as a reference.
60    pub fn as_input(&self) -> &crate::operation::terminate_environment::builders::TerminateEnvironmentInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::terminate_environment::TerminateEnvironmentOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::terminate_environment::TerminateEnvironmentError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::terminate_environment::TerminateEnvironment::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::terminate_environment::TerminateEnvironment::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::terminate_environment::TerminateEnvironmentOutput,
97        crate::operation::terminate_environment::TerminateEnvironmentError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The ID of the environment to terminate.</p>
112    /// <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>
113    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.environment_id(input.into());
115        self
116    }
117    /// <p>The ID of the environment to terminate.</p>
118    /// <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>
119    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_environment_id(input);
121        self
122    }
123    /// <p>The ID of the environment to terminate.</p>
124    /// <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>
125    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_environment_id()
127    }
128    /// <p>The name of the environment to terminate.</p>
129    /// <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>
130    pub fn environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.environment_name(input.into());
132        self
133    }
134    /// <p>The name of the environment to terminate.</p>
135    /// <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>
136    pub fn set_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.inner = self.inner.set_environment_name(input);
138        self
139    }
140    /// <p>The name of the environment to terminate.</p>
141    /// <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>
142    pub fn get_environment_name(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_environment_name()
144    }
145    /// <p>Indicates whether the associated AWS resources should shut down when the environment is terminated:</p>
146    /// <ul>
147    /// <li>
148    /// <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>
149    /// <li>
150    /// <p><code>false</code>: AWS Elastic Beanstalk resource management is removed from the environment, but the AWS resources continue to operate.</p></li>
151    /// </ul>
152    /// <p>For more information, see the <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/ug/"> AWS Elastic Beanstalk User Guide. </a></p>
153    /// <p>Default: <code>true</code></p>
154    /// <p>Valid Values: <code>true</code> | <code>false</code></p>
155    pub fn terminate_resources(mut self, input: bool) -> Self {
156        self.inner = self.inner.terminate_resources(input);
157        self
158    }
159    /// <p>Indicates whether the associated AWS resources should shut down when the environment is terminated:</p>
160    /// <ul>
161    /// <li>
162    /// <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>
163    /// <li>
164    /// <p><code>false</code>: AWS Elastic Beanstalk resource management is removed from the environment, but the AWS resources continue to operate.</p></li>
165    /// </ul>
166    /// <p>For more information, see the <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/ug/"> AWS Elastic Beanstalk User Guide. </a></p>
167    /// <p>Default: <code>true</code></p>
168    /// <p>Valid Values: <code>true</code> | <code>false</code></p>
169    pub fn set_terminate_resources(mut self, input: ::std::option::Option<bool>) -> Self {
170        self.inner = self.inner.set_terminate_resources(input);
171        self
172    }
173    /// <p>Indicates whether the associated AWS resources should shut down when the environment is terminated:</p>
174    /// <ul>
175    /// <li>
176    /// <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>
177    /// <li>
178    /// <p><code>false</code>: AWS Elastic Beanstalk resource management is removed from the environment, but the AWS resources continue to operate.</p></li>
179    /// </ul>
180    /// <p>For more information, see the <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/ug/"> AWS Elastic Beanstalk User Guide. </a></p>
181    /// <p>Default: <code>true</code></p>
182    /// <p>Valid Values: <code>true</code> | <code>false</code></p>
183    pub fn get_terminate_resources(&self) -> &::std::option::Option<bool> {
184        self.inner.get_terminate_resources()
185    }
186    /// <p>Terminates the target environment even if another environment in the same group is dependent on it.</p>
187    pub fn force_terminate(mut self, input: bool) -> Self {
188        self.inner = self.inner.force_terminate(input);
189        self
190    }
191    /// <p>Terminates the target environment even if another environment in the same group is dependent on it.</p>
192    pub fn set_force_terminate(mut self, input: ::std::option::Option<bool>) -> Self {
193        self.inner = self.inner.set_force_terminate(input);
194        self
195    }
196    /// <p>Terminates the target environment even if another environment in the same group is dependent on it.</p>
197    pub fn get_force_terminate(&self) -> &::std::option::Option<bool> {
198        self.inner.get_force_terminate()
199    }
200}