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. Only specify this parameter when copying a snapshot from an Amazon Web Services Region to an Outpost. The snapshot must be in the Region for the destination Outpost. You cannot copy a snapshot from an Outpost to a Region, from one Outpost to another, or within the same Outpost.</p>
9 /// <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>
10 pub destination_outpost_arn: ::std::option::Option<::std::string::String>,
11 /// <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>
12 /// <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>
13 pub destination_region: ::std::option::Option<::std::string::String>,
14 /// <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. 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>
15 pub encrypted: ::std::option::Option<bool>,
16 /// <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>
17 /// <p>You can specify the KMS key using any of the following:</p>
18 /// <ul>
19 /// <li>
20 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
21 /// <li>
22 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
23 /// <li>
24 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
25 /// <li>
26 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
27 /// </ul>
28 /// <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>
29 pub kms_key_id: ::std::option::Option<::std::string::String>,
30 /// <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>
31 /// <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>
32 pub presigned_url: ::std::option::Option<::std::string::String>,
33 /// <p>The ID of the Region that contains the snapshot to be copied.</p>
34 pub source_region: ::std::option::Option<::std::string::String>,
35 /// <p>The ID of the EBS snapshot to copy.</p>
36 pub source_snapshot_id: ::std::option::Option<::std::string::String>,
37 /// <p>The tags to apply to the new snapshot.</p>
38 pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
39 /// <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>
40 /// <p>If you do not specify a value, the snapshot copy operation is completed on a best-effort basis.</p>
41 pub completion_duration_minutes: ::std::option::Option<i32>,
42 /// <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>
43 pub dry_run: ::std::option::Option<bool>,
44}
45impl CopySnapshotInput {
46 /// <p>A description for the EBS snapshot.</p>
47 pub fn description(&self) -> ::std::option::Option<&str> {
48 self.description.as_deref()
49 }
50 /// <p>The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot. Only specify this parameter when copying a snapshot from an Amazon Web Services Region to an Outpost. The snapshot must be in the Region for the destination Outpost. You cannot copy a snapshot from an Outpost to a Region, from one Outpost to another, or within the same Outpost.</p>
51 /// <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>
52 pub fn destination_outpost_arn(&self) -> ::std::option::Option<&str> {
53 self.destination_outpost_arn.as_deref()
54 }
55 /// <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>
56 /// <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>
57 pub fn destination_region(&self) -> ::std::option::Option<&str> {
58 self.destination_region.as_deref()
59 }
60 /// <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. 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>
61 pub fn encrypted(&self) -> ::std::option::Option<bool> {
62 self.encrypted
63 }
64 /// <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>
65 /// <p>You can specify the KMS key using any of the following:</p>
66 /// <ul>
67 /// <li>
68 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
69 /// <li>
70 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
71 /// <li>
72 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
73 /// <li>
74 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
75 /// </ul>
76 /// <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>
77 pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
78 self.kms_key_id.as_deref()
79 }
80 /// <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>
81 /// <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>
82 pub fn presigned_url(&self) -> ::std::option::Option<&str> {
83 self.presigned_url.as_deref()
84 }
85 /// <p>The ID of the Region that contains the snapshot to be copied.</p>
86 pub fn source_region(&self) -> ::std::option::Option<&str> {
87 self.source_region.as_deref()
88 }
89 /// <p>The ID of the EBS snapshot to copy.</p>
90 pub fn source_snapshot_id(&self) -> ::std::option::Option<&str> {
91 self.source_snapshot_id.as_deref()
92 }
93 /// <p>The tags to apply to the new snapshot.</p>
94 ///
95 /// 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()`.
96 pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
97 self.tag_specifications.as_deref().unwrap_or_default()
98 }
99 /// <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>
100 /// <p>If you do not specify a value, the snapshot copy operation is completed on a best-effort basis.</p>
101 pub fn completion_duration_minutes(&self) -> ::std::option::Option<i32> {
102 self.completion_duration_minutes
103 }
104 /// <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>
105 pub fn dry_run(&self) -> ::std::option::Option<bool> {
106 self.dry_run
107 }
108}
109impl ::std::fmt::Debug for CopySnapshotInput {
110 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
111 let mut formatter = f.debug_struct("CopySnapshotInput");
112 formatter.field("description", &self.description);
113 formatter.field("destination_outpost_arn", &self.destination_outpost_arn);
114 formatter.field("destination_region", &self.destination_region);
115 formatter.field("encrypted", &self.encrypted);
116 formatter.field("kms_key_id", &self.kms_key_id);
117 formatter.field("presigned_url", &"*** Sensitive Data Redacted ***");
118 formatter.field("source_region", &self.source_region);
119 formatter.field("source_snapshot_id", &self.source_snapshot_id);
120 formatter.field("tag_specifications", &self.tag_specifications);
121 formatter.field("completion_duration_minutes", &self.completion_duration_minutes);
122 formatter.field("dry_run", &self.dry_run);
123 formatter.finish()
124 }
125}
126impl CopySnapshotInput {
127 /// Creates a new builder-style object to manufacture [`CopySnapshotInput`](crate::operation::copy_snapshot::CopySnapshotInput).
128 pub fn builder() -> crate::operation::copy_snapshot::builders::CopySnapshotInputBuilder {
129 crate::operation::copy_snapshot::builders::CopySnapshotInputBuilder::default()
130 }
131}
132
133/// A builder for [`CopySnapshotInput`](crate::operation::copy_snapshot::CopySnapshotInput).
134#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
135#[non_exhaustive]
136pub struct CopySnapshotInputBuilder {
137 pub(crate) description: ::std::option::Option<::std::string::String>,
138 pub(crate) destination_outpost_arn: ::std::option::Option<::std::string::String>,
139 pub(crate) destination_region: ::std::option::Option<::std::string::String>,
140 pub(crate) encrypted: ::std::option::Option<bool>,
141 pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
142 pub(crate) presigned_url: ::std::option::Option<::std::string::String>,
143 pub(crate) source_region: ::std::option::Option<::std::string::String>,
144 pub(crate) source_snapshot_id: ::std::option::Option<::std::string::String>,
145 pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
146 pub(crate) completion_duration_minutes: ::std::option::Option<i32>,
147 pub(crate) dry_run: ::std::option::Option<bool>,
148}
149impl CopySnapshotInputBuilder {
150 /// <p>A description for the EBS snapshot.</p>
151 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152 self.description = ::std::option::Option::Some(input.into());
153 self
154 }
155 /// <p>A description for the EBS snapshot.</p>
156 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157 self.description = input;
158 self
159 }
160 /// <p>A description for the EBS snapshot.</p>
161 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
162 &self.description
163 }
164 /// <p>The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot. Only specify this parameter when copying a snapshot from an Amazon Web Services Region to an Outpost. The snapshot must be in the Region for the destination Outpost. You cannot copy a snapshot from an Outpost to a Region, from one Outpost to another, or within the same Outpost.</p>
165 /// <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>
166 pub fn destination_outpost_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167 self.destination_outpost_arn = ::std::option::Option::Some(input.into());
168 self
169 }
170 /// <p>The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot. Only specify this parameter when copying a snapshot from an Amazon Web Services Region to an Outpost. The snapshot must be in the Region for the destination Outpost. You cannot copy a snapshot from an Outpost to a Region, from one Outpost to another, or within the same Outpost.</p>
171 /// <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>
172 pub fn set_destination_outpost_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173 self.destination_outpost_arn = input;
174 self
175 }
176 /// <p>The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot. Only specify this parameter when copying a snapshot from an Amazon Web Services Region to an Outpost. The snapshot must be in the Region for the destination Outpost. You cannot copy a snapshot from an Outpost to a Region, from one Outpost to another, or within the same Outpost.</p>
177 /// <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>
178 pub fn get_destination_outpost_arn(&self) -> &::std::option::Option<::std::string::String> {
179 &self.destination_outpost_arn
180 }
181 /// <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>
182 /// <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>
183 pub fn destination_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184 self.destination_region = ::std::option::Option::Some(input.into());
185 self
186 }
187 /// <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>
188 /// <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>
189 pub fn set_destination_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190 self.destination_region = input;
191 self
192 }
193 /// <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>
194 /// <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>
195 pub fn get_destination_region(&self) -> &::std::option::Option<::std::string::String> {
196 &self.destination_region
197 }
198 /// <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. 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>
199 pub fn encrypted(mut self, input: bool) -> Self {
200 self.encrypted = ::std::option::Option::Some(input);
201 self
202 }
203 /// <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. 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>
204 pub fn set_encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
205 self.encrypted = input;
206 self
207 }
208 /// <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. 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>
209 pub fn get_encrypted(&self) -> &::std::option::Option<bool> {
210 &self.encrypted
211 }
212 /// <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>
213 /// <p>You can specify the KMS key using any of the following:</p>
214 /// <ul>
215 /// <li>
216 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
217 /// <li>
218 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
219 /// <li>
220 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
221 /// <li>
222 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
223 /// </ul>
224 /// <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>
225 pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
226 self.kms_key_id = ::std::option::Option::Some(input.into());
227 self
228 }
229 /// <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>
230 /// <p>You can specify the KMS key using any of the following:</p>
231 /// <ul>
232 /// <li>
233 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
234 /// <li>
235 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
236 /// <li>
237 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
238 /// <li>
239 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
240 /// </ul>
241 /// <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>
242 pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
243 self.kms_key_id = input;
244 self
245 }
246 /// <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>
247 /// <p>You can specify the KMS key using any of the following:</p>
248 /// <ul>
249 /// <li>
250 /// <p>Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
251 /// <li>
252 /// <p>Key alias. For example, alias/ExampleAlias.</p></li>
253 /// <li>
254 /// <p>Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.</p></li>
255 /// <li>
256 /// <p>Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.</p></li>
257 /// </ul>
258 /// <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>
259 pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
260 &self.kms_key_id
261 }
262 /// <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>
263 /// <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>
264 pub fn presigned_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
265 self.presigned_url = ::std::option::Option::Some(input.into());
266 self
267 }
268 /// <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>
269 /// <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>
270 pub fn set_presigned_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
271 self.presigned_url = input;
272 self
273 }
274 /// <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>
275 /// <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>
276 pub fn get_presigned_url(&self) -> &::std::option::Option<::std::string::String> {
277 &self.presigned_url
278 }
279 /// <p>The ID of the Region that contains the snapshot to be copied.</p>
280 /// This field is required.
281 pub fn source_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
282 self.source_region = ::std::option::Option::Some(input.into());
283 self
284 }
285 /// <p>The ID of the Region that contains the snapshot to be copied.</p>
286 pub fn set_source_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
287 self.source_region = input;
288 self
289 }
290 /// <p>The ID of the Region that contains the snapshot to be copied.</p>
291 pub fn get_source_region(&self) -> &::std::option::Option<::std::string::String> {
292 &self.source_region
293 }
294 /// <p>The ID of the EBS snapshot to copy.</p>
295 /// This field is required.
296 pub fn source_snapshot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
297 self.source_snapshot_id = ::std::option::Option::Some(input.into());
298 self
299 }
300 /// <p>The ID of the EBS snapshot to copy.</p>
301 pub fn set_source_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
302 self.source_snapshot_id = input;
303 self
304 }
305 /// <p>The ID of the EBS snapshot to copy.</p>
306 pub fn get_source_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
307 &self.source_snapshot_id
308 }
309 /// Appends an item to `tag_specifications`.
310 ///
311 /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
312 ///
313 /// <p>The tags to apply to the new snapshot.</p>
314 pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
315 let mut v = self.tag_specifications.unwrap_or_default();
316 v.push(input);
317 self.tag_specifications = ::std::option::Option::Some(v);
318 self
319 }
320 /// <p>The tags to apply to the new snapshot.</p>
321 pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
322 self.tag_specifications = input;
323 self
324 }
325 /// <p>The tags to apply to the new snapshot.</p>
326 pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
327 &self.tag_specifications
328 }
329 /// <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>
330 /// <p>If you do not specify a value, the snapshot copy operation is completed on a best-effort basis.</p>
331 pub fn completion_duration_minutes(mut self, input: i32) -> Self {
332 self.completion_duration_minutes = ::std::option::Option::Some(input);
333 self
334 }
335 /// <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>
336 /// <p>If you do not specify a value, the snapshot copy operation is completed on a best-effort basis.</p>
337 pub fn set_completion_duration_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
338 self.completion_duration_minutes = input;
339 self
340 }
341 /// <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>
342 /// <p>If you do not specify a value, the snapshot copy operation is completed on a best-effort basis.</p>
343 pub fn get_completion_duration_minutes(&self) -> &::std::option::Option<i32> {
344 &self.completion_duration_minutes
345 }
346 /// <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>
347 pub fn dry_run(mut self, input: bool) -> Self {
348 self.dry_run = ::std::option::Option::Some(input);
349 self
350 }
351 /// <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>
352 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
353 self.dry_run = input;
354 self
355 }
356 /// <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>
357 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
358 &self.dry_run
359 }
360 /// Consumes the builder and constructs a [`CopySnapshotInput`](crate::operation::copy_snapshot::CopySnapshotInput).
361 pub fn build(
362 self,
363 ) -> ::std::result::Result<crate::operation::copy_snapshot::CopySnapshotInput, ::aws_smithy_types::error::operation::BuildError> {
364 ::std::result::Result::Ok(crate::operation::copy_snapshot::CopySnapshotInput {
365 description: self.description,
366 destination_outpost_arn: self.destination_outpost_arn,
367 destination_region: self.destination_region,
368 encrypted: self.encrypted,
369 kms_key_id: self.kms_key_id,
370 presigned_url: self.presigned_url,
371 source_region: self.source_region,
372 source_snapshot_id: self.source_snapshot_id,
373 tag_specifications: self.tag_specifications,
374 completion_duration_minutes: self.completion_duration_minutes,
375 dry_run: self.dry_run,
376 })
377 }
378}
379impl ::std::fmt::Debug for CopySnapshotInputBuilder {
380 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
381 let mut formatter = f.debug_struct("CopySnapshotInputBuilder");
382 formatter.field("description", &self.description);
383 formatter.field("destination_outpost_arn", &self.destination_outpost_arn);
384 formatter.field("destination_region", &self.destination_region);
385 formatter.field("encrypted", &self.encrypted);
386 formatter.field("kms_key_id", &self.kms_key_id);
387 formatter.field("presigned_url", &"*** Sensitive Data Redacted ***");
388 formatter.field("source_region", &self.source_region);
389 formatter.field("source_snapshot_id", &self.source_snapshot_id);
390 formatter.field("tag_specifications", &self.tag_specifications);
391 formatter.field("completion_duration_minutes", &self.completion_duration_minutes);
392 formatter.field("dry_run", &self.dry_run);
393 formatter.finish()
394 }
395}