aws_sdk_evs/operation/delete_environment/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_environment::_delete_environment_output::DeleteEnvironmentOutputBuilder;
3
4pub use crate::operation::delete_environment::_delete_environment_input::DeleteEnvironmentInputBuilder;
5
6impl crate::operation::delete_environment::builders::DeleteEnvironmentInputBuilder {
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::delete_environment::DeleteEnvironmentOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::delete_environment::DeleteEnvironmentError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.delete_environment();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeleteEnvironment`.
24///
25/// <note>
26/// <p>Amazon EVS is in public preview release and is subject to change.</p>
27/// </note>
28/// <p>Deletes an Amazon EVS environment.</p>
29/// <p>Amazon EVS environments will only be enabled for deletion once the hosts are deleted. You can delete hosts using the <code>DeleteEnvironmentHost</code> action.</p>
30/// <p>Environment deletion also deletes the associated Amazon EVS VLAN subnets. Other associated Amazon Web Services resources are not deleted. These resources may continue to incur costs.</p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct DeleteEnvironmentFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::delete_environment::builders::DeleteEnvironmentInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::delete_environment::DeleteEnvironmentOutput,
40        crate::operation::delete_environment::DeleteEnvironmentError,
41    > for DeleteEnvironmentFluentBuilder
42{
43    fn send(
44        self,
45        config_override: crate::config::Builder,
46    ) -> crate::client::customize::internal::BoxFuture<
47        crate::client::customize::internal::SendResult<
48            crate::operation::delete_environment::DeleteEnvironmentOutput,
49            crate::operation::delete_environment::DeleteEnvironmentError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl DeleteEnvironmentFluentBuilder {
56    /// Creates a new `DeleteEnvironmentFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the DeleteEnvironment as a reference.
65    pub fn as_input(&self) -> &crate::operation::delete_environment::builders::DeleteEnvironmentInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::delete_environment::DeleteEnvironmentOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::delete_environment::DeleteEnvironmentError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::delete_environment::DeleteEnvironment::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::delete_environment::DeleteEnvironment::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::delete_environment::DeleteEnvironmentOutput,
102        crate::operation::delete_environment::DeleteEnvironmentError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    /// <note>
117    /// <p>This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect.</p>
118    /// </note>
119    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the environment deletion request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
120    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.client_token(input.into());
122        self
123    }
124    /// <note>
125    /// <p>This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect.</p>
126    /// </note>
127    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the environment deletion request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
128    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.inner = self.inner.set_client_token(input);
130        self
131    }
132    /// <note>
133    /// <p>This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect.</p>
134    /// </note>
135    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the environment deletion request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
136    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_client_token()
138    }
139    /// <p>A unique ID associated with the environment to be deleted.</p>
140    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.environment_id(input.into());
142        self
143    }
144    /// <p>A unique ID associated with the environment to be deleted.</p>
145    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_environment_id(input);
147        self
148    }
149    /// <p>A unique ID associated with the environment to be deleted.</p>
150    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_environment_id()
152    }
153}