280 146 | }
|
281 147 | }
|
282 148 | impl crate::constrained::Constrained for crate::input::ListChangedBlocksInput {
|
283 149 | type Unconstrained = crate::input::list_changed_blocks_input::Builder;
|
284 150 | }
|
285 151 |
|
286 152 | #[allow(missing_docs)] // documentation missing in model
|
287 153 | #[derive(
|
288 154 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
289 155 | )]
|
290 - | pub struct GetSnapshotBlockInput {
|
291 - | /// <p>The ID of the snapshot containing the block from which to get data.</p>
|
156 + | pub struct ListSnapshotBlocksInput {
|
157 + | /// <p>The number of results to return.</p>
|
158 + | pub max_results: ::std::option::Option<crate::model::MaxResults>,
|
159 + | /// <p>The block index from which the list should start. The list in the response will start from this block index or the next valid block index in the snapshot.</p>
|
160 + | pub starting_block_index: ::std::option::Option<crate::model::BlockIndex>,
|
161 + | /// <p>The token to request the next page of results.</p>
|
162 + | pub next_token: ::std::option::Option<crate::model::PageToken>,
|
163 + | /// <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
|
292 164 | pub snapshot_id: crate::model::SnapshotId,
|
293 - | /// <p>The block token of the block from which to get data.</p>
|
294 - | /// <p>Obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
295 - | pub block_token: crate::model::BlockToken,
|
296 - | /// <p>The block index of the block from which to get data.</p>
|
297 - | /// <p>Obtain the <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
165 + | }
|
166 + | impl ListSnapshotBlocksInput {
|
167 + | /// <p>The number of results to return.</p>
|
168 + | pub fn max_results(&self) -> ::std::option::Option<&crate::model::MaxResults> {
|
169 + | self.max_results.as_ref()
|
170 + | }
|
171 + | /// <p>The block index from which the list should start. The list in the response will start from this block index or the next valid block index in the snapshot.</p>
|
172 + | pub fn starting_block_index(&self) -> ::std::option::Option<&crate::model::BlockIndex> {
|
173 + | self.starting_block_index.as_ref()
|
174 + | }
|
175 + | /// <p>The token to request the next page of results.</p>
|
176 + | pub fn next_token(&self) -> ::std::option::Option<&crate::model::PageToken> {
|
177 + | self.next_token.as_ref()
|
178 + | }
|
179 + | /// <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
|
180 + | pub fn snapshot_id(&self) -> &crate::model::SnapshotId {
|
181 + | &self.snapshot_id
|
182 + | }
|
183 + | }
|
184 + | impl ListSnapshotBlocksInput {
|
185 + | /// Creates a new builder-style object to manufacture [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
186 + | pub fn builder() -> crate::input::list_snapshot_blocks_input::Builder {
|
187 + | crate::input::list_snapshot_blocks_input::Builder::default()
|
188 + | }
|
189 + | }
|
190 + | impl crate::constrained::Constrained for crate::input::ListSnapshotBlocksInput {
|
191 + | type Unconstrained = crate::input::list_snapshot_blocks_input::Builder;
|
192 + | }
|
193 + |
|
194 + | #[allow(missing_docs)] // documentation missing in model
|
195 + | pub struct PutSnapshotBlockInput {
|
196 + | /// <p>The ID of the snapshot.</p>
|
197 + | pub snapshot_id: crate::model::SnapshotId,
|
198 + | /// <p>The block index of the block in which to write the data. A block index is a logical index in units of <code>512</code> KiB blocks. To identify the block index, divide the logical offset of the data in the logical volume by the block size (logical offset of data/<code>524288</code>). The logical offset of the data must be <code>512</code> KiB aligned.</p>
|
298 199 | pub block_index: crate::model::BlockIndex,
|
200 + | /// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
|
201 + | pub checksum: crate::model::Checksum,
|
202 + | /// <p>The progress of the write process, as a percentage.</p>
|
203 + | pub progress: ::std::option::Option<crate::model::Progress>,
|
204 + | /// <p>The data to write to the block.</p>
|
205 + | /// <p>The block data is not signed as part of the Signature Version 4 signing process. As a result, you must generate and provide a Base64-encoded SHA256 checksum for the block data using the <b>x-amz-Checksum</b> header. Also, you must specify the checksum algorithm using the <b>x-amz-Checksum-Algorithm</b> header. The checksum that you provide is part of the Signature Version 4 signing process. It is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity of the data. If the checksums do not correspond, the request fails. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-checksums"> Using checksums with the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
206 + | pub block_data: ::aws_smithy_types::byte_stream::ByteStream,
|
207 + | /// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code>.</p>
|
208 + | /// <p>Valid values: <code>524288</code></p>
|
209 + | pub data_length: i32,
|
210 + | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
211 + | pub checksum_algorithm: crate::model::ChecksumAlgorithm,
|
299 212 | }
|
300 - | impl GetSnapshotBlockInput {
|
301 - | /// <p>The ID of the snapshot containing the block from which to get data.</p>
|
213 + | impl PutSnapshotBlockInput {
|
214 + | /// <p>The ID of the snapshot.</p>
|
302 215 | pub fn snapshot_id(&self) -> &crate::model::SnapshotId {
|
303 216 | &self.snapshot_id
|
304 217 | }
|
305 - | /// <p>The block token of the block from which to get data.</p>
|
306 - | /// <p>Obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
307 - | pub fn block_token(&self) -> &crate::model::BlockToken {
|
308 - | &self.block_token
|
218 + | /// <p>The block index of the block in which to write the data. A block index is a logical index in units of <code>512</code> KiB blocks. To identify the block index, divide the logical offset of the data in the logical volume by the block size (logical offset of data/<code>524288</code>). The logical offset of the data must be <code>512</code> KiB aligned.</p>
|
219 + | pub fn block_index(&self) -> &crate::model::BlockIndex {
|
220 + | &self.block_index
|
221 + | }
|
222 + | /// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
|
223 + | pub fn checksum(&self) -> &crate::model::Checksum {
|
224 + | &self.checksum
|
225 + | }
|
226 + | /// <p>The progress of the write process, as a percentage.</p>
|
227 + | pub fn progress(&self) -> ::std::option::Option<&crate::model::Progress> {
|
228 + | self.progress.as_ref()
|
229 + | }
|
230 + | /// <p>The data to write to the block.</p>
|
231 + | /// <p>The block data is not signed as part of the Signature Version 4 signing process. As a result, you must generate and provide a Base64-encoded SHA256 checksum for the block data using the <b>x-amz-Checksum</b> header. Also, you must specify the checksum algorithm using the <b>x-amz-Checksum-Algorithm</b> header. The checksum that you provide is part of the Signature Version 4 signing process. It is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity of the data. If the checksums do not correspond, the request fails. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-checksums"> Using checksums with the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
232 + | pub fn block_data(&self) -> &::aws_smithy_types::byte_stream::ByteStream {
|
233 + | &self.block_data
|
234 + | }
|
235 + | /// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code>.</p>
|
236 + | /// <p>Valid values: <code>524288</code></p>
|
237 + | pub fn data_length(&self) -> i32 {
|
238 + | self.data_length
|
239 + | }
|
240 + | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
241 + | pub fn checksum_algorithm(&self) -> &crate::model::ChecksumAlgorithm {
|
242 + | &self.checksum_algorithm
|
243 + | }
|
244 + | }
|
245 + | impl ::std::fmt::Debug for PutSnapshotBlockInput {
|
246 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
247 + | let mut formatter = f.debug_struct("PutSnapshotBlockInput");
|
248 + | formatter.field("snapshot_id", &self.snapshot_id);
|
249 + | formatter.field("block_index", &self.block_index);
|
250 + | formatter.field("checksum", &self.checksum);
|
251 + | formatter.field("progress", &self.progress);
|
252 + | formatter.field("block_data", &"*** Sensitive Data Redacted ***");
|
253 + | formatter.field("data_length", &self.data_length);
|
254 + | formatter.field("checksum_algorithm", &self.checksum_algorithm);
|
255 + | formatter.finish()
|
256 + | }
|
257 + | }
|
258 + | impl PutSnapshotBlockInput {
|
259 + | /// Creates a new builder-style object to manufacture [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
260 + | pub fn builder() -> crate::input::put_snapshot_block_input::Builder {
|
261 + | crate::input::put_snapshot_block_input::Builder::default()
|
262 + | }
|
263 + | }
|
264 + | impl crate::constrained::Constrained for crate::input::PutSnapshotBlockInput {
|
265 + | type Unconstrained = crate::input::put_snapshot_block_input::Builder;
|
266 + | }
|
267 + |
|
268 + | #[allow(missing_docs)] // documentation missing in model
|
269 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::hash::Hash)]
|
270 + | pub struct StartSnapshotInput {
|
271 + | /// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
|
272 + | /// <ul>
|
273 + | /// <li>
|
274 + | /// <p>No blocks are written to the snapshot.</p></li>
|
275 + | /// <li>
|
276 + | /// <p>The snapshot is not completed after writing the last block of data.</p></li>
|
277 + | /// </ul>
|
278 + | /// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
|
279 + | pub timeout: ::std::option::Option<crate::model::Timeout>,
|
280 + | /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
|
281 + | /// <p>If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
|
282 + | /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html"> Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
283 + | pub client_token: ::std::option::Option<crate::model::IdempotencyToken>,
|
284 + | /// <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
|
285 + | pub volume_size: crate::model::VolumeSize,
|
286 + | /// <p>The tags to apply to the snapshot.</p>
|
287 + | pub tags: ::std::option::Option<::std::vec::Vec<crate::model::Tag>>,
|
288 + | /// <p>Indicates whether to encrypt the snapshot. To create an encrypted snapshot, specify <code>true</code>. To create an unencrypted snapshot, omit this parameter.</p>
|
289 + | /// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
|
290 + | /// <p>If you specify <code>true</code>, the snapshot is encrypted using the CMK specified using the <b>KmsKeyArn</b> parameter. If no value is specified for <b>KmsKeyArn</b>, the default CMK for your account is used. If no default CMK has been specified for your account, the AWS managed CMK is used. To set a default CMK for your account, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html"> ModifyEbsDefaultKmsKeyId</a>.</p>
|
291 + | /// <p>If your account is enabled for encryption by default, you cannot set this parameter to <code>false</code>. In this case, you can omit this parameter.</p>
|
292 + | /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption"> Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
293 + | pub encrypted: ::std::option::Option<bool>,
|
294 + | /// <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) to be used to encrypt the snapshot. If you do not specify a CMK, the default AWS managed CMK is used.</p>
|
295 + | /// <p>If you specify a <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted using the same CMK that was used to encrypt the parent snapshot.</p>
|
296 + | /// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN.</p>
|
297 + | pub kms_key_arn: ::std::option::Option<crate::model::KmsKeyArn>,
|
298 + | /// <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are creating the first snapshot for an on-premises volume, omit this parameter.</p>
|
299 + | /// <p>If your account is enabled for encryption by default, you cannot use an unencrypted snapshot as a parent snapshot. You must first create an encrypted copy of the parent snapshot using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
|
300 + | pub parent_snapshot_id: ::std::option::Option<crate::model::SnapshotId>,
|
301 + | /// <p>A description for the snapshot.</p>
|
302 + | pub description: ::std::option::Option<crate::model::Description>,
|
303 + | }
|
304 + | impl StartSnapshotInput {
|
305 + | /// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
|
306 + | /// <ul>
|
307 + | /// <li>
|
308 + | /// <p>No blocks are written to the snapshot.</p></li>
|
309 + | /// <li>
|
310 + | /// <p>The snapshot is not completed after writing the last block of data.</p></li>
|
311 + | /// </ul>
|
312 + | /// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
|
313 + | pub fn timeout(&self) -> ::std::option::Option<&crate::model::Timeout> {
|
314 + | self.timeout.as_ref()
|
315 + | }
|
316 + | /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
|
317 + | /// <p>If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
|
318 + | /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html"> Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
319 + | pub fn client_token(&self) -> ::std::option::Option<&crate::model::IdempotencyToken> {
|
320 + | self.client_token.as_ref()
|
309 321 | }
|
310 - | /// <p>The block index of the block from which to get data.</p>
|
311 - | /// <p>Obtain the <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
312 - | pub fn block_index(&self) -> &crate::model::BlockIndex {
|
313 - | &self.block_index
|
322 + | /// <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
|
323 + | pub fn volume_size(&self) -> &crate::model::VolumeSize {
|
324 + | &self.volume_size
|
314 325 | }
|
315 - | }
|
316 - | impl GetSnapshotBlockInput {
|
317 - | /// Creates a new builder-style object to manufacture [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
318 - | pub fn builder() -> crate::input::get_snapshot_block_input::Builder {
|
319 - | crate::input::get_snapshot_block_input::Builder::default()
|
326 + | /// <p>The tags to apply to the snapshot.</p>
|
327 + | pub fn tags(&self) -> ::std::option::Option<&[crate::model::Tag]> {
|
328 + | self.tags.as_deref()
|
320 329 | }
|
321 - | }
|
322 - | impl crate::constrained::Constrained for crate::input::GetSnapshotBlockInput {
|
323 - | type Unconstrained = crate::input::get_snapshot_block_input::Builder;
|
324 - | }
|
325 - |
|
326 - | #[allow(missing_docs)] // documentation missing in model
|
327 - | #[derive(
|
328 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
329 - | )]
|
330 - | pub struct CompleteSnapshotInput {
|
331 - | /// <p>The number of blocks that were written to the snapshot.</p>
|
332 - | pub changed_blocks_count: crate::model::ChangedBlocksCount,
|
333 - | /// <p>The aggregation method used to generate the checksum. Currently, the only supported aggregation method is <code>LINEAR</code>.</p>
|
334 - | pub checksum_aggregation_method: ::std::option::Option<crate::model::ChecksumAggregationMethod>,
|
335 - | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
336 - | pub checksum_algorithm: ::std::option::Option<crate::model::ChecksumAlgorithm>,
|
337 - | /// <p>The ID of the snapshot.</p>
|
338 - | pub snapshot_id: crate::model::SnapshotId,
|
339 - | /// <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written block.</p>
|
340 - | /// <p>To generate the aggregated checksum using the linear aggregation method, arrange the checksums for each written block in ascending order of their block index, concatenate them to form a single string, and then generate the checksum on the entire string using the SHA256 algorithm.</p>
|
341 - | pub checksum: ::std::option::Option<crate::model::Checksum>,
|
342 - | }
|
343 - | impl CompleteSnapshotInput {
|
344 - | /// <p>The number of blocks that were written to the snapshot.</p>
|
345 - | pub fn changed_blocks_count(&self) -> &crate::model::ChangedBlocksCount {
|
346 - | &self.changed_blocks_count
|
330 + | /// <p>Indicates whether to encrypt the snapshot. To create an encrypted snapshot, specify <code>true</code>. To create an unencrypted snapshot, omit this parameter.</p>
|
331 + | /// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
|
332 + | /// <p>If you specify <code>true</code>, the snapshot is encrypted using the CMK specified using the <b>KmsKeyArn</b> parameter. If no value is specified for <b>KmsKeyArn</b>, the default CMK for your account is used. If no default CMK has been specified for your account, the AWS managed CMK is used. To set a default CMK for your account, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html"> ModifyEbsDefaultKmsKeyId</a>.</p>
|
333 + | /// <p>If your account is enabled for encryption by default, you cannot set this parameter to <code>false</code>. In this case, you can omit this parameter.</p>
|
334 + | /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption"> Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
335 + | pub fn encrypted(&self) -> ::std::option::Option<bool> {
|
336 + | self.encrypted
|
347 337 | }
|
348 - | /// <p>The aggregation method used to generate the checksum. Currently, the only supported aggregation method is <code>LINEAR</code>.</p>
|
349 - | pub fn checksum_aggregation_method(
|
350 - | &self,
|
351 - | ) -> ::std::option::Option<&crate::model::ChecksumAggregationMethod> {
|
352 - | self.checksum_aggregation_method.as_ref()
|
338 + | /// <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) to be used to encrypt the snapshot. If you do not specify a CMK, the default AWS managed CMK is used.</p>
|
339 + | /// <p>If you specify a <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted using the same CMK that was used to encrypt the parent snapshot.</p>
|
340 + | /// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN.</p>
|
341 + | pub fn kms_key_arn(&self) -> ::std::option::Option<&crate::model::KmsKeyArn> {
|
342 + | self.kms_key_arn.as_ref()
|
353 343 | }
|
354 - | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
355 - | pub fn checksum_algorithm(&self) -> ::std::option::Option<&crate::model::ChecksumAlgorithm> {
|
356 - | self.checksum_algorithm.as_ref()
|
344 + | /// <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are creating the first snapshot for an on-premises volume, omit this parameter.</p>
|
345 + | /// <p>If your account is enabled for encryption by default, you cannot use an unencrypted snapshot as a parent snapshot. You must first create an encrypted copy of the parent snapshot using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
|
346 + | pub fn parent_snapshot_id(&self) -> ::std::option::Option<&crate::model::SnapshotId> {
|
347 + | self.parent_snapshot_id.as_ref()
|
357 348 | }
|
358 - | /// <p>The ID of the snapshot.</p>
|
359 - | pub fn snapshot_id(&self) -> &crate::model::SnapshotId {
|
360 - | &self.snapshot_id
|
349 + | /// <p>A description for the snapshot.</p>
|
350 + | pub fn description(&self) -> ::std::option::Option<&crate::model::Description> {
|
351 + | self.description.as_ref()
|
361 352 | }
|
362 - | /// <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written block.</p>
|
363 - | /// <p>To generate the aggregated checksum using the linear aggregation method, arrange the checksums for each written block in ascending order of their block index, concatenate them to form a single string, and then generate the checksum on the entire string using the SHA256 algorithm.</p>
|
364 - | pub fn checksum(&self) -> ::std::option::Option<&crate::model::Checksum> {
|
365 - | self.checksum.as_ref()
|
353 + | }
|
354 + | impl ::std::fmt::Debug for StartSnapshotInput {
|
355 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
356 + | let mut formatter = f.debug_struct("StartSnapshotInput");
|
357 + | formatter.field("timeout", &self.timeout);
|
358 + | formatter.field("client_token", &self.client_token);
|
359 + | formatter.field("volume_size", &self.volume_size);
|
360 + | formatter.field("tags", &self.tags);
|
361 + | formatter.field("encrypted", &self.encrypted);
|
362 + | formatter.field("kms_key_arn", &"*** Sensitive Data Redacted ***");
|
363 + | formatter.field("parent_snapshot_id", &self.parent_snapshot_id);
|
364 + | formatter.field("description", &self.description);
|
365 + | formatter.finish()
|
366 366 | }
|
367 367 | }
|
368 - | impl CompleteSnapshotInput {
|
369 - | /// Creates a new builder-style object to manufacture [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
370 - | pub fn builder() -> crate::input::complete_snapshot_input::Builder {
|
371 - | crate::input::complete_snapshot_input::Builder::default()
|
368 + | impl StartSnapshotInput {
|
369 + | /// Creates a new builder-style object to manufacture [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
370 + | pub fn builder() -> crate::input::start_snapshot_input::Builder {
|
371 + | crate::input::start_snapshot_input::Builder::default()
|
372 372 | }
|
373 373 | }
|
374 - | impl crate::constrained::Constrained for crate::input::CompleteSnapshotInput {
|
375 - | type Unconstrained = crate::input::complete_snapshot_input::Builder;
|
374 + | impl crate::constrained::Constrained for crate::input::StartSnapshotInput {
|
375 + | type Unconstrained = crate::input::start_snapshot_input::Builder;
|
376 376 | }
|
377 - | /// See [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
378 - | pub mod start_snapshot_input {
|
377 + | /// See [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
378 + | pub mod complete_snapshot_input {
|
379 379 |
|
380 380 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
381 381 | /// Holds one variant for each of the ways the builder can fail.
|
382 382 | #[non_exhaustive]
|
383 383 | #[allow(clippy::enum_variant_names)]
|
384 384 | pub enum ConstraintViolation {
|
385 - | /// Constraint violation occurred building member `timeout` when building `StartSnapshotInput`.
|
386 - | #[doc(hidden)]
|
387 - | Timeout(crate::model::timeout::ConstraintViolation),
|
388 - | /// Constraint violation occurred building member `client_token` when building `StartSnapshotInput`.
|
389 - | #[doc(hidden)]
|
390 - | ClientToken(crate::model::idempotency_token::ConstraintViolation),
|
391 - | /// `volume_size` was not provided but it is required when building `StartSnapshotInput`.
|
392 - | MissingVolumeSize,
|
393 - | /// Constraint violation occurred building member `volume_size` when building `StartSnapshotInput`.
|
385 + | /// `changed_blocks_count` was not provided but it is required when building `CompleteSnapshotInput`.
|
386 + | MissingChangedBlocksCount,
|
387 + | /// Constraint violation occurred building member `changed_blocks_count` when building `CompleteSnapshotInput`.
|
394 388 | #[doc(hidden)]
|
395 - | VolumeSize(crate::model::volume_size::ConstraintViolation),
|
396 - | /// Constraint violation occurred building member `tags` when building `StartSnapshotInput`.
|
389 + | ChangedBlocksCount(crate::model::changed_blocks_count::ConstraintViolation),
|
390 + | /// Constraint violation occurred building member `checksum_aggregation_method` when building `CompleteSnapshotInput`.
|
397 391 | #[doc(hidden)]
|
398 - | Tags(crate::model::tags::ConstraintViolation),
|
399 - | /// Constraint violation occurred building member `kms_key_arn` when building `StartSnapshotInput`.
|
392 + | ChecksumAggregationMethod(crate::model::checksum_aggregation_method::ConstraintViolation),
|
393 + | /// Constraint violation occurred building member `checksum_algorithm` when building `CompleteSnapshotInput`.
|
400 394 | #[doc(hidden)]
|
401 - | KmsKeyArn(crate::model::kms_key_arn::ConstraintViolation),
|
402 - | /// Constraint violation occurred building member `parent_snapshot_id` when building `StartSnapshotInput`.
|
395 + | ChecksumAlgorithm(crate::model::checksum_algorithm::ConstraintViolation),
|
396 + | /// `snapshot_id` was not provided but it is required when building `CompleteSnapshotInput`.
|
397 + | MissingSnapshotId,
|
398 + | /// Constraint violation occurred building member `snapshot_id` when building `CompleteSnapshotInput`.
|
403 399 | #[doc(hidden)]
|
404 - | ParentSnapshotId(crate::model::snapshot_id::ConstraintViolation),
|
405 - | /// Constraint violation occurred building member `description` when building `StartSnapshotInput`.
|
400 + | SnapshotId(crate::model::snapshot_id::ConstraintViolation),
|
401 + | /// Constraint violation occurred building member `checksum` when building `CompleteSnapshotInput`.
|
406 402 | #[doc(hidden)]
|
407 - | Description(crate::model::description::ConstraintViolation),
|
403 + | Checksum(crate::model::checksum::ConstraintViolation),
|
408 404 | }
|
409 405 | impl ::std::fmt::Display for ConstraintViolation {
|
410 406 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
411 407 | match self {
|
412 - | ConstraintViolation::Timeout(_) => write!(f, "constraint violation occurred building member `timeout` when building `StartSnapshotInput`"),
|
413 - | ConstraintViolation::ClientToken(_) => write!(f, "constraint violation occurred building member `client_token` when building `StartSnapshotInput`"),
|
414 - | ConstraintViolation::MissingVolumeSize => write!(f, "`volume_size` was not provided but it is required when building `StartSnapshotInput`"),
|
415 - | ConstraintViolation::VolumeSize(_) => write!(f, "constraint violation occurred building member `volume_size` when building `StartSnapshotInput`"),
|
416 - | ConstraintViolation::Tags(_) => write!(f, "constraint violation occurred building member `tags` when building `StartSnapshotInput`"),
|
417 - | ConstraintViolation::KmsKeyArn(_) => write!(f, "constraint violation occurred building member `kms_key_arn` when building `StartSnapshotInput`"),
|
418 - | ConstraintViolation::ParentSnapshotId(_) => write!(f, "constraint violation occurred building member `parent_snapshot_id` when building `StartSnapshotInput`"),
|
419 - | ConstraintViolation::Description(_) => write!(f, "constraint violation occurred building member `description` when building `StartSnapshotInput`"),
|
408 + | ConstraintViolation::MissingChangedBlocksCount => write!(f, "`changed_blocks_count` was not provided but it is required when building `CompleteSnapshotInput`"),
|
409 + | ConstraintViolation::ChangedBlocksCount(_) => write!(f, "constraint violation occurred building member `changed_blocks_count` when building `CompleteSnapshotInput`"),
|
410 + | ConstraintViolation::ChecksumAggregationMethod(_) => write!(f, "constraint violation occurred building member `checksum_aggregation_method` when building `CompleteSnapshotInput`"),
|
411 + | ConstraintViolation::ChecksumAlgorithm(_) => write!(f, "constraint violation occurred building member `checksum_algorithm` when building `CompleteSnapshotInput`"),
|
412 + | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `CompleteSnapshotInput`"),
|
413 + | ConstraintViolation::SnapshotId(_) => write!(f, "constraint violation occurred building member `snapshot_id` when building `CompleteSnapshotInput`"),
|
414 + | ConstraintViolation::Checksum(_) => write!(f, "constraint violation occurred building member `checksum` when building `CompleteSnapshotInput`"),
|
420 415 | }
|
421 416 | }
|
422 417 | }
|
423 418 | impl ::std::error::Error for ConstraintViolation {}
|
424 419 | impl ConstraintViolation {
|
425 420 | pub(crate) fn as_validation_exception_field(
|
426 421 | self,
|
427 422 | path: ::std::string::String,
|
428 423 | ) -> crate::model::ValidationExceptionField {
|
429 424 | match self {
|
430 - | ConstraintViolation::Timeout(inner) => inner.as_validation_exception_field(path + "/Timeout"),
|
431 - | ConstraintViolation::ClientToken(inner) => inner.as_validation_exception_field(path + "/ClientToken"),
|
432 - | ConstraintViolation::MissingVolumeSize => crate::model::ValidationExceptionField {
|
433 - | message: format!("Value at '{}/VolumeSize' failed to satisfy constraint: Member must not be null", path),
|
434 - | path: path + "/VolumeSize",
|
425 + | ConstraintViolation::MissingChangedBlocksCount => crate::model::ValidationExceptionField {
|
426 + | message: format!("Value at '{}/ChangedBlocksCount' failed to satisfy constraint: Member must not be null", path),
|
427 + | path: path + "/ChangedBlocksCount",
|
435 428 | },
|
436 - | ConstraintViolation::VolumeSize(inner) => inner.as_validation_exception_field(path + "/VolumeSize"),
|
437 - | ConstraintViolation::Tags(inner) => inner.as_validation_exception_field(path + "/Tags"),
|
438 - | ConstraintViolation::KmsKeyArn(inner) => inner.as_validation_exception_field(path + "/KmsKeyArn"),
|
439 - | ConstraintViolation::ParentSnapshotId(inner) => inner.as_validation_exception_field(path + "/ParentSnapshotId"),
|
440 - | ConstraintViolation::Description(inner) => inner.as_validation_exception_field(path + "/Description"),
|
429 + | ConstraintViolation::ChangedBlocksCount(inner) => inner.as_validation_exception_field(path + "/ChangedBlocksCount"),
|
430 + | ConstraintViolation::ChecksumAggregationMethod(inner) => inner.as_validation_exception_field(path + "/ChecksumAggregationMethod"),
|
431 + | ConstraintViolation::ChecksumAlgorithm(inner) => inner.as_validation_exception_field(path + "/ChecksumAlgorithm"),
|
432 + | ConstraintViolation::MissingSnapshotId => crate::model::ValidationExceptionField {
|
433 + | message: format!("Value at '{}/SnapshotId' failed to satisfy constraint: Member must not be null", path),
|
434 + | path: path + "/SnapshotId",
|
435 + | },
|
436 + | ConstraintViolation::SnapshotId(inner) => inner.as_validation_exception_field(path + "/SnapshotId"),
|
437 + | ConstraintViolation::Checksum(inner) => inner.as_validation_exception_field(path + "/Checksum"),
|
441 438 | }
|
442 439 | }
|
443 440 | }
|
444 441 | impl ::std::convert::From<ConstraintViolation>
|
445 442 | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
446 443 | {
|
447 444 | fn from(constraint_violation: ConstraintViolation) -> Self {
|
448 445 | let first_validation_exception_field =
|
449 446 | constraint_violation.as_validation_exception_field("".to_owned());
|
450 447 | let validation_exception = crate::error::ValidationException {
|
451 448 | message: format!(
|
452 449 | "1 validation error detected. {}",
|
453 450 | &first_validation_exception_field.message
|
454 451 | ),
|
455 452 | field_list: Some(vec![first_validation_exception_field]),
|
456 453 | };
|
457 454 | Self::ConstraintViolation(
|
458 455 | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
459 456 | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
460 457 | )
|
461 458 | }
|
462 459 | }
|
463 460 | impl ::std::convert::From<Builder>
|
464 - | for crate::constrained::MaybeConstrained<crate::input::StartSnapshotInput>
|
461 + | for crate::constrained::MaybeConstrained<crate::input::CompleteSnapshotInput>
|
465 462 | {
|
466 463 | fn from(builder: Builder) -> Self {
|
467 464 | Self::Unconstrained(builder)
|
468 465 | }
|
469 466 | }
|
470 - | impl ::std::convert::TryFrom<Builder> for crate::input::StartSnapshotInput {
|
467 + | impl ::std::convert::TryFrom<Builder> for crate::input::CompleteSnapshotInput {
|
471 468 | type Error = ConstraintViolation;
|
472 469 |
|
473 470 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
474 471 | builder.build()
|
475 472 | }
|
476 473 | }
|
477 - | /// A builder for [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
478 - | #[derive(::std::clone::Clone, ::std::default::Default)]
|
479 - | pub struct Builder {
|
480 - | pub(crate) timeout:
|
481 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Timeout>>,
|
482 - | pub(crate) client_token: ::std::option::Option<
|
483 - | crate::constrained::MaybeConstrained<crate::model::IdempotencyToken>,
|
484 - | >,
|
485 - | pub(crate) volume_size:
|
486 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::VolumeSize>>,
|
487 - | pub(crate) tags: ::std::option::Option<
|
488 - | crate::constrained::MaybeConstrained<
|
489 - | crate::constrained::tags_constrained::TagsConstrained,
|
490 - | >,
|
491 - | >,
|
492 - | pub(crate) encrypted: ::std::option::Option<bool>,
|
493 - | pub(crate) kms_key_arn:
|
494 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::KmsKeyArn>>,
|
495 - | pub(crate) parent_snapshot_id:
|
496 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
497 - | pub(crate) description:
|
498 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Description>>,
|
499 - | }
|
500 - | impl Builder {
|
501 - | /// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
|
502 - | /// <ul>
|
503 - | /// <li>
|
504 - | /// <p>No blocks are written to the snapshot.</p></li>
|
505 - | /// <li>
|
506 - | /// <p>The snapshot is not completed after writing the last block of data.</p></li>
|
507 - | /// </ul>
|
508 - | /// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
|
509 - | pub fn timeout(mut self, input: ::std::option::Option<crate::model::Timeout>) -> Self {
|
510 - | self.timeout = input.map(crate::constrained::MaybeConstrained::Constrained);
|
511 - | self
|
512 - | }
|
513 - | /// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
|
514 - | /// <ul>
|
515 - | /// <li>
|
516 - | /// <p>No blocks are written to the snapshot.</p></li>
|
517 - | /// <li>
|
518 - | /// <p>The snapshot is not completed after writing the last block of data.</p></li>
|
519 - | /// </ul>
|
520 - | /// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
|
521 - | pub(crate) fn set_timeout(
|
522 - | mut self,
|
523 - | input: Option<
|
524 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Timeout>>,
|
525 - | >,
|
526 - | ) -> Self {
|
527 - | self.timeout = input.map(|v| v.into());
|
528 - | self
|
529 - | }
|
530 - | /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
|
531 - | /// <p>If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
|
532 - | /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html"> Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
533 - | pub fn client_token(
|
534 - | mut self,
|
535 - | input: ::std::option::Option<crate::model::IdempotencyToken>,
|
536 - | ) -> Self {
|
537 - | self.client_token = input.map(crate::constrained::MaybeConstrained::Constrained);
|
538 - | self
|
539 - | }
|
540 - | /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
|
541 - | /// <p>If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
|
542 - | /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html"> Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
543 - | pub(crate) fn set_client_token(
|
544 - | mut self,
|
545 - | input: Option<
|
546 - | impl ::std::convert::Into<
|
547 - | crate::constrained::MaybeConstrained<crate::model::IdempotencyToken>,
|
474 + | /// A builder for [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
475 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
476 + | pub struct Builder {
|
477 + | pub(crate) changed_blocks_count: ::std::option::Option<
|
478 + | crate::constrained::MaybeConstrained<crate::model::ChangedBlocksCount>,
|
548 479 | >,
|
480 + | pub(crate) checksum_aggregation_method: ::std::option::Option<
|
481 + | crate::constrained::MaybeConstrained<crate::model::ChecksumAggregationMethod>,
|
549 482 | >,
|
550 - | ) -> Self {
|
551 - | self.client_token = input.map(|v| v.into());
|
552 - | self
|
483 + | pub(crate) checksum_algorithm: ::std::option::Option<
|
484 + | crate::constrained::MaybeConstrained<crate::model::ChecksumAlgorithm>,
|
485 + | >,
|
486 + | pub(crate) snapshot_id:
|
487 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
488 + | pub(crate) checksum:
|
489 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Checksum>>,
|
553 490 | }
|
554 - | /// <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
|
555 - | pub fn volume_size(mut self, input: crate::model::VolumeSize) -> Self {
|
556 - | self.volume_size = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
491 + | impl Builder {
|
492 + | /// <p>The number of blocks that were written to the snapshot.</p>
|
493 + | pub fn changed_blocks_count(mut self, input: crate::model::ChangedBlocksCount) -> Self {
|
494 + | self.changed_blocks_count =
|
495 + | Some(crate::constrained::MaybeConstrained::Constrained(input));
|
557 496 | self
|
558 497 | }
|
559 - | /// <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
|
560 - | pub(crate) fn set_volume_size(
|
498 + | /// <p>The number of blocks that were written to the snapshot.</p>
|
499 + | pub(crate) fn set_changed_blocks_count(
|
561 500 | mut self,
|
562 501 | input: impl ::std::convert::Into<
|
563 - | crate::constrained::MaybeConstrained<crate::model::VolumeSize>,
|
502 + | crate::constrained::MaybeConstrained<crate::model::ChangedBlocksCount>,
|
564 503 | >,
|
565 504 | ) -> Self {
|
566 - | self.volume_size = Some(input.into());
|
505 + | self.changed_blocks_count = Some(input.into());
|
567 506 | self
|
568 507 | }
|
569 - | /// <p>The tags to apply to the snapshot.</p>
|
570 - | pub fn tags(
|
508 + | /// <p>The aggregation method used to generate the checksum. Currently, the only supported aggregation method is <code>LINEAR</code>.</p>
|
509 + | pub fn checksum_aggregation_method(
|
571 510 | mut self,
|
572 - | input: ::std::option::Option<::std::vec::Vec<crate::model::Tag>>,
|
511 + | input: ::std::option::Option<crate::model::ChecksumAggregationMethod>,
|
573 512 | ) -> Self {
|
574 - | self.tags =
|
575 - | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
513 + | self.checksum_aggregation_method =
|
514 + | input.map(crate::constrained::MaybeConstrained::Constrained);
|
576 515 | self
|
577 516 | }
|
578 - | /// <p>The tags to apply to the snapshot.</p>
|
579 - | pub(crate) fn set_tags(
|
517 + | /// <p>The aggregation method used to generate the checksum. Currently, the only supported aggregation method is <code>LINEAR</code>.</p>
|
518 + | pub(crate) fn set_checksum_aggregation_method(
|
580 519 | mut self,
|
581 520 | input: Option<
|
582 521 | impl ::std::convert::Into<
|
583 - | crate::constrained::MaybeConstrained<
|
584 - | crate::constrained::tags_constrained::TagsConstrained,
|
585 - | >,
|
522 + | crate::constrained::MaybeConstrained<crate::model::ChecksumAggregationMethod>,
|
586 523 | >,
|
587 524 | >,
|
588 525 | ) -> Self {
|
589 - | self.tags = input.map(|v| v.into());
|
590 - | self
|
591 - | }
|
592 - | /// <p>Indicates whether to encrypt the snapshot. To create an encrypted snapshot, specify <code>true</code>. To create an unencrypted snapshot, omit this parameter.</p>
|
593 - | /// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
|
594 - | /// <p>If you specify <code>true</code>, the snapshot is encrypted using the CMK specified using the <b>KmsKeyArn</b> parameter. If no value is specified for <b>KmsKeyArn</b>, the default CMK for your account is used. If no default CMK has been specified for your account, the AWS managed CMK is used. To set a default CMK for your account, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html"> ModifyEbsDefaultKmsKeyId</a>.</p>
|
595 - | /// <p>If your account is enabled for encryption by default, you cannot set this parameter to <code>false</code>. In this case, you can omit this parameter.</p>
|
596 - | /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption"> Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
597 - | pub fn encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
|
598 - | self.encrypted = input;
|
599 - | self
|
600 - | }
|
601 - | /// <p>Indicates whether to encrypt the snapshot. To create an encrypted snapshot, specify <code>true</code>. To create an unencrypted snapshot, omit this parameter.</p>
|
602 - | /// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
|
603 - | /// <p>If you specify <code>true</code>, the snapshot is encrypted using the CMK specified using the <b>KmsKeyArn</b> parameter. If no value is specified for <b>KmsKeyArn</b>, the default CMK for your account is used. If no default CMK has been specified for your account, the AWS managed CMK is used. To set a default CMK for your account, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html"> ModifyEbsDefaultKmsKeyId</a>.</p>
|
604 - | /// <p>If your account is enabled for encryption by default, you cannot set this parameter to <code>false</code>. In this case, you can omit this parameter.</p>
|
605 - | /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption"> Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
606 - | pub(crate) fn set_encrypted(
|
607 - | mut self,
|
608 - | input: Option<impl ::std::convert::Into<bool>>,
|
609 - | ) -> Self {
|
610 - | self.encrypted = input.map(|v| v.into());
|
526 + | self.checksum_aggregation_method = input.map(|v| v.into());
|
611 527 | self
|
612 528 | }
|
613 - | /// <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) to be used to encrypt the snapshot. If you do not specify a CMK, the default AWS managed CMK is used.</p>
|
614 - | /// <p>If you specify a <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted using the same CMK that was used to encrypt the parent snapshot.</p>
|
615 - | /// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN.</p>
|
616 - | pub fn kms_key_arn(
|
529 + | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
530 + | pub fn checksum_algorithm(
|
617 531 | mut self,
|
618 - | input: ::std::option::Option<crate::model::KmsKeyArn>,
|
532 + | input: ::std::option::Option<crate::model::ChecksumAlgorithm>,
|
619 533 | ) -> Self {
|
620 - | self.kms_key_arn = input.map(crate::constrained::MaybeConstrained::Constrained);
|
534 + | self.checksum_algorithm = input.map(crate::constrained::MaybeConstrained::Constrained);
|
621 535 | self
|
622 536 | }
|
623 - | /// <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) to be used to encrypt the snapshot. If you do not specify a CMK, the default AWS managed CMK is used.</p>
|
624 - | /// <p>If you specify a <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted using the same CMK that was used to encrypt the parent snapshot.</p>
|
625 - | /// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN.</p>
|
626 - | pub(crate) fn set_kms_key_arn(
|
537 + | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
538 + | pub(crate) fn set_checksum_algorithm(
|
627 539 | mut self,
|
628 540 | input: Option<
|
629 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::KmsKeyArn>>,
|
541 + | impl ::std::convert::Into<
|
542 + | crate::constrained::MaybeConstrained<crate::model::ChecksumAlgorithm>,
|
543 + | >,
|
630 544 | >,
|
631 545 | ) -> Self {
|
632 - | self.kms_key_arn = input.map(|v| v.into());
|
546 + | self.checksum_algorithm = input.map(|v| v.into());
|
633 547 | self
|
634 548 | }
|
635 - | /// <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are creating the first snapshot for an on-premises volume, omit this parameter.</p>
|
636 - | /// <p>If your account is enabled for encryption by default, you cannot use an unencrypted snapshot as a parent snapshot. You must first create an encrypted copy of the parent snapshot using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
|
637 - | pub fn parent_snapshot_id(
|
638 - | mut self,
|
639 - | input: ::std::option::Option<crate::model::SnapshotId>,
|
640 - | ) -> Self {
|
641 - | self.parent_snapshot_id = input.map(crate::constrained::MaybeConstrained::Constrained);
|
549 + | /// <p>The ID of the snapshot.</p>
|
550 + | pub fn snapshot_id(mut self, input: crate::model::SnapshotId) -> Self {
|
551 + | self.snapshot_id = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
642 552 | self
|
643 553 | }
|
644 - | /// <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are creating the first snapshot for an on-premises volume, omit this parameter.</p>
|
645 - | /// <p>If your account is enabled for encryption by default, you cannot use an unencrypted snapshot as a parent snapshot. You must first create an encrypted copy of the parent snapshot using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
|
646 - | pub(crate) fn set_parent_snapshot_id(
|
554 + | /// <p>The ID of the snapshot.</p>
|
555 + | pub(crate) fn set_snapshot_id(
|
647 556 | mut self,
|
648 - | input: Option<
|
649 - | impl ::std::convert::Into<
|
557 + | input: impl ::std::convert::Into<
|
650 558 | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
651 559 | >,
|
652 - | >,
|
653 560 | ) -> Self {
|
654 - | self.parent_snapshot_id = input.map(|v| v.into());
|
561 + | self.snapshot_id = Some(input.into());
|
655 562 | self
|
656 563 | }
|
657 - | /// <p>A description for the snapshot.</p>
|
658 - | pub fn description(
|
659 - | mut self,
|
660 - | input: ::std::option::Option<crate::model::Description>,
|
661 - | ) -> Self {
|
662 - | self.description = input.map(crate::constrained::MaybeConstrained::Constrained);
|
564 + | /// <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written block.</p>
|
565 + | /// <p>To generate the aggregated checksum using the linear aggregation method, arrange the checksums for each written block in ascending order of their block index, concatenate them to form a single string, and then generate the checksum on the entire string using the SHA256 algorithm.</p>
|
566 + | pub fn checksum(mut self, input: ::std::option::Option<crate::model::Checksum>) -> Self {
|
567 + | self.checksum = input.map(crate::constrained::MaybeConstrained::Constrained);
|
663 568 | self
|
664 569 | }
|
665 - | /// <p>A description for the snapshot.</p>
|
666 - | pub(crate) fn set_description(
|
570 + | /// <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written block.</p>
|
571 + | /// <p>To generate the aggregated checksum using the linear aggregation method, arrange the checksums for each written block in ascending order of their block index, concatenate them to form a single string, and then generate the checksum on the entire string using the SHA256 algorithm.</p>
|
572 + | pub(crate) fn set_checksum(
|
667 573 | mut self,
|
668 574 | input: Option<
|
669 - | impl ::std::convert::Into<
|
670 - | crate::constrained::MaybeConstrained<crate::model::Description>,
|
671 - | >,
|
575 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Checksum>>,
|
672 576 | >,
|
673 577 | ) -> Self {
|
674 - | self.description = input.map(|v| v.into());
|
578 + | self.checksum = input.map(|v| v.into());
|
675 579 | self
|
676 580 | }
|
677 - | /// Consumes the builder and constructs a [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
581 + | /// Consumes the builder and constructs a [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
678 582 | ///
|
679 - | /// The builder fails to construct a [`StartSnapshotInput`](crate::input::StartSnapshotInput) if a [`ConstraintViolation`] occurs.
|
583 + | /// The builder fails to construct a [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput) if a [`ConstraintViolation`] occurs.
|
680 584 | ///
|
681 585 | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
682 - | pub fn build(self) -> Result<crate::input::StartSnapshotInput, ConstraintViolation> {
|
586 + | pub fn build(self) -> Result<crate::input::CompleteSnapshotInput, ConstraintViolation> {
|
683 587 | self.build_enforcing_all_constraints()
|
684 588 | }
|
685 589 | fn build_enforcing_all_constraints(
|
686 590 | self,
|
687 - | ) -> Result<crate::input::StartSnapshotInput, ConstraintViolation> {
|
688 - | Ok(crate::input::StartSnapshotInput {
|
689 - | timeout: self
|
690 - | .timeout
|
691 - | .map(|v| match v {
|
692 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
693 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
694 - | })
|
695 - | .map(|res| res.map_err(ConstraintViolation::Timeout))
|
696 - | .transpose()?,
|
697 - | client_token: self
|
698 - | .client_token
|
699 - | .map(|v| match v {
|
700 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
701 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
702 - | })
|
703 - | .map(|res| res.map_err(ConstraintViolation::ClientToken))
|
704 - | .transpose()?,
|
705 - | volume_size: self
|
706 - | .volume_size
|
591 + | ) -> Result<crate::input::CompleteSnapshotInput, ConstraintViolation> {
|
592 + | Ok(crate::input::CompleteSnapshotInput {
|
593 + | changed_blocks_count: self
|
594 + | .changed_blocks_count
|
707 595 | .map(|v| match v {
|
708 596 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
709 597 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
710 598 | })
|
711 - | .map(|res| res.map_err(ConstraintViolation::VolumeSize))
|
599 + | .map(|res| res.map_err(ConstraintViolation::ChangedBlocksCount))
|
712 600 | .transpose()?
|
713 - | .ok_or(ConstraintViolation::MissingVolumeSize)?,
|
714 - | tags: self
|
715 - | .tags
|
601 + | .ok_or(ConstraintViolation::MissingChangedBlocksCount)?,
|
602 + | checksum_aggregation_method: self
|
603 + | .checksum_aggregation_method
|
716 604 | .map(|v| match v {
|
717 605 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
718 606 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
719 607 | })
|
720 - | .map(|res| res.map(|v| v.into()).map_err(ConstraintViolation::Tags))
|
608 + | .map(|res| res.map_err(ConstraintViolation::ChecksumAggregationMethod))
|
721 609 | .transpose()?,
|
722 - | encrypted: self.encrypted,
|
723 - | kms_key_arn: self
|
724 - | .kms_key_arn
|
610 + | checksum_algorithm: self
|
611 + | .checksum_algorithm
|
725 612 | .map(|v| match v {
|
726 613 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
727 614 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
728 615 | })
|
729 - | .map(|res| res.map_err(ConstraintViolation::KmsKeyArn))
|
616 + | .map(|res| res.map_err(ConstraintViolation::ChecksumAlgorithm))
|
730 617 | .transpose()?,
|
731 - | parent_snapshot_id: self
|
732 - | .parent_snapshot_id
|
618 + | snapshot_id: self
|
619 + | .snapshot_id
|
733 620 | .map(|v| match v {
|
734 621 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
735 622 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
736 623 | })
|
737 - | .map(|res| res.map_err(ConstraintViolation::ParentSnapshotId))
|
738 - | .transpose()?,
|
739 - | description: self
|
740 - | .description
|
624 + | .map(|res| res.map_err(ConstraintViolation::SnapshotId))
|
625 + | .transpose()?
|
626 + | .ok_or(ConstraintViolation::MissingSnapshotId)?,
|
627 + | checksum: self
|
628 + | .checksum
|
741 629 | .map(|v| match v {
|
742 630 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
743 631 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
744 632 | })
|
745 - | .map(|res| res.map_err(ConstraintViolation::Description))
|
633 + | .map(|res| res.map_err(ConstraintViolation::Checksum))
|
746 634 | .transpose()?,
|
747 635 | })
|
748 636 | }
|
749 637 | }
|
750 - | impl ::std::fmt::Debug for Builder {
|
751 - | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
752 - | let mut formatter = f.debug_struct("Builder");
|
753 - | formatter.field("timeout", &self.timeout);
|
754 - | formatter.field("client_token", &self.client_token);
|
755 - | formatter.field("volume_size", &self.volume_size);
|
756 - | formatter.field("tags", &self.tags);
|
757 - | formatter.field("encrypted", &self.encrypted);
|
758 - | formatter.field("kms_key_arn", &"*** Sensitive Data Redacted ***");
|
759 - | formatter.field("parent_snapshot_id", &self.parent_snapshot_id);
|
760 - | formatter.field("description", &self.description);
|
761 - | formatter.finish()
|
762 - | }
|
763 - | }
|
764 638 | }
|
765 - | /// See [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
766 - | pub mod put_snapshot_block_input {
|
639 + | /// See [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
640 + | pub mod get_snapshot_block_input {
|
767 641 |
|
768 642 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
769 643 | /// Holds one variant for each of the ways the builder can fail.
|
770 644 | #[non_exhaustive]
|
771 645 | #[allow(clippy::enum_variant_names)]
|
772 646 | pub enum ConstraintViolation {
|
773 - | /// `snapshot_id` was not provided but it is required when building `PutSnapshotBlockInput`.
|
647 + | /// `snapshot_id` was not provided but it is required when building `GetSnapshotBlockInput`.
|
774 648 | MissingSnapshotId,
|
775 - | /// Constraint violation occurred building member `snapshot_id` when building `PutSnapshotBlockInput`.
|
649 + | /// Constraint violation occurred building member `snapshot_id` when building `GetSnapshotBlockInput`.
|
776 650 | #[doc(hidden)]
|
777 651 | SnapshotId(crate::model::snapshot_id::ConstraintViolation),
|
778 - | /// `block_index` was not provided but it is required when building `PutSnapshotBlockInput`.
|
779 - | MissingBlockIndex,
|
780 - | /// Constraint violation occurred building member `block_index` when building `PutSnapshotBlockInput`.
|
781 - | #[doc(hidden)]
|
782 - | BlockIndex(crate::model::block_index::ConstraintViolation),
|
783 - | /// `checksum` was not provided but it is required when building `PutSnapshotBlockInput`.
|
784 - | MissingChecksum,
|
785 - | /// Constraint violation occurred building member `checksum` when building `PutSnapshotBlockInput`.
|
786 - | #[doc(hidden)]
|
787 - | Checksum(crate::model::checksum::ConstraintViolation),
|
788 - | /// Constraint violation occurred building member `progress` when building `PutSnapshotBlockInput`.
|
652 + | /// `block_token` was not provided but it is required when building `GetSnapshotBlockInput`.
|
653 + | MissingBlockToken,
|
654 + | /// Constraint violation occurred building member `block_token` when building `GetSnapshotBlockInput`.
|
789 655 | #[doc(hidden)]
|
790 - | Progress(crate::model::progress::ConstraintViolation),
|
791 - | /// `block_data` was not provided but it is required when building `PutSnapshotBlockInput`.
|
792 - | MissingBlockData,
|
793 - | /// `data_length` was not provided but it is required when building `PutSnapshotBlockInput`.
|
794 - | MissingDataLength,
|
795 - | /// `checksum_algorithm` was not provided but it is required when building `PutSnapshotBlockInput`.
|
796 - | MissingChecksumAlgorithm,
|
797 - | /// Constraint violation occurred building member `checksum_algorithm` when building `PutSnapshotBlockInput`.
|
656 + | BlockToken(crate::model::block_token::ConstraintViolation),
|
657 + | /// `block_index` was not provided but it is required when building `GetSnapshotBlockInput`.
|
658 + | MissingBlockIndex,
|
659 + | /// Constraint violation occurred building member `block_index` when building `GetSnapshotBlockInput`.
|
798 660 | #[doc(hidden)]
|
799 - | ChecksumAlgorithm(crate::model::checksum_algorithm::ConstraintViolation),
|
661 + | BlockIndex(crate::model::block_index::ConstraintViolation),
|
800 662 | }
|
801 663 | impl ::std::fmt::Display for ConstraintViolation {
|
802 664 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
803 665 | match self {
|
804 - | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
805 - | ConstraintViolation::SnapshotId(_) => write!(f, "constraint violation occurred building member `snapshot_id` when building `PutSnapshotBlockInput`"),
|
806 - | ConstraintViolation::MissingBlockIndex => write!(f, "`block_index` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
807 - | ConstraintViolation::BlockIndex(_) => write!(f, "constraint violation occurred building member `block_index` when building `PutSnapshotBlockInput`"),
|
808 - | ConstraintViolation::MissingChecksum => write!(f, "`checksum` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
809 - | ConstraintViolation::Checksum(_) => write!(f, "constraint violation occurred building member `checksum` when building `PutSnapshotBlockInput`"),
|
810 - | ConstraintViolation::Progress(_) => write!(f, "constraint violation occurred building member `progress` when building `PutSnapshotBlockInput`"),
|
811 - | ConstraintViolation::MissingBlockData => write!(f, "`block_data` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
812 - | ConstraintViolation::MissingDataLength => write!(f, "`data_length` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
813 - | ConstraintViolation::MissingChecksumAlgorithm => write!(f, "`checksum_algorithm` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
814 - | ConstraintViolation::ChecksumAlgorithm(_) => write!(f, "constraint violation occurred building member `checksum_algorithm` when building `PutSnapshotBlockInput`"),
|
666 + | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `GetSnapshotBlockInput`"),
|
667 + | ConstraintViolation::SnapshotId(_) => write!(f, "constraint violation occurred building member `snapshot_id` when building `GetSnapshotBlockInput`"),
|
668 + | ConstraintViolation::MissingBlockToken => write!(f, "`block_token` was not provided but it is required when building `GetSnapshotBlockInput`"),
|
669 + | ConstraintViolation::BlockToken(_) => write!(f, "constraint violation occurred building member `block_token` when building `GetSnapshotBlockInput`"),
|
670 + | ConstraintViolation::MissingBlockIndex => write!(f, "`block_index` was not provided but it is required when building `GetSnapshotBlockInput`"),
|
671 + | ConstraintViolation::BlockIndex(_) => write!(f, "constraint violation occurred building member `block_index` when building `GetSnapshotBlockInput`"),
|
815 672 | }
|
816 673 | }
|
817 674 | }
|
818 675 | impl ::std::error::Error for ConstraintViolation {}
|
819 676 | impl ConstraintViolation {
|
820 677 | pub(crate) fn as_validation_exception_field(
|
821 678 | self,
|
822 679 | path: ::std::string::String,
|
823 680 | ) -> crate::model::ValidationExceptionField {
|
824 681 | match self {
|
825 682 | ConstraintViolation::MissingSnapshotId => crate::model::ValidationExceptionField {
|
826 683 | message: format!("Value at '{}/SnapshotId' failed to satisfy constraint: Member must not be null", path),
|
827 684 | path: path + "/SnapshotId",
|
828 685 | },
|
829 686 | ConstraintViolation::SnapshotId(inner) => inner.as_validation_exception_field(path + "/SnapshotId"),
|
687 + | ConstraintViolation::MissingBlockToken => crate::model::ValidationExceptionField {
|
688 + | message: format!("Value at '{}/BlockToken' failed to satisfy constraint: Member must not be null", path),
|
689 + | path: path + "/BlockToken",
|
690 + | },
|
691 + | ConstraintViolation::BlockToken(inner) => inner.as_validation_exception_field(path + "/BlockToken"),
|
830 692 | ConstraintViolation::MissingBlockIndex => crate::model::ValidationExceptionField {
|
831 693 | message: format!("Value at '{}/BlockIndex' failed to satisfy constraint: Member must not be null", path),
|
832 694 | path: path + "/BlockIndex",
|
833 695 | },
|
834 696 | ConstraintViolation::BlockIndex(inner) => inner.as_validation_exception_field(path + "/BlockIndex"),
|
835 - | ConstraintViolation::MissingChecksum => crate::model::ValidationExceptionField {
|
836 - | message: format!("Value at '{}/Checksum' failed to satisfy constraint: Member must not be null", path),
|
837 - | path: path + "/Checksum",
|
838 - | },
|
839 - | ConstraintViolation::Checksum(inner) => inner.as_validation_exception_field(path + "/Checksum"),
|
840 - | ConstraintViolation::Progress(inner) => inner.as_validation_exception_field(path + "/Progress"),
|
841 - | ConstraintViolation::MissingBlockData => crate::model::ValidationExceptionField {
|
842 - | message: format!("Value at '{}/BlockData' failed to satisfy constraint: Member must not be null", path),
|
843 - | path: path + "/BlockData",
|
844 - | },
|
845 - | ConstraintViolation::MissingDataLength => crate::model::ValidationExceptionField {
|
846 - | message: format!("Value at '{}/DataLength' failed to satisfy constraint: Member must not be null", path),
|
847 - | path: path + "/DataLength",
|
848 - | },
|
849 - | ConstraintViolation::MissingChecksumAlgorithm => crate::model::ValidationExceptionField {
|
850 - | message: format!("Value at '{}/ChecksumAlgorithm' failed to satisfy constraint: Member must not be null", path),
|
851 - | path: path + "/ChecksumAlgorithm",
|
852 - | },
|
853 - | ConstraintViolation::ChecksumAlgorithm(inner) => inner.as_validation_exception_field(path + "/ChecksumAlgorithm"),
|
854 697 | }
|
855 698 | }
|
856 699 | }
|
857 700 | impl ::std::convert::From<ConstraintViolation>
|
858 701 | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
859 702 | {
|
860 703 | fn from(constraint_violation: ConstraintViolation) -> Self {
|
861 704 | let first_validation_exception_field =
|
862 705 | constraint_violation.as_validation_exception_field("".to_owned());
|
863 706 | let validation_exception = crate::error::ValidationException {
|
864 707 | message: format!(
|
865 708 | "1 validation error detected. {}",
|
866 709 | &first_validation_exception_field.message
|
867 710 | ),
|
868 711 | field_list: Some(vec![first_validation_exception_field]),
|
869 712 | };
|
870 713 | Self::ConstraintViolation(
|
871 714 | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
872 715 | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
873 716 | )
|
874 717 | }
|
875 718 | }
|
876 719 | impl ::std::convert::From<Builder>
|
877 - | for crate::constrained::MaybeConstrained<crate::input::PutSnapshotBlockInput>
|
720 + | for crate::constrained::MaybeConstrained<crate::input::GetSnapshotBlockInput>
|
878 721 | {
|
879 722 | fn from(builder: Builder) -> Self {
|
880 723 | Self::Unconstrained(builder)
|
881 724 | }
|
882 725 | }
|
883 - | impl ::std::convert::TryFrom<Builder> for crate::input::PutSnapshotBlockInput {
|
726 + | impl ::std::convert::TryFrom<Builder> for crate::input::GetSnapshotBlockInput {
|
884 727 | type Error = ConstraintViolation;
|
885 728 |
|
886 729 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
887 730 | builder.build()
|
888 731 | }
|
889 732 | }
|
890 - | /// A builder for [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
891 - | #[derive(::std::default::Default)]
|
733 + | /// A builder for [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
734 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
892 735 | pub struct Builder {
|
893 736 | pub(crate) snapshot_id:
|
894 737 | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
738 + | pub(crate) block_token:
|
739 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::BlockToken>>,
|
895 740 | pub(crate) block_index:
|
896 741 | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::BlockIndex>>,
|
897 - | pub(crate) checksum:
|
898 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Checksum>>,
|
899 - | pub(crate) progress:
|
900 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Progress>>,
|
901 - | pub(crate) block_data: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>,
|
902 - | pub(crate) data_length: ::std::option::Option<i32>,
|
903 - | pub(crate) checksum_algorithm: ::std::option::Option<
|
904 - | crate::constrained::MaybeConstrained<crate::model::ChecksumAlgorithm>,
|
905 - | >,
|
906 742 | }
|
907 743 | impl Builder {
|
908 - | /// <p>The ID of the snapshot.</p>
|
744 + | /// <p>The ID of the snapshot containing the block from which to get data.</p>
|
909 745 | pub fn snapshot_id(mut self, input: crate::model::SnapshotId) -> Self {
|
910 746 | self.snapshot_id = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
911 747 | self
|
912 748 | }
|
913 - | /// <p>The ID of the snapshot.</p>
|
749 + | /// <p>The ID of the snapshot containing the block from which to get data.</p>
|
914 750 | pub(crate) fn set_snapshot_id(
|
915 751 | mut self,
|
916 752 | input: impl ::std::convert::Into<
|
917 753 | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
918 754 | >,
|
919 755 | ) -> Self {
|
920 756 | self.snapshot_id = Some(input.into());
|
921 757 | self
|
922 758 | }
|
923 - | /// <p>The block index of the block in which to write the data. A block index is a logical index in units of <code>512</code> KiB blocks. To identify the block index, divide the logical offset of the data in the logical volume by the block size (logical offset of data/<code>524288</code>). The logical offset of the data must be <code>512</code> KiB aligned.</p>
|
924 - | pub fn block_index(mut self, input: crate::model::BlockIndex) -> Self {
|
925 - | self.block_index = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
926 - | self
|
927 - | }
|
928 - | /// <p>The block index of the block in which to write the data. A block index is a logical index in units of <code>512</code> KiB blocks. To identify the block index, divide the logical offset of the data in the logical volume by the block size (logical offset of data/<code>524288</code>). The logical offset of the data must be <code>512</code> KiB aligned.</p>
|
929 - | pub(crate) fn set_block_index(
|
930 - | mut self,
|
931 - | input: impl ::std::convert::Into<
|
932 - | crate::constrained::MaybeConstrained<crate::model::BlockIndex>,
|
933 - | >,
|
934 - | ) -> Self {
|
935 - | self.block_index = Some(input.into());
|
936 - | self
|
937 - | }
|
938 - | /// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
|
939 - | pub fn checksum(mut self, input: crate::model::Checksum) -> Self {
|
940 - | self.checksum = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
759 + | /// <p>The block token of the block from which to get data.</p>
|
760 + | /// <p>Obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
761 + | pub fn block_token(mut self, input: crate::model::BlockToken) -> Self {
|
762 + | self.block_token = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
941 763 | self
|
942 764 | }
|
943 - | /// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
|
944 - | pub(crate) fn set_checksum(
|
765 + | /// <p>The block token of the block from which to get data.</p>
|
766 + | /// <p>Obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
767 + | pub(crate) fn set_block_token(
|
945 768 | mut self,
|
946 769 | input: impl ::std::convert::Into<
|
947 - | crate::constrained::MaybeConstrained<crate::model::Checksum>,
|
948 - | >,
|
949 - | ) -> Self {
|
950 - | self.checksum = Some(input.into());
|
951 - | self
|
952 - | }
|
953 - | /// <p>The progress of the write process, as a percentage.</p>
|
954 - | pub fn progress(mut self, input: ::std::option::Option<crate::model::Progress>) -> Self {
|
955 - | self.progress = input.map(crate::constrained::MaybeConstrained::Constrained);
|
956 - | self
|
957 - | }
|
958 - | /// <p>The progress of the write process, as a percentage.</p>
|
959 - | pub(crate) fn set_progress(
|
960 - | mut self,
|
961 - | input: Option<
|
962 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Progress>>,
|
770 + | crate::constrained::MaybeConstrained<crate::model::BlockToken>,
|
963 771 | >,
|
964 772 | ) -> Self {
|
965 - | self.progress = input.map(|v| v.into());
|
966 - | self
|
967 - | }
|
968 - | /// <p>The data to write to the block.</p>
|
969 - | /// <p>The block data is not signed as part of the Signature Version 4 signing process. As a result, you must generate and provide a Base64-encoded SHA256 checksum for the block data using the <b>x-amz-Checksum</b> header. Also, you must specify the checksum algorithm using the <b>x-amz-Checksum-Algorithm</b> header. The checksum that you provide is part of the Signature Version 4 signing process. It is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity of the data. If the checksums do not correspond, the request fails. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-checksums"> Using checksums with the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
970 - | pub fn block_data(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
|
971 - | self.block_data = Some(input);
|
972 - | self
|
973 - | }
|
974 - | /// <p>The data to write to the block.</p>
|
975 - | /// <p>The block data is not signed as part of the Signature Version 4 signing process. As a result, you must generate and provide a Base64-encoded SHA256 checksum for the block data using the <b>x-amz-Checksum</b> header. Also, you must specify the checksum algorithm using the <b>x-amz-Checksum-Algorithm</b> header. The checksum that you provide is part of the Signature Version 4 signing process. It is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity of the data. If the checksums do not correspond, the request fails. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-checksums"> Using checksums with the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
976 - | pub(crate) fn set_block_data(
|
977 - | mut self,
|
978 - | input: impl ::std::convert::Into<::aws_smithy_types::byte_stream::ByteStream>,
|
979 - | ) -> Self {
|
980 - | self.block_data = Some(input.into());
|
981 - | self
|
982 - | }
|
983 - | /// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code>.</p>
|
984 - | /// <p>Valid values: <code>524288</code></p>
|
985 - | pub fn data_length(mut self, input: i32) -> Self {
|
986 - | self.data_length = Some(input);
|
987 - | self
|
988 - | }
|
989 - | /// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code>.</p>
|
990 - | /// <p>Valid values: <code>524288</code></p>
|
991 - | pub(crate) fn set_data_length(mut self, input: impl ::std::convert::Into<i32>) -> Self {
|
992 - | self.data_length = Some(input.into());
|
773 + | self.block_token = Some(input.into());
|
993 774 | self
|
994 775 | }
|
995 - | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
996 - | pub fn checksum_algorithm(mut self, input: crate::model::ChecksumAlgorithm) -> Self {
|
997 - | self.checksum_algorithm =
|
998 - | Some(crate::constrained::MaybeConstrained::Constrained(input));
|
776 + | /// <p>The block index of the block from which to get data.</p>
|
777 + | /// <p>Obtain the <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
778 + | pub fn block_index(mut self, input: crate::model::BlockIndex) -> Self {
|
779 + | self.block_index = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
999 780 | self
|
1000 781 | }
|
1001 - | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
1002 - | pub(crate) fn set_checksum_algorithm(
|
782 + | /// <p>The block index of the block from which to get data.</p>
|
783 + | /// <p>Obtain the <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
784 + | pub(crate) fn set_block_index(
|
1003 785 | mut self,
|
1004 786 | input: impl ::std::convert::Into<
|
1005 - | crate::constrained::MaybeConstrained<crate::model::ChecksumAlgorithm>,
|
787 + | crate::constrained::MaybeConstrained<crate::model::BlockIndex>,
|
1006 788 | >,
|
1007 789 | ) -> Self {
|
1008 - | self.checksum_algorithm = Some(input.into());
|
790 + | self.block_index = Some(input.into());
|
1009 791 | self
|
1010 792 | }
|
1011 - | /// Consumes the builder and constructs a [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
793 + | /// Consumes the builder and constructs a [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
1012 794 | ///
|
1013 - | /// The builder fails to construct a [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput) if a [`ConstraintViolation`] occurs.
|
795 + | /// The builder fails to construct a [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput) if a [`ConstraintViolation`] occurs.
|
1014 796 | ///
|
1015 797 | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
1016 - | pub fn build(self) -> Result<crate::input::PutSnapshotBlockInput, ConstraintViolation> {
|
798 + | pub fn build(self) -> Result<crate::input::GetSnapshotBlockInput, ConstraintViolation> {
|
1017 799 | self.build_enforcing_all_constraints()
|
1018 800 | }
|
1019 801 | fn build_enforcing_all_constraints(
|
1020 802 | self,
|
1021 - | ) -> Result<crate::input::PutSnapshotBlockInput, ConstraintViolation> {
|
1022 - | Ok(crate::input::PutSnapshotBlockInput {
|
803 + | ) -> Result<crate::input::GetSnapshotBlockInput, ConstraintViolation> {
|
804 + | Ok(crate::input::GetSnapshotBlockInput {
|
1023 805 | snapshot_id: self
|
1024 806 | .snapshot_id
|
1025 807 | .map(|v| match v {
|
1026 808 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1027 809 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1028 810 | })
|
1029 811 | .map(|res| res.map_err(ConstraintViolation::SnapshotId))
|
1030 812 | .transpose()?
|
1031 813 | .ok_or(ConstraintViolation::MissingSnapshotId)?,
|
1032 - | block_index: self
|
1033 - | .block_index
|
1034 - | .map(|v| match v {
|
1035 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1036 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1037 - | })
|
1038 - | .map(|res| res.map_err(ConstraintViolation::BlockIndex))
|
1039 - | .transpose()?
|
1040 - | .ok_or(ConstraintViolation::MissingBlockIndex)?,
|
1041 - | checksum: self
|
1042 - | .checksum
|
814 + | block_token: self
|
815 + | .block_token
|
1043 816 | .map(|v| match v {
|
1044 817 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1045 818 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1046 819 | })
|
1047 - | .map(|res| res.map_err(ConstraintViolation::Checksum))
|
820 + | .map(|res| res.map_err(ConstraintViolation::BlockToken))
|
1048 821 | .transpose()?
|
1049 - | .ok_or(ConstraintViolation::MissingChecksum)?,
|
1050 - | progress: self
|
1051 - | .progress
|
1052 - | .map(|v| match v {
|
1053 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1054 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1055 - | })
|
1056 - | .map(|res| res.map_err(ConstraintViolation::Progress))
|
1057 - | .transpose()?,
|
1058 - | block_data: self
|
1059 - | .block_data
|
1060 - | .ok_or(ConstraintViolation::MissingBlockData)?,
|
1061 - | data_length: self
|
1062 - | .data_length
|
1063 - | .ok_or(ConstraintViolation::MissingDataLength)?,
|
1064 - | checksum_algorithm: self
|
1065 - | .checksum_algorithm
|
822 + | .ok_or(ConstraintViolation::MissingBlockToken)?,
|
823 + | block_index: self
|
824 + | .block_index
|
1066 825 | .map(|v| match v {
|
1067 826 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1068 827 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1069 828 | })
|
1070 - | .map(|res| res.map_err(ConstraintViolation::ChecksumAlgorithm))
|
829 + | .map(|res| res.map_err(ConstraintViolation::BlockIndex))
|
1071 830 | .transpose()?
|
1072 - | .ok_or(ConstraintViolation::MissingChecksumAlgorithm)?,
|
831 + | .ok_or(ConstraintViolation::MissingBlockIndex)?,
|
1073 832 | })
|
1074 833 | }
|
1075 834 | }
|
1076 - | impl ::std::fmt::Debug for Builder {
|
1077 - | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
1078 - | let mut formatter = f.debug_struct("Builder");
|
1079 - | formatter.field("snapshot_id", &self.snapshot_id);
|
1080 - | formatter.field("block_index", &self.block_index);
|
1081 - | formatter.field("checksum", &self.checksum);
|
1082 - | formatter.field("progress", &self.progress);
|
1083 - | formatter.field("block_data", &"*** Sensitive Data Redacted ***");
|
1084 - | formatter.field("data_length", &self.data_length);
|
1085 - | formatter.field("checksum_algorithm", &self.checksum_algorithm);
|
1086 - | formatter.finish()
|
1087 - | }
|
1088 - | }
|
1089 835 | }
|
1090 - | /// See [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
1091 - | pub mod list_snapshot_blocks_input {
|
836 + | /// See [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
837 + | pub mod list_changed_blocks_input {
|
1092 838 |
|
1093 839 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1094 840 | /// Holds one variant for each of the ways the builder can fail.
|
1095 841 | #[non_exhaustive]
|
1096 842 | #[allow(clippy::enum_variant_names)]
|
1097 843 | pub enum ConstraintViolation {
|
1098 - | /// Constraint violation occurred building member `max_results` when building `ListSnapshotBlocksInput`.
|
844 + | /// `second_snapshot_id` was not provided but it is required when building `ListChangedBlocksInput`.
|
845 + | MissingSecondSnapshotId,
|
846 + | /// Constraint violation occurred building member `second_snapshot_id` when building `ListChangedBlocksInput`.
|
1099 847 | #[doc(hidden)]
|
1100 - | MaxResults(crate::model::max_results::ConstraintViolation),
|
1101 - | /// Constraint violation occurred building member `starting_block_index` when building `ListSnapshotBlocksInput`.
|
848 + | SecondSnapshotId(crate::model::snapshot_id::ConstraintViolation),
|
849 + | /// Constraint violation occurred building member `first_snapshot_id` when building `ListChangedBlocksInput`.
|
1102 850 | #[doc(hidden)]
|
1103 - | StartingBlockIndex(crate::model::block_index::ConstraintViolation),
|
1104 - | /// Constraint violation occurred building member `next_token` when building `ListSnapshotBlocksInput`.
|
851 + | FirstSnapshotId(crate::model::snapshot_id::ConstraintViolation),
|
852 + | /// Constraint violation occurred building member `next_token` when building `ListChangedBlocksInput`.
|
1105 853 | #[doc(hidden)]
|
1106 854 | NextToken(crate::model::page_token::ConstraintViolation),
|
1107 - | /// `snapshot_id` was not provided but it is required when building `ListSnapshotBlocksInput`.
|
1108 - | MissingSnapshotId,
|
1109 - | /// Constraint violation occurred building member `snapshot_id` when building `ListSnapshotBlocksInput`.
|
855 + | /// Constraint violation occurred building member `max_results` when building `ListChangedBlocksInput`.
|
1110 856 | #[doc(hidden)]
|
1111 - | SnapshotId(crate::model::snapshot_id::ConstraintViolation),
|
857 + | MaxResults(crate::model::max_results::ConstraintViolation),
|
858 + | /// Constraint violation occurred building member `starting_block_index` when building `ListChangedBlocksInput`.
|
859 + | #[doc(hidden)]
|
860 + | StartingBlockIndex(crate::model::block_index::ConstraintViolation),
|
1112 861 | }
|
1113 862 | impl ::std::fmt::Display for ConstraintViolation {
|
1114 863 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1115 864 | match self {
|
1116 - | ConstraintViolation::MaxResults(_) => write!(f, "constraint violation occurred building member `max_results` when building `ListSnapshotBlocksInput`"),
|
1117 - | ConstraintViolation::StartingBlockIndex(_) => write!(f, "constraint violation occurred building member `starting_block_index` when building `ListSnapshotBlocksInput`"),
|
1118 - | ConstraintViolation::NextToken(_) => write!(f, "constraint violation occurred building member `next_token` when building `ListSnapshotBlocksInput`"),
|
1119 - | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `ListSnapshotBlocksInput`"),
|
1120 - | ConstraintViolation::SnapshotId(_) => write!(f, "constraint violation occurred building member `snapshot_id` when building `ListSnapshotBlocksInput`"),
|
865 + | ConstraintViolation::MissingSecondSnapshotId => write!(f, "`second_snapshot_id` was not provided but it is required when building `ListChangedBlocksInput`"),
|
866 + | ConstraintViolation::SecondSnapshotId(_) => write!(f, "constraint violation occurred building member `second_snapshot_id` when building `ListChangedBlocksInput`"),
|
867 + | ConstraintViolation::FirstSnapshotId(_) => write!(f, "constraint violation occurred building member `first_snapshot_id` when building `ListChangedBlocksInput`"),
|
868 + | ConstraintViolation::NextToken(_) => write!(f, "constraint violation occurred building member `next_token` when building `ListChangedBlocksInput`"),
|
869 + | ConstraintViolation::MaxResults(_) => write!(f, "constraint violation occurred building member `max_results` when building `ListChangedBlocksInput`"),
|
870 + | ConstraintViolation::StartingBlockIndex(_) => write!(f, "constraint violation occurred building member `starting_block_index` when building `ListChangedBlocksInput`"),
|
1121 871 | }
|
1122 872 | }
|
1123 873 | }
|
1124 874 | impl ::std::error::Error for ConstraintViolation {}
|
1125 875 | impl ConstraintViolation {
|
1126 876 | pub(crate) fn as_validation_exception_field(
|
1127 877 | self,
|
1128 878 | path: ::std::string::String,
|
1129 879 | ) -> crate::model::ValidationExceptionField {
|
1130 880 | match self {
|
881 + | ConstraintViolation::MissingSecondSnapshotId => crate::model::ValidationExceptionField {
|
882 + | message: format!("Value at '{}/SecondSnapshotId' failed to satisfy constraint: Member must not be null", path),
|
883 + | path: path + "/SecondSnapshotId",
|
884 + | },
|
885 + | ConstraintViolation::SecondSnapshotId(inner) => inner.as_validation_exception_field(path + "/SecondSnapshotId"),
|
886 + | ConstraintViolation::FirstSnapshotId(inner) => inner.as_validation_exception_field(path + "/FirstSnapshotId"),
|
887 + | ConstraintViolation::NextToken(inner) => inner.as_validation_exception_field(path + "/NextToken"),
|
1131 888 | ConstraintViolation::MaxResults(inner) => inner.as_validation_exception_field(path + "/MaxResults"),
|
1132 889 | ConstraintViolation::StartingBlockIndex(inner) => inner.as_validation_exception_field(path + "/StartingBlockIndex"),
|
1133 - | ConstraintViolation::NextToken(inner) => inner.as_validation_exception_field(path + "/NextToken"),
|
1134 - | ConstraintViolation::MissingSnapshotId => crate::model::ValidationExceptionField {
|
1135 - | message: format!("Value at '{}/SnapshotId' failed to satisfy constraint: Member must not be null", path),
|
1136 - | path: path + "/SnapshotId",
|
1137 - | },
|
1138 - | ConstraintViolation::SnapshotId(inner) => inner.as_validation_exception_field(path + "/SnapshotId"),
|
1139 890 | }
|
1140 891 | }
|
1141 892 | }
|
1142 893 | impl ::std::convert::From<ConstraintViolation>
|
1143 894 | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
1144 895 | {
|
1145 896 | fn from(constraint_violation: ConstraintViolation) -> Self {
|
1146 897 | let first_validation_exception_field =
|
1147 898 | constraint_violation.as_validation_exception_field("".to_owned());
|
1148 899 | let validation_exception = crate::error::ValidationException {
|
1149 900 | message: format!(
|
1150 901 | "1 validation error detected. {}",
|
1151 902 | &first_validation_exception_field.message
|
1152 903 | ),
|
1153 904 | field_list: Some(vec![first_validation_exception_field]),
|
1154 905 | };
|
1155 906 | Self::ConstraintViolation(
|
1156 907 | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
1157 908 | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
1158 909 | )
|
1159 910 | }
|
1160 911 | }
|
1161 912 | impl ::std::convert::From<Builder>
|
1162 - | for crate::constrained::MaybeConstrained<crate::input::ListSnapshotBlocksInput>
|
913 + | for crate::constrained::MaybeConstrained<crate::input::ListChangedBlocksInput>
|
1163 914 | {
|
1164 915 | fn from(builder: Builder) -> Self {
|
1165 916 | Self::Unconstrained(builder)
|
1166 917 | }
|
1167 918 | }
|
1168 - | impl ::std::convert::TryFrom<Builder> for crate::input::ListSnapshotBlocksInput {
|
919 + | impl ::std::convert::TryFrom<Builder> for crate::input::ListChangedBlocksInput {
|
1169 920 | type Error = ConstraintViolation;
|
1170 921 |
|
1171 922 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1172 923 | builder.build()
|
1173 924 | }
|
1174 925 | }
|
1175 - | /// A builder for [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
926 + | /// A builder for [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
1176 927 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1177 928 | pub struct Builder {
|
929 + | pub(crate) second_snapshot_id:
|
930 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
931 + | pub(crate) first_snapshot_id:
|
932 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
933 + | pub(crate) next_token:
|
934 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::PageToken>>,
|
1178 935 | pub(crate) max_results:
|
1179 936 | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxResults>>,
|
1180 937 | pub(crate) starting_block_index:
|
1181 938 | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::BlockIndex>>,
|
1182 - | pub(crate) next_token:
|
1183 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::PageToken>>,
|
1184 - | pub(crate) snapshot_id:
|
1185 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
1186 939 | }
|
1187 940 | impl Builder {
|
1188 - | /// <p>The number of results to return.</p>
|
1189 - | pub fn max_results(
|
1190 - | mut self,
|
1191 - | input: ::std::option::Option<crate::model::MaxResults>,
|
1192 - | ) -> Self {
|
1193 - | self.max_results = input.map(crate::constrained::MaybeConstrained::Constrained);
|
941 + | /// <p>The ID of the second snapshot to use for the comparison.</p><important>
|
942 + | /// <p>The <code>SecondSnapshotId</code> parameter must be specified with a <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
|
943 + | /// </important>
|
944 + | pub fn second_snapshot_id(mut self, input: crate::model::SnapshotId) -> Self {
|
945 + | self.second_snapshot_id =
|
946 + | Some(crate::constrained::MaybeConstrained::Constrained(input));
|
1194 947 | self
|
1195 948 | }
|
1196 - | /// <p>The number of results to return.</p>
|
1197 - | pub(crate) fn set_max_results(
|
949 + | /// <p>The ID of the second snapshot to use for the comparison.</p><important>
|
950 + | /// <p>The <code>SecondSnapshotId</code> parameter must be specified with a <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
|
951 + | /// </important>
|
952 + | pub(crate) fn set_second_snapshot_id(
|
1198 953 | mut self,
|
1199 - | input: Option<
|
1200 - | impl ::std::convert::Into<
|
1201 - | crate::constrained::MaybeConstrained<crate::model::MaxResults>,
|
1202 - | >,
|
954 + | input: impl ::std::convert::Into<
|
955 + | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
1203 956 | >,
|
1204 957 | ) -> Self {
|
1205 - | self.max_results = input.map(|v| v.into());
|
958 + | self.second_snapshot_id = Some(input.into());
|
1206 959 | self
|
1207 960 | }
|
1208 - | /// <p>The block index from which the list should start. The list in the response will start from this block index or the next valid block index in the snapshot.</p>
|
1209 - | pub fn starting_block_index(
|
961 + | /// <p>The ID of the first snapshot to use for the comparison.</p><important>
|
962 + | /// <p>The <code>FirstSnapshotID</code> parameter must be specified with a <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
|
963 + | /// </important>
|
964 + | pub fn first_snapshot_id(
|
1210 965 | mut self,
|
1211 - | input: ::std::option::Option<crate::model::BlockIndex>,
|
966 + | input: ::std::option::Option<crate::model::SnapshotId>,
|
1212 967 | ) -> Self {
|
1213 - | self.starting_block_index =
|
1214 - | input.map(crate::constrained::MaybeConstrained::Constrained);
|
968 + | self.first_snapshot_id = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1215 969 | self
|
1216 970 | }
|
1217 - | /// <p>The block index from which the list should start. The list in the response will start from this block index or the next valid block index in the snapshot.</p>
|
1218 - | pub(crate) fn set_starting_block_index(
|
971 + | /// <p>The ID of the first snapshot to use for the comparison.</p><important>
|
972 + | /// <p>The <code>FirstSnapshotID</code> parameter must be specified with a <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
|
973 + | /// </important>
|
974 + | pub(crate) fn set_first_snapshot_id(
|
1219 975 | mut self,
|
1220 976 | input: Option<
|
1221 977 | impl ::std::convert::Into<
|
1222 - | crate::constrained::MaybeConstrained<crate::model::BlockIndex>,
|
978 + | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
1223 979 | >,
|
1224 980 | >,
|
1225 981 | ) -> Self {
|
1226 - | self.starting_block_index = input.map(|v| v.into());
|
982 + | self.first_snapshot_id = input.map(|v| v.into());
|
1227 983 | self
|
1228 984 | }
|
1229 985 | /// <p>The token to request the next page of results.</p>
|
1230 986 | pub fn next_token(mut self, input: ::std::option::Option<crate::model::PageToken>) -> Self {
|
1231 987 | self.next_token = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1232 988 | self
|
1233 989 | }
|
1234 990 | /// <p>The token to request the next page of results.</p>
|
1235 991 | pub(crate) fn set_next_token(
|
1236 992 | mut self,
|
1237 993 | input: Option<
|
1238 994 | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::PageToken>>,
|
1239 995 | >,
|
1240 996 | ) -> Self {
|
1241 997 | self.next_token = input.map(|v| v.into());
|
1242 998 | self
|
1243 999 | }
|
1244 - | /// <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
|
1245 - | pub fn snapshot_id(mut self, input: crate::model::SnapshotId) -> Self {
|
1246 - | self.snapshot_id = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
1000 + | /// <p>The number of results to return.</p>
|
1001 + | pub fn max_results(
|
1002 + | mut self,
|
1003 + | input: ::std::option::Option<crate::model::MaxResults>,
|
1004 + | ) -> Self {
|
1005 + | self.max_results = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1247 1006 | self
|
1248 1007 | }
|
1249 - | /// <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
|
1250 - | pub(crate) fn set_snapshot_id(
|
1008 + | /// <p>The number of results to return.</p>
|
1009 + | pub(crate) fn set_max_results(
|
1251 1010 | mut self,
|
1252 - | input: impl ::std::convert::Into<
|
1253 - | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
1011 + | input: Option<
|
1012 + | impl ::std::convert::Into<
|
1013 + | crate::constrained::MaybeConstrained<crate::model::MaxResults>,
|
1014 + | >,
|
1254 1015 | >,
|
1255 1016 | ) -> Self {
|
1256 - | self.snapshot_id = Some(input.into());
|
1017 + | self.max_results = input.map(|v| v.into());
|
1257 1018 | self
|
1258 1019 | }
|
1259 - | /// Consumes the builder and constructs a [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
1020 + | /// <p>The block index from which the comparison should start.</p>
|
1021 + | /// <p>The list in the response will start from this block index or the next valid block index in the snapshots.</p>
|
1022 + | pub fn starting_block_index(
|
1023 + | mut self,
|
1024 + | input: ::std::option::Option<crate::model::BlockIndex>,
|
1025 + | ) -> Self {
|
1026 + | self.starting_block_index =
|
1027 + | input.map(crate::constrained::MaybeConstrained::Constrained);
|
1028 + | self
|
1029 + | }
|
1030 + | /// <p>The block index from which the comparison should start.</p>
|
1031 + | /// <p>The list in the response will start from this block index or the next valid block index in the snapshots.</p>
|
1032 + | pub(crate) fn set_starting_block_index(
|
1033 + | mut self,
|
1034 + | input: Option<
|
1035 + | impl ::std::convert::Into<
|
1036 + | crate::constrained::MaybeConstrained<crate::model::BlockIndex>,
|
1037 + | >,
|
1038 + | >,
|
1039 + | ) -> Self {
|
1040 + | self.starting_block_index = input.map(|v| v.into());
|
1041 + | self
|
1042 + | }
|
1043 + | /// Consumes the builder and constructs a [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
1260 1044 | ///
|
1261 - | /// The builder fails to construct a [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput) if a [`ConstraintViolation`] occurs.
|
1045 + | /// The builder fails to construct a [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput) if a [`ConstraintViolation`] occurs.
|
1262 1046 | ///
|
1263 1047 | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
1264 - | pub fn build(self) -> Result<crate::input::ListSnapshotBlocksInput, ConstraintViolation> {
|
1048 + | pub fn build(self) -> Result<crate::input::ListChangedBlocksInput, ConstraintViolation> {
|
1265 1049 | self.build_enforcing_all_constraints()
|
1266 1050 | }
|
1267 1051 | fn build_enforcing_all_constraints(
|
1268 1052 | self,
|
1269 - | ) -> Result<crate::input::ListSnapshotBlocksInput, ConstraintViolation> {
|
1270 - | Ok(crate::input::ListSnapshotBlocksInput {
|
1271 - | max_results: self
|
1272 - | .max_results
|
1053 + | ) -> Result<crate::input::ListChangedBlocksInput, ConstraintViolation> {
|
1054 + | Ok(crate::input::ListChangedBlocksInput {
|
1055 + | second_snapshot_id: self
|
1056 + | .second_snapshot_id
|
1273 1057 | .map(|v| match v {
|
1274 1058 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1275 1059 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1276 1060 | })
|
1277 - | .map(|res| res.map_err(ConstraintViolation::MaxResults))
|
1278 - | .transpose()?,
|
1279 - | starting_block_index: self
|
1280 - | .starting_block_index
|
1061 + | .map(|res| res.map_err(ConstraintViolation::SecondSnapshotId))
|
1062 + | .transpose()?
|
1063 + | .ok_or(ConstraintViolation::MissingSecondSnapshotId)?,
|
1064 + | first_snapshot_id: self
|
1065 + | .first_snapshot_id
|
1281 1066 | .map(|v| match v {
|
1282 1067 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1283 1068 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1284 1069 | })
|
1285 - | .map(|res| res.map_err(ConstraintViolation::StartingBlockIndex))
|
1070 + | .map(|res| res.map_err(ConstraintViolation::FirstSnapshotId))
|
1286 1071 | .transpose()?,
|
1287 1072 | next_token: self
|
1288 1073 | .next_token
|
1289 1074 | .map(|v| match v {
|
1290 1075 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1291 1076 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1292 1077 | })
|
1293 1078 | .map(|res| res.map_err(ConstraintViolation::NextToken))
|
1294 1079 | .transpose()?,
|
1295 - | snapshot_id: self
|
1296 - | .snapshot_id
|
1080 + | max_results: self
|
1081 + | .max_results
|
1297 1082 | .map(|v| match v {
|
1298 1083 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1299 1084 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1300 1085 | })
|
1301 - | .map(|res| res.map_err(ConstraintViolation::SnapshotId))
|
1302 - | .transpose()?
|
1303 - | .ok_or(ConstraintViolation::MissingSnapshotId)?,
|
1086 + | .map(|res| res.map_err(ConstraintViolation::MaxResults))
|
1087 + | .transpose()?,
|
1088 + | starting_block_index: self
|
1089 + | .starting_block_index
|
1090 + | .map(|v| match v {
|
1091 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1092 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1093 + | })
|
1094 + | .map(|res| res.map_err(ConstraintViolation::StartingBlockIndex))
|
1095 + | .transpose()?,
|
1304 1096 | })
|
1305 1097 | }
|
1306 1098 | }
|
1307 1099 | }
|
1308 - | /// See [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
1309 - | pub mod list_changed_blocks_input {
|
1100 + | /// See [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
1101 + | pub mod list_snapshot_blocks_input {
|
1310 1102 |
|
1311 1103 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1312 1104 | /// Holds one variant for each of the ways the builder can fail.
|
1313 1105 | #[non_exhaustive]
|
1314 1106 | #[allow(clippy::enum_variant_names)]
|
1315 1107 | pub enum ConstraintViolation {
|
1316 - | /// `second_snapshot_id` was not provided but it is required when building `ListChangedBlocksInput`.
|
1317 - | MissingSecondSnapshotId,
|
1318 - | /// Constraint violation occurred building member `second_snapshot_id` when building `ListChangedBlocksInput`.
|
1108 + | /// Constraint violation occurred building member `max_results` when building `ListSnapshotBlocksInput`.
|
1319 1109 | #[doc(hidden)]
|
1320 - | SecondSnapshotId(crate::model::snapshot_id::ConstraintViolation),
|
1321 - | /// Constraint violation occurred building member `first_snapshot_id` when building `ListChangedBlocksInput`.
|
1110 + | MaxResults(crate::model::max_results::ConstraintViolation),
|
1111 + | /// Constraint violation occurred building member `starting_block_index` when building `ListSnapshotBlocksInput`.
|
1322 1112 | #[doc(hidden)]
|
1323 - | FirstSnapshotId(crate::model::snapshot_id::ConstraintViolation),
|
1324 - | /// Constraint violation occurred building member `next_token` when building `ListChangedBlocksInput`.
|
1113 + | StartingBlockIndex(crate::model::block_index::ConstraintViolation),
|
1114 + | /// Constraint violation occurred building member `next_token` when building `ListSnapshotBlocksInput`.
|
1325 1115 | #[doc(hidden)]
|
1326 1116 | NextToken(crate::model::page_token::ConstraintViolation),
|
1327 - | /// Constraint violation occurred building member `max_results` when building `ListChangedBlocksInput`.
|
1328 - | #[doc(hidden)]
|
1329 - | MaxResults(crate::model::max_results::ConstraintViolation),
|
1330 - | /// Constraint violation occurred building member `starting_block_index` when building `ListChangedBlocksInput`.
|
1117 + | /// `snapshot_id` was not provided but it is required when building `ListSnapshotBlocksInput`.
|
1118 + | MissingSnapshotId,
|
1119 + | /// Constraint violation occurred building member `snapshot_id` when building `ListSnapshotBlocksInput`.
|
1331 1120 | #[doc(hidden)]
|
1332 - | StartingBlockIndex(crate::model::block_index::ConstraintViolation),
|
1121 + | SnapshotId(crate::model::snapshot_id::ConstraintViolation),
|
1333 1122 | }
|
1334 1123 | impl ::std::fmt::Display for ConstraintViolation {
|
1335 1124 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1336 1125 | match self {
|
1337 - | ConstraintViolation::MissingSecondSnapshotId => write!(f, "`second_snapshot_id` was not provided but it is required when building `ListChangedBlocksInput`"),
|
1338 - | ConstraintViolation::SecondSnapshotId(_) => write!(f, "constraint violation occurred building member `second_snapshot_id` when building `ListChangedBlocksInput`"),
|
1339 - | ConstraintViolation::FirstSnapshotId(_) => write!(f, "constraint violation occurred building member `first_snapshot_id` when building `ListChangedBlocksInput`"),
|
1340 - | ConstraintViolation::NextToken(_) => write!(f, "constraint violation occurred building member `next_token` when building `ListChangedBlocksInput`"),
|
1341 - | ConstraintViolation::MaxResults(_) => write!(f, "constraint violation occurred building member `max_results` when building `ListChangedBlocksInput`"),
|
1342 - | ConstraintViolation::StartingBlockIndex(_) => write!(f, "constraint violation occurred building member `starting_block_index` when building `ListChangedBlocksInput`"),
|
1126 + | ConstraintViolation::MaxResults(_) => write!(f, "constraint violation occurred building member `max_results` when building `ListSnapshotBlocksInput`"),
|
1127 + | ConstraintViolation::StartingBlockIndex(_) => write!(f, "constraint violation occurred building member `starting_block_index` when building `ListSnapshotBlocksInput`"),
|
1128 + | ConstraintViolation::NextToken(_) => write!(f, "constraint violation occurred building member `next_token` when building `ListSnapshotBlocksInput`"),
|
1129 + | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `ListSnapshotBlocksInput`"),
|
1130 + | ConstraintViolation::SnapshotId(_) => write!(f, "constraint violation occurred building member `snapshot_id` when building `ListSnapshotBlocksInput`"),
|
1343 1131 | }
|
1344 1132 | }
|
1345 1133 | }
|
1346 1134 | impl ::std::error::Error for ConstraintViolation {}
|
1347 1135 | impl ConstraintViolation {
|
1348 1136 | pub(crate) fn as_validation_exception_field(
|
1349 1137 | self,
|
1350 1138 | path: ::std::string::String,
|
1351 1139 | ) -> crate::model::ValidationExceptionField {
|
1352 1140 | match self {
|
1353 - | ConstraintViolation::MissingSecondSnapshotId => crate::model::ValidationExceptionField {
|
1354 - | message: format!("Value at '{}/SecondSnapshotId' failed to satisfy constraint: Member must not be null", path),
|
1355 - | path: path + "/SecondSnapshotId",
|
1356 - | },
|
1357 - | ConstraintViolation::SecondSnapshotId(inner) => inner.as_validation_exception_field(path + "/SecondSnapshotId"),
|
1358 - | ConstraintViolation::FirstSnapshotId(inner) => inner.as_validation_exception_field(path + "/FirstSnapshotId"),
|
1359 - | ConstraintViolation::NextToken(inner) => inner.as_validation_exception_field(path + "/NextToken"),
|
1360 1141 | ConstraintViolation::MaxResults(inner) => inner.as_validation_exception_field(path + "/MaxResults"),
|
1361 1142 | ConstraintViolation::StartingBlockIndex(inner) => inner.as_validation_exception_field(path + "/StartingBlockIndex"),
|
1143 + | ConstraintViolation::NextToken(inner) => inner.as_validation_exception_field(path + "/NextToken"),
|
1144 + | ConstraintViolation::MissingSnapshotId => crate::model::ValidationExceptionField {
|
1145 + | message: format!("Value at '{}/SnapshotId' failed to satisfy constraint: Member must not be null", path),
|
1146 + | path: path + "/SnapshotId",
|
1147 + | },
|
1148 + | ConstraintViolation::SnapshotId(inner) => inner.as_validation_exception_field(path + "/SnapshotId"),
|
1362 1149 | }
|
1363 1150 | }
|
1364 1151 | }
|
1365 1152 | impl ::std::convert::From<ConstraintViolation>
|
1366 1153 | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
1367 1154 | {
|
1368 1155 | fn from(constraint_violation: ConstraintViolation) -> Self {
|
1369 1156 | let first_validation_exception_field =
|
1370 1157 | constraint_violation.as_validation_exception_field("".to_owned());
|
1371 1158 | let validation_exception = crate::error::ValidationException {
|
1372 1159 | message: format!(
|
1373 1160 | "1 validation error detected. {}",
|
1374 1161 | &first_validation_exception_field.message
|
1375 1162 | ),
|
1376 1163 | field_list: Some(vec![first_validation_exception_field]),
|
1377 1164 | };
|
1378 1165 | Self::ConstraintViolation(
|
1379 1166 | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
1380 1167 | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
1381 1168 | )
|
1382 1169 | }
|
1383 1170 | }
|
1384 1171 | impl ::std::convert::From<Builder>
|
1385 - | for crate::constrained::MaybeConstrained<crate::input::ListChangedBlocksInput>
|
1386 - | {
|
1387 - | fn from(builder: Builder) -> Self {
|
1388 - | Self::Unconstrained(builder)
|
1389 - | }
|
1390 - | }
|
1391 - | impl ::std::convert::TryFrom<Builder> for crate::input::ListChangedBlocksInput {
|
1392 - | type Error = ConstraintViolation;
|
1393 - |
|
1394 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1395 - | builder.build()
|
1396 - | }
|
1397 - | }
|
1398 - | /// A builder for [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
1399 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1400 - | pub struct Builder {
|
1401 - | pub(crate) second_snapshot_id:
|
1402 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
1403 - | pub(crate) first_snapshot_id:
|
1404 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
1405 - | pub(crate) next_token:
|
1406 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::PageToken>>,
|
1407 - | pub(crate) max_results:
|
1408 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxResults>>,
|
1409 - | pub(crate) starting_block_index:
|
1410 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::BlockIndex>>,
|
1411 - | }
|
1412 - | impl Builder {
|
1413 - | /// <p>The ID of the second snapshot to use for the comparison.</p><important>
|
1414 - | /// <p>The <code>SecondSnapshotId</code> parameter must be specified with a <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
|
1415 - | /// </important>
|
1416 - | pub fn second_snapshot_id(mut self, input: crate::model::SnapshotId) -> Self {
|
1417 - | self.second_snapshot_id =
|
1418 - | Some(crate::constrained::MaybeConstrained::Constrained(input));
|
1419 - | self
|
1420 - | }
|
1421 - | /// <p>The ID of the second snapshot to use for the comparison.</p><important>
|
1422 - | /// <p>The <code>SecondSnapshotId</code> parameter must be specified with a <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
|
1423 - | /// </important>
|
1424 - | pub(crate) fn set_second_snapshot_id(
|
1425 - | mut self,
|
1426 - | input: impl ::std::convert::Into<
|
1427 - | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
1428 - | >,
|
1429 - | ) -> Self {
|
1430 - | self.second_snapshot_id = Some(input.into());
|
1431 - | self
|
1172 + | for crate::constrained::MaybeConstrained<crate::input::ListSnapshotBlocksInput>
|
1173 + | {
|
1174 + | fn from(builder: Builder) -> Self {
|
1175 + | Self::Unconstrained(builder)
|
1432 1176 | }
|
1433 - | /// <p>The ID of the first snapshot to use for the comparison.</p><important>
|
1434 - | /// <p>The <code>FirstSnapshotID</code> parameter must be specified with a <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
|
1435 - | /// </important>
|
1436 - | pub fn first_snapshot_id(
|
1437 - | mut self,
|
1438 - | input: ::std::option::Option<crate::model::SnapshotId>,
|
1439 - | ) -> Self {
|
1440 - | self.first_snapshot_id = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1441 - | self
|
1442 1177 | }
|
1443 - | /// <p>The ID of the first snapshot to use for the comparison.</p><important>
|
1444 - | /// <p>The <code>FirstSnapshotID</code> parameter must be specified with a <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
|
1445 - | /// </important>
|
1446 - | pub(crate) fn set_first_snapshot_id(
|
1447 - | mut self,
|
1448 - | input: Option<
|
1449 - | impl ::std::convert::Into<
|
1450 - | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
1451 - | >,
|
1452 - | >,
|
1453 - | ) -> Self {
|
1454 - | self.first_snapshot_id = input.map(|v| v.into());
|
1455 - | self
|
1178 + | impl ::std::convert::TryFrom<Builder> for crate::input::ListSnapshotBlocksInput {
|
1179 + | type Error = ConstraintViolation;
|
1180 + |
|
1181 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1182 + | builder.build()
|
1456 1183 | }
|
1457 - | /// <p>The token to request the next page of results.</p>
|
1458 - | pub fn next_token(mut self, input: ::std::option::Option<crate::model::PageToken>) -> Self {
|
1459 - | self.next_token = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1460 - | self
|
1461 1184 | }
|
1462 - | /// <p>The token to request the next page of results.</p>
|
1463 - | pub(crate) fn set_next_token(
|
1464 - | mut self,
|
1465 - | input: Option<
|
1466 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::PageToken>>,
|
1467 - | >,
|
1468 - | ) -> Self {
|
1469 - | self.next_token = input.map(|v| v.into());
|
1470 - | self
|
1185 + | /// A builder for [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
1186 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1187 + | pub struct Builder {
|
1188 + | pub(crate) max_results:
|
1189 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxResults>>,
|
1190 + | pub(crate) starting_block_index:
|
1191 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::BlockIndex>>,
|
1192 + | pub(crate) next_token:
|
1193 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::PageToken>>,
|
1194 + | pub(crate) snapshot_id:
|
1195 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
1471 1196 | }
|
1197 + | impl Builder {
|
1472 1198 | /// <p>The number of results to return.</p>
|
1473 1199 | pub fn max_results(
|
1474 1200 | mut self,
|
1475 1201 | input: ::std::option::Option<crate::model::MaxResults>,
|
1476 1202 | ) -> Self {
|
1477 1203 | self.max_results = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1478 1204 | self
|
1479 1205 | }
|
1480 1206 | /// <p>The number of results to return.</p>
|
1481 1207 | pub(crate) fn set_max_results(
|
1482 1208 | mut self,
|
1483 1209 | input: Option<
|
1484 1210 | impl ::std::convert::Into<
|
1485 1211 | crate::constrained::MaybeConstrained<crate::model::MaxResults>,
|
1486 1212 | >,
|
1487 1213 | >,
|
1488 1214 | ) -> Self {
|
1489 1215 | self.max_results = input.map(|v| v.into());
|
1490 1216 | self
|
1491 1217 | }
|
1492 - | /// <p>The block index from which the comparison should start.</p>
|
1493 - | /// <p>The list in the response will start from this block index or the next valid block index in the snapshots.</p>
|
1218 + | /// <p>The block index from which the list should start. The list in the response will start from this block index or the next valid block index in the snapshot.</p>
|
1494 1219 | pub fn starting_block_index(
|
1495 1220 | mut self,
|
1496 1221 | input: ::std::option::Option<crate::model::BlockIndex>,
|
1497 1222 | ) -> Self {
|
1498 1223 | self.starting_block_index =
|
1499 1224 | input.map(crate::constrained::MaybeConstrained::Constrained);
|
1500 1225 | self
|
1501 1226 | }
|
1502 - | /// <p>The block index from which the comparison should start.</p>
|
1503 - | /// <p>The list in the response will start from this block index or the next valid block index in the snapshots.</p>
|
1227 + | /// <p>The block index from which the list should start. The list in the response will start from this block index or the next valid block index in the snapshot.</p>
|
1504 1228 | pub(crate) fn set_starting_block_index(
|
1505 1229 | mut self,
|
1506 1230 | input: Option<
|
1507 1231 | impl ::std::convert::Into<
|
1508 1232 | crate::constrained::MaybeConstrained<crate::model::BlockIndex>,
|
1509 1233 | >,
|
1510 1234 | >,
|
1511 1235 | ) -> Self {
|
1512 1236 | self.starting_block_index = input.map(|v| v.into());
|
1513 1237 | self
|
1514 1238 | }
|
1515 - | /// Consumes the builder and constructs a [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
1239 + | /// <p>The token to request the next page of results.</p>
|
1240 + | pub fn next_token(mut self, input: ::std::option::Option<crate::model::PageToken>) -> Self {
|
1241 + | self.next_token = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1242 + | self
|
1243 + | }
|
1244 + | /// <p>The token to request the next page of results.</p>
|
1245 + | pub(crate) fn set_next_token(
|
1246 + | mut self,
|
1247 + | input: Option<
|
1248 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::PageToken>>,
|
1249 + | >,
|
1250 + | ) -> Self {
|
1251 + | self.next_token = input.map(|v| v.into());
|
1252 + | self
|
1253 + | }
|
1254 + | /// <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
|
1255 + | pub fn snapshot_id(mut self, input: crate::model::SnapshotId) -> Self {
|
1256 + | self.snapshot_id = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
1257 + | self
|
1258 + | }
|
1259 + | /// <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
|
1260 + | pub(crate) fn set_snapshot_id(
|
1261 + | mut self,
|
1262 + | input: impl ::std::convert::Into<
|
1263 + | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
1264 + | >,
|
1265 + | ) -> Self {
|
1266 + | self.snapshot_id = Some(input.into());
|
1267 + | self
|
1268 + | }
|
1269 + | /// Consumes the builder and constructs a [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
1516 1270 | ///
|
1517 - | /// The builder fails to construct a [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput) if a [`ConstraintViolation`] occurs.
|
1271 + | /// The builder fails to construct a [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput) if a [`ConstraintViolation`] occurs.
|
1518 1272 | ///
|
1519 1273 | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
1520 - | pub fn build(self) -> Result<crate::input::ListChangedBlocksInput, ConstraintViolation> {
|
1274 + | pub fn build(self) -> Result<crate::input::ListSnapshotBlocksInput, ConstraintViolation> {
|
1521 1275 | self.build_enforcing_all_constraints()
|
1522 1276 | }
|
1523 1277 | fn build_enforcing_all_constraints(
|
1524 1278 | self,
|
1525 - | ) -> Result<crate::input::ListChangedBlocksInput, ConstraintViolation> {
|
1526 - | Ok(crate::input::ListChangedBlocksInput {
|
1527 - | second_snapshot_id: self
|
1528 - | .second_snapshot_id
|
1279 + | ) -> Result<crate::input::ListSnapshotBlocksInput, ConstraintViolation> {
|
1280 + | Ok(crate::input::ListSnapshotBlocksInput {
|
1281 + | max_results: self
|
1282 + | .max_results
|
1529 1283 | .map(|v| match v {
|
1530 1284 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1531 1285 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1532 1286 | })
|
1533 - | .map(|res| res.map_err(ConstraintViolation::SecondSnapshotId))
|
1534 - | .transpose()?
|
1535 - | .ok_or(ConstraintViolation::MissingSecondSnapshotId)?,
|
1536 - | first_snapshot_id: self
|
1537 - | .first_snapshot_id
|
1287 + | .map(|res| res.map_err(ConstraintViolation::MaxResults))
|
1288 + | .transpose()?,
|
1289 + | starting_block_index: self
|
1290 + | .starting_block_index
|
1538 1291 | .map(|v| match v {
|
1539 1292 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1540 1293 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1541 1294 | })
|
1542 - | .map(|res| res.map_err(ConstraintViolation::FirstSnapshotId))
|
1295 + | .map(|res| res.map_err(ConstraintViolation::StartingBlockIndex))
|
1543 1296 | .transpose()?,
|
1544 1297 | next_token: self
|
1545 1298 | .next_token
|
1546 1299 | .map(|v| match v {
|
1547 1300 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1548 1301 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1549 1302 | })
|
1550 1303 | .map(|res| res.map_err(ConstraintViolation::NextToken))
|
1551 1304 | .transpose()?,
|
1552 - | max_results: self
|
1553 - | .max_results
|
1554 - | .map(|v| match v {
|
1555 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1556 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1557 - | })
|
1558 - | .map(|res| res.map_err(ConstraintViolation::MaxResults))
|
1559 - | .transpose()?,
|
1560 - | starting_block_index: self
|
1561 - | .starting_block_index
|
1305 + | snapshot_id: self
|
1306 + | .snapshot_id
|
1562 1307 | .map(|v| match v {
|
1563 1308 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1564 1309 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1565 1310 | })
|
1566 - | .map(|res| res.map_err(ConstraintViolation::StartingBlockIndex))
|
1567 - | .transpose()?,
|
1311 + | .map(|res| res.map_err(ConstraintViolation::SnapshotId))
|
1312 + | .transpose()?
|
1313 + | .ok_or(ConstraintViolation::MissingSnapshotId)?,
|
1568 1314 | })
|
1569 1315 | }
|
1570 1316 | }
|
1571 1317 | }
|
1572 - | /// See [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
1573 - | pub mod get_snapshot_block_input {
|
1318 + | /// See [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
1319 + | pub mod put_snapshot_block_input {
|
1574 1320 |
|
1575 1321 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1576 1322 | /// Holds one variant for each of the ways the builder can fail.
|
1577 1323 | #[non_exhaustive]
|
1578 1324 | #[allow(clippy::enum_variant_names)]
|
1579 1325 | pub enum ConstraintViolation {
|
1580 - | /// `snapshot_id` was not provided but it is required when building `GetSnapshotBlockInput`.
|
1326 + | /// `snapshot_id` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1581 1327 | MissingSnapshotId,
|
1582 - | /// Constraint violation occurred building member `snapshot_id` when building `GetSnapshotBlockInput`.
|
1328 + | /// Constraint violation occurred building member `snapshot_id` when building `PutSnapshotBlockInput`.
|
1583 1329 | #[doc(hidden)]
|
1584 1330 | SnapshotId(crate::model::snapshot_id::ConstraintViolation),
|
1585 - | /// `block_token` was not provided but it is required when building `GetSnapshotBlockInput`.
|
1586 - | MissingBlockToken,
|
1587 - | /// Constraint violation occurred building member `block_token` when building `GetSnapshotBlockInput`.
|
1588 - | #[doc(hidden)]
|
1589 - | BlockToken(crate::model::block_token::ConstraintViolation),
|
1590 - | /// `block_index` was not provided but it is required when building `GetSnapshotBlockInput`.
|
1331 + | /// `block_index` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1591 1332 | MissingBlockIndex,
|
1592 - | /// Constraint violation occurred building member `block_index` when building `GetSnapshotBlockInput`.
|
1333 + | /// Constraint violation occurred building member `block_index` when building `PutSnapshotBlockInput`.
|
1593 1334 | #[doc(hidden)]
|
1594 1335 | BlockIndex(crate::model::block_index::ConstraintViolation),
|
1336 + | /// `checksum` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1337 + | MissingChecksum,
|
1338 + | /// Constraint violation occurred building member `checksum` when building `PutSnapshotBlockInput`.
|
1339 + | #[doc(hidden)]
|
1340 + | Checksum(crate::model::checksum::ConstraintViolation),
|
1341 + | /// Constraint violation occurred building member `progress` when building `PutSnapshotBlockInput`.
|
1342 + | #[doc(hidden)]
|
1343 + | Progress(crate::model::progress::ConstraintViolation),
|
1344 + | /// `block_data` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1345 + | MissingBlockData,
|
1346 + | /// `data_length` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1347 + | MissingDataLength,
|
1348 + | /// `checksum_algorithm` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1349 + | MissingChecksumAlgorithm,
|
1350 + | /// Constraint violation occurred building member `checksum_algorithm` when building `PutSnapshotBlockInput`.
|
1351 + | #[doc(hidden)]
|
1352 + | ChecksumAlgorithm(crate::model::checksum_algorithm::ConstraintViolation),
|
1595 1353 | }
|
1596 1354 | impl ::std::fmt::Display for ConstraintViolation {
|
1597 1355 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1598 1356 | match self {
|
1599 - | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `GetSnapshotBlockInput`"),
|
1600 - | ConstraintViolation::SnapshotId(_) => write!(f, "constraint violation occurred building member `snapshot_id` when building `GetSnapshotBlockInput`"),
|
1601 - | ConstraintViolation::MissingBlockToken => write!(f, "`block_token` was not provided but it is required when building `GetSnapshotBlockInput`"),
|
1602 - | ConstraintViolation::BlockToken(_) => write!(f, "constraint violation occurred building member `block_token` when building `GetSnapshotBlockInput`"),
|
1603 - | ConstraintViolation::MissingBlockIndex => write!(f, "`block_index` was not provided but it is required when building `GetSnapshotBlockInput`"),
|
1604 - | ConstraintViolation::BlockIndex(_) => write!(f, "constraint violation occurred building member `block_index` when building `GetSnapshotBlockInput`"),
|
1357 + | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1358 + | ConstraintViolation::SnapshotId(_) => write!(f, "constraint violation occurred building member `snapshot_id` when building `PutSnapshotBlockInput`"),
|
1359 + | ConstraintViolation::MissingBlockIndex => write!(f, "`block_index` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1360 + | ConstraintViolation::BlockIndex(_) => write!(f, "constraint violation occurred building member `block_index` when building `PutSnapshotBlockInput`"),
|
1361 + | ConstraintViolation::MissingChecksum => write!(f, "`checksum` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1362 + | ConstraintViolation::Checksum(_) => write!(f, "constraint violation occurred building member `checksum` when building `PutSnapshotBlockInput`"),
|
1363 + | ConstraintViolation::Progress(_) => write!(f, "constraint violation occurred building member `progress` when building `PutSnapshotBlockInput`"),
|
1364 + | ConstraintViolation::MissingBlockData => write!(f, "`block_data` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1365 + | ConstraintViolation::MissingDataLength => write!(f, "`data_length` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1366 + | ConstraintViolation::MissingChecksumAlgorithm => write!(f, "`checksum_algorithm` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1367 + | ConstraintViolation::ChecksumAlgorithm(_) => write!(f, "constraint violation occurred building member `checksum_algorithm` when building `PutSnapshotBlockInput`"),
|
1605 1368 | }
|
1606 1369 | }
|
1607 1370 | }
|
1608 1371 | impl ::std::error::Error for ConstraintViolation {}
|
1609 1372 | impl ConstraintViolation {
|
1610 1373 | pub(crate) fn as_validation_exception_field(
|
1611 1374 | self,
|
1612 1375 | path: ::std::string::String,
|
1613 1376 | ) -> crate::model::ValidationExceptionField {
|
1614 1377 | match self {
|
1615 1378 | ConstraintViolation::MissingSnapshotId => crate::model::ValidationExceptionField {
|
1616 1379 | message: format!("Value at '{}/SnapshotId' failed to satisfy constraint: Member must not be null", path),
|
1617 1380 | path: path + "/SnapshotId",
|
1618 1381 | },
|
1619 1382 | ConstraintViolation::SnapshotId(inner) => inner.as_validation_exception_field(path + "/SnapshotId"),
|
1620 - | ConstraintViolation::MissingBlockToken => crate::model::ValidationExceptionField {
|
1621 - | message: format!("Value at '{}/BlockToken' failed to satisfy constraint: Member must not be null", path),
|
1622 - | path: path + "/BlockToken",
|
1623 - | },
|
1624 - | ConstraintViolation::BlockToken(inner) => inner.as_validation_exception_field(path + "/BlockToken"),
|
1625 1383 | ConstraintViolation::MissingBlockIndex => crate::model::ValidationExceptionField {
|
1626 1384 | message: format!("Value at '{}/BlockIndex' failed to satisfy constraint: Member must not be null", path),
|
1627 1385 | path: path + "/BlockIndex",
|
1628 1386 | },
|
1629 1387 | ConstraintViolation::BlockIndex(inner) => inner.as_validation_exception_field(path + "/BlockIndex"),
|
1388 + | ConstraintViolation::MissingChecksum => crate::model::ValidationExceptionField {
|
1389 + | message: format!("Value at '{}/Checksum' failed to satisfy constraint: Member must not be null", path),
|
1390 + | path: path + "/Checksum",
|
1391 + | },
|
1392 + | ConstraintViolation::Checksum(inner) => inner.as_validation_exception_field(path + "/Checksum"),
|
1393 + | ConstraintViolation::Progress(inner) => inner.as_validation_exception_field(path + "/Progress"),
|
1394 + | ConstraintViolation::MissingBlockData => crate::model::ValidationExceptionField {
|
1395 + | message: format!("Value at '{}/BlockData' failed to satisfy constraint: Member must not be null", path),
|
1396 + | path: path + "/BlockData",
|
1397 + | },
|
1398 + | ConstraintViolation::MissingDataLength => crate::model::ValidationExceptionField {
|
1399 + | message: format!("Value at '{}/DataLength' failed to satisfy constraint: Member must not be null", path),
|
1400 + | path: path + "/DataLength",
|
1401 + | },
|
1402 + | ConstraintViolation::MissingChecksumAlgorithm => crate::model::ValidationExceptionField {
|
1403 + | message: format!("Value at '{}/ChecksumAlgorithm' failed to satisfy constraint: Member must not be null", path),
|
1404 + | path: path + "/ChecksumAlgorithm",
|
1405 + | },
|
1406 + | ConstraintViolation::ChecksumAlgorithm(inner) => inner.as_validation_exception_field(path + "/ChecksumAlgorithm"),
|
1630 1407 | }
|
1631 1408 | }
|
1632 1409 | }
|
1633 1410 | impl ::std::convert::From<ConstraintViolation>
|
1634 1411 | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
1635 1412 | {
|
1636 1413 | fn from(constraint_violation: ConstraintViolation) -> Self {
|
1637 1414 | let first_validation_exception_field =
|
1638 1415 | constraint_violation.as_validation_exception_field("".to_owned());
|
1639 1416 | let validation_exception = crate::error::ValidationException {
|
1640 1417 | message: format!(
|
1641 1418 | "1 validation error detected. {}",
|
1642 1419 | &first_validation_exception_field.message
|
1643 1420 | ),
|
1644 1421 | field_list: Some(vec![first_validation_exception_field]),
|
1645 1422 | };
|
1646 1423 | Self::ConstraintViolation(
|
1647 1424 | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
1648 1425 | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
1649 1426 | )
|
1650 1427 | }
|
1651 1428 | }
|
1652 1429 | impl ::std::convert::From<Builder>
|
1653 - | for crate::constrained::MaybeConstrained<crate::input::GetSnapshotBlockInput>
|
1430 + | for crate::constrained::MaybeConstrained<crate::input::PutSnapshotBlockInput>
|
1654 1431 | {
|
1655 1432 | fn from(builder: Builder) -> Self {
|
1656 1433 | Self::Unconstrained(builder)
|
1657 1434 | }
|
1658 1435 | }
|
1659 - | impl ::std::convert::TryFrom<Builder> for crate::input::GetSnapshotBlockInput {
|
1436 + | impl ::std::convert::TryFrom<Builder> for crate::input::PutSnapshotBlockInput {
|
1660 1437 | type Error = ConstraintViolation;
|
1661 1438 |
|
1662 1439 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1663 1440 | builder.build()
|
1664 1441 | }
|
1665 1442 | }
|
1666 - | /// A builder for [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
1667 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1443 + | /// A builder for [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
1444 + | #[derive(::std::default::Default)]
|
1668 1445 | pub struct Builder {
|
1669 1446 | pub(crate) snapshot_id:
|
1670 1447 | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
1671 - | pub(crate) block_token:
|
1672 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::BlockToken>>,
|
1673 1448 | pub(crate) block_index:
|
1674 1449 | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::BlockIndex>>,
|
1450 + | pub(crate) checksum:
|
1451 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Checksum>>,
|
1452 + | pub(crate) progress:
|
1453 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Progress>>,
|
1454 + | pub(crate) block_data: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>,
|
1455 + | pub(crate) data_length: ::std::option::Option<i32>,
|
1456 + | pub(crate) checksum_algorithm: ::std::option::Option<
|
1457 + | crate::constrained::MaybeConstrained<crate::model::ChecksumAlgorithm>,
|
1458 + | >,
|
1459 + | }
|
1460 + | impl Builder {
|
1461 + | /// <p>The ID of the snapshot.</p>
|
1462 + | pub fn snapshot_id(mut self, input: crate::model::SnapshotId) -> Self {
|
1463 + | self.snapshot_id = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
1464 + | self
|
1465 + | }
|
1466 + | /// <p>The ID of the snapshot.</p>
|
1467 + | pub(crate) fn set_snapshot_id(
|
1468 + | mut self,
|
1469 + | input: impl ::std::convert::Into<
|
1470 + | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
1471 + | >,
|
1472 + | ) -> Self {
|
1473 + | self.snapshot_id = Some(input.into());
|
1474 + | self
|
1475 + | }
|
1476 + | /// <p>The block index of the block in which to write the data. A block index is a logical index in units of <code>512</code> KiB blocks. To identify the block index, divide the logical offset of the data in the logical volume by the block size (logical offset of data/<code>524288</code>). The logical offset of the data must be <code>512</code> KiB aligned.</p>
|
1477 + | pub fn block_index(mut self, input: crate::model::BlockIndex) -> Self {
|
1478 + | self.block_index = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
1479 + | self
|
1480 + | }
|
1481 + | /// <p>The block index of the block in which to write the data. A block index is a logical index in units of <code>512</code> KiB blocks. To identify the block index, divide the logical offset of the data in the logical volume by the block size (logical offset of data/<code>524288</code>). The logical offset of the data must be <code>512</code> KiB aligned.</p>
|
1482 + | pub(crate) fn set_block_index(
|
1483 + | mut self,
|
1484 + | input: impl ::std::convert::Into<
|
1485 + | crate::constrained::MaybeConstrained<crate::model::BlockIndex>,
|
1486 + | >,
|
1487 + | ) -> Self {
|
1488 + | self.block_index = Some(input.into());
|
1489 + | self
|
1675 1490 | }
|
1676 - | impl Builder {
|
1677 - | /// <p>The ID of the snapshot containing the block from which to get data.</p>
|
1678 - | pub fn snapshot_id(mut self, input: crate::model::SnapshotId) -> Self {
|
1679 - | self.snapshot_id = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
1491 + | /// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
|
1492 + | pub fn checksum(mut self, input: crate::model::Checksum) -> Self {
|
1493 + | self.checksum = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
1680 1494 | self
|
1681 1495 | }
|
1682 - | /// <p>The ID of the snapshot containing the block from which to get data.</p>
|
1683 - | pub(crate) fn set_snapshot_id(
|
1496 + | /// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
|
1497 + | pub(crate) fn set_checksum(
|
1684 1498 | mut self,
|
1685 1499 | input: impl ::std::convert::Into<
|
1686 - | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
1500 + | crate::constrained::MaybeConstrained<crate::model::Checksum>,
|
1687 1501 | >,
|
1688 1502 | ) -> Self {
|
1689 - | self.snapshot_id = Some(input.into());
|
1503 + | self.checksum = Some(input.into());
|
1690 1504 | self
|
1691 1505 | }
|
1692 - | /// <p>The block token of the block from which to get data.</p>
|
1693 - | /// <p>Obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
1694 - | pub fn block_token(mut self, input: crate::model::BlockToken) -> Self {
|
1695 - | self.block_token = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
1506 + | /// <p>The progress of the write process, as a percentage.</p>
|
1507 + | pub fn progress(mut self, input: ::std::option::Option<crate::model::Progress>) -> Self {
|
1508 + | self.progress = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1696 1509 | self
|
1697 1510 | }
|
1698 - | /// <p>The block token of the block from which to get data.</p>
|
1699 - | /// <p>Obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
1700 - | pub(crate) fn set_block_token(
|
1511 + | /// <p>The progress of the write process, as a percentage.</p>
|
1512 + | pub(crate) fn set_progress(
|
1701 1513 | mut self,
|
1702 - | input: impl ::std::convert::Into<
|
1703 - | crate::constrained::MaybeConstrained<crate::model::BlockToken>,
|
1514 + | input: Option<
|
1515 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Progress>>,
|
1704 1516 | >,
|
1705 1517 | ) -> Self {
|
1706 - | self.block_token = Some(input.into());
|
1518 + | self.progress = input.map(|v| v.into());
|
1707 1519 | self
|
1708 1520 | }
|
1709 - | /// <p>The block index of the block from which to get data.</p>
|
1710 - | /// <p>Obtain the <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
1711 - | pub fn block_index(mut self, input: crate::model::BlockIndex) -> Self {
|
1712 - | self.block_index = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
1521 + | /// <p>The data to write to the block.</p>
|
1522 + | /// <p>The block data is not signed as part of the Signature Version 4 signing process. As a result, you must generate and provide a Base64-encoded SHA256 checksum for the block data using the <b>x-amz-Checksum</b> header. Also, you must specify the checksum algorithm using the <b>x-amz-Checksum-Algorithm</b> header. The checksum that you provide is part of the Signature Version 4 signing process. It is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity of the data. If the checksums do not correspond, the request fails. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-checksums"> Using checksums with the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
1523 + | pub fn block_data(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
|
1524 + | self.block_data = Some(input);
|
1713 1525 | self
|
1714 1526 | }
|
1715 - | /// <p>The block index of the block from which to get data.</p>
|
1716 - | /// <p>Obtain the <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
1717 - | pub(crate) fn set_block_index(
|
1527 + | /// <p>The data to write to the block.</p>
|
1528 + | /// <p>The block data is not signed as part of the Signature Version 4 signing process. As a result, you must generate and provide a Base64-encoded SHA256 checksum for the block data using the <b>x-amz-Checksum</b> header. Also, you must specify the checksum algorithm using the <b>x-amz-Checksum-Algorithm</b> header. The checksum that you provide is part of the Signature Version 4 signing process. It is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity of the data. If the checksums do not correspond, the request fails. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-checksums"> Using checksums with the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
1529 + | pub(crate) fn set_block_data(
|
1530 + | mut self,
|
1531 + | input: impl ::std::convert::Into<::aws_smithy_types::byte_stream::ByteStream>,
|
1532 + | ) -> Self {
|
1533 + | self.block_data = Some(input.into());
|
1534 + | self
|
1535 + | }
|
1536 + | /// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code>.</p>
|
1537 + | /// <p>Valid values: <code>524288</code></p>
|
1538 + | pub fn data_length(mut self, input: i32) -> Self {
|
1539 + | self.data_length = Some(input);
|
1540 + | self
|
1541 + | }
|
1542 + | /// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code>.</p>
|
1543 + | /// <p>Valid values: <code>524288</code></p>
|
1544 + | pub(crate) fn set_data_length(mut self, input: impl ::std::convert::Into<i32>) -> Self {
|
1545 + | self.data_length = Some(input.into());
|
1546 + | self
|
1547 + | }
|
1548 + | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
1549 + | pub fn checksum_algorithm(mut self, input: crate::model::ChecksumAlgorithm) -> Self {
|
1550 + | self.checksum_algorithm =
|
1551 + | Some(crate::constrained::MaybeConstrained::Constrained(input));
|
1552 + | self
|
1553 + | }
|
1554 + | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
1555 + | pub(crate) fn set_checksum_algorithm(
|
1718 1556 | mut self,
|
1719 1557 | input: impl ::std::convert::Into<
|
1720 - | crate::constrained::MaybeConstrained<crate::model::BlockIndex>,
|
1558 + | crate::constrained::MaybeConstrained<crate::model::ChecksumAlgorithm>,
|
1721 1559 | >,
|
1722 1560 | ) -> Self {
|
1723 - | self.block_index = Some(input.into());
|
1561 + | self.checksum_algorithm = Some(input.into());
|
1724 1562 | self
|
1725 1563 | }
|
1726 - | /// Consumes the builder and constructs a [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
1564 + | /// Consumes the builder and constructs a [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
1727 1565 | ///
|
1728 - | /// The builder fails to construct a [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput) if a [`ConstraintViolation`] occurs.
|
1566 + | /// The builder fails to construct a [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput) if a [`ConstraintViolation`] occurs.
|
1729 1567 | ///
|
1730 1568 | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
1731 - | pub fn build(self) -> Result<crate::input::GetSnapshotBlockInput, ConstraintViolation> {
|
1569 + | pub fn build(self) -> Result<crate::input::PutSnapshotBlockInput, ConstraintViolation> {
|
1732 1570 | self.build_enforcing_all_constraints()
|
1733 1571 | }
|
1734 1572 | fn build_enforcing_all_constraints(
|
1735 1573 | self,
|
1736 - | ) -> Result<crate::input::GetSnapshotBlockInput, ConstraintViolation> {
|
1737 - | Ok(crate::input::GetSnapshotBlockInput {
|
1574 + | ) -> Result<crate::input::PutSnapshotBlockInput, ConstraintViolation> {
|
1575 + | Ok(crate::input::PutSnapshotBlockInput {
|
1738 1576 | snapshot_id: self
|
1739 1577 | .snapshot_id
|
1740 1578 | .map(|v| match v {
|
1741 1579 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1742 1580 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1743 1581 | })
|
1744 1582 | .map(|res| res.map_err(ConstraintViolation::SnapshotId))
|
1745 1583 | .transpose()?
|
1746 1584 | .ok_or(ConstraintViolation::MissingSnapshotId)?,
|
1747 - | block_token: self
|
1748 - | .block_token
|
1585 + | block_index: self
|
1586 + | .block_index
|
1749 1587 | .map(|v| match v {
|
1750 1588 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1751 1589 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1752 1590 | })
|
1753 - | .map(|res| res.map_err(ConstraintViolation::BlockToken))
|
1591 + | .map(|res| res.map_err(ConstraintViolation::BlockIndex))
|
1754 1592 | .transpose()?
|
1755 - | .ok_or(ConstraintViolation::MissingBlockToken)?,
|
1756 - | block_index: self
|
1757 - | .block_index
|
1593 + | .ok_or(ConstraintViolation::MissingBlockIndex)?,
|
1594 + | checksum: self
|
1595 + | .checksum
|
1758 1596 | .map(|v| match v {
|
1759 1597 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1760 1598 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1761 1599 | })
|
1762 - | .map(|res| res.map_err(ConstraintViolation::BlockIndex))
|
1600 + | .map(|res| res.map_err(ConstraintViolation::Checksum))
|
1763 1601 | .transpose()?
|
1764 - | .ok_or(ConstraintViolation::MissingBlockIndex)?,
|
1602 + | .ok_or(ConstraintViolation::MissingChecksum)?,
|
1603 + | progress: self
|
1604 + | .progress
|
1605 + | .map(|v| match v {
|
1606 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1607 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1608 + | })
|
1609 + | .map(|res| res.map_err(ConstraintViolation::Progress))
|
1610 + | .transpose()?,
|
1611 + | block_data: self
|
1612 + | .block_data
|
1613 + | .ok_or(ConstraintViolation::MissingBlockData)?,
|
1614 + | data_length: self
|
1615 + | .data_length
|
1616 + | .ok_or(ConstraintViolation::MissingDataLength)?,
|
1617 + | checksum_algorithm: self
|
1618 + | .checksum_algorithm
|
1619 + | .map(|v| match v {
|
1620 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1621 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1622 + | })
|
1623 + | .map(|res| res.map_err(ConstraintViolation::ChecksumAlgorithm))
|
1624 + | .transpose()?
|
1625 + | .ok_or(ConstraintViolation::MissingChecksumAlgorithm)?,
|
1765 1626 | })
|
1766 1627 | }
|
1767 1628 | }
|
1629 + | impl ::std::fmt::Debug for Builder {
|
1630 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
1631 + | let mut formatter = f.debug_struct("Builder");
|
1632 + | formatter.field("snapshot_id", &self.snapshot_id);
|
1633 + | formatter.field("block_index", &self.block_index);
|
1634 + | formatter.field("checksum", &self.checksum);
|
1635 + | formatter.field("progress", &self.progress);
|
1636 + | formatter.field("block_data", &"*** Sensitive Data Redacted ***");
|
1637 + | formatter.field("data_length", &self.data_length);
|
1638 + | formatter.field("checksum_algorithm", &self.checksum_algorithm);
|
1639 + | formatter.finish()
|
1640 + | }
|
1641 + | }
|
1768 1642 | }
|
1769 - | /// See [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
1770 - | pub mod complete_snapshot_input {
|
1643 + | /// See [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
1644 + | pub mod start_snapshot_input {
|
1771 1645 |
|
1772 1646 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1773 1647 | /// Holds one variant for each of the ways the builder can fail.
|
1774 1648 | #[non_exhaustive]
|
1775 1649 | #[allow(clippy::enum_variant_names)]
|
1776 1650 | pub enum ConstraintViolation {
|
1777 - | /// `changed_blocks_count` was not provided but it is required when building `CompleteSnapshotInput`.
|
1778 - | MissingChangedBlocksCount,
|
1779 - | /// Constraint violation occurred building member `changed_blocks_count` when building `CompleteSnapshotInput`.
|
1651 + | /// Constraint violation occurred building member `timeout` when building `StartSnapshotInput`.
|
1780 1652 | #[doc(hidden)]
|
1781 - | ChangedBlocksCount(crate::model::changed_blocks_count::ConstraintViolation),
|
1782 - | /// Constraint violation occurred building member `checksum_aggregation_method` when building `CompleteSnapshotInput`.
|
1653 + | Timeout(crate::model::timeout::ConstraintViolation),
|
1654 + | /// Constraint violation occurred building member `client_token` when building `StartSnapshotInput`.
|
1783 1655 | #[doc(hidden)]
|
1784 - | ChecksumAggregationMethod(crate::model::checksum_aggregation_method::ConstraintViolation),
|
1785 - | /// Constraint violation occurred building member `checksum_algorithm` when building `CompleteSnapshotInput`.
|
1656 + | ClientToken(crate::model::idempotency_token::ConstraintViolation),
|
1657 + | /// `volume_size` was not provided but it is required when building `StartSnapshotInput`.
|
1658 + | MissingVolumeSize,
|
1659 + | /// Constraint violation occurred building member `volume_size` when building `StartSnapshotInput`.
|
1786 1660 | #[doc(hidden)]
|
1787 - | ChecksumAlgorithm(crate::model::checksum_algorithm::ConstraintViolation),
|
1788 - | /// `snapshot_id` was not provided but it is required when building `CompleteSnapshotInput`.
|
1789 - | MissingSnapshotId,
|
1790 - | /// Constraint violation occurred building member `snapshot_id` when building `CompleteSnapshotInput`.
|
1661 + | VolumeSize(crate::model::volume_size::ConstraintViolation),
|
1662 + | /// Constraint violation occurred building member `tags` when building `StartSnapshotInput`.
|
1791 1663 | #[doc(hidden)]
|
1792 - | SnapshotId(crate::model::snapshot_id::ConstraintViolation),
|
1793 - | /// Constraint violation occurred building member `checksum` when building `CompleteSnapshotInput`.
|
1664 + | Tags(crate::model::tags::ConstraintViolation),
|
1665 + | /// Constraint violation occurred building member `kms_key_arn` when building `StartSnapshotInput`.
|
1794 1666 | #[doc(hidden)]
|
1795 - | Checksum(crate::model::checksum::ConstraintViolation),
|
1667 + | KmsKeyArn(crate::model::kms_key_arn::ConstraintViolation),
|
1668 + | /// Constraint violation occurred building member `parent_snapshot_id` when building `StartSnapshotInput`.
|
1669 + | #[doc(hidden)]
|
1670 + | ParentSnapshotId(crate::model::snapshot_id::ConstraintViolation),
|
1671 + | /// Constraint violation occurred building member `description` when building `StartSnapshotInput`.
|
1672 + | #[doc(hidden)]
|
1673 + | Description(crate::model::description::ConstraintViolation),
|
1796 1674 | }
|
1797 1675 | impl ::std::fmt::Display for ConstraintViolation {
|
1798 1676 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1799 1677 | match self {
|
1800 - | ConstraintViolation::MissingChangedBlocksCount => write!(f, "`changed_blocks_count` was not provided but it is required when building `CompleteSnapshotInput`"),
|
1801 - | ConstraintViolation::ChangedBlocksCount(_) => write!(f, "constraint violation occurred building member `changed_blocks_count` when building `CompleteSnapshotInput`"),
|
1802 - | ConstraintViolation::ChecksumAggregationMethod(_) => write!(f, "constraint violation occurred building member `checksum_aggregation_method` when building `CompleteSnapshotInput`"),
|
1803 - | ConstraintViolation::ChecksumAlgorithm(_) => write!(f, "constraint violation occurred building member `checksum_algorithm` when building `CompleteSnapshotInput`"),
|
1804 - | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `CompleteSnapshotInput`"),
|
1805 - | ConstraintViolation::SnapshotId(_) => write!(f, "constraint violation occurred building member `snapshot_id` when building `CompleteSnapshotInput`"),
|
1806 - | ConstraintViolation::Checksum(_) => write!(f, "constraint violation occurred building member `checksum` when building `CompleteSnapshotInput`"),
|
1678 + | ConstraintViolation::Timeout(_) => write!(f, "constraint violation occurred building member `timeout` when building `StartSnapshotInput`"),
|
1679 + | ConstraintViolation::ClientToken(_) => write!(f, "constraint violation occurred building member `client_token` when building `StartSnapshotInput`"),
|
1680 + | ConstraintViolation::MissingVolumeSize => write!(f, "`volume_size` was not provided but it is required when building `StartSnapshotInput`"),
|
1681 + | ConstraintViolation::VolumeSize(_) => write!(f, "constraint violation occurred building member `volume_size` when building `StartSnapshotInput`"),
|
1682 + | ConstraintViolation::Tags(_) => write!(f, "constraint violation occurred building member `tags` when building `StartSnapshotInput`"),
|
1683 + | ConstraintViolation::KmsKeyArn(_) => write!(f, "constraint violation occurred building member `kms_key_arn` when building `StartSnapshotInput`"),
|
1684 + | ConstraintViolation::ParentSnapshotId(_) => write!(f, "constraint violation occurred building member `parent_snapshot_id` when building `StartSnapshotInput`"),
|
1685 + | ConstraintViolation::Description(_) => write!(f, "constraint violation occurred building member `description` when building `StartSnapshotInput`"),
|
1807 1686 | }
|
1808 1687 | }
|
1809 1688 | }
|
1810 1689 | impl ::std::error::Error for ConstraintViolation {}
|
1811 1690 | impl ConstraintViolation {
|
1812 1691 | pub(crate) fn as_validation_exception_field(
|
1813 1692 | self,
|
1814 1693 | path: ::std::string::String,
|
1815 1694 | ) -> crate::model::ValidationExceptionField {
|
1816 1695 | match self {
|
1817 - | ConstraintViolation::MissingChangedBlocksCount => crate::model::ValidationExceptionField {
|
1818 - | message: format!("Value at '{}/ChangedBlocksCount' failed to satisfy constraint: Member must not be null", path),
|
1819 - | path: path + "/ChangedBlocksCount",
|
1820 - | },
|
1821 - | ConstraintViolation::ChangedBlocksCount(inner) => inner.as_validation_exception_field(path + "/ChangedBlocksCount"),
|
1822 - | ConstraintViolation::ChecksumAggregationMethod(inner) => inner.as_validation_exception_field(path + "/ChecksumAggregationMethod"),
|
1823 - | ConstraintViolation::ChecksumAlgorithm(inner) => inner.as_validation_exception_field(path + "/ChecksumAlgorithm"),
|
1824 - | ConstraintViolation::MissingSnapshotId => crate::model::ValidationExceptionField {
|
1825 - | message: format!("Value at '{}/SnapshotId' failed to satisfy constraint: Member must not be null", path),
|
1826 - | path: path + "/SnapshotId",
|
1696 + | ConstraintViolation::Timeout(inner) => inner.as_validation_exception_field(path + "/Timeout"),
|
1697 + | ConstraintViolation::ClientToken(inner) => inner.as_validation_exception_field(path + "/ClientToken"),
|
1698 + | ConstraintViolation::MissingVolumeSize => crate::model::ValidationExceptionField {
|
1699 + | message: format!("Value at '{}/VolumeSize' failed to satisfy constraint: Member must not be null", path),
|
1700 + | path: path + "/VolumeSize",
|
1827 1701 | },
|
1828 - | ConstraintViolation::SnapshotId(inner) => inner.as_validation_exception_field(path + "/SnapshotId"),
|
1829 - | ConstraintViolation::Checksum(inner) => inner.as_validation_exception_field(path + "/Checksum"),
|
1702 + | ConstraintViolation::VolumeSize(inner) => inner.as_validation_exception_field(path + "/VolumeSize"),
|
1703 + | ConstraintViolation::Tags(inner) => inner.as_validation_exception_field(path + "/Tags"),
|
1704 + | ConstraintViolation::KmsKeyArn(inner) => inner.as_validation_exception_field(path + "/KmsKeyArn"),
|
1705 + | ConstraintViolation::ParentSnapshotId(inner) => inner.as_validation_exception_field(path + "/ParentSnapshotId"),
|
1706 + | ConstraintViolation::Description(inner) => inner.as_validation_exception_field(path + "/Description"),
|
1830 1707 | }
|
1831 1708 | }
|
1832 1709 | }
|
1833 1710 | impl ::std::convert::From<ConstraintViolation>
|
1834 1711 | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
1835 1712 | {
|
1836 1713 | fn from(constraint_violation: ConstraintViolation) -> Self {
|
1837 1714 | let first_validation_exception_field =
|
1838 1715 | constraint_violation.as_validation_exception_field("".to_owned());
|
1839 1716 | let validation_exception = crate::error::ValidationException {
|
1840 1717 | message: format!(
|
1841 1718 | "1 validation error detected. {}",
|
1842 1719 | &first_validation_exception_field.message
|
1843 1720 | ),
|
1844 1721 | field_list: Some(vec![first_validation_exception_field]),
|
1845 1722 | };
|
1846 1723 | Self::ConstraintViolation(
|
1847 1724 | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
1848 1725 | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
1849 1726 | )
|
1850 1727 | }
|
1851 1728 | }
|
1852 1729 | impl ::std::convert::From<Builder>
|
1853 - | for crate::constrained::MaybeConstrained<crate::input::CompleteSnapshotInput>
|
1730 + | for crate::constrained::MaybeConstrained<crate::input::StartSnapshotInput>
|
1854 1731 | {
|
1855 1732 | fn from(builder: Builder) -> Self {
|
1856 1733 | Self::Unconstrained(builder)
|
1857 1734 | }
|
1858 1735 | }
|
1859 - | impl ::std::convert::TryFrom<Builder> for crate::input::CompleteSnapshotInput {
|
1860 - | type Error = ConstraintViolation;
|
1861 - |
|
1862 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1863 - | builder.build()
|
1736 + | impl ::std::convert::TryFrom<Builder> for crate::input::StartSnapshotInput {
|
1737 + | type Error = ConstraintViolation;
|
1738 + |
|
1739 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1740 + | builder.build()
|
1741 + | }
|
1742 + | }
|
1743 + | /// A builder for [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
1744 + | #[derive(::std::clone::Clone, ::std::default::Default)]
|
1745 + | pub struct Builder {
|
1746 + | pub(crate) timeout:
|
1747 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Timeout>>,
|
1748 + | pub(crate) client_token: ::std::option::Option<
|
1749 + | crate::constrained::MaybeConstrained<crate::model::IdempotencyToken>,
|
1750 + | >,
|
1751 + | pub(crate) volume_size:
|
1752 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::VolumeSize>>,
|
1753 + | pub(crate) tags: ::std::option::Option<
|
1754 + | crate::constrained::MaybeConstrained<
|
1755 + | crate::constrained::tags_constrained::TagsConstrained,
|
1756 + | >,
|
1757 + | >,
|
1758 + | pub(crate) encrypted: ::std::option::Option<bool>,
|
1759 + | pub(crate) kms_key_arn:
|
1760 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::KmsKeyArn>>,
|
1761 + | pub(crate) parent_snapshot_id:
|
1762 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
1763 + | pub(crate) description:
|
1764 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Description>>,
|
1765 + | }
|
1766 + | impl Builder {
|
1767 + | /// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
|
1768 + | /// <ul>
|
1769 + | /// <li>
|
1770 + | /// <p>No blocks are written to the snapshot.</p></li>
|
1771 + | /// <li>
|
1772 + | /// <p>The snapshot is not completed after writing the last block of data.</p></li>
|
1773 + | /// </ul>
|
1774 + | /// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
|
1775 + | pub fn timeout(mut self, input: ::std::option::Option<crate::model::Timeout>) -> Self {
|
1776 + | self.timeout = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1777 + | self
|
1778 + | }
|
1779 + | /// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
|
1780 + | /// <ul>
|
1781 + | /// <li>
|
1782 + | /// <p>No blocks are written to the snapshot.</p></li>
|
1783 + | /// <li>
|
1784 + | /// <p>The snapshot is not completed after writing the last block of data.</p></li>
|
1785 + | /// </ul>
|
1786 + | /// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
|
1787 + | pub(crate) fn set_timeout(
|
1788 + | mut self,
|
1789 + | input: Option<
|
1790 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Timeout>>,
|
1791 + | >,
|
1792 + | ) -> Self {
|
1793 + | self.timeout = input.map(|v| v.into());
|
1794 + | self
|
1864 1795 | }
|
1796 + | /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
|
1797 + | /// <p>If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
|
1798 + | /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html"> Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
1799 + | pub fn client_token(
|
1800 + | mut self,
|
1801 + | input: ::std::option::Option<crate::model::IdempotencyToken>,
|
1802 + | ) -> Self {
|
1803 + | self.client_token = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1804 + | self
|
1865 1805 | }
|
1866 - | /// A builder for [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
1867 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1868 - | pub struct Builder {
|
1869 - | pub(crate) changed_blocks_count: ::std::option::Option<
|
1870 - | crate::constrained::MaybeConstrained<crate::model::ChangedBlocksCount>,
|
1871 - | >,
|
1872 - | pub(crate) checksum_aggregation_method: ::std::option::Option<
|
1873 - | crate::constrained::MaybeConstrained<crate::model::ChecksumAggregationMethod>,
|
1806 + | /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
|
1807 + | /// <p>If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
|
1808 + | /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html"> Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
1809 + | pub(crate) fn set_client_token(
|
1810 + | mut self,
|
1811 + | input: Option<
|
1812 + | impl ::std::convert::Into<
|
1813 + | crate::constrained::MaybeConstrained<crate::model::IdempotencyToken>,
|
1874 1814 | >,
|
1875 - | pub(crate) checksum_algorithm: ::std::option::Option<
|
1876 - | crate::constrained::MaybeConstrained<crate::model::ChecksumAlgorithm>,
|
1877 1815 | >,
|
1878 - | pub(crate) snapshot_id:
|
1879 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
1880 - | pub(crate) checksum:
|
1881 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Checksum>>,
|
1816 + | ) -> Self {
|
1817 + | self.client_token = input.map(|v| v.into());
|
1818 + | self
|
1882 1819 | }
|
1883 - | impl Builder {
|
1884 - | /// <p>The number of blocks that were written to the snapshot.</p>
|
1885 - | pub fn changed_blocks_count(mut self, input: crate::model::ChangedBlocksCount) -> Self {
|
1886 - | self.changed_blocks_count =
|
1887 - | Some(crate::constrained::MaybeConstrained::Constrained(input));
|
1820 + | /// <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
|
1821 + | pub fn volume_size(mut self, input: crate::model::VolumeSize) -> Self {
|
1822 + | self.volume_size = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
1888 1823 | self
|
1889 1824 | }
|
1890 - | /// <p>The number of blocks that were written to the snapshot.</p>
|
1891 - | pub(crate) fn set_changed_blocks_count(
|
1825 + | /// <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
|
1826 + | pub(crate) fn set_volume_size(
|
1892 1827 | mut self,
|
1893 1828 | input: impl ::std::convert::Into<
|
1894 - | crate::constrained::MaybeConstrained<crate::model::ChangedBlocksCount>,
|
1829 + | crate::constrained::MaybeConstrained<crate::model::VolumeSize>,
|
1895 1830 | >,
|
1896 1831 | ) -> Self {
|
1897 - | self.changed_blocks_count = Some(input.into());
|
1832 + | self.volume_size = Some(input.into());
|
1898 1833 | self
|
1899 1834 | }
|
1900 - | /// <p>The aggregation method used to generate the checksum. Currently, the only supported aggregation method is <code>LINEAR</code>.</p>
|
1901 - | pub fn checksum_aggregation_method(
|
1835 + | /// <p>The tags to apply to the snapshot.</p>
|
1836 + | pub fn tags(
|
1902 1837 | mut self,
|
1903 - | input: ::std::option::Option<crate::model::ChecksumAggregationMethod>,
|
1838 + | input: ::std::option::Option<::std::vec::Vec<crate::model::Tag>>,
|
1904 1839 | ) -> Self {
|
1905 - | self.checksum_aggregation_method =
|
1906 - | input.map(crate::constrained::MaybeConstrained::Constrained);
|
1840 + | self.tags =
|
1841 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
1907 1842 | self
|
1908 1843 | }
|
1909 - | /// <p>The aggregation method used to generate the checksum. Currently, the only supported aggregation method is <code>LINEAR</code>.</p>
|
1910 - | pub(crate) fn set_checksum_aggregation_method(
|
1844 + | /// <p>The tags to apply to the snapshot.</p>
|
1845 + | pub(crate) fn set_tags(
|
1911 1846 | mut self,
|
1912 1847 | input: Option<
|
1913 1848 | impl ::std::convert::Into<
|
1914 - | crate::constrained::MaybeConstrained<crate::model::ChecksumAggregationMethod>,
|
1849 + | crate::constrained::MaybeConstrained<
|
1850 + | crate::constrained::tags_constrained::TagsConstrained,
|
1851 + | >,
|
1915 1852 | >,
|
1916 1853 | >,
|
1917 1854 | ) -> Self {
|
1918 - | self.checksum_aggregation_method = input.map(|v| v.into());
|
1855 + | self.tags = input.map(|v| v.into());
|
1919 1856 | self
|
1920 1857 | }
|
1921 - | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
1922 - | pub fn checksum_algorithm(
|
1858 + | /// <p>Indicates whether to encrypt the snapshot. To create an encrypted snapshot, specify <code>true</code>. To create an unencrypted snapshot, omit this parameter.</p>
|
1859 + | /// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
|
1860 + | /// <p>If you specify <code>true</code>, the snapshot is encrypted using the CMK specified using the <b>KmsKeyArn</b> parameter. If no value is specified for <b>KmsKeyArn</b>, the default CMK for your account is used. If no default CMK has been specified for your account, the AWS managed CMK is used. To set a default CMK for your account, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html"> ModifyEbsDefaultKmsKeyId</a>.</p>
|
1861 + | /// <p>If your account is enabled for encryption by default, you cannot set this parameter to <code>false</code>. In this case, you can omit this parameter.</p>
|
1862 + | /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption"> Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
1863 + | pub fn encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
|
1864 + | self.encrypted = input;
|
1865 + | self
|
1866 + | }
|
1867 + | /// <p>Indicates whether to encrypt the snapshot. To create an encrypted snapshot, specify <code>true</code>. To create an unencrypted snapshot, omit this parameter.</p>
|
1868 + | /// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
|
1869 + | /// <p>If you specify <code>true</code>, the snapshot is encrypted using the CMK specified using the <b>KmsKeyArn</b> parameter. If no value is specified for <b>KmsKeyArn</b>, the default CMK for your account is used. If no default CMK has been specified for your account, the AWS managed CMK is used. To set a default CMK for your account, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html"> ModifyEbsDefaultKmsKeyId</a>.</p>
|
1870 + | /// <p>If your account is enabled for encryption by default, you cannot set this parameter to <code>false</code>. In this case, you can omit this parameter.</p>
|
1871 + | /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption"> Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
1872 + | pub(crate) fn set_encrypted(
|
1923 1873 | mut self,
|
1924 - | input: ::std::option::Option<crate::model::ChecksumAlgorithm>,
|
1874 + | input: Option<impl ::std::convert::Into<bool>>,
|
1925 1875 | ) -> Self {
|
1926 - | self.checksum_algorithm = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1876 + | self.encrypted = input.map(|v| v.into());
|
1927 1877 | self
|
1928 1878 | }
|
1929 - | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
1930 - | pub(crate) fn set_checksum_algorithm(
|
1879 + | /// <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) to be used to encrypt the snapshot. If you do not specify a CMK, the default AWS managed CMK is used.</p>
|
1880 + | /// <p>If you specify a <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted using the same CMK that was used to encrypt the parent snapshot.</p>
|
1881 + | /// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN.</p>
|
1882 + | pub fn kms_key_arn(
|
1883 + | mut self,
|
1884 + | input: ::std::option::Option<crate::model::KmsKeyArn>,
|
1885 + | ) -> Self {
|
1886 + | self.kms_key_arn = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1887 + | self
|
1888 + | }
|
1889 + | /// <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) to be used to encrypt the snapshot. If you do not specify a CMK, the default AWS managed CMK is used.</p>
|
1890 + | /// <p>If you specify a <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted using the same CMK that was used to encrypt the parent snapshot.</p>
|
1891 + | /// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN.</p>
|
1892 + | pub(crate) fn set_kms_key_arn(
|
1931 1893 | mut self,
|
1932 1894 | input: Option<
|
1933 - | impl ::std::convert::Into<
|
1934 - | crate::constrained::MaybeConstrained<crate::model::ChecksumAlgorithm>,
|
1935 - | >,
|
1895 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::KmsKeyArn>>,
|
1936 1896 | >,
|
1937 1897 | ) -> Self {
|
1938 - | self.checksum_algorithm = input.map(|v| v.into());
|
1898 + | self.kms_key_arn = input.map(|v| v.into());
|
1939 1899 | self
|
1940 1900 | }
|
1941 - | /// <p>The ID of the snapshot.</p>
|
1942 - | pub fn snapshot_id(mut self, input: crate::model::SnapshotId) -> Self {
|
1943 - | self.snapshot_id = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
1901 + | /// <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are creating the first snapshot for an on-premises volume, omit this parameter.</p>
|
1902 + | /// <p>If your account is enabled for encryption by default, you cannot use an unencrypted snapshot as a parent snapshot. You must first create an encrypted copy of the parent snapshot using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
|
1903 + | pub fn parent_snapshot_id(
|
1904 + | mut self,
|
1905 + | input: ::std::option::Option<crate::model::SnapshotId>,
|
1906 + | ) -> Self {
|
1907 + | self.parent_snapshot_id = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1944 1908 | self
|
1945 1909 | }
|
1946 - | /// <p>The ID of the snapshot.</p>
|
1947 - | pub(crate) fn set_snapshot_id(
|
1910 + | /// <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are creating the first snapshot for an on-premises volume, omit this parameter.</p>
|
1911 + | /// <p>If your account is enabled for encryption by default, you cannot use an unencrypted snapshot as a parent snapshot. You must first create an encrypted copy of the parent snapshot using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
|
1912 + | pub(crate) fn set_parent_snapshot_id(
|
1948 1913 | mut self,
|
1949 - | input: impl ::std::convert::Into<
|
1914 + | input: Option<
|
1915 + | impl ::std::convert::Into<
|
1950 1916 | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
1951 1917 | >,
|
1918 + | >,
|
1952 1919 | ) -> Self {
|
1953 - | self.snapshot_id = Some(input.into());
|
1920 + | self.parent_snapshot_id = input.map(|v| v.into());
|
1954 1921 | self
|
1955 1922 | }
|
1956 - | /// <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written block.</p>
|
1957 - | /// <p>To generate the aggregated checksum using the linear aggregation method, arrange the checksums for each written block in ascending order of their block index, concatenate them to form a single string, and then generate the checksum on the entire string using the SHA256 algorithm.</p>
|
1958 - | pub fn checksum(mut self, input: ::std::option::Option<crate::model::Checksum>) -> Self {
|
1959 - | self.checksum = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1923 + | /// <p>A description for the snapshot.</p>
|
1924 + | pub fn description(
|
1925 + | mut self,
|
1926 + | input: ::std::option::Option<crate::model::Description>,
|
1927 + | ) -> Self {
|
1928 + | self.description = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1960 1929 | self
|
1961 1930 | }
|
1962 - | /// <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written block.</p>
|
1963 - | /// <p>To generate the aggregated checksum using the linear aggregation method, arrange the checksums for each written block in ascending order of their block index, concatenate them to form a single string, and then generate the checksum on the entire string using the SHA256 algorithm.</p>
|
1964 - | pub(crate) fn set_checksum(
|
1931 + | /// <p>A description for the snapshot.</p>
|
1932 + | pub(crate) fn set_description(
|
1965 1933 | mut self,
|
1966 1934 | input: Option<
|
1967 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Checksum>>,
|
1935 + | impl ::std::convert::Into<
|
1936 + | crate::constrained::MaybeConstrained<crate::model::Description>,
|
1937 + | >,
|
1968 1938 | >,
|
1969 1939 | ) -> Self {
|
1970 - | self.checksum = input.map(|v| v.into());
|
1940 + | self.description = input.map(|v| v.into());
|
1971 1941 | self
|
1972 1942 | }
|
1973 - | /// Consumes the builder and constructs a [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
1943 + | /// Consumes the builder and constructs a [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
1974 1944 | ///
|
1975 - | /// The builder fails to construct a [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput) if a [`ConstraintViolation`] occurs.
|
1945 + | /// The builder fails to construct a [`StartSnapshotInput`](crate::input::StartSnapshotInput) if a [`ConstraintViolation`] occurs.
|
1976 1946 | ///
|
1977 1947 | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
1978 - | pub fn build(self) -> Result<crate::input::CompleteSnapshotInput, ConstraintViolation> {
|
1948 + | pub fn build(self) -> Result<crate::input::StartSnapshotInput, ConstraintViolation> {
|
1979 1949 | self.build_enforcing_all_constraints()
|
1980 1950 | }
|
1981 1951 | fn build_enforcing_all_constraints(
|
1982 1952 | self,
|
1983 - | ) -> Result<crate::input::CompleteSnapshotInput, ConstraintViolation> {
|
1984 - | Ok(crate::input::CompleteSnapshotInput {
|
1985 - | changed_blocks_count: self
|
1986 - | .changed_blocks_count
|
1953 + | ) -> Result<crate::input::StartSnapshotInput, ConstraintViolation> {
|
1954 + | Ok(crate::input::StartSnapshotInput {
|
1955 + | timeout: self
|
1956 + | .timeout
|
1987 1957 | .map(|v| match v {
|
1988 1958 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1989 1959 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1990 1960 | })
|
1991 - | .map(|res| res.map_err(ConstraintViolation::ChangedBlocksCount))
|
1961 + | .map(|res| res.map_err(ConstraintViolation::Timeout))
|
1962 + | .transpose()?,
|
1963 + | client_token: self
|
1964 + | .client_token
|
1965 + | .map(|v| match v {
|
1966 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1967 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1968 + | })
|
1969 + | .map(|res| res.map_err(ConstraintViolation::ClientToken))
|
1970 + | .transpose()?,
|
1971 + | volume_size: self
|
1972 + | .volume_size
|
1973 + | .map(|v| match v {
|
1974 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1975 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1976 + | })
|
1977 + | .map(|res| res.map_err(ConstraintViolation::VolumeSize))
|
1992 1978 | .transpose()?
|
1993 - | .ok_or(ConstraintViolation::MissingChangedBlocksCount)?,
|
1994 - | checksum_aggregation_method: self
|
1995 - | .checksum_aggregation_method
|
1979 + | .ok_or(ConstraintViolation::MissingVolumeSize)?,
|
1980 + | tags: self
|
1981 + | .tags
|
1996 1982 | .map(|v| match v {
|
1997 1983 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1998 1984 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1999 1985 | })
|
2000 - | .map(|res| res.map_err(ConstraintViolation::ChecksumAggregationMethod))
|
1986 + | .map(|res| res.map(|v| v.into()).map_err(ConstraintViolation::Tags))
|
2001 1987 | .transpose()?,
|
2002 - | checksum_algorithm: self
|
2003 - | .checksum_algorithm
|
1988 + | encrypted: self.encrypted,
|
1989 + | kms_key_arn: self
|
1990 + | .kms_key_arn
|
2004 1991 | .map(|v| match v {
|
2005 1992 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2006 1993 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2007 1994 | })
|
2008 - | .map(|res| res.map_err(ConstraintViolation::ChecksumAlgorithm))
|
1995 + | .map(|res| res.map_err(ConstraintViolation::KmsKeyArn))
|
2009 1996 | .transpose()?,
|
2010 - | snapshot_id: self
|
2011 - | .snapshot_id
|
1997 + | parent_snapshot_id: self
|
1998 + | .parent_snapshot_id
|
2012 1999 | .map(|v| match v {
|
2013 2000 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2014 2001 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2015 2002 | })
|
2016 - | .map(|res| res.map_err(ConstraintViolation::SnapshotId))
|
2017 - | .transpose()?
|
2018 - | .ok_or(ConstraintViolation::MissingSnapshotId)?,
|
2019 - | checksum: self
|
2020 - | .checksum
|
2003 + | .map(|res| res.map_err(ConstraintViolation::ParentSnapshotId))
|
2004 + | .transpose()?,
|
2005 + | description: self
|
2006 + | .description
|
2021 2007 | .map(|v| match v {
|
2022 2008 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2023 2009 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2024 2010 | })
|
2025 - | .map(|res| res.map_err(ConstraintViolation::Checksum))
|
2011 + | .map(|res| res.map_err(ConstraintViolation::Description))
|
2026 2012 | .transpose()?,
|
2027 2013 | })
|
2028 2014 | }
|
2029 2015 | }
|
2016 + | impl ::std::fmt::Debug for Builder {
|
2017 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
2018 + | let mut formatter = f.debug_struct("Builder");
|
2019 + | formatter.field("timeout", &self.timeout);
|
2020 + | formatter.field("client_token", &self.client_token);
|
2021 + | formatter.field("volume_size", &self.volume_size);
|
2022 + | formatter.field("tags", &self.tags);
|
2023 + | formatter.field("encrypted", &self.encrypted);
|
2024 + | formatter.field("kms_key_arn", &"*** Sensitive Data Redacted ***");
|
2025 + | formatter.field("parent_snapshot_id", &self.parent_snapshot_id);
|
2026 + | formatter.field("description", &self.description);
|
2027 + | formatter.finish()
|
2028 + | }
|
2029 + | }
|
2030 2030 | }
|