aws_sdk_ec2/operation/copy_image/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::copy_image::_copy_image_output::CopyImageOutputBuilder;
3
4pub use crate::operation::copy_image::_copy_image_input::CopyImageInputBuilder;
5
6impl crate::operation::copy_image::builders::CopyImageInputBuilder {
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::copy_image::CopyImageOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::copy_image::CopyImageError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.copy_image();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CopyImage`.
24///
25/// <p>Initiates an AMI copy operation. You must specify the source AMI ID and both the source and destination locations. The copy operation must be initiated in the destination Region.</p>
26/// <p class="title"><b>CopyImage supports the following source to destination copies:</b></p>
27/// <ul>
28/// <li>
29/// <p>Region to Region</p></li>
30/// <li>
31/// <p>Region to Outpost</p></li>
32/// <li>
33/// <p>Parent Region to Local Zone</p></li>
34/// <li>
35/// <p>Local Zone to parent Region</p></li>
36/// <li>
37/// <p>Between Local Zones with the same parent Region (only supported for certain Local Zones)</p></li>
38/// </ul>
39/// <p class="title"><b>CopyImage does not support the following source to destination copies:</b></p>
40/// <ul>
41/// <li>
42/// <p>Local Zone to non-parent Regions</p></li>
43/// <li>
44/// <p>Between Local Zones with different parent Regions</p></li>
45/// <li>
46/// <p>Local Zone to Outpost</p></li>
47/// <li>
48/// <p>Outpost to Local Zone</p></li>
49/// <li>
50/// <p>Outpost to Region</p></li>
51/// <li>
52/// <p>Between Outposts</p></li>
53/// <li>
54/// <p>Within same Outpost</p></li>
55/// <li>
56/// <p>Cross-partition copies (use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateStoreImageTask.html">CreateStoreImageTask</a> instead)</p></li>
57/// </ul>
58/// <p class="title"><b>Destination specification</b></p>
59/// <ul>
60/// <li>
61/// <p>Region to Region: The destination Region is the Region in which you initiate the copy operation.</p></li>
62/// <li>
63/// <p>Region to Outpost: Specify the destination using the <code>DestinationOutpostArn</code> parameter (the ARN of the Outpost)</p></li>
64/// <li>
65/// <p>Region to Local Zone, and Local Zone to Local Zone copies: Specify the destination using the <code>DestinationAvailabilityZone</code> parameter (the name of the destination Local Zone) or <code>DestinationAvailabilityZoneId</code> parameter (the ID of the destination Local Zone).</p></li>
66/// </ul>
67/// <p class="title"><b>Snapshot encryption</b></p>
68/// <ul>
69/// <li>
70/// <p>Region to Outpost: Backing snapshots copied to an Outpost are encrypted by default using the default encryption key for the Region or the key that you specify. Outposts do not support unencrypted snapshots.</p></li>
71/// <li>
72/// <p>Region to Local Zone, and Local Zone to Local Zone: Not all Local Zones require encrypted snapshots. In Local Zones that require encrypted snapshots, backing snapshots are automatically encrypted during copy. In Local Zones where encryption is not required, snapshots retain their original encryption state (encrypted or unencrypted) by default.</p></li>
73/// </ul>
74/// <p>For more information, including the required permissions for copying an AMI, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/CopyingAMIs.html">Copy an Amazon EC2 AMI</a> in the <i>Amazon EC2 User Guide</i>.</p>
75#[derive(::std::clone::Clone, ::std::fmt::Debug)]
76pub struct CopyImageFluentBuilder {
77 handle: ::std::sync::Arc<crate::client::Handle>,
78 inner: crate::operation::copy_image::builders::CopyImageInputBuilder,
79 config_override: ::std::option::Option<crate::config::Builder>,
80}
81impl crate::client::customize::internal::CustomizableSend<crate::operation::copy_image::CopyImageOutput, crate::operation::copy_image::CopyImageError>
82 for CopyImageFluentBuilder
83{
84 fn send(
85 self,
86 config_override: crate::config::Builder,
87 ) -> crate::client::customize::internal::BoxFuture<
88 crate::client::customize::internal::SendResult<crate::operation::copy_image::CopyImageOutput, crate::operation::copy_image::CopyImageError>,
89 > {
90 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
91 }
92}
93impl CopyImageFluentBuilder {
94 /// Creates a new `CopyImageFluentBuilder`.
95 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
96 Self {
97 handle,
98 inner: ::std::default::Default::default(),
99 config_override: ::std::option::Option::None,
100 }
101 }
102 /// Access the CopyImage as a reference.
103 pub fn as_input(&self) -> &crate::operation::copy_image::builders::CopyImageInputBuilder {
104 &self.inner
105 }
106 /// Sends the request and returns the response.
107 ///
108 /// If an error occurs, an `SdkError` will be returned with additional details that
109 /// can be matched against.
110 ///
111 /// By default, any retryable failures will be retried twice. Retry behavior
112 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
113 /// set when configuring the client.
114 pub async fn send(
115 self,
116 ) -> ::std::result::Result<
117 crate::operation::copy_image::CopyImageOutput,
118 ::aws_smithy_runtime_api::client::result::SdkError<
119 crate::operation::copy_image::CopyImageError,
120 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
121 >,
122 > {
123 let input = self
124 .inner
125 .build()
126 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
127 let runtime_plugins = crate::operation::copy_image::CopyImage::operation_runtime_plugins(
128 self.handle.runtime_plugins.clone(),
129 &self.handle.conf,
130 self.config_override,
131 );
132 crate::operation::copy_image::CopyImage::orchestrate(&runtime_plugins, input).await
133 }
134
135 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
136 pub fn customize(
137 self,
138 ) -> crate::client::customize::CustomizableOperation<
139 crate::operation::copy_image::CopyImageOutput,
140 crate::operation::copy_image::CopyImageError,
141 Self,
142 > {
143 crate::client::customize::CustomizableOperation::new(self)
144 }
145 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
146 self.set_config_override(::std::option::Option::Some(config_override.into()));
147 self
148 }
149
150 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
151 self.config_override = config_override;
152 self
153 }
154 /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a> in the <i>Amazon EC2 API Reference</i>.</p>
155 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156 self.inner = self.inner.client_token(input.into());
157 self
158 }
159 /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a> in the <i>Amazon EC2 API Reference</i>.</p>
160 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161 self.inner = self.inner.set_client_token(input);
162 self
163 }
164 /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a> in the <i>Amazon EC2 API Reference</i>.</p>
165 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
166 self.inner.get_client_token()
167 }
168 /// <p>A description for the new AMI.</p>
169 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170 self.inner = self.inner.description(input.into());
171 self
172 }
173 /// <p>A description for the new AMI.</p>
174 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
175 self.inner = self.inner.set_description(input);
176 self
177 }
178 /// <p>A description for the new AMI.</p>
179 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
180 self.inner.get_description()
181 }
182 /// <p>Specifies whether to encrypt the snapshots of the copied image.</p>
183 /// <p>You can encrypt a copy of an unencrypted snapshot, but you cannot create an unencrypted copy of an encrypted snapshot. The default KMS key for Amazon EBS is used unless you specify a non-default Key Management Service (KMS) KMS key using <code>KmsKeyId</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIEncryption.html">Use encryption with EBS-backed AMIs</a> in the <i>Amazon EC2 User Guide</i>.</p>
184 pub fn encrypted(mut self, input: bool) -> Self {
185 self.inner = self.inner.encrypted(input);
186 self
187 }
188 /// <p>Specifies whether to encrypt the snapshots of the copied image.</p>
189 /// <p>You can encrypt a copy of an unencrypted snapshot, but you cannot create an unencrypted copy of an encrypted snapshot. The default KMS key for Amazon EBS is used unless you specify a non-default Key Management Service (KMS) KMS key using <code>KmsKeyId</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIEncryption.html">Use encryption with EBS-backed AMIs</a> in the <i>Amazon EC2 User Guide</i>.</p>
190 pub fn set_encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
191 self.inner = self.inner.set_encrypted(input);
192 self
193 }
194 /// <p>Specifies whether to encrypt the snapshots of the copied image.</p>
195 /// <p>You can encrypt a copy of an unencrypted snapshot, but you cannot create an unencrypted copy of an encrypted snapshot. The default KMS key for Amazon EBS is used unless you specify a non-default Key Management Service (KMS) KMS key using <code>KmsKeyId</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIEncryption.html">Use encryption with EBS-backed AMIs</a> in the <i>Amazon EC2 User Guide</i>.</p>
196 pub fn get_encrypted(&self) -> &::std::option::Option<bool> {
197 self.inner.get_encrypted()
198 }
199 /// <p>The identifier of the symmetric Key Management Service (KMS) KMS key to use when creating encrypted volumes. If this parameter is not specified, your Amazon Web Services managed KMS key for Amazon EBS is used. If you specify a KMS key, you must also set the encrypted state to <code>true</code>.</p>
200 /// <p>You can specify a KMS key using any of the following:</p>
201 /// <ul>
202 /// <li>
203 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
204 /// <li>
205 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
206 /// <li>
207 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
208 /// <li>
209 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
210 /// </ul>
211 /// <p>Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an identifier that is not valid, the action can appear to complete, but eventually fails.</p>
212 /// <p>The specified KMS key must exist in the destination Region.</p>
213 /// <p>Amazon EBS does not support asymmetric KMS keys.</p>
214 pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
215 self.inner = self.inner.kms_key_id(input.into());
216 self
217 }
218 /// <p>The identifier of the symmetric Key Management Service (KMS) KMS key to use when creating encrypted volumes. If this parameter is not specified, your Amazon Web Services managed KMS key for Amazon EBS is used. If you specify a KMS key, you must also set the encrypted state to <code>true</code>.</p>
219 /// <p>You can specify a KMS key using any of the following:</p>
220 /// <ul>
221 /// <li>
222 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
223 /// <li>
224 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
225 /// <li>
226 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
227 /// <li>
228 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
229 /// </ul>
230 /// <p>Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an identifier that is not valid, the action can appear to complete, but eventually fails.</p>
231 /// <p>The specified KMS key must exist in the destination Region.</p>
232 /// <p>Amazon EBS does not support asymmetric KMS keys.</p>
233 pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
234 self.inner = self.inner.set_kms_key_id(input);
235 self
236 }
237 /// <p>The identifier of the symmetric Key Management Service (KMS) KMS key to use when creating encrypted volumes. If this parameter is not specified, your Amazon Web Services managed KMS key for Amazon EBS is used. If you specify a KMS key, you must also set the encrypted state to <code>true</code>.</p>
238 /// <p>You can specify a KMS key using any of the following:</p>
239 /// <ul>
240 /// <li>
241 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
242 /// <li>
243 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
244 /// <li>
245 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
246 /// <li>
247 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
248 /// </ul>
249 /// <p>Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an identifier that is not valid, the action can appear to complete, but eventually fails.</p>
250 /// <p>The specified KMS key must exist in the destination Region.</p>
251 /// <p>Amazon EBS does not support asymmetric KMS keys.</p>
252 pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
253 self.inner.get_kms_key_id()
254 }
255 /// <p>The name of the new AMI.</p>
256 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
257 self.inner = self.inner.name(input.into());
258 self
259 }
260 /// <p>The name of the new AMI.</p>
261 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
262 self.inner = self.inner.set_name(input);
263 self
264 }
265 /// <p>The name of the new AMI.</p>
266 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
267 self.inner.get_name()
268 }
269 /// <p>The ID of the AMI to copy.</p>
270 pub fn source_image_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
271 self.inner = self.inner.source_image_id(input.into());
272 self
273 }
274 /// <p>The ID of the AMI to copy.</p>
275 pub fn set_source_image_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
276 self.inner = self.inner.set_source_image_id(input);
277 self
278 }
279 /// <p>The ID of the AMI to copy.</p>
280 pub fn get_source_image_id(&self) -> &::std::option::Option<::std::string::String> {
281 self.inner.get_source_image_id()
282 }
283 /// <p>The name of the Region that contains the AMI to copy.</p>
284 pub fn source_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
285 self.inner = self.inner.source_region(input.into());
286 self
287 }
288 /// <p>The name of the Region that contains the AMI to copy.</p>
289 pub fn set_source_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
290 self.inner = self.inner.set_source_region(input);
291 self
292 }
293 /// <p>The name of the Region that contains the AMI to copy.</p>
294 pub fn get_source_region(&self) -> &::std::option::Option<::std::string::String> {
295 self.inner.get_source_region()
296 }
297 /// <p>The Amazon Resource Name (ARN) of the Outpost for the new AMI.</p>
298 /// <p>Only specify this parameter when copying an AMI from an Amazon Web Services Region to an Outpost. The AMI must be in the Region of the destination Outpost. You can't copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost.</p>
299 /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#copy-amis">Copy AMIs from an Amazon Web Services Region to an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
300 /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
301 pub fn destination_outpost_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
302 self.inner = self.inner.destination_outpost_arn(input.into());
303 self
304 }
305 /// <p>The Amazon Resource Name (ARN) of the Outpost for the new AMI.</p>
306 /// <p>Only specify this parameter when copying an AMI from an Amazon Web Services Region to an Outpost. The AMI must be in the Region of the destination Outpost. You can't copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost.</p>
307 /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#copy-amis">Copy AMIs from an Amazon Web Services Region to an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
308 /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
309 pub fn set_destination_outpost_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
310 self.inner = self.inner.set_destination_outpost_arn(input);
311 self
312 }
313 /// <p>The Amazon Resource Name (ARN) of the Outpost for the new AMI.</p>
314 /// <p>Only specify this parameter when copying an AMI from an Amazon Web Services Region to an Outpost. The AMI must be in the Region of the destination Outpost. You can't copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost.</p>
315 /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#copy-amis">Copy AMIs from an Amazon Web Services Region to an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
316 /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
317 pub fn get_destination_outpost_arn(&self) -> &::std::option::Option<::std::string::String> {
318 self.inner.get_destination_outpost_arn()
319 }
320 /// <p>Specifies whether to copy your user-defined AMI tags to the new AMI.</p>
321 /// <p>The following tags are not be copied:</p>
322 /// <ul>
323 /// <li>
324 /// <p>System tags (prefixed with <code>aws:</code>)</p></li>
325 /// <li>
326 /// <p>For public and shared AMIs, user-defined tags that are attached by other Amazon Web Services accounts</p></li>
327 /// </ul>
328 /// <p>Default: Your user-defined AMI tags are not copied.</p>
329 pub fn copy_image_tags(mut self, input: bool) -> Self {
330 self.inner = self.inner.copy_image_tags(input);
331 self
332 }
333 /// <p>Specifies whether to copy your user-defined AMI tags to the new AMI.</p>
334 /// <p>The following tags are not be copied:</p>
335 /// <ul>
336 /// <li>
337 /// <p>System tags (prefixed with <code>aws:</code>)</p></li>
338 /// <li>
339 /// <p>For public and shared AMIs, user-defined tags that are attached by other Amazon Web Services accounts</p></li>
340 /// </ul>
341 /// <p>Default: Your user-defined AMI tags are not copied.</p>
342 pub fn set_copy_image_tags(mut self, input: ::std::option::Option<bool>) -> Self {
343 self.inner = self.inner.set_copy_image_tags(input);
344 self
345 }
346 /// <p>Specifies whether to copy your user-defined AMI tags to the new AMI.</p>
347 /// <p>The following tags are not be copied:</p>
348 /// <ul>
349 /// <li>
350 /// <p>System tags (prefixed with <code>aws:</code>)</p></li>
351 /// <li>
352 /// <p>For public and shared AMIs, user-defined tags that are attached by other Amazon Web Services accounts</p></li>
353 /// </ul>
354 /// <p>Default: Your user-defined AMI tags are not copied.</p>
355 pub fn get_copy_image_tags(&self) -> &::std::option::Option<bool> {
356 self.inner.get_copy_image_tags()
357 }
358 ///
359 /// Appends an item to `TagSpecifications`.
360 ///
361 /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
362 ///
363 /// <p>The tags to apply to the new AMI and new snapshots. You can tag the AMI, the snapshots, or both.</p>
364 /// <ul>
365 /// <li>
366 /// <p>To tag the new AMI, the value for <code>ResourceType</code> must be <code>image</code>.</p></li>
367 /// <li>
368 /// <p>To tag the new snapshots, the value for <code>ResourceType</code> must be <code>snapshot</code>. The same tag is applied to all the new snapshots.</p></li>
369 /// </ul>
370 /// <p>If you specify other values for <code>ResourceType</code>, the request fails.</p>
371 /// <p>To tag an AMI or snapshot after it has been created, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html">CreateTags</a>.</p>
372 pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
373 self.inner = self.inner.tag_specifications(input);
374 self
375 }
376 /// <p>The tags to apply to the new AMI and new snapshots. You can tag the AMI, the snapshots, or both.</p>
377 /// <ul>
378 /// <li>
379 /// <p>To tag the new AMI, the value for <code>ResourceType</code> must be <code>image</code>.</p></li>
380 /// <li>
381 /// <p>To tag the new snapshots, the value for <code>ResourceType</code> must be <code>snapshot</code>. The same tag is applied to all the new snapshots.</p></li>
382 /// </ul>
383 /// <p>If you specify other values for <code>ResourceType</code>, the request fails.</p>
384 /// <p>To tag an AMI or snapshot after it has been created, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html">CreateTags</a>.</p>
385 pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
386 self.inner = self.inner.set_tag_specifications(input);
387 self
388 }
389 /// <p>The tags to apply to the new AMI and new snapshots. You can tag the AMI, the snapshots, or both.</p>
390 /// <ul>
391 /// <li>
392 /// <p>To tag the new AMI, the value for <code>ResourceType</code> must be <code>image</code>.</p></li>
393 /// <li>
394 /// <p>To tag the new snapshots, the value for <code>ResourceType</code> must be <code>snapshot</code>. The same tag is applied to all the new snapshots.</p></li>
395 /// </ul>
396 /// <p>If you specify other values for <code>ResourceType</code>, the request fails.</p>
397 /// <p>To tag an AMI or snapshot after it has been created, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html">CreateTags</a>.</p>
398 pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
399 self.inner.get_tag_specifications()
400 }
401 /// <p>Specify a completion duration, in 15 minute increments, to initiate a time-based AMI copy. The specified completion duration applies to each of the snapshots associated with the AMI. Each snapshot associated with the AMI will be completed within the specified completion duration, with copy throughput automatically adjusted for each snapshot based on its size to meet the timing target.</p>
402 /// <p>If you do not specify a value, the AMI copy operation is completed on a best-effort basis.</p><note>
403 /// <p>This parameter is not supported when copying an AMI to or from a Local Zone, or to an Outpost.</p>
404 /// </note>
405 /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/time-based-copies.html">Time-based copies for Amazon EBS snapshots and EBS-backed AMIs</a>.</p>
406 pub fn snapshot_copy_completion_duration_minutes(mut self, input: i64) -> Self {
407 self.inner = self.inner.snapshot_copy_completion_duration_minutes(input);
408 self
409 }
410 /// <p>Specify a completion duration, in 15 minute increments, to initiate a time-based AMI copy. The specified completion duration applies to each of the snapshots associated with the AMI. Each snapshot associated with the AMI will be completed within the specified completion duration, with copy throughput automatically adjusted for each snapshot based on its size to meet the timing target.</p>
411 /// <p>If you do not specify a value, the AMI copy operation is completed on a best-effort basis.</p><note>
412 /// <p>This parameter is not supported when copying an AMI to or from a Local Zone, or to an Outpost.</p>
413 /// </note>
414 /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/time-based-copies.html">Time-based copies for Amazon EBS snapshots and EBS-backed AMIs</a>.</p>
415 pub fn set_snapshot_copy_completion_duration_minutes(mut self, input: ::std::option::Option<i64>) -> Self {
416 self.inner = self.inner.set_snapshot_copy_completion_duration_minutes(input);
417 self
418 }
419 /// <p>Specify a completion duration, in 15 minute increments, to initiate a time-based AMI copy. The specified completion duration applies to each of the snapshots associated with the AMI. Each snapshot associated with the AMI will be completed within the specified completion duration, with copy throughput automatically adjusted for each snapshot based on its size to meet the timing target.</p>
420 /// <p>If you do not specify a value, the AMI copy operation is completed on a best-effort basis.</p><note>
421 /// <p>This parameter is not supported when copying an AMI to or from a Local Zone, or to an Outpost.</p>
422 /// </note>
423 /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/time-based-copies.html">Time-based copies for Amazon EBS snapshots and EBS-backed AMIs</a>.</p>
424 pub fn get_snapshot_copy_completion_duration_minutes(&self) -> &::std::option::Option<i64> {
425 self.inner.get_snapshot_copy_completion_duration_minutes()
426 }
427 /// <p>The Local Zone for the new AMI (for example, <code>cn-north-1-pkx-1a</code>).</p>
428 /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
429 pub fn destination_availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
430 self.inner = self.inner.destination_availability_zone(input.into());
431 self
432 }
433 /// <p>The Local Zone for the new AMI (for example, <code>cn-north-1-pkx-1a</code>).</p>
434 /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
435 pub fn set_destination_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
436 self.inner = self.inner.set_destination_availability_zone(input);
437 self
438 }
439 /// <p>The Local Zone for the new AMI (for example, <code>cn-north-1-pkx-1a</code>).</p>
440 /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
441 pub fn get_destination_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
442 self.inner.get_destination_availability_zone()
443 }
444 /// <p>The ID of the Local Zone for the new AMI (for example, <code>cnn1-pkx1-az1</code>).</p>
445 /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
446 pub fn destination_availability_zone_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
447 self.inner = self.inner.destination_availability_zone_id(input.into());
448 self
449 }
450 /// <p>The ID of the Local Zone for the new AMI (for example, <code>cnn1-pkx1-az1</code>).</p>
451 /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
452 pub fn set_destination_availability_zone_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
453 self.inner = self.inner.set_destination_availability_zone_id(input);
454 self
455 }
456 /// <p>The ID of the Local Zone for the new AMI (for example, <code>cnn1-pkx1-az1</code>).</p>
457 /// <p>Only one of <code>DestinationAvailabilityZone</code>, <code>DestinationAvailabilityZoneId</code>, or <code>DestinationOutpostArn</code> can be specified.</p>
458 pub fn get_destination_availability_zone_id(&self) -> &::std::option::Option<::std::string::String> {
459 self.inner.get_destination_availability_zone_id()
460 }
461 /// <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>
462 pub fn dry_run(mut self, input: bool) -> Self {
463 self.inner = self.inner.dry_run(input);
464 self
465 }
466 /// <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>
467 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
468 self.inner = self.inner.set_dry_run(input);
469 self
470 }
471 /// <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>
472 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
473 self.inner.get_dry_run()
474 }
475}