aws_sdk_evs/operation/create_environment_host/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_environment_host::_create_environment_host_output::CreateEnvironmentHostOutputBuilder;
3
4pub use crate::operation::create_environment_host::_create_environment_host_input::CreateEnvironmentHostInputBuilder;
5
6impl crate::operation::create_environment_host::builders::CreateEnvironmentHostInputBuilder {
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::create_environment_host::CreateEnvironmentHostOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_environment_host::CreateEnvironmentHostError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_environment_host();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateEnvironmentHost`.
24///
25/// <p>Creates an ESXi host and adds it to an Amazon EVS environment. Amazon EVS supports 4-16 hosts per environment.</p>
26/// <p>This action can only be used after the Amazon EVS environment is deployed.</p>
27/// <p>You can use the <code>dedicatedHostId</code> parameter to specify an Amazon EC2 Dedicated Host for ESXi host creation.</p>
28/// <p>You can use the <code>placementGroupId</code> parameter to specify a cluster or partition placement group to launch EC2 instances into.</p><note>
29/// <p>You cannot use the <code>dedicatedHostId</code> and <code>placementGroupId</code> parameters together in the same <code>CreateEnvironmentHost</code> action. This results in a <code>ValidationException</code> response.</p>
30/// </note>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct CreateEnvironmentHostFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::create_environment_host::builders::CreateEnvironmentHostInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::create_environment_host::CreateEnvironmentHostOutput,
40        crate::operation::create_environment_host::CreateEnvironmentHostError,
41    > for CreateEnvironmentHostFluentBuilder
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::create_environment_host::CreateEnvironmentHostOutput,
49            crate::operation::create_environment_host::CreateEnvironmentHostError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl CreateEnvironmentHostFluentBuilder {
56    /// Creates a new `CreateEnvironmentHostFluentBuilder`.
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 CreateEnvironmentHost as a reference.
65    pub fn as_input(&self) -> &crate::operation::create_environment_host::builders::CreateEnvironmentHostInputBuilder {
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::create_environment_host::CreateEnvironmentHostOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::create_environment_host::CreateEnvironmentHostError,
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::create_environment_host::CreateEnvironmentHost::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::create_environment_host::CreateEnvironmentHost::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::create_environment_host::CreateEnvironmentHostOutput,
102        crate::operation::create_environment_host::CreateEnvironmentHostError,
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 host creation 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 host creation 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 host creation 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 for the environment that the host is added to.</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 for the environment that the host is added to.</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 for the environment that the host is added to.</p>
150    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_environment_id()
152    }
153    /// <p>The host that is created and added to the environment.</p>
154    pub fn host(mut self, input: crate::types::HostInfoForCreate) -> Self {
155        self.inner = self.inner.host(input);
156        self
157    }
158    /// <p>The host that is created and added to the environment.</p>
159    pub fn set_host(mut self, input: ::std::option::Option<crate::types::HostInfoForCreate>) -> Self {
160        self.inner = self.inner.set_host(input);
161        self
162    }
163    /// <p>The host that is created and added to the environment.</p>
164    pub fn get_host(&self) -> &::std::option::Option<crate::types::HostInfoForCreate> {
165        self.inner.get_host()
166    }
167}