aws_sdk_ec2/operation/describe_launch_template_versions/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_launch_template_versions::_describe_launch_template_versions_output::DescribeLaunchTemplateVersionsOutputBuilder;
3
4pub use crate::operation::describe_launch_template_versions::_describe_launch_template_versions_input::DescribeLaunchTemplateVersionsInputBuilder;
5
6impl crate::operation::describe_launch_template_versions::builders::DescribeLaunchTemplateVersionsInputBuilder {
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::describe_launch_template_versions::DescribeLaunchTemplateVersionsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::describe_launch_template_versions::DescribeLaunchTemplateVersionsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.describe_launch_template_versions();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DescribeLaunchTemplateVersions`.
24///
25/// <p>Describes one or more versions of a specified launch template. You can describe all versions, individual versions, or a range of versions. You can also describe all the latest versions or all the default versions of all the launch templates in your account.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct DescribeLaunchTemplateVersionsFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::describe_launch_template_versions::builders::DescribeLaunchTemplateVersionsInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::describe_launch_template_versions::DescribeLaunchTemplateVersionsOutput,
35 crate::operation::describe_launch_template_versions::DescribeLaunchTemplateVersionsError,
36 > for DescribeLaunchTemplateVersionsFluentBuilder
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::describe_launch_template_versions::DescribeLaunchTemplateVersionsOutput,
44 crate::operation::describe_launch_template_versions::DescribeLaunchTemplateVersionsError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl DescribeLaunchTemplateVersionsFluentBuilder {
51 /// Creates a new `DescribeLaunchTemplateVersionsFluentBuilder`.
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 DescribeLaunchTemplateVersions as a reference.
60 pub fn as_input(&self) -> &crate::operation::describe_launch_template_versions::builders::DescribeLaunchTemplateVersionsInputBuilder {
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::describe_launch_template_versions::DescribeLaunchTemplateVersionsOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::describe_launch_template_versions::DescribeLaunchTemplateVersionsError,
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::describe_launch_template_versions::DescribeLaunchTemplateVersions::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::describe_launch_template_versions::DescribeLaunchTemplateVersions::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::describe_launch_template_versions::DescribeLaunchTemplateVersionsOutput,
97 crate::operation::describe_launch_template_versions::DescribeLaunchTemplateVersionsError,
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 /// Create a paginator for this request
112 ///
113 /// Paginators are used by calling [`send().await`](crate::operation::describe_launch_template_versions::paginator::DescribeLaunchTemplateVersionsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
114 pub fn into_paginator(self) -> crate::operation::describe_launch_template_versions::paginator::DescribeLaunchTemplateVersionsPaginator {
115 crate::operation::describe_launch_template_versions::paginator::DescribeLaunchTemplateVersionsPaginator::new(self.handle, self.inner)
116 }
117 /// <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>
118 pub fn dry_run(mut self, input: bool) -> Self {
119 self.inner = self.inner.dry_run(input);
120 self
121 }
122 /// <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>
123 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
124 self.inner = self.inner.set_dry_run(input);
125 self
126 }
127 /// <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>
128 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
129 self.inner.get_dry_run()
130 }
131 /// <p>The ID of the launch template.</p>
132 /// <p>To describe one or more versions of a specified launch template, you must specify either the launch template ID or the launch template name, but not both.</p>
133 /// <p>To describe all the latest or default launch template versions in your account, you must omit this parameter.</p>
134 pub fn launch_template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135 self.inner = self.inner.launch_template_id(input.into());
136 self
137 }
138 /// <p>The ID of the launch template.</p>
139 /// <p>To describe one or more versions of a specified launch template, you must specify either the launch template ID or the launch template name, but not both.</p>
140 /// <p>To describe all the latest or default launch template versions in your account, you must omit this parameter.</p>
141 pub fn set_launch_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142 self.inner = self.inner.set_launch_template_id(input);
143 self
144 }
145 /// <p>The ID of the launch template.</p>
146 /// <p>To describe one or more versions of a specified launch template, you must specify either the launch template ID or the launch template name, but not both.</p>
147 /// <p>To describe all the latest or default launch template versions in your account, you must omit this parameter.</p>
148 pub fn get_launch_template_id(&self) -> &::std::option::Option<::std::string::String> {
149 self.inner.get_launch_template_id()
150 }
151 /// <p>The name of the launch template.</p>
152 /// <p>To describe one or more versions of a specified launch template, you must specify either the launch template name or the launch template ID, but not both.</p>
153 /// <p>To describe all the latest or default launch template versions in your account, you must omit this parameter.</p>
154 pub fn launch_template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155 self.inner = self.inner.launch_template_name(input.into());
156 self
157 }
158 /// <p>The name of the launch template.</p>
159 /// <p>To describe one or more versions of a specified launch template, you must specify either the launch template name or the launch template ID, but not both.</p>
160 /// <p>To describe all the latest or default launch template versions in your account, you must omit this parameter.</p>
161 pub fn set_launch_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162 self.inner = self.inner.set_launch_template_name(input);
163 self
164 }
165 /// <p>The name of the launch template.</p>
166 /// <p>To describe one or more versions of a specified launch template, you must specify either the launch template name or the launch template ID, but not both.</p>
167 /// <p>To describe all the latest or default launch template versions in your account, you must omit this parameter.</p>
168 pub fn get_launch_template_name(&self) -> &::std::option::Option<::std::string::String> {
169 self.inner.get_launch_template_name()
170 }
171 ///
172 /// Appends an item to `Versions`.
173 ///
174 /// To override the contents of this collection use [`set_versions`](Self::set_versions).
175 ///
176 /// <p>One or more versions of the launch template. Valid values depend on whether you are describing a specified launch template (by ID or name) or all launch templates in your account.</p>
177 /// <p>To describe one or more versions of a specified launch template, valid values are <code>$Latest</code>, <code>$Default</code>, and numbers.</p>
178 /// <p>To describe all launch templates in your account that are defined as the latest version, the valid value is <code>$Latest</code>. To describe all launch templates in your account that are defined as the default version, the valid value is <code>$Default</code>. You can specify <code>$Latest</code> and <code>$Default</code> in the same request. You cannot specify numbers.</p>
179 pub fn versions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180 self.inner = self.inner.versions(input.into());
181 self
182 }
183 /// <p>One or more versions of the launch template. Valid values depend on whether you are describing a specified launch template (by ID or name) or all launch templates in your account.</p>
184 /// <p>To describe one or more versions of a specified launch template, valid values are <code>$Latest</code>, <code>$Default</code>, and numbers.</p>
185 /// <p>To describe all launch templates in your account that are defined as the latest version, the valid value is <code>$Latest</code>. To describe all launch templates in your account that are defined as the default version, the valid value is <code>$Default</code>. You can specify <code>$Latest</code> and <code>$Default</code> in the same request. You cannot specify numbers.</p>
186 pub fn set_versions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
187 self.inner = self.inner.set_versions(input);
188 self
189 }
190 /// <p>One or more versions of the launch template. Valid values depend on whether you are describing a specified launch template (by ID or name) or all launch templates in your account.</p>
191 /// <p>To describe one or more versions of a specified launch template, valid values are <code>$Latest</code>, <code>$Default</code>, and numbers.</p>
192 /// <p>To describe all launch templates in your account that are defined as the latest version, the valid value is <code>$Latest</code>. To describe all launch templates in your account that are defined as the default version, the valid value is <code>$Default</code>. You can specify <code>$Latest</code> and <code>$Default</code> in the same request. You cannot specify numbers.</p>
193 pub fn get_versions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
194 self.inner.get_versions()
195 }
196 /// <p>The version number after which to describe launch template versions.</p>
197 pub fn min_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198 self.inner = self.inner.min_version(input.into());
199 self
200 }
201 /// <p>The version number after which to describe launch template versions.</p>
202 pub fn set_min_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203 self.inner = self.inner.set_min_version(input);
204 self
205 }
206 /// <p>The version number after which to describe launch template versions.</p>
207 pub fn get_min_version(&self) -> &::std::option::Option<::std::string::String> {
208 self.inner.get_min_version()
209 }
210 /// <p>The version number up to which to describe launch template versions.</p>
211 pub fn max_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
212 self.inner = self.inner.max_version(input.into());
213 self
214 }
215 /// <p>The version number up to which to describe launch template versions.</p>
216 pub fn set_max_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
217 self.inner = self.inner.set_max_version(input);
218 self
219 }
220 /// <p>The version number up to which to describe launch template versions.</p>
221 pub fn get_max_version(&self) -> &::std::option::Option<::std::string::String> {
222 self.inner.get_max_version()
223 }
224 /// <p>The token to request the next page of results.</p>
225 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
226 self.inner = self.inner.next_token(input.into());
227 self
228 }
229 /// <p>The token to request the next page of results.</p>
230 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
231 self.inner = self.inner.set_next_token(input);
232 self
233 }
234 /// <p>The token to request the next page of results.</p>
235 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
236 self.inner.get_next_token()
237 }
238 /// <p>The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned <code>NextToken</code> value. This value can be between 1 and 200.</p>
239 pub fn max_results(mut self, input: i32) -> Self {
240 self.inner = self.inner.max_results(input);
241 self
242 }
243 /// <p>The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned <code>NextToken</code> value. This value can be between 1 and 200.</p>
244 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
245 self.inner = self.inner.set_max_results(input);
246 self
247 }
248 /// <p>The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned <code>NextToken</code> value. This value can be between 1 and 200.</p>
249 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
250 self.inner.get_max_results()
251 }
252 ///
253 /// Appends an item to `Filters`.
254 ///
255 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
256 ///
257 /// <p>One or more filters.</p>
258 /// <ul>
259 /// <li>
260 /// <p><code>create-time</code> - The time the launch template version was created.</p></li>
261 /// <li>
262 /// <p><code>ebs-optimized</code> - A boolean that indicates whether the instance is optimized for Amazon EBS I/O.</p></li>
263 /// <li>
264 /// <p><code>http-endpoint</code> - Indicates whether the HTTP metadata endpoint on your instances is enabled (<code>enabled</code> | <code>disabled</code>).</p></li>
265 /// <li>
266 /// <p><code>http-protocol-ipv4</code> - Indicates whether the IPv4 endpoint for the instance metadata service is enabled (<code>enabled</code> | <code>disabled</code>).</p></li>
267 /// <li>
268 /// <p><code>host-resource-group-arn</code> - The ARN of the host resource group in which to launch the instances.</p></li>
269 /// <li>
270 /// <p><code>http-tokens</code> - The state of token usage for your instance metadata requests (<code>optional</code> | <code>required</code>).</p></li>
271 /// <li>
272 /// <p><code>iam-instance-profile</code> - The ARN of the IAM instance profile.</p></li>
273 /// <li>
274 /// <p><code>image-id</code> - The ID of the AMI.</p></li>
275 /// <li>
276 /// <p><code>instance-type</code> - The instance type.</p></li>
277 /// <li>
278 /// <p><code>is-default-version</code> - A boolean that indicates whether the launch template version is the default version.</p></li>
279 /// <li>
280 /// <p><code>kernel-id</code> - The kernel ID.</p></li>
281 /// <li>
282 /// <p><code>license-configuration-arn</code> - The ARN of the license configuration.</p></li>
283 /// <li>
284 /// <p><code>network-card-index</code> - The index of the network card.</p></li>
285 /// <li>
286 /// <p><code>ram-disk-id</code> - The RAM disk ID.</p></li>
287 /// </ul>
288 pub fn filters(mut self, input: crate::types::Filter) -> Self {
289 self.inner = self.inner.filters(input);
290 self
291 }
292 /// <p>One or more filters.</p>
293 /// <ul>
294 /// <li>
295 /// <p><code>create-time</code> - The time the launch template version was created.</p></li>
296 /// <li>
297 /// <p><code>ebs-optimized</code> - A boolean that indicates whether the instance is optimized for Amazon EBS I/O.</p></li>
298 /// <li>
299 /// <p><code>http-endpoint</code> - Indicates whether the HTTP metadata endpoint on your instances is enabled (<code>enabled</code> | <code>disabled</code>).</p></li>
300 /// <li>
301 /// <p><code>http-protocol-ipv4</code> - Indicates whether the IPv4 endpoint for the instance metadata service is enabled (<code>enabled</code> | <code>disabled</code>).</p></li>
302 /// <li>
303 /// <p><code>host-resource-group-arn</code> - The ARN of the host resource group in which to launch the instances.</p></li>
304 /// <li>
305 /// <p><code>http-tokens</code> - The state of token usage for your instance metadata requests (<code>optional</code> | <code>required</code>).</p></li>
306 /// <li>
307 /// <p><code>iam-instance-profile</code> - The ARN of the IAM instance profile.</p></li>
308 /// <li>
309 /// <p><code>image-id</code> - The ID of the AMI.</p></li>
310 /// <li>
311 /// <p><code>instance-type</code> - The instance type.</p></li>
312 /// <li>
313 /// <p><code>is-default-version</code> - A boolean that indicates whether the launch template version is the default version.</p></li>
314 /// <li>
315 /// <p><code>kernel-id</code> - The kernel ID.</p></li>
316 /// <li>
317 /// <p><code>license-configuration-arn</code> - The ARN of the license configuration.</p></li>
318 /// <li>
319 /// <p><code>network-card-index</code> - The index of the network card.</p></li>
320 /// <li>
321 /// <p><code>ram-disk-id</code> - The RAM disk ID.</p></li>
322 /// </ul>
323 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
324 self.inner = self.inner.set_filters(input);
325 self
326 }
327 /// <p>One or more filters.</p>
328 /// <ul>
329 /// <li>
330 /// <p><code>create-time</code> - The time the launch template version was created.</p></li>
331 /// <li>
332 /// <p><code>ebs-optimized</code> - A boolean that indicates whether the instance is optimized for Amazon EBS I/O.</p></li>
333 /// <li>
334 /// <p><code>http-endpoint</code> - Indicates whether the HTTP metadata endpoint on your instances is enabled (<code>enabled</code> | <code>disabled</code>).</p></li>
335 /// <li>
336 /// <p><code>http-protocol-ipv4</code> - Indicates whether the IPv4 endpoint for the instance metadata service is enabled (<code>enabled</code> | <code>disabled</code>).</p></li>
337 /// <li>
338 /// <p><code>host-resource-group-arn</code> - The ARN of the host resource group in which to launch the instances.</p></li>
339 /// <li>
340 /// <p><code>http-tokens</code> - The state of token usage for your instance metadata requests (<code>optional</code> | <code>required</code>).</p></li>
341 /// <li>
342 /// <p><code>iam-instance-profile</code> - The ARN of the IAM instance profile.</p></li>
343 /// <li>
344 /// <p><code>image-id</code> - The ID of the AMI.</p></li>
345 /// <li>
346 /// <p><code>instance-type</code> - The instance type.</p></li>
347 /// <li>
348 /// <p><code>is-default-version</code> - A boolean that indicates whether the launch template version is the default version.</p></li>
349 /// <li>
350 /// <p><code>kernel-id</code> - The kernel ID.</p></li>
351 /// <li>
352 /// <p><code>license-configuration-arn</code> - The ARN of the license configuration.</p></li>
353 /// <li>
354 /// <p><code>network-card-index</code> - The index of the network card.</p></li>
355 /// <li>
356 /// <p><code>ram-disk-id</code> - The RAM disk ID.</p></li>
357 /// </ul>
358 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
359 self.inner.get_filters()
360 }
361 /// <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>.</p>
362 /// <p>If <code>false</code>, and if a Systems Manager parameter is specified for <code>ImageId</code>, the parameter is displayed in the response for <code>imageId</code>.</p>
363 /// <p>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>
364 /// <p>Default: <code>false</code></p>
365 pub fn resolve_alias(mut self, input: bool) -> Self {
366 self.inner = self.inner.resolve_alias(input);
367 self
368 }
369 /// <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>.</p>
370 /// <p>If <code>false</code>, and if a Systems Manager parameter is specified for <code>ImageId</code>, the parameter is displayed in the response for <code>imageId</code>.</p>
371 /// <p>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>
372 /// <p>Default: <code>false</code></p>
373 pub fn set_resolve_alias(mut self, input: ::std::option::Option<bool>) -> Self {
374 self.inner = self.inner.set_resolve_alias(input);
375 self
376 }
377 /// <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>.</p>
378 /// <p>If <code>false</code>, and if a Systems Manager parameter is specified for <code>ImageId</code>, the parameter is displayed in the response for <code>imageId</code>.</p>
379 /// <p>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>
380 /// <p>Default: <code>false</code></p>
381 pub fn get_resolve_alias(&self) -> &::std::option::Option<bool> {
382 self.inner.get_resolve_alias()
383 }
384}