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/ec2-launch-templates.html#manage-launch-template-versions">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. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
129    /// <p>Constraint: Maximum 128 ASCII characters.</p>
130    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.client_token(input.into());
132        self
133    }
134    /// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
135    /// <p>Constraint: Maximum 128 ASCII characters.</p>
136    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.inner = self.inner.set_client_token(input);
138        self
139    }
140    /// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
141    /// <p>Constraint: Maximum 128 ASCII characters.</p>
142    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_client_token()
144    }
145    /// <p>The ID of the launch template.</p>
146    /// <p>You must specify either the launch template ID or the launch template name, but not both.</p>
147    pub fn launch_template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.launch_template_id(input.into());
149        self
150    }
151    /// <p>The ID of the launch template.</p>
152    /// <p>You must specify either the launch template ID or the launch template name, but not both.</p>
153    pub fn set_launch_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_launch_template_id(input);
155        self
156    }
157    /// <p>The ID of the launch template.</p>
158    /// <p>You must specify either the launch template ID or the launch template name, but not both.</p>
159    pub fn get_launch_template_id(&self) -> &::std::option::Option<::std::string::String> {
160        self.inner.get_launch_template_id()
161    }
162    /// <p>The name of the launch template.</p>
163    /// <p>You must specify either the launch template ID or the launch template name, but not both.</p>
164    pub fn launch_template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.inner = self.inner.launch_template_name(input.into());
166        self
167    }
168    /// <p>The name of the launch template.</p>
169    /// <p>You must specify either the launch template ID or the launch template name, but not both.</p>
170    pub fn set_launch_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171        self.inner = self.inner.set_launch_template_name(input);
172        self
173    }
174    /// <p>The name of the launch template.</p>
175    /// <p>You must specify either the launch template ID or the launch template name, but not both.</p>
176    pub fn get_launch_template_name(&self) -> &::std::option::Option<::std::string::String> {
177        self.inner.get_launch_template_name()
178    }
179    /// <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>
180    /// <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>
181    /// <p>If you omit this parameter, the new version contains only the launch parameters that you specify for the new version.</p>
182    pub fn source_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.inner = self.inner.source_version(input.into());
184        self
185    }
186    /// <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>
187    /// <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>
188    /// <p>If you omit this parameter, the new version contains only the launch parameters that you specify for the new version.</p>
189    pub fn set_source_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190        self.inner = self.inner.set_source_version(input);
191        self
192    }
193    /// <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>
194    /// <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>
195    /// <p>If you omit this parameter, the new version contains only the launch parameters that you specify for the new version.</p>
196    pub fn get_source_version(&self) -> &::std::option::Option<::std::string::String> {
197        self.inner.get_source_version()
198    }
199    /// <p>A description for the version of the launch template.</p>
200    pub fn version_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
201        self.inner = self.inner.version_description(input.into());
202        self
203    }
204    /// <p>A description for the version of the launch template.</p>
205    pub fn set_version_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
206        self.inner = self.inner.set_version_description(input);
207        self
208    }
209    /// <p>A description for the version of the launch template.</p>
210    pub fn get_version_description(&self) -> &::std::option::Option<::std::string::String> {
211        self.inner.get_version_description()
212    }
213    /// <p>The information for the launch template.</p>
214    pub fn launch_template_data(mut self, input: crate::types::RequestLaunchTemplateData) -> Self {
215        self.inner = self.inner.launch_template_data(input);
216        self
217    }
218    /// <p>The information for the launch template.</p>
219    pub fn set_launch_template_data(mut self, input: ::std::option::Option<crate::types::RequestLaunchTemplateData>) -> Self {
220        self.inner = self.inner.set_launch_template_data(input);
221        self
222    }
223    /// <p>The information for the launch template.</p>
224    pub fn get_launch_template_data(&self) -> &::std::option::Option<crate::types::RequestLaunchTemplateData> {
225        self.inner.get_launch_template_data()
226    }
227    /// <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/ec2-launch-templates.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>
228    /// <p>Default: <code>false</code></p>
229    pub fn resolve_alias(mut self, input: bool) -> Self {
230        self.inner = self.inner.resolve_alias(input);
231        self
232    }
233    /// <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/ec2-launch-templates.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>
234    /// <p>Default: <code>false</code></p>
235    pub fn set_resolve_alias(mut self, input: ::std::option::Option<bool>) -> Self {
236        self.inner = self.inner.set_resolve_alias(input);
237        self
238    }
239    /// <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/ec2-launch-templates.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>
240    /// <p>Default: <code>false</code></p>
241    pub fn get_resolve_alias(&self) -> &::std::option::Option<bool> {
242        self.inner.get_resolve_alias()
243    }
244}