aws_sdk_drs/operation/create_launch_configuration_template/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_launch_configuration_template::_create_launch_configuration_template_output::CreateLaunchConfigurationTemplateOutputBuilder;
3
4pub use crate::operation::create_launch_configuration_template::_create_launch_configuration_template_input::CreateLaunchConfigurationTemplateInputBuilder;
5
6impl crate::operation::create_launch_configuration_template::builders::CreateLaunchConfigurationTemplateInputBuilder {
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_launch_configuration_template::CreateLaunchConfigurationTemplateOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_launch_configuration_template::CreateLaunchConfigurationTemplateError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_launch_configuration_template();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateLaunchConfigurationTemplate`.
24///
25/// <p>Creates a new Launch Configuration Template.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateLaunchConfigurationTemplateFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_launch_configuration_template::builders::CreateLaunchConfigurationTemplateInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_launch_configuration_template::CreateLaunchConfigurationTemplateOutput,
35        crate::operation::create_launch_configuration_template::CreateLaunchConfigurationTemplateError,
36    > for CreateLaunchConfigurationTemplateFluentBuilder
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::create_launch_configuration_template::CreateLaunchConfigurationTemplateOutput,
44            crate::operation::create_launch_configuration_template::CreateLaunchConfigurationTemplateError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateLaunchConfigurationTemplateFluentBuilder {
51    /// Creates a new `CreateLaunchConfigurationTemplateFluentBuilder`.
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 CreateLaunchConfigurationTemplate as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_launch_configuration_template::builders::CreateLaunchConfigurationTemplateInputBuilder {
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::create_launch_configuration_template::CreateLaunchConfigurationTemplateOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_launch_configuration_template::CreateLaunchConfigurationTemplateError,
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::create_launch_configuration_template::CreateLaunchConfigurationTemplate::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_launch_configuration_template::CreateLaunchConfigurationTemplate::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::create_launch_configuration_template::CreateLaunchConfigurationTemplateOutput,
97        crate::operation::create_launch_configuration_template::CreateLaunchConfigurationTemplateError,
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    ///
112    /// Adds a key-value pair to `tags`.
113    ///
114    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
115    ///
116    /// <p>Request to associate tags during creation of a Launch Configuration Template.</p>
117    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.inner = self.inner.tags(k.into(), v.into());
119        self
120    }
121    /// <p>Request to associate tags during creation of a Launch Configuration Template.</p>
122    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
123        self.inner = self.inner.set_tags(input);
124        self
125    }
126    /// <p>Request to associate tags during creation of a Launch Configuration Template.</p>
127    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
128        self.inner.get_tags()
129    }
130    /// <p>Launch disposition.</p>
131    pub fn launch_disposition(mut self, input: crate::types::LaunchDisposition) -> Self {
132        self.inner = self.inner.launch_disposition(input);
133        self
134    }
135    /// <p>Launch disposition.</p>
136    pub fn set_launch_disposition(mut self, input: ::std::option::Option<crate::types::LaunchDisposition>) -> Self {
137        self.inner = self.inner.set_launch_disposition(input);
138        self
139    }
140    /// <p>Launch disposition.</p>
141    pub fn get_launch_disposition(&self) -> &::std::option::Option<crate::types::LaunchDisposition> {
142        self.inner.get_launch_disposition()
143    }
144    /// <p>Target instance type right-sizing method.</p>
145    pub fn target_instance_type_right_sizing_method(mut self, input: crate::types::TargetInstanceTypeRightSizingMethod) -> Self {
146        self.inner = self.inner.target_instance_type_right_sizing_method(input);
147        self
148    }
149    /// <p>Target instance type right-sizing method.</p>
150    pub fn set_target_instance_type_right_sizing_method(
151        mut self,
152        input: ::std::option::Option<crate::types::TargetInstanceTypeRightSizingMethod>,
153    ) -> Self {
154        self.inner = self.inner.set_target_instance_type_right_sizing_method(input);
155        self
156    }
157    /// <p>Target instance type right-sizing method.</p>
158    pub fn get_target_instance_type_right_sizing_method(&self) -> &::std::option::Option<crate::types::TargetInstanceTypeRightSizingMethod> {
159        self.inner.get_target_instance_type_right_sizing_method()
160    }
161    /// <p>Copy private IP.</p>
162    pub fn copy_private_ip(mut self, input: bool) -> Self {
163        self.inner = self.inner.copy_private_ip(input);
164        self
165    }
166    /// <p>Copy private IP.</p>
167    pub fn set_copy_private_ip(mut self, input: ::std::option::Option<bool>) -> Self {
168        self.inner = self.inner.set_copy_private_ip(input);
169        self
170    }
171    /// <p>Copy private IP.</p>
172    pub fn get_copy_private_ip(&self) -> &::std::option::Option<bool> {
173        self.inner.get_copy_private_ip()
174    }
175    /// <p>Copy tags.</p>
176    pub fn copy_tags(mut self, input: bool) -> Self {
177        self.inner = self.inner.copy_tags(input);
178        self
179    }
180    /// <p>Copy tags.</p>
181    pub fn set_copy_tags(mut self, input: ::std::option::Option<bool>) -> Self {
182        self.inner = self.inner.set_copy_tags(input);
183        self
184    }
185    /// <p>Copy tags.</p>
186    pub fn get_copy_tags(&self) -> &::std::option::Option<bool> {
187        self.inner.get_copy_tags()
188    }
189    /// <p>Licensing.</p>
190    pub fn licensing(mut self, input: crate::types::Licensing) -> Self {
191        self.inner = self.inner.licensing(input);
192        self
193    }
194    /// <p>Licensing.</p>
195    pub fn set_licensing(mut self, input: ::std::option::Option<crate::types::Licensing>) -> Self {
196        self.inner = self.inner.set_licensing(input);
197        self
198    }
199    /// <p>Licensing.</p>
200    pub fn get_licensing(&self) -> &::std::option::Option<crate::types::Licensing> {
201        self.inner.get_licensing()
202    }
203    /// <p>S3 bucket ARN to export Source Network templates.</p>
204    pub fn export_bucket_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205        self.inner = self.inner.export_bucket_arn(input.into());
206        self
207    }
208    /// <p>S3 bucket ARN to export Source Network templates.</p>
209    pub fn set_export_bucket_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210        self.inner = self.inner.set_export_bucket_arn(input);
211        self
212    }
213    /// <p>S3 bucket ARN to export Source Network templates.</p>
214    pub fn get_export_bucket_arn(&self) -> &::std::option::Option<::std::string::String> {
215        self.inner.get_export_bucket_arn()
216    }
217    /// <p>Whether we want to activate post-launch actions.</p>
218    pub fn post_launch_enabled(mut self, input: bool) -> Self {
219        self.inner = self.inner.post_launch_enabled(input);
220        self
221    }
222    /// <p>Whether we want to activate post-launch actions.</p>
223    pub fn set_post_launch_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
224        self.inner = self.inner.set_post_launch_enabled(input);
225        self
226    }
227    /// <p>Whether we want to activate post-launch actions.</p>
228    pub fn get_post_launch_enabled(&self) -> &::std::option::Option<bool> {
229        self.inner.get_post_launch_enabled()
230    }
231    /// <p>DRS will set the 'launch into instance ID' of any source server when performing a drill, recovery or failback to the previous region or availability zone, using the instance ID of the source instance.</p>
232    pub fn launch_into_source_instance(mut self, input: bool) -> Self {
233        self.inner = self.inner.launch_into_source_instance(input);
234        self
235    }
236    /// <p>DRS will set the 'launch into instance ID' of any source server when performing a drill, recovery or failback to the previous region or availability zone, using the instance ID of the source instance.</p>
237    pub fn set_launch_into_source_instance(mut self, input: ::std::option::Option<bool>) -> Self {
238        self.inner = self.inner.set_launch_into_source_instance(input);
239        self
240    }
241    /// <p>DRS will set the 'launch into instance ID' of any source server when performing a drill, recovery or failback to the previous region or availability zone, using the instance ID of the source instance.</p>
242    pub fn get_launch_into_source_instance(&self) -> &::std::option::Option<bool> {
243        self.inner.get_launch_into_source_instance()
244    }
245}