aws_sdk_ec2/operation/create_launch_template_version/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_launch_template_version::_create_launch_template_version_output::CreateLaunchTemplateVersionOutputBuilder;
3
4pub use crate::operation::create_launch_template_version::_create_launch_template_version_input::CreateLaunchTemplateVersionInputBuilder;
5
6impl crate::operation::create_launch_template_version::builders::CreateLaunchTemplateVersionInputBuilder {
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_template_version::CreateLaunchTemplateVersionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_launch_template_version::CreateLaunchTemplateVersionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_launch_template_version();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateLaunchTemplateVersion`.
24///
25/// <p>Creates a new version of a launch template. You must specify an existing launch template, either by name or ID. You can determine whether the new version inherits parameters from a source version, and add or overwrite parameters as needed.</p>
26/// <p>Launch template versions are numbered in the order in which they are created. You can't specify, change, or replace the numbering of launch template versions.</p>
27/// <p>Launch templates are immutable; after you create a launch template, you can't modify it. Instead, you can create a new version of the launch template that includes the changes that you require.</p>
28/// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-launch-template-versions.html">Modify a launch template (manage launch template versions)</a> in the <i>Amazon EC2 User Guide</i>.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct CreateLaunchTemplateVersionFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::create_launch_template_version::builders::CreateLaunchTemplateVersionInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::create_launch_template_version::CreateLaunchTemplateVersionOutput,
38        crate::operation::create_launch_template_version::CreateLaunchTemplateVersionError,
39    > for CreateLaunchTemplateVersionFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::create_launch_template_version::CreateLaunchTemplateVersionOutput,
47            crate::operation::create_launch_template_version::CreateLaunchTemplateVersionError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl CreateLaunchTemplateVersionFluentBuilder {
54    /// Creates a new `CreateLaunchTemplateVersionFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the CreateLaunchTemplateVersion as a reference.
63    pub fn as_input(&self) -> &crate::operation::create_launch_template_version::builders::CreateLaunchTemplateVersionInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::create_launch_template_version::CreateLaunchTemplateVersionOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::create_launch_template_version::CreateLaunchTemplateVersionError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::create_launch_template_version::CreateLaunchTemplateVersion::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::create_launch_template_version::CreateLaunchTemplateVersion::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::create_launch_template_version::CreateLaunchTemplateVersionOutput,
100        crate::operation::create_launch_template_version::CreateLaunchTemplateVersionError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
115    pub fn dry_run(mut self, input: bool) -> Self {
116        self.inner = self.inner.dry_run(input);
117        self
118    }
119    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
120    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
121        self.inner = self.inner.set_dry_run(input);
122        self
123    }
124    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
125    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
126        self.inner.get_dry_run()
127    }
128    /// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If a client token isn't specified, a randomly generated token is used in the request to ensure idempotency.</p>
129    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
130    /// <p>Constraint: Maximum 128 ASCII characters.</p>
131    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.inner = self.inner.client_token(input.into());
133        self
134    }
135    /// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If a client token isn't specified, a randomly generated token is used in the request to ensure idempotency.</p>
136    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
137    /// <p>Constraint: Maximum 128 ASCII characters.</p>
138    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_client_token(input);
140        self
141    }
142    /// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If a client token isn't specified, a randomly generated token is used in the request to ensure idempotency.</p>
143    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
144    /// <p>Constraint: Maximum 128 ASCII characters.</p>
145    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
146        self.inner.get_client_token()
147    }
148    /// <p>The ID of the launch template.</p>
149    /// <p>You must specify either the launch template ID or the launch template name, but not both.</p>
150    pub fn launch_template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.inner = self.inner.launch_template_id(input.into());
152        self
153    }
154    /// <p>The ID of the launch template.</p>
155    /// <p>You must specify either the launch template ID or the launch template name, but not both.</p>
156    pub fn set_launch_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157        self.inner = self.inner.set_launch_template_id(input);
158        self
159    }
160    /// <p>The ID of the launch template.</p>
161    /// <p>You must specify either the launch template ID or the launch template name, but not both.</p>
162    pub fn get_launch_template_id(&self) -> &::std::option::Option<::std::string::String> {
163        self.inner.get_launch_template_id()
164    }
165    /// <p>The name of the launch template.</p>
166    /// <p>You must specify either the launch template ID or the launch template name, but not both.</p>
167    pub fn launch_template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168        self.inner = self.inner.launch_template_name(input.into());
169        self
170    }
171    /// <p>The name of the launch template.</p>
172    /// <p>You must specify either the launch template ID or the launch template name, but not both.</p>
173    pub fn set_launch_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174        self.inner = self.inner.set_launch_template_name(input);
175        self
176    }
177    /// <p>The name of the launch template.</p>
178    /// <p>You must specify either the launch template ID or the launch template name, but not both.</p>
179    pub fn get_launch_template_name(&self) -> &::std::option::Option<::std::string::String> {
180        self.inner.get_launch_template_name()
181    }
182    /// <p>The version of the launch template on which to base the new version. Snapshots applied to the block device mapping are ignored when creating a new version unless they are explicitly included.</p>
183    /// <p>If you specify this parameter, the new version inherits the launch parameters from the source version. If you specify additional launch parameters for the new version, they overwrite any corresponding launch parameters inherited from the source version.</p>
184    /// <p>If you omit this parameter, the new version contains only the launch parameters that you specify for the new version.</p>
185    pub fn source_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186        self.inner = self.inner.source_version(input.into());
187        self
188    }
189    /// <p>The version of the launch template on which to base the new version. Snapshots applied to the block device mapping are ignored when creating a new version unless they are explicitly included.</p>
190    /// <p>If you specify this parameter, the new version inherits the launch parameters from the source version. If you specify additional launch parameters for the new version, they overwrite any corresponding launch parameters inherited from the source version.</p>
191    /// <p>If you omit this parameter, the new version contains only the launch parameters that you specify for the new version.</p>
192    pub fn set_source_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193        self.inner = self.inner.set_source_version(input);
194        self
195    }
196    /// <p>The version of the launch template on which to base the new version. Snapshots applied to the block device mapping are ignored when creating a new version unless they are explicitly included.</p>
197    /// <p>If you specify this parameter, the new version inherits the launch parameters from the source version. If you specify additional launch parameters for the new version, they overwrite any corresponding launch parameters inherited from the source version.</p>
198    /// <p>If you omit this parameter, the new version contains only the launch parameters that you specify for the new version.</p>
199    pub fn get_source_version(&self) -> &::std::option::Option<::std::string::String> {
200        self.inner.get_source_version()
201    }
202    /// <p>A description for the version of the launch template.</p>
203    pub fn version_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
204        self.inner = self.inner.version_description(input.into());
205        self
206    }
207    /// <p>A description for the version of the launch template.</p>
208    pub fn set_version_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
209        self.inner = self.inner.set_version_description(input);
210        self
211    }
212    /// <p>A description for the version of the launch template.</p>
213    pub fn get_version_description(&self) -> &::std::option::Option<::std::string::String> {
214        self.inner.get_version_description()
215    }
216    /// <p>The information for the launch template.</p>
217    pub fn launch_template_data(mut self, input: crate::types::RequestLaunchTemplateData) -> Self {
218        self.inner = self.inner.launch_template_data(input);
219        self
220    }
221    /// <p>The information for the launch template.</p>
222    pub fn set_launch_template_data(mut self, input: ::std::option::Option<crate::types::RequestLaunchTemplateData>) -> Self {
223        self.inner = self.inner.set_launch_template_data(input);
224        self
225    }
226    /// <p>The information for the launch template.</p>
227    pub fn get_launch_template_data(&self) -> &::std::option::Option<crate::types::RequestLaunchTemplateData> {
228        self.inner.get_launch_template_data()
229    }
230    /// <p>If <code>true</code>, and if a Systems Manager parameter is specified for <code>ImageId</code>, the AMI ID is displayed in the response for <code>imageID</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-launch-template.html#use-an-ssm-parameter-instead-of-an-ami-id">Use a Systems Manager parameter instead of an AMI ID</a> in the <i>Amazon EC2 User Guide</i>.</p>
231    /// <p>Default: <code>false</code></p>
232    pub fn resolve_alias(mut self, input: bool) -> Self {
233        self.inner = self.inner.resolve_alias(input);
234        self
235    }
236    /// <p>If <code>true</code>, and if a Systems Manager parameter is specified for <code>ImageId</code>, the AMI ID is displayed in the response for <code>imageID</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-launch-template.html#use-an-ssm-parameter-instead-of-an-ami-id">Use a Systems Manager parameter instead of an AMI ID</a> in the <i>Amazon EC2 User Guide</i>.</p>
237    /// <p>Default: <code>false</code></p>
238    pub fn set_resolve_alias(mut self, input: ::std::option::Option<bool>) -> Self {
239        self.inner = self.inner.set_resolve_alias(input);
240        self
241    }
242    /// <p>If <code>true</code>, and if a Systems Manager parameter is specified for <code>ImageId</code>, the AMI ID is displayed in the response for <code>imageID</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-launch-template.html#use-an-ssm-parameter-instead-of-an-ami-id">Use a Systems Manager parameter instead of an AMI ID</a> in the <i>Amazon EC2 User Guide</i>.</p>
243    /// <p>Default: <code>false</code></p>
244    pub fn get_resolve_alias(&self) -> &::std::option::Option<bool> {
245        self.inner.get_resolve_alias()
246    }
247}