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. All Amazon EVS hosts are created with the latest AMI release version for the respective VCF version of the environment.</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> <note>
31/// <p>EC2 instances created through Amazon EVS do not support associating an IAM instance profile.</p>
32/// </note>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct CreateEnvironmentHostFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::create_environment_host::builders::CreateEnvironmentHostInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::create_environment_host::CreateEnvironmentHostOutput,
42        crate::operation::create_environment_host::CreateEnvironmentHostError,
43    > for CreateEnvironmentHostFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<
50            crate::operation::create_environment_host::CreateEnvironmentHostOutput,
51            crate::operation::create_environment_host::CreateEnvironmentHostError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl CreateEnvironmentHostFluentBuilder {
58    /// Creates a new `CreateEnvironmentHostFluentBuilder`.
59    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60        Self {
61            handle,
62            inner: ::std::default::Default::default(),
63            config_override: ::std::option::Option::None,
64        }
65    }
66    /// Access the CreateEnvironmentHost as a reference.
67    pub fn as_input(&self) -> &crate::operation::create_environment_host::builders::CreateEnvironmentHostInputBuilder {
68        &self.inner
69    }
70    /// Sends the request and returns the response.
71    ///
72    /// If an error occurs, an `SdkError` will be returned with additional details that
73    /// can be matched against.
74    ///
75    /// By default, any retryable failures will be retried twice. Retry behavior
76    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77    /// set when configuring the client.
78    pub async fn send(
79        self,
80    ) -> ::std::result::Result<
81        crate::operation::create_environment_host::CreateEnvironmentHostOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::create_environment_host::CreateEnvironmentHostError,
84            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85        >,
86    > {
87        let input = self
88            .inner
89            .build()
90            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91        let runtime_plugins = crate::operation::create_environment_host::CreateEnvironmentHost::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::create_environment_host::CreateEnvironmentHost::orchestrate(&runtime_plugins, input).await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::create_environment_host::CreateEnvironmentHostOutput,
104        crate::operation::create_environment_host::CreateEnvironmentHostError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118    /// <note>
119    /// <p>This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect.</p>
120    /// </note>
121    /// <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>
122    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.inner = self.inner.client_token(input.into());
124        self
125    }
126    /// <note>
127    /// <p>This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect.</p>
128    /// </note>
129    /// <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>
130    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.inner = self.inner.set_client_token(input);
132        self
133    }
134    /// <note>
135    /// <p>This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect.</p>
136    /// </note>
137    /// <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>
138    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_client_token()
140    }
141    /// <p>A unique ID for the environment that the host is added to.</p>
142    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.environment_id(input.into());
144        self
145    }
146    /// <p>A unique ID for the environment that the host is added to.</p>
147    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_environment_id(input);
149        self
150    }
151    /// <p>A unique ID for the environment that the host is added to.</p>
152    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_environment_id()
154    }
155    /// <p>The host that is created and added to the environment.</p>
156    pub fn host(mut self, input: crate::types::HostInfoForCreate) -> Self {
157        self.inner = self.inner.host(input);
158        self
159    }
160    /// <p>The host that is created and added to the environment.</p>
161    pub fn set_host(mut self, input: ::std::option::Option<crate::types::HostInfoForCreate>) -> Self {
162        self.inner = self.inner.set_host(input);
163        self
164    }
165    /// <p>The host that is created and added to the environment.</p>
166    pub fn get_host(&self) -> &::std::option::Option<crate::types::HostInfoForCreate> {
167        self.inner.get_host()
168    }
169}