aws_sdk_ec2/operation/copy_snapshot/
_copy_snapshot_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CopySnapshotInput {
6    /// <p>A description for the EBS snapshot.</p>
7    pub description: ::std::option::Option<::std::string::String>,
8    /// <p>The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot.</p><note>
9    /// <p>Only supported when copying a snapshot to an Outpost.</p>
10    /// </note>
11    /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#copy-snapshots"> Copy snapshots from an Amazon Web Services Region to an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
12    pub destination_outpost_arn: ::std::option::Option<::std::string::String>,
13    /// <p>The destination Region to use in the <code>PresignedUrl</code> parameter of a snapshot copy operation. This parameter is only valid for specifying the destination Region in a <code>PresignedUrl</code> parameter, where it is required.</p>
14    /// <p>The snapshot copy is sent to the regional endpoint that you sent the HTTP request to (for example, <code>ec2.us-east-1.amazonaws.com</code>). With the CLI, this is specified using the <code>--region</code> parameter or the default Region in your Amazon Web Services configuration file.</p>
15    pub destination_region: ::std::option::Option<::std::string::String>,
16    /// <p>To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using this parameter. Otherwise, omit this parameter. Copies of encrypted snapshots are encrypted, even if you omit this parameter and encryption by default is not enabled. You cannot set this parameter to false. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html">Amazon EBS encryption</a> in the <i>Amazon EBS User Guide</i>.</p>
17    pub encrypted: ::std::option::Option<bool>,
18    /// <p>The identifier of the KMS key to use for Amazon EBS encryption. If this parameter is not specified, your KMS key for Amazon EBS is used. If <code>KmsKeyId</code> is specified, the encrypted state must be <code>true</code>.</p>
19    /// <p>You can specify the KMS key using any of the following:</p>
20    /// <ul>
21    /// <li>
22    /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
23    /// <li>
24    /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
25    /// <li>
26    /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
27    /// <li>
28    /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
29    /// </ul>
30    /// <p>Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an ID, alias, or ARN that is not valid, the action can appear to complete, but eventually fails.</p>
31    pub kms_key_id: ::std::option::Option<::std::string::String>,
32    /// <p>When you copy an encrypted source snapshot using the Amazon EC2 Query API, you must supply a pre-signed URL. This parameter is optional for unencrypted snapshots. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html">Query requests</a>.</p>
33    /// <p>The <code>PresignedUrl</code> should use the snapshot source endpoint, the <code>CopySnapshot</code> action, and include the <code>SourceRegion</code>, <code>SourceSnapshotId</code>, and <code>DestinationRegion</code> parameters. The <code>PresignedUrl</code> must be signed using Amazon Web Services Signature Version 4. Because EBS snapshots are stored in Amazon S3, the signing algorithm for this parameter uses the same logic that is described in <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html"> Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)</a> in the <i>Amazon S3 API Reference</i>. An invalid or improperly signed <code>PresignedUrl</code> will cause the copy operation to fail asynchronously, and the snapshot will move to an <code>error</code> state.</p>
34    pub presigned_url: ::std::option::Option<::std::string::String>,
35    /// <p>The ID of the Region that contains the snapshot to be copied.</p>
36    pub source_region: ::std::option::Option<::std::string::String>,
37    /// <p>The ID of the EBS snapshot to copy.</p>
38    pub source_snapshot_id: ::std::option::Option<::std::string::String>,
39    /// <p>The tags to apply to the new snapshot.</p>
40    pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
41    /// <note>
42    /// <p>Not supported when copying snapshots to or from Local Zones or Outposts.</p>
43    /// </note>
44    /// <p>Specify a completion duration, in 15 minute increments, to initiate a time-based snapshot copy. Time-based snapshot copy operations complete within the specified duration. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/time-based-copies.html"> Time-based copies</a>.</p>
45    /// <p>If you do not specify a value, the snapshot copy operation is completed on a best-effort basis.</p>
46    pub completion_duration_minutes: ::std::option::Option<i32>,
47    /// <p>The Local Zone, for example, <code>cn-north-1-pkx-1a</code> to which to copy the snapshot.</p><note>
48    /// <p>Only supported when copying a snapshot to a Local Zone.</p>
49    /// </note>
50    pub destination_availability_zone: ::std::option::Option<::std::string::String>,
51    /// <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>
52    pub dry_run: ::std::option::Option<bool>,
53}
54impl CopySnapshotInput {
55    /// <p>A description for the EBS snapshot.</p>
56    pub fn description(&self) -> ::std::option::Option<&str> {
57        self.description.as_deref()
58    }
59    /// <p>The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot.</p><note>
60    /// <p>Only supported when copying a snapshot to an Outpost.</p>
61    /// </note>
62    /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#copy-snapshots"> Copy snapshots from an Amazon Web Services Region to an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
63    pub fn destination_outpost_arn(&self) -> ::std::option::Option<&str> {
64        self.destination_outpost_arn.as_deref()
65    }
66    /// <p>The destination Region to use in the <code>PresignedUrl</code> parameter of a snapshot copy operation. This parameter is only valid for specifying the destination Region in a <code>PresignedUrl</code> parameter, where it is required.</p>
67    /// <p>The snapshot copy is sent to the regional endpoint that you sent the HTTP request to (for example, <code>ec2.us-east-1.amazonaws.com</code>). With the CLI, this is specified using the <code>--region</code> parameter or the default Region in your Amazon Web Services configuration file.</p>
68    pub fn destination_region(&self) -> ::std::option::Option<&str> {
69        self.destination_region.as_deref()
70    }
71    /// <p>To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using this parameter. Otherwise, omit this parameter. Copies of encrypted snapshots are encrypted, even if you omit this parameter and encryption by default is not enabled. You cannot set this parameter to false. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html">Amazon EBS encryption</a> in the <i>Amazon EBS User Guide</i>.</p>
72    pub fn encrypted(&self) -> ::std::option::Option<bool> {
73        self.encrypted
74    }
75    /// <p>The identifier of the KMS key to use for Amazon EBS encryption. If this parameter is not specified, your KMS key for Amazon EBS is used. If <code>KmsKeyId</code> is specified, the encrypted state must be <code>true</code>.</p>
76    /// <p>You can specify the KMS key using any of the following:</p>
77    /// <ul>
78    /// <li>
79    /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
80    /// <li>
81    /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
82    /// <li>
83    /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
84    /// <li>
85    /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
86    /// </ul>
87    /// <p>Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an ID, alias, or ARN that is not valid, the action can appear to complete, but eventually fails.</p>
88    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
89        self.kms_key_id.as_deref()
90    }
91    /// <p>When you copy an encrypted source snapshot using the Amazon EC2 Query API, you must supply a pre-signed URL. This parameter is optional for unencrypted snapshots. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html">Query requests</a>.</p>
92    /// <p>The <code>PresignedUrl</code> should use the snapshot source endpoint, the <code>CopySnapshot</code> action, and include the <code>SourceRegion</code>, <code>SourceSnapshotId</code>, and <code>DestinationRegion</code> parameters. The <code>PresignedUrl</code> must be signed using Amazon Web Services Signature Version 4. Because EBS snapshots are stored in Amazon S3, the signing algorithm for this parameter uses the same logic that is described in <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html"> Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)</a> in the <i>Amazon S3 API Reference</i>. An invalid or improperly signed <code>PresignedUrl</code> will cause the copy operation to fail asynchronously, and the snapshot will move to an <code>error</code> state.</p>
93    pub fn presigned_url(&self) -> ::std::option::Option<&str> {
94        self.presigned_url.as_deref()
95    }
96    /// <p>The ID of the Region that contains the snapshot to be copied.</p>
97    pub fn source_region(&self) -> ::std::option::Option<&str> {
98        self.source_region.as_deref()
99    }
100    /// <p>The ID of the EBS snapshot to copy.</p>
101    pub fn source_snapshot_id(&self) -> ::std::option::Option<&str> {
102        self.source_snapshot_id.as_deref()
103    }
104    /// <p>The tags to apply to the new snapshot.</p>
105    ///
106    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tag_specifications.is_none()`.
107    pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
108        self.tag_specifications.as_deref().unwrap_or_default()
109    }
110    /// <note>
111    /// <p>Not supported when copying snapshots to or from Local Zones or Outposts.</p>
112    /// </note>
113    /// <p>Specify a completion duration, in 15 minute increments, to initiate a time-based snapshot copy. Time-based snapshot copy operations complete within the specified duration. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/time-based-copies.html"> Time-based copies</a>.</p>
114    /// <p>If you do not specify a value, the snapshot copy operation is completed on a best-effort basis.</p>
115    pub fn completion_duration_minutes(&self) -> ::std::option::Option<i32> {
116        self.completion_duration_minutes
117    }
118    /// <p>The Local Zone, for example, <code>cn-north-1-pkx-1a</code> to which to copy the snapshot.</p><note>
119    /// <p>Only supported when copying a snapshot to a Local Zone.</p>
120    /// </note>
121    pub fn destination_availability_zone(&self) -> ::std::option::Option<&str> {
122        self.destination_availability_zone.as_deref()
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 dry_run(&self) -> ::std::option::Option<bool> {
126        self.dry_run
127    }
128}
129impl ::std::fmt::Debug for CopySnapshotInput {
130    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
131        let mut formatter = f.debug_struct("CopySnapshotInput");
132        formatter.field("description", &self.description);
133        formatter.field("destination_outpost_arn", &self.destination_outpost_arn);
134        formatter.field("destination_region", &self.destination_region);
135        formatter.field("encrypted", &self.encrypted);
136        formatter.field("kms_key_id", &self.kms_key_id);
137        formatter.field("presigned_url", &"*** Sensitive Data Redacted ***");
138        formatter.field("source_region", &self.source_region);
139        formatter.field("source_snapshot_id", &self.source_snapshot_id);
140        formatter.field("tag_specifications", &self.tag_specifications);
141        formatter.field("completion_duration_minutes", &self.completion_duration_minutes);
142        formatter.field("destination_availability_zone", &self.destination_availability_zone);
143        formatter.field("dry_run", &self.dry_run);
144        formatter.finish()
145    }
146}
147impl CopySnapshotInput {
148    /// Creates a new builder-style object to manufacture [`CopySnapshotInput`](crate::operation::copy_snapshot::CopySnapshotInput).
149    pub fn builder() -> crate::operation::copy_snapshot::builders::CopySnapshotInputBuilder {
150        crate::operation::copy_snapshot::builders::CopySnapshotInputBuilder::default()
151    }
152}
153
154/// A builder for [`CopySnapshotInput`](crate::operation::copy_snapshot::CopySnapshotInput).
155#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
156#[non_exhaustive]
157pub struct CopySnapshotInputBuilder {
158    pub(crate) description: ::std::option::Option<::std::string::String>,
159    pub(crate) destination_outpost_arn: ::std::option::Option<::std::string::String>,
160    pub(crate) destination_region: ::std::option::Option<::std::string::String>,
161    pub(crate) encrypted: ::std::option::Option<bool>,
162    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
163    pub(crate) presigned_url: ::std::option::Option<::std::string::String>,
164    pub(crate) source_region: ::std::option::Option<::std::string::String>,
165    pub(crate) source_snapshot_id: ::std::option::Option<::std::string::String>,
166    pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
167    pub(crate) completion_duration_minutes: ::std::option::Option<i32>,
168    pub(crate) destination_availability_zone: ::std::option::Option<::std::string::String>,
169    pub(crate) dry_run: ::std::option::Option<bool>,
170}
171impl CopySnapshotInputBuilder {
172    /// <p>A description for the EBS snapshot.</p>
173    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174        self.description = ::std::option::Option::Some(input.into());
175        self
176    }
177    /// <p>A description for the EBS snapshot.</p>
178    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179        self.description = input;
180        self
181    }
182    /// <p>A description for the EBS snapshot.</p>
183    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
184        &self.description
185    }
186    /// <p>The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot.</p><note>
187    /// <p>Only supported when copying a snapshot to an Outpost.</p>
188    /// </note>
189    /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#copy-snapshots"> Copy snapshots from an Amazon Web Services Region to an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
190    pub fn destination_outpost_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.destination_outpost_arn = ::std::option::Option::Some(input.into());
192        self
193    }
194    /// <p>The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot.</p><note>
195    /// <p>Only supported when copying a snapshot to an Outpost.</p>
196    /// </note>
197    /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#copy-snapshots"> Copy snapshots from an Amazon Web Services Region to an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
198    pub fn set_destination_outpost_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
199        self.destination_outpost_arn = input;
200        self
201    }
202    /// <p>The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot.</p><note>
203    /// <p>Only supported when copying a snapshot to an Outpost.</p>
204    /// </note>
205    /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#copy-snapshots"> Copy snapshots from an Amazon Web Services Region to an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
206    pub fn get_destination_outpost_arn(&self) -> &::std::option::Option<::std::string::String> {
207        &self.destination_outpost_arn
208    }
209    /// <p>The destination Region to use in the <code>PresignedUrl</code> parameter of a snapshot copy operation. This parameter is only valid for specifying the destination Region in a <code>PresignedUrl</code> parameter, where it is required.</p>
210    /// <p>The snapshot copy is sent to the regional endpoint that you sent the HTTP request to (for example, <code>ec2.us-east-1.amazonaws.com</code>). With the CLI, this is specified using the <code>--region</code> parameter or the default Region in your Amazon Web Services configuration file.</p>
211    pub fn destination_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
212        self.destination_region = ::std::option::Option::Some(input.into());
213        self
214    }
215    /// <p>The destination Region to use in the <code>PresignedUrl</code> parameter of a snapshot copy operation. This parameter is only valid for specifying the destination Region in a <code>PresignedUrl</code> parameter, where it is required.</p>
216    /// <p>The snapshot copy is sent to the regional endpoint that you sent the HTTP request to (for example, <code>ec2.us-east-1.amazonaws.com</code>). With the CLI, this is specified using the <code>--region</code> parameter or the default Region in your Amazon Web Services configuration file.</p>
217    pub fn set_destination_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218        self.destination_region = input;
219        self
220    }
221    /// <p>The destination Region to use in the <code>PresignedUrl</code> parameter of a snapshot copy operation. This parameter is only valid for specifying the destination Region in a <code>PresignedUrl</code> parameter, where it is required.</p>
222    /// <p>The snapshot copy is sent to the regional endpoint that you sent the HTTP request to (for example, <code>ec2.us-east-1.amazonaws.com</code>). With the CLI, this is specified using the <code>--region</code> parameter or the default Region in your Amazon Web Services configuration file.</p>
223    pub fn get_destination_region(&self) -> &::std::option::Option<::std::string::String> {
224        &self.destination_region
225    }
226    /// <p>To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using this parameter. Otherwise, omit this parameter. Copies of encrypted snapshots are encrypted, even if you omit this parameter and encryption by default is not enabled. You cannot set this parameter to false. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html">Amazon EBS encryption</a> in the <i>Amazon EBS User Guide</i>.</p>
227    pub fn encrypted(mut self, input: bool) -> Self {
228        self.encrypted = ::std::option::Option::Some(input);
229        self
230    }
231    /// <p>To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using this parameter. Otherwise, omit this parameter. Copies of encrypted snapshots are encrypted, even if you omit this parameter and encryption by default is not enabled. You cannot set this parameter to false. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html">Amazon EBS encryption</a> in the <i>Amazon EBS User Guide</i>.</p>
232    pub fn set_encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
233        self.encrypted = input;
234        self
235    }
236    /// <p>To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using this parameter. Otherwise, omit this parameter. Copies of encrypted snapshots are encrypted, even if you omit this parameter and encryption by default is not enabled. You cannot set this parameter to false. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html">Amazon EBS encryption</a> in the <i>Amazon EBS User Guide</i>.</p>
237    pub fn get_encrypted(&self) -> &::std::option::Option<bool> {
238        &self.encrypted
239    }
240    /// <p>The identifier of the KMS key to use for Amazon EBS encryption. If this parameter is not specified, your KMS key for Amazon EBS is used. If <code>KmsKeyId</code> is specified, the encrypted state must be <code>true</code>.</p>
241    /// <p>You can specify the KMS key using any of the following:</p>
242    /// <ul>
243    /// <li>
244    /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
245    /// <li>
246    /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
247    /// <li>
248    /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
249    /// <li>
250    /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
251    /// </ul>
252    /// <p>Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an ID, alias, or ARN that is not valid, the action can appear to complete, but eventually fails.</p>
253    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
254        self.kms_key_id = ::std::option::Option::Some(input.into());
255        self
256    }
257    /// <p>The identifier of the KMS key to use for Amazon EBS encryption. If this parameter is not specified, your KMS key for Amazon EBS is used. If <code>KmsKeyId</code> is specified, the encrypted state must be <code>true</code>.</p>
258    /// <p>You can specify the KMS key using any of the following:</p>
259    /// <ul>
260    /// <li>
261    /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
262    /// <li>
263    /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
264    /// <li>
265    /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
266    /// <li>
267    /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
268    /// </ul>
269    /// <p>Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an ID, alias, or ARN that is not valid, the action can appear to complete, but eventually fails.</p>
270    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
271        self.kms_key_id = input;
272        self
273    }
274    /// <p>The identifier of the KMS key to use for Amazon EBS encryption. If this parameter is not specified, your KMS key for Amazon EBS is used. If <code>KmsKeyId</code> is specified, the encrypted state must be <code>true</code>.</p>
275    /// <p>You can specify the KMS key using any of the following:</p>
276    /// <ul>
277    /// <li>
278    /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
279    /// <li>
280    /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
281    /// <li>
282    /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
283    /// <li>
284    /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
285    /// </ul>
286    /// <p>Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an ID, alias, or ARN that is not valid, the action can appear to complete, but eventually fails.</p>
287    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
288        &self.kms_key_id
289    }
290    /// <p>When you copy an encrypted source snapshot using the Amazon EC2 Query API, you must supply a pre-signed URL. This parameter is optional for unencrypted snapshots. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html">Query requests</a>.</p>
291    /// <p>The <code>PresignedUrl</code> should use the snapshot source endpoint, the <code>CopySnapshot</code> action, and include the <code>SourceRegion</code>, <code>SourceSnapshotId</code>, and <code>DestinationRegion</code> parameters. The <code>PresignedUrl</code> must be signed using Amazon Web Services Signature Version 4. Because EBS snapshots are stored in Amazon S3, the signing algorithm for this parameter uses the same logic that is described in <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html"> Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)</a> in the <i>Amazon S3 API Reference</i>. An invalid or improperly signed <code>PresignedUrl</code> will cause the copy operation to fail asynchronously, and the snapshot will move to an <code>error</code> state.</p>
292    pub fn presigned_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
293        self.presigned_url = ::std::option::Option::Some(input.into());
294        self
295    }
296    /// <p>When you copy an encrypted source snapshot using the Amazon EC2 Query API, you must supply a pre-signed URL. This parameter is optional for unencrypted snapshots. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html">Query requests</a>.</p>
297    /// <p>The <code>PresignedUrl</code> should use the snapshot source endpoint, the <code>CopySnapshot</code> action, and include the <code>SourceRegion</code>, <code>SourceSnapshotId</code>, and <code>DestinationRegion</code> parameters. The <code>PresignedUrl</code> must be signed using Amazon Web Services Signature Version 4. Because EBS snapshots are stored in Amazon S3, the signing algorithm for this parameter uses the same logic that is described in <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html"> Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)</a> in the <i>Amazon S3 API Reference</i>. An invalid or improperly signed <code>PresignedUrl</code> will cause the copy operation to fail asynchronously, and the snapshot will move to an <code>error</code> state.</p>
298    pub fn set_presigned_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
299        self.presigned_url = input;
300        self
301    }
302    /// <p>When you copy an encrypted source snapshot using the Amazon EC2 Query API, you must supply a pre-signed URL. This parameter is optional for unencrypted snapshots. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html">Query requests</a>.</p>
303    /// <p>The <code>PresignedUrl</code> should use the snapshot source endpoint, the <code>CopySnapshot</code> action, and include the <code>SourceRegion</code>, <code>SourceSnapshotId</code>, and <code>DestinationRegion</code> parameters. The <code>PresignedUrl</code> must be signed using Amazon Web Services Signature Version 4. Because EBS snapshots are stored in Amazon S3, the signing algorithm for this parameter uses the same logic that is described in <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html"> Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)</a> in the <i>Amazon S3 API Reference</i>. An invalid or improperly signed <code>PresignedUrl</code> will cause the copy operation to fail asynchronously, and the snapshot will move to an <code>error</code> state.</p>
304    pub fn get_presigned_url(&self) -> &::std::option::Option<::std::string::String> {
305        &self.presigned_url
306    }
307    /// <p>The ID of the Region that contains the snapshot to be copied.</p>
308    /// This field is required.
309    pub fn source_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
310        self.source_region = ::std::option::Option::Some(input.into());
311        self
312    }
313    /// <p>The ID of the Region that contains the snapshot to be copied.</p>
314    pub fn set_source_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
315        self.source_region = input;
316        self
317    }
318    /// <p>The ID of the Region that contains the snapshot to be copied.</p>
319    pub fn get_source_region(&self) -> &::std::option::Option<::std::string::String> {
320        &self.source_region
321    }
322    /// <p>The ID of the EBS snapshot to copy.</p>
323    /// This field is required.
324    pub fn source_snapshot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
325        self.source_snapshot_id = ::std::option::Option::Some(input.into());
326        self
327    }
328    /// <p>The ID of the EBS snapshot to copy.</p>
329    pub fn set_source_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
330        self.source_snapshot_id = input;
331        self
332    }
333    /// <p>The ID of the EBS snapshot to copy.</p>
334    pub fn get_source_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
335        &self.source_snapshot_id
336    }
337    /// Appends an item to `tag_specifications`.
338    ///
339    /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
340    ///
341    /// <p>The tags to apply to the new snapshot.</p>
342    pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
343        let mut v = self.tag_specifications.unwrap_or_default();
344        v.push(input);
345        self.tag_specifications = ::std::option::Option::Some(v);
346        self
347    }
348    /// <p>The tags to apply to the new snapshot.</p>
349    pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
350        self.tag_specifications = input;
351        self
352    }
353    /// <p>The tags to apply to the new snapshot.</p>
354    pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
355        &self.tag_specifications
356    }
357    /// <note>
358    /// <p>Not supported when copying snapshots to or from Local Zones or Outposts.</p>
359    /// </note>
360    /// <p>Specify a completion duration, in 15 minute increments, to initiate a time-based snapshot copy. Time-based snapshot copy operations complete within the specified duration. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/time-based-copies.html"> Time-based copies</a>.</p>
361    /// <p>If you do not specify a value, the snapshot copy operation is completed on a best-effort basis.</p>
362    pub fn completion_duration_minutes(mut self, input: i32) -> Self {
363        self.completion_duration_minutes = ::std::option::Option::Some(input);
364        self
365    }
366    /// <note>
367    /// <p>Not supported when copying snapshots to or from Local Zones or Outposts.</p>
368    /// </note>
369    /// <p>Specify a completion duration, in 15 minute increments, to initiate a time-based snapshot copy. Time-based snapshot copy operations complete within the specified duration. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/time-based-copies.html"> Time-based copies</a>.</p>
370    /// <p>If you do not specify a value, the snapshot copy operation is completed on a best-effort basis.</p>
371    pub fn set_completion_duration_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
372        self.completion_duration_minutes = input;
373        self
374    }
375    /// <note>
376    /// <p>Not supported when copying snapshots to or from Local Zones or Outposts.</p>
377    /// </note>
378    /// <p>Specify a completion duration, in 15 minute increments, to initiate a time-based snapshot copy. Time-based snapshot copy operations complete within the specified duration. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/time-based-copies.html"> Time-based copies</a>.</p>
379    /// <p>If you do not specify a value, the snapshot copy operation is completed on a best-effort basis.</p>
380    pub fn get_completion_duration_minutes(&self) -> &::std::option::Option<i32> {
381        &self.completion_duration_minutes
382    }
383    /// <p>The Local Zone, for example, <code>cn-north-1-pkx-1a</code> to which to copy the snapshot.</p><note>
384    /// <p>Only supported when copying a snapshot to a Local Zone.</p>
385    /// </note>
386    pub fn destination_availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
387        self.destination_availability_zone = ::std::option::Option::Some(input.into());
388        self
389    }
390    /// <p>The Local Zone, for example, <code>cn-north-1-pkx-1a</code> to which to copy the snapshot.</p><note>
391    /// <p>Only supported when copying a snapshot to a Local Zone.</p>
392    /// </note>
393    pub fn set_destination_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
394        self.destination_availability_zone = input;
395        self
396    }
397    /// <p>The Local Zone, for example, <code>cn-north-1-pkx-1a</code> to which to copy the snapshot.</p><note>
398    /// <p>Only supported when copying a snapshot to a Local Zone.</p>
399    /// </note>
400    pub fn get_destination_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
401        &self.destination_availability_zone
402    }
403    /// <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>
404    pub fn dry_run(mut self, input: bool) -> Self {
405        self.dry_run = ::std::option::Option::Some(input);
406        self
407    }
408    /// <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>
409    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
410        self.dry_run = input;
411        self
412    }
413    /// <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>
414    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
415        &self.dry_run
416    }
417    /// Consumes the builder and constructs a [`CopySnapshotInput`](crate::operation::copy_snapshot::CopySnapshotInput).
418    pub fn build(
419        self,
420    ) -> ::std::result::Result<crate::operation::copy_snapshot::CopySnapshotInput, ::aws_smithy_types::error::operation::BuildError> {
421        ::std::result::Result::Ok(crate::operation::copy_snapshot::CopySnapshotInput {
422            description: self.description,
423            destination_outpost_arn: self.destination_outpost_arn,
424            destination_region: self.destination_region,
425            encrypted: self.encrypted,
426            kms_key_id: self.kms_key_id,
427            presigned_url: self.presigned_url,
428            source_region: self.source_region,
429            source_snapshot_id: self.source_snapshot_id,
430            tag_specifications: self.tag_specifications,
431            completion_duration_minutes: self.completion_duration_minutes,
432            destination_availability_zone: self.destination_availability_zone,
433            dry_run: self.dry_run,
434        })
435    }
436}
437impl ::std::fmt::Debug for CopySnapshotInputBuilder {
438    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
439        let mut formatter = f.debug_struct("CopySnapshotInputBuilder");
440        formatter.field("description", &self.description);
441        formatter.field("destination_outpost_arn", &self.destination_outpost_arn);
442        formatter.field("destination_region", &self.destination_region);
443        formatter.field("encrypted", &self.encrypted);
444        formatter.field("kms_key_id", &self.kms_key_id);
445        formatter.field("presigned_url", &"*** Sensitive Data Redacted ***");
446        formatter.field("source_region", &self.source_region);
447        formatter.field("source_snapshot_id", &self.source_snapshot_id);
448        formatter.field("tag_specifications", &self.tag_specifications);
449        formatter.field("completion_duration_minutes", &self.completion_duration_minutes);
450        formatter.field("destination_availability_zone", &self.destination_availability_zone);
451        formatter.field("dry_run", &self.dry_run);
452        formatter.finish()
453    }
454}