aws_sdk_drs/operation/update_launch_configuration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_launch_configuration::_update_launch_configuration_output::UpdateLaunchConfigurationOutputBuilder;
3
4pub use crate::operation::update_launch_configuration::_update_launch_configuration_input::UpdateLaunchConfigurationInputBuilder;
5
6impl crate::operation::update_launch_configuration::builders::UpdateLaunchConfigurationInputBuilder {
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::update_launch_configuration::UpdateLaunchConfigurationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_launch_configuration::UpdateLaunchConfigurationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_launch_configuration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateLaunchConfiguration`.
24///
25/// <p>Updates a LaunchConfiguration by Source Server ID.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateLaunchConfigurationFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_launch_configuration::builders::UpdateLaunchConfigurationInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_launch_configuration::UpdateLaunchConfigurationOutput,
35        crate::operation::update_launch_configuration::UpdateLaunchConfigurationError,
36    > for UpdateLaunchConfigurationFluentBuilder
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::update_launch_configuration::UpdateLaunchConfigurationOutput,
44            crate::operation::update_launch_configuration::UpdateLaunchConfigurationError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateLaunchConfigurationFluentBuilder {
51    /// Creates a new `UpdateLaunchConfigurationFluentBuilder`.
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 UpdateLaunchConfiguration as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_launch_configuration::builders::UpdateLaunchConfigurationInputBuilder {
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::update_launch_configuration::UpdateLaunchConfigurationOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_launch_configuration::UpdateLaunchConfigurationError,
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::update_launch_configuration::UpdateLaunchConfiguration::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_launch_configuration::UpdateLaunchConfiguration::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::update_launch_configuration::UpdateLaunchConfigurationOutput,
97        crate::operation::update_launch_configuration::UpdateLaunchConfigurationError,
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 Source Server that we want to retrieve a Launch Configuration for.</p>
112    pub fn source_server_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.source_server_id(input.into());
114        self
115    }
116    /// <p>The ID of the Source Server that we want to retrieve a Launch Configuration for.</p>
117    pub fn set_source_server_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_source_server_id(input);
119        self
120    }
121    /// <p>The ID of the Source Server that we want to retrieve a Launch Configuration for.</p>
122    pub fn get_source_server_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_source_server_id()
124    }
125    /// <p>The name of the launch configuration.</p>
126    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.name(input.into());
128        self
129    }
130    /// <p>The name of the launch configuration.</p>
131    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_name(input);
133        self
134    }
135    /// <p>The name of the launch configuration.</p>
136    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_name()
138    }
139    /// <p>The state of the Recovery Instance in EC2 after the recovery operation.</p>
140    pub fn launch_disposition(mut self, input: crate::types::LaunchDisposition) -> Self {
141        self.inner = self.inner.launch_disposition(input);
142        self
143    }
144    /// <p>The state of the Recovery Instance in EC2 after the recovery operation.</p>
145    pub fn set_launch_disposition(mut self, input: ::std::option::Option<crate::types::LaunchDisposition>) -> Self {
146        self.inner = self.inner.set_launch_disposition(input);
147        self
148    }
149    /// <p>The state of the Recovery Instance in EC2 after the recovery operation.</p>
150    pub fn get_launch_disposition(&self) -> &::std::option::Option<crate::types::LaunchDisposition> {
151        self.inner.get_launch_disposition()
152    }
153    /// <p>Whether Elastic Disaster Recovery should try to automatically choose the instance type that best matches the OS, CPU, and RAM of your Source Server.</p>
154    pub fn target_instance_type_right_sizing_method(mut self, input: crate::types::TargetInstanceTypeRightSizingMethod) -> Self {
155        self.inner = self.inner.target_instance_type_right_sizing_method(input);
156        self
157    }
158    /// <p>Whether Elastic Disaster Recovery should try to automatically choose the instance type that best matches the OS, CPU, and RAM of your Source Server.</p>
159    pub fn set_target_instance_type_right_sizing_method(
160        mut self,
161        input: ::std::option::Option<crate::types::TargetInstanceTypeRightSizingMethod>,
162    ) -> Self {
163        self.inner = self.inner.set_target_instance_type_right_sizing_method(input);
164        self
165    }
166    /// <p>Whether Elastic Disaster Recovery should try to automatically choose the instance type that best matches the OS, CPU, and RAM of your Source Server.</p>
167    pub fn get_target_instance_type_right_sizing_method(&self) -> &::std::option::Option<crate::types::TargetInstanceTypeRightSizingMethod> {
168        self.inner.get_target_instance_type_right_sizing_method()
169    }
170    /// <p>Whether we should copy the Private IP of the Source Server to the Recovery Instance.</p>
171    pub fn copy_private_ip(mut self, input: bool) -> Self {
172        self.inner = self.inner.copy_private_ip(input);
173        self
174    }
175    /// <p>Whether we should copy the Private IP of the Source Server to the Recovery Instance.</p>
176    pub fn set_copy_private_ip(mut self, input: ::std::option::Option<bool>) -> Self {
177        self.inner = self.inner.set_copy_private_ip(input);
178        self
179    }
180    /// <p>Whether we should copy the Private IP of the Source Server to the Recovery Instance.</p>
181    pub fn get_copy_private_ip(&self) -> &::std::option::Option<bool> {
182        self.inner.get_copy_private_ip()
183    }
184    /// <p>Whether we want to copy the tags of the Source Server to the EC2 machine of the Recovery Instance.</p>
185    pub fn copy_tags(mut self, input: bool) -> Self {
186        self.inner = self.inner.copy_tags(input);
187        self
188    }
189    /// <p>Whether we want to copy the tags of the Source Server to the EC2 machine of the Recovery Instance.</p>
190    pub fn set_copy_tags(mut self, input: ::std::option::Option<bool>) -> Self {
191        self.inner = self.inner.set_copy_tags(input);
192        self
193    }
194    /// <p>Whether we want to copy the tags of the Source Server to the EC2 machine of the Recovery Instance.</p>
195    pub fn get_copy_tags(&self) -> &::std::option::Option<bool> {
196        self.inner.get_copy_tags()
197    }
198    /// <p>The licensing configuration to be used for this launch configuration.</p>
199    pub fn licensing(mut self, input: crate::types::Licensing) -> Self {
200        self.inner = self.inner.licensing(input);
201        self
202    }
203    /// <p>The licensing configuration to be used for this launch configuration.</p>
204    pub fn set_licensing(mut self, input: ::std::option::Option<crate::types::Licensing>) -> Self {
205        self.inner = self.inner.set_licensing(input);
206        self
207    }
208    /// <p>The licensing configuration to be used for this launch configuration.</p>
209    pub fn get_licensing(&self) -> &::std::option::Option<crate::types::Licensing> {
210        self.inner.get_licensing()
211    }
212    /// <p>Whether we want to enable post-launch actions for the Source Server.</p>
213    pub fn post_launch_enabled(mut self, input: bool) -> Self {
214        self.inner = self.inner.post_launch_enabled(input);
215        self
216    }
217    /// <p>Whether we want to enable post-launch actions for the Source Server.</p>
218    pub fn set_post_launch_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
219        self.inner = self.inner.set_post_launch_enabled(input);
220        self
221    }
222    /// <p>Whether we want to enable post-launch actions for the Source Server.</p>
223    pub fn get_post_launch_enabled(&self) -> &::std::option::Option<bool> {
224        self.inner.get_post_launch_enabled()
225    }
226    /// <p>Launch into existing instance properties.</p>
227    pub fn launch_into_instance_properties(mut self, input: crate::types::LaunchIntoInstanceProperties) -> Self {
228        self.inner = self.inner.launch_into_instance_properties(input);
229        self
230    }
231    /// <p>Launch into existing instance properties.</p>
232    pub fn set_launch_into_instance_properties(mut self, input: ::std::option::Option<crate::types::LaunchIntoInstanceProperties>) -> Self {
233        self.inner = self.inner.set_launch_into_instance_properties(input);
234        self
235    }
236    /// <p>Launch into existing instance properties.</p>
237    pub fn get_launch_into_instance_properties(&self) -> &::std::option::Option<crate::types::LaunchIntoInstanceProperties> {
238        self.inner.get_launch_into_instance_properties()
239    }
240}