1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 2 | #[::pyo3::pyclass]
|
3 - | /// :param volume_size int:
|
4 - | /// :param timeout typing.Optional\[int\]:
|
5 - | /// :param client_token typing.Optional\[str\]:
|
6 - | /// :param tags typing.Optional\[typing.List\[ebs.model.Tag\]\]:
|
7 - | /// :param encrypted typing.Optional\[bool\]:
|
8 - | /// :param kms_key_arn typing.Optional\[str\]:
|
9 - | /// :param parent_snapshot_id typing.Optional\[str\]:
|
10 - | /// :param description typing.Optional\[str\]:
|
3 + | /// :param changed_blocks_count int:
|
4 + | /// :param snapshot_id str:
|
5 + | /// :param checksum_aggregation_method typing.Optional\[ebs.model.ChecksumAggregationMethod\]:
|
6 + | /// :param checksum_algorithm typing.Optional\[ebs.model.ChecksumAlgorithm\]:
|
7 + | /// :param checksum typing.Optional\[str\]:
|
11 8 | /// :rtype None:
|
12 9 | #[allow(missing_docs)] // documentation missing in model
|
13 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::hash::Hash)]
|
14 - | pub struct StartSnapshotInput {
|
15 - | #[pyo3(get, set)]
|
16 - | /// :type typing.Optional\[int\]:
|
17 - | /// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
|
18 - | /// <ul>
|
19 - | /// <li>
|
20 - | /// <p>No blocks are written to the snapshot.</p></li>
|
21 - | /// <li>
|
22 - | /// <p>The snapshot is not completed after writing the last block of data.</p></li>
|
23 - | /// </ul>
|
24 - | /// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
|
25 - | pub timeout: ::std::option::Option<i32>,
|
26 - | #[pyo3(get, set)]
|
27 - | /// :type typing.Optional\[str\]:
|
28 - | /// <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>
|
29 - | /// <p>If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
|
30 - | /// <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>
|
31 - | pub client_token: ::std::option::Option<::std::string::String>,
|
10 + | #[derive(
|
11 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
12 + | )]
|
13 + | pub struct CompleteSnapshotInput {
|
32 14 | #[pyo3(get, set)]
|
33 15 | /// :type int:
|
34 - | /// <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
|
35 - | pub volume_size: i64,
|
36 - | #[pyo3(get, set)]
|
37 - | /// :type typing.Optional\[typing.List\[ebs.model.Tag\]\]:
|
38 - | /// <p>The tags to apply to the snapshot.</p>
|
39 - | pub tags: ::std::option::Option<::std::vec::Vec<crate::model::Tag>>,
|
16 + | /// <p>The number of blocks that were written to the snapshot.</p>
|
17 + | pub changed_blocks_count: i32,
|
40 18 | #[pyo3(get, set)]
|
41 - | /// :type typing.Optional\[bool\]:
|
42 - | /// <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>
|
43 - | /// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
|
44 - | /// <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>
|
45 - | /// <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>
|
46 - | /// <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>
|
47 - | pub encrypted: ::std::option::Option<bool>,
|
19 + | /// :type typing.Optional\[ebs.model.ChecksumAggregationMethod\]:
|
20 + | /// <p>The aggregation method used to generate the checksum. Currently, the only supported aggregation method is <code>LINEAR</code>.</p>
|
21 + | pub checksum_aggregation_method: ::std::option::Option<crate::model::ChecksumAggregationMethod>,
|
48 22 | #[pyo3(get, set)]
|
49 - | /// :type typing.Optional\[str\]:
|
50 - | /// <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>
|
51 - | /// <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>
|
52 - | /// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN.</p>
|
53 - | pub kms_key_arn: ::std::option::Option<::std::string::String>,
|
23 + | /// :type typing.Optional\[ebs.model.ChecksumAlgorithm\]:
|
24 + | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
25 + | pub checksum_algorithm: ::std::option::Option<crate::model::ChecksumAlgorithm>,
|
54 26 | #[pyo3(get, set)]
|
55 - | /// :type typing.Optional\[str\]:
|
56 - | /// <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>
|
57 - | /// <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>
|
58 - | pub parent_snapshot_id: ::std::option::Option<::std::string::String>,
|
27 + | /// :type str:
|
28 + | /// <p>The ID of the snapshot.</p>
|
29 + | pub snapshot_id: ::std::string::String,
|
59 30 | #[pyo3(get, set)]
|
60 31 | /// :type typing.Optional\[str\]:
|
61 - | /// <p>A description for the snapshot.</p>
|
62 - | pub description: ::std::option::Option<::std::string::String>,
|
32 + | /// <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written block.</p>
|
33 + | /// <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>
|
34 + | pub checksum: ::std::option::Option<::std::string::String>,
|
63 35 | }
|
64 - | impl StartSnapshotInput {
|
65 - | /// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
|
66 - | /// <ul>
|
67 - | /// <li>
|
68 - | /// <p>No blocks are written to the snapshot.</p></li>
|
69 - | /// <li>
|
70 - | /// <p>The snapshot is not completed after writing the last block of data.</p></li>
|
71 - | /// </ul>
|
72 - | /// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
|
73 - | pub fn timeout(&self) -> ::std::option::Option<i32> {
|
74 - | self.timeout
|
75 - | }
|
76 - | /// <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>
|
77 - | /// <p>If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
|
78 - | /// <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>
|
79 - | pub fn client_token(&self) -> ::std::option::Option<&str> {
|
80 - | self.client_token.as_deref()
|
81 - | }
|
82 - | /// <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
|
83 - | pub fn volume_size(&self) -> i64 {
|
84 - | self.volume_size
|
85 - | }
|
86 - | /// <p>The tags to apply to the snapshot.</p>
|
87 - | pub fn tags(&self) -> ::std::option::Option<&[crate::model::Tag]> {
|
88 - | self.tags.as_deref()
|
89 - | }
|
90 - | /// <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>
|
91 - | /// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
|
92 - | /// <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>
|
93 - | /// <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>
|
94 - | /// <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>
|
95 - | pub fn encrypted(&self) -> ::std::option::Option<bool> {
|
96 - | self.encrypted
|
36 + | impl CompleteSnapshotInput {
|
37 + | /// <p>The number of blocks that were written to the snapshot.</p>
|
38 + | pub fn changed_blocks_count(&self) -> i32 {
|
39 + | self.changed_blocks_count
|
97 40 | }
|
98 - | /// <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>
|
99 - | /// <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>
|
100 - | /// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN.</p>
|
101 - | pub fn kms_key_arn(&self) -> ::std::option::Option<&str> {
|
102 - | self.kms_key_arn.as_deref()
|
41 + | /// <p>The aggregation method used to generate the checksum. Currently, the only supported aggregation method is <code>LINEAR</code>.</p>
|
42 + | pub fn checksum_aggregation_method(
|
43 + | &self,
|
44 + | ) -> ::std::option::Option<&crate::model::ChecksumAggregationMethod> {
|
45 + | self.checksum_aggregation_method.as_ref()
|
103 46 | }
|
104 - | /// <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>
|
105 - | /// <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>
|
106 - | pub fn parent_snapshot_id(&self) -> ::std::option::Option<&str> {
|
107 - | self.parent_snapshot_id.as_deref()
|
47 + | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
48 + | pub fn checksum_algorithm(&self) -> ::std::option::Option<&crate::model::ChecksumAlgorithm> {
|
49 + | self.checksum_algorithm.as_ref()
|
108 50 | }
|
109 - | /// <p>A description for the snapshot.</p>
|
110 - | pub fn description(&self) -> ::std::option::Option<&str> {
|
111 - | self.description.as_deref()
|
51 + | /// <p>The ID of the snapshot.</p>
|
52 + | pub fn snapshot_id(&self) -> &str {
|
53 + | use std::ops::Deref;
|
54 + | self.snapshot_id.deref()
|
112 55 | }
|
113 - | }
|
114 - | impl ::std::fmt::Debug for StartSnapshotInput {
|
115 - | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
116 - | let mut formatter = f.debug_struct("StartSnapshotInput");
|
117 - | formatter.field("timeout", &self.timeout);
|
118 - | formatter.field("client_token", &self.client_token);
|
119 - | formatter.field("volume_size", &self.volume_size);
|
120 - | formatter.field("tags", &self.tags);
|
121 - | formatter.field("encrypted", &self.encrypted);
|
122 - | formatter.field("kms_key_arn", &"*** Sensitive Data Redacted ***");
|
123 - | formatter.field("parent_snapshot_id", &self.parent_snapshot_id);
|
124 - | formatter.field("description", &self.description);
|
125 - | formatter.finish()
|
56 + | /// <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written block.</p>
|
57 + | /// <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>
|
58 + | pub fn checksum(&self) -> ::std::option::Option<&str> {
|
59 + | self.checksum.as_deref()
|
126 60 | }
|
127 61 | }
|
128 62 | #[allow(clippy::new_without_default)]
|
129 63 | #[allow(clippy::too_many_arguments)]
|
130 64 | #[::pyo3::pymethods]
|
131 - | impl StartSnapshotInput {
|
65 + | impl CompleteSnapshotInput {
|
132 66 | #[new]
|
133 67 | pub fn new(
|
134 - | volume_size: i64,
|
135 - | timeout: ::std::option::Option<i32>,
|
136 - | client_token: ::std::option::Option<::std::string::String>,
|
137 - | tags: ::std::option::Option<::std::vec::Vec<crate::model::Tag>>,
|
138 - | encrypted: ::std::option::Option<bool>,
|
139 - | kms_key_arn: ::std::option::Option<::std::string::String>,
|
140 - | parent_snapshot_id: ::std::option::Option<::std::string::String>,
|
141 - | description: ::std::option::Option<::std::string::String>,
|
68 + | changed_blocks_count: i32,
|
69 + | snapshot_id: ::std::string::String,
|
70 + | checksum_aggregation_method: ::std::option::Option<crate::model::ChecksumAggregationMethod>,
|
71 + | checksum_algorithm: ::std::option::Option<crate::model::ChecksumAlgorithm>,
|
72 + | checksum: ::std::option::Option<::std::string::String>,
|
142 73 | ) -> Self {
|
143 74 | Self {
|
144 - | volume_size,
|
145 - | timeout,
|
146 - | client_token,
|
147 - | tags,
|
148 - | encrypted,
|
149 - | kms_key_arn,
|
150 - | parent_snapshot_id,
|
151 - | description,
|
75 + | changed_blocks_count,
|
76 + | snapshot_id,
|
77 + | checksum_aggregation_method,
|
78 + | checksum_algorithm,
|
79 + | checksum,
|
152 80 | }
|
153 81 | }
|
154 82 | fn __repr__(&self) -> String {
|
155 83 | format!("{self:?}")
|
156 84 | }
|
157 85 | fn __str__(&self) -> String {
|
158 86 | format!("{self:?}")
|
159 87 | }
|
160 88 | }
|
161 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<StartSnapshotInput> {
|
89 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<CompleteSnapshotInput> {
|
162 90 | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
163 - | ob.extract::<StartSnapshotInput>().map(Box::new)
|
91 + | ob.extract::<CompleteSnapshotInput>().map(Box::new)
|
164 92 | }
|
165 93 | }
|
166 94 |
|
167 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<StartSnapshotInput> {
|
95 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<CompleteSnapshotInput> {
|
168 96 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
169 97 | (*self).into_py(py)
|
170 98 | }
|
171 99 | }
|
172 - | impl crate::constrained::Constrained for crate::input::StartSnapshotInput {
|
173 - | type Unconstrained = crate::input::start_snapshot_input_internal::Builder;
|
100 + | impl crate::constrained::Constrained for crate::input::CompleteSnapshotInput {
|
101 + | type Unconstrained = crate::input::complete_snapshot_input_internal::Builder;
|
174 102 | }
|
175 - | impl StartSnapshotInput {
|
176 - | /// Creates a new builder-style object to manufacture [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
177 - | pub fn builder() -> crate::input::start_snapshot_input::Builder {
|
178 - | crate::input::start_snapshot_input::Builder::default()
|
103 + | impl CompleteSnapshotInput {
|
104 + | /// Creates a new builder-style object to manufacture [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
105 + | pub fn builder() -> crate::input::complete_snapshot_input::Builder {
|
106 + | crate::input::complete_snapshot_input::Builder::default()
|
179 107 | }
|
180 108 | }
|
181 109 |
|
182 110 | #[::pyo3::pyclass]
|
183 111 | /// :param snapshot_id str:
|
112 + | /// :param block_token str:
|
184 113 | /// :param block_index int:
|
185 - | /// :param checksum str:
|
186 - | /// :param block_data ebs.types.ByteStream:
|
187 - | /// :param data_length int:
|
188 - | /// :param checksum_algorithm ebs.model.ChecksumAlgorithm:
|
189 - | /// :param progress typing.Optional\[int\]:
|
190 114 | /// :rtype None:
|
191 115 | #[allow(missing_docs)] // documentation missing in model
|
192 - | #[derive(::std::clone::Clone)]
|
193 - | pub struct PutSnapshotBlockInput {
|
116 + | #[derive(
|
117 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
118 + | )]
|
119 + | pub struct GetSnapshotBlockInput {
|
194 120 | #[pyo3(get, set)]
|
195 121 | /// :type str:
|
196 - | /// <p>The ID of the snapshot.</p>
|
122 + | /// <p>The ID of the snapshot containing the block from which to get data.</p>
|
197 123 | pub snapshot_id: ::std::string::String,
|
198 124 | #[pyo3(get, set)]
|
199 - | /// :type int:
|
200 - | /// <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>
|
201 - | pub block_index: i32,
|
202 - | #[pyo3(get, set)]
|
203 125 | /// :type str:
|
204 - | /// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
|
205 - | pub checksum: ::std::string::String,
|
206 - | #[pyo3(get, set)]
|
207 - | /// :type typing.Optional\[int\]:
|
208 - | /// <p>The progress of the write process, as a percentage.</p>
|
209 - | pub progress: ::std::option::Option<i32>,
|
210 - | #[pyo3(get, set)]
|
211 - | /// :type ebs.types.ByteStream:
|
212 - | /// <p>The data to write to the block.</p>
|
213 - | /// <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>
|
214 - | pub block_data: ::aws_smithy_http_server_python::types::ByteStream,
|
126 + | /// <p>The block token of the block from which to get data.</p>
|
127 + | /// <p>Obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
128 + | pub block_token: ::std::string::String,
|
215 129 | #[pyo3(get, set)]
|
216 130 | /// :type int:
|
217 - | /// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code>.</p>
|
218 - | /// <p>Valid values: <code>524288</code></p>
|
219 - | pub data_length: i32,
|
220 - | #[pyo3(get, set)]
|
221 - | /// :type ebs.model.ChecksumAlgorithm:
|
222 - | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
223 - | pub checksum_algorithm: crate::model::ChecksumAlgorithm,
|
131 + | /// <p>The block index of the block from which to get data.</p>
|
132 + | /// <p>Obtain the <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
133 + | pub block_index: i32,
|
224 134 | }
|
225 - | impl PutSnapshotBlockInput {
|
226 - | /// <p>The ID of the snapshot.</p>
|
135 + | impl GetSnapshotBlockInput {
|
136 + | /// <p>The ID of the snapshot containing the block from which to get data.</p>
|
227 137 | pub fn snapshot_id(&self) -> &str {
|
228 138 | use std::ops::Deref;
|
229 139 | self.snapshot_id.deref()
|
230 140 | }
|
231 - | /// <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>
|
232 - | pub fn block_index(&self) -> i32 {
|
233 - | self.block_index
|
234 - | }
|
235 - | /// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
|
236 - | pub fn checksum(&self) -> &str {
|
141 + | /// <p>The block token of the block from which to get data.</p>
|
142 + | /// <p>Obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
143 + | pub fn block_token(&self) -> &str {
|
237 144 | use std::ops::Deref;
|
238 - | self.checksum.deref()
|
239 - | }
|
240 - | /// <p>The progress of the write process, as a percentage.</p>
|
241 - | pub fn progress(&self) -> ::std::option::Option<i32> {
|
242 - | self.progress
|
243 - | }
|
244 - | /// <p>The data to write to the block.</p>
|
245 - | /// <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>
|
246 - | pub fn block_data(&self) -> &::aws_smithy_http_server_python::types::ByteStream {
|
247 - | &self.block_data
|
248 - | }
|
249 - | /// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code>.</p>
|
250 - | /// <p>Valid values: <code>524288</code></p>
|
251 - | pub fn data_length(&self) -> i32 {
|
252 - | self.data_length
|
253 - | }
|
254 - | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
255 - | pub fn checksum_algorithm(&self) -> &crate::model::ChecksumAlgorithm {
|
256 - | &self.checksum_algorithm
|
145 + | self.block_token.deref()
|
257 146 | }
|
258 - | }
|
259 - | impl ::std::fmt::Debug for PutSnapshotBlockInput {
|
260 - | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
261 - | let mut formatter = f.debug_struct("PutSnapshotBlockInput");
|
262 - | formatter.field("snapshot_id", &self.snapshot_id);
|
263 - | formatter.field("block_index", &self.block_index);
|
264 - | formatter.field("checksum", &self.checksum);
|
265 - | formatter.field("progress", &self.progress);
|
266 - | formatter.field("block_data", &"*** Sensitive Data Redacted ***");
|
267 - | formatter.field("data_length", &self.data_length);
|
268 - | formatter.field("checksum_algorithm", &self.checksum_algorithm);
|
269 - | formatter.finish()
|
147 + | /// <p>The block index of the block from which to get data.</p>
|
148 + | /// <p>Obtain the <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
149 + | pub fn block_index(&self) -> i32 {
|
150 + | self.block_index
|
270 151 | }
|
271 152 | }
|
272 153 | #[allow(clippy::new_without_default)]
|
273 154 | #[allow(clippy::too_many_arguments)]
|
274 155 | #[::pyo3::pymethods]
|
275 - | impl PutSnapshotBlockInput {
|
156 + | impl GetSnapshotBlockInput {
|
276 157 | #[new]
|
277 158 | pub fn new(
|
278 159 | snapshot_id: ::std::string::String,
|
160 + | block_token: ::std::string::String,
|
279 161 | block_index: i32,
|
280 - | checksum: ::std::string::String,
|
281 - | block_data: ::aws_smithy_http_server_python::types::ByteStream,
|
282 - | data_length: i32,
|
283 - | checksum_algorithm: crate::model::ChecksumAlgorithm,
|
284 - | progress: ::std::option::Option<i32>,
|
285 162 | ) -> Self {
|
286 163 | Self {
|
287 164 | snapshot_id,
|
165 + | block_token,
|
288 166 | block_index,
|
289 - | checksum,
|
290 - | block_data,
|
291 - | data_length,
|
292 - | checksum_algorithm,
|
293 - | progress,
|
294 167 | }
|
295 168 | }
|
296 169 | fn __repr__(&self) -> String {
|
297 170 | format!("{self:?}")
|
298 171 | }
|
299 172 | fn __str__(&self) -> String {
|
300 173 | format!("{self:?}")
|
301 174 | }
|
302 175 | }
|
303 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<PutSnapshotBlockInput> {
|
176 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<GetSnapshotBlockInput> {
|
304 177 | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
305 - | ob.extract::<PutSnapshotBlockInput>().map(Box::new)
|
178 + | ob.extract::<GetSnapshotBlockInput>().map(Box::new)
|
306 179 | }
|
307 180 | }
|
308 181 |
|
309 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<PutSnapshotBlockInput> {
|
182 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<GetSnapshotBlockInput> {
|
310 183 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
311 184 | (*self).into_py(py)
|
312 185 | }
|
313 186 | }
|
314 - | impl crate::constrained::Constrained for crate::input::PutSnapshotBlockInput {
|
315 - | type Unconstrained = crate::input::put_snapshot_block_input_internal::Builder;
|
187 + | impl crate::constrained::Constrained for crate::input::GetSnapshotBlockInput {
|
188 + | type Unconstrained = crate::input::get_snapshot_block_input_internal::Builder;
|
316 189 | }
|
317 - | impl PutSnapshotBlockInput {
|
318 - | /// Creates a new builder-style object to manufacture [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
319 - | pub fn builder() -> crate::input::put_snapshot_block_input::Builder {
|
320 - | crate::input::put_snapshot_block_input::Builder::default()
|
190 + | impl GetSnapshotBlockInput {
|
191 + | /// Creates a new builder-style object to manufacture [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
192 + | pub fn builder() -> crate::input::get_snapshot_block_input::Builder {
|
193 + | crate::input::get_snapshot_block_input::Builder::default()
|
321 194 | }
|
322 195 | }
|
323 196 |
|
324 197 | #[::pyo3::pyclass]
|
325 - | /// :param snapshot_id str:
|
198 + | /// :param second_snapshot_id str:
|
199 + | /// :param first_snapshot_id typing.Optional\[str\]:
|
200 + | /// :param next_token typing.Optional\[str\]:
|
326 201 | /// :param max_results typing.Optional\[int\]:
|
327 202 | /// :param starting_block_index typing.Optional\[int\]:
|
328 - | /// :param next_token typing.Optional\[str\]:
|
329 203 | /// :rtype None:
|
330 204 | #[allow(missing_docs)] // documentation missing in model
|
331 205 | #[derive(
|
332 206 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
333 207 | )]
|
334 - | pub struct ListSnapshotBlocksInput {
|
208 + | pub struct ListChangedBlocksInput {
|
335 209 | #[pyo3(get, set)]
|
336 - | /// :type typing.Optional\[int\]:
|
337 - | /// <p>The number of results to return.</p>
|
338 - | pub max_results: ::std::option::Option<i32>,
|
210 + | /// :type str:
|
211 + | /// <p>The ID of the second snapshot to use for the comparison.</p><important>
|
212 + | /// <p>The <code>SecondSnapshotId</code> parameter must be specified with a <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
|
213 + | /// </important>
|
214 + | pub second_snapshot_id: ::std::string::String,
|
339 215 | #[pyo3(get, set)]
|
340 - | /// :type typing.Optional\[int\]:
|
341 - | /// <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>
|
342 - | pub starting_block_index: ::std::option::Option<i32>,
|
216 + | /// :type typing.Optional\[str\]:
|
217 + | /// <p>The ID of the first snapshot to use for the comparison.</p><important>
|
218 + | /// <p>The <code>FirstSnapshotID</code> parameter must be specified with a <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
|
219 + | /// </important>
|
220 + | pub first_snapshot_id: ::std::option::Option<::std::string::String>,
|
343 221 | #[pyo3(get, set)]
|
344 222 | /// :type typing.Optional\[str\]:
|
345 223 | /// <p>The token to request the next page of results.</p>
|
346 224 | pub next_token: ::std::option::Option<::std::string::String>,
|
347 225 | #[pyo3(get, set)]
|
348 - | /// :type str:
|
349 - | /// <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
|
350 - | pub snapshot_id: ::std::string::String,
|
351 - | }
|
352 - | impl ListSnapshotBlocksInput {
|
226 + | /// :type typing.Optional\[int\]:
|
353 227 | /// <p>The number of results to return.</p>
|
354 - | pub fn max_results(&self) -> ::std::option::Option<i32> {
|
355 - | self.max_results
|
228 + | pub max_results: ::std::option::Option<i32>,
|
229 + | #[pyo3(get, set)]
|
230 + | /// :type typing.Optional\[int\]:
|
231 + | /// <p>The block index from which the comparison should start.</p>
|
232 + | /// <p>The list in the response will start from this block index or the next valid block index in the snapshots.</p>
|
233 + | pub starting_block_index: ::std::option::Option<i32>,
|
234 + | }
|
235 + | impl ListChangedBlocksInput {
|
236 + | /// <p>The ID of the second snapshot to use for the comparison.</p><important>
|
237 + | /// <p>The <code>SecondSnapshotId</code> parameter must be specified with a <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
|
238 + | /// </important>
|
239 + | pub fn second_snapshot_id(&self) -> &str {
|
240 + | use std::ops::Deref;
|
241 + | self.second_snapshot_id.deref()
|
356 242 | }
|
357 - | /// <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>
|
358 - | pub fn starting_block_index(&self) -> ::std::option::Option<i32> {
|
359 - | self.starting_block_index
|
243 + | /// <p>The ID of the first snapshot to use for the comparison.</p><important>
|
244 + | /// <p>The <code>FirstSnapshotID</code> parameter must be specified with a <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
|
245 + | /// </important>
|
246 + | pub fn first_snapshot_id(&self) -> ::std::option::Option<&str> {
|
247 + | self.first_snapshot_id.as_deref()
|
360 248 | }
|
361 249 | /// <p>The token to request the next page of results.</p>
|
362 250 | pub fn next_token(&self) -> ::std::option::Option<&str> {
|
363 251 | self.next_token.as_deref()
|
364 252 | }
|
365 - | /// <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
|
366 - | pub fn snapshot_id(&self) -> &str {
|
367 - | use std::ops::Deref;
|
368 - | self.snapshot_id.deref()
|
253 + | /// <p>The number of results to return.</p>
|
254 + | pub fn max_results(&self) -> ::std::option::Option<i32> {
|
255 + | self.max_results
|
256 + | }
|
257 + | /// <p>The block index from which the comparison should start.</p>
|
258 + | /// <p>The list in the response will start from this block index or the next valid block index in the snapshots.</p>
|
259 + | pub fn starting_block_index(&self) -> ::std::option::Option<i32> {
|
260 + | self.starting_block_index
|
369 261 | }
|
370 262 | }
|
371 263 | #[allow(clippy::new_without_default)]
|
372 264 | #[allow(clippy::too_many_arguments)]
|
373 265 | #[::pyo3::pymethods]
|
374 - | impl ListSnapshotBlocksInput {
|
266 + | impl ListChangedBlocksInput {
|
375 267 | #[new]
|
376 268 | pub fn new(
|
377 - | snapshot_id: ::std::string::String,
|
269 + | second_snapshot_id: ::std::string::String,
|
270 + | first_snapshot_id: ::std::option::Option<::std::string::String>,
|
271 + | next_token: ::std::option::Option<::std::string::String>,
|
378 272 | max_results: ::std::option::Option<i32>,
|
379 273 | starting_block_index: ::std::option::Option<i32>,
|
380 - | next_token: ::std::option::Option<::std::string::String>,
|
381 274 | ) -> Self {
|
382 275 | Self {
|
383 - | snapshot_id,
|
276 + | second_snapshot_id,
|
277 + | first_snapshot_id,
|
278 + | next_token,
|
384 279 | max_results,
|
385 280 | starting_block_index,
|
386 - | next_token,
|
387 281 | }
|
388 282 | }
|
389 283 | fn __repr__(&self) -> String {
|
390 284 | format!("{self:?}")
|
391 285 | }
|
392 286 | fn __str__(&self) -> String {
|
393 287 | format!("{self:?}")
|
394 288 | }
|
395 289 | }
|
396 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ListSnapshotBlocksInput> {
|
290 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ListChangedBlocksInput> {
|
397 291 | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
398 - | ob.extract::<ListSnapshotBlocksInput>().map(Box::new)
|
292 + | ob.extract::<ListChangedBlocksInput>().map(Box::new)
|
399 293 | }
|
400 294 | }
|
401 295 |
|
402 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ListSnapshotBlocksInput> {
|
296 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ListChangedBlocksInput> {
|
403 297 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
404 298 | (*self).into_py(py)
|
405 299 | }
|
406 300 | }
|
407 - | impl crate::constrained::Constrained for crate::input::ListSnapshotBlocksInput {
|
408 - | type Unconstrained = crate::input::list_snapshot_blocks_input_internal::Builder;
|
301 + | impl crate::constrained::Constrained for crate::input::ListChangedBlocksInput {
|
302 + | type Unconstrained = crate::input::list_changed_blocks_input_internal::Builder;
|
409 303 | }
|
410 - | impl ListSnapshotBlocksInput {
|
411 - | /// Creates a new builder-style object to manufacture [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
412 - | pub fn builder() -> crate::input::list_snapshot_blocks_input::Builder {
|
413 - | crate::input::list_snapshot_blocks_input::Builder::default()
|
304 + | impl ListChangedBlocksInput {
|
305 + | /// Creates a new builder-style object to manufacture [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
306 + | pub fn builder() -> crate::input::list_changed_blocks_input::Builder {
|
307 + | crate::input::list_changed_blocks_input::Builder::default()
|
414 308 | }
|
415 309 | }
|
416 310 |
|
417 311 | #[::pyo3::pyclass]
|
418 - | /// :param second_snapshot_id str:
|
419 - | /// :param first_snapshot_id typing.Optional\[str\]:
|
420 - | /// :param next_token typing.Optional\[str\]:
|
312 + | /// :param snapshot_id str:
|
421 313 | /// :param max_results typing.Optional\[int\]:
|
422 314 | /// :param starting_block_index typing.Optional\[int\]:
|
315 + | /// :param next_token typing.Optional\[str\]:
|
423 316 | /// :rtype None:
|
424 317 | #[allow(missing_docs)] // documentation missing in model
|
425 318 | #[derive(
|
426 319 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
427 320 | )]
|
428 - | pub struct ListChangedBlocksInput {
|
429 - | #[pyo3(get, set)]
|
430 - | /// :type str:
|
431 - | /// <p>The ID of the second snapshot to use for the comparison.</p><important>
|
432 - | /// <p>The <code>SecondSnapshotId</code> parameter must be specified with a <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
|
433 - | /// </important>
|
434 - | pub second_snapshot_id: ::std::string::String,
|
435 - | #[pyo3(get, set)]
|
436 - | /// :type typing.Optional\[str\]:
|
437 - | /// <p>The ID of the first snapshot to use for the comparison.</p><important>
|
438 - | /// <p>The <code>FirstSnapshotID</code> parameter must be specified with a <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
|
439 - | /// </important>
|
440 - | pub first_snapshot_id: ::std::option::Option<::std::string::String>,
|
441 - | #[pyo3(get, set)]
|
442 - | /// :type typing.Optional\[str\]:
|
443 - | /// <p>The token to request the next page of results.</p>
|
444 - | pub next_token: ::std::option::Option<::std::string::String>,
|
321 + | pub struct ListSnapshotBlocksInput {
|
445 322 | #[pyo3(get, set)]
|
446 323 | /// :type typing.Optional\[int\]:
|
447 324 | /// <p>The number of results to return.</p>
|
448 325 | pub max_results: ::std::option::Option<i32>,
|
449 326 | #[pyo3(get, set)]
|
450 327 | /// :type typing.Optional\[int\]:
|
451 - | /// <p>The block index from which the comparison should start.</p>
|
452 - | /// <p>The list in the response will start from this block index or the next valid block index in the snapshots.</p>
|
328 + | /// <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>
|
453 329 | pub starting_block_index: ::std::option::Option<i32>,
|
454 - | }
|
455 - | impl ListChangedBlocksInput {
|
456 - | /// <p>The ID of the second snapshot to use for the comparison.</p><important>
|
457 - | /// <p>The <code>SecondSnapshotId</code> parameter must be specified with a <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
|
458 - | /// </important>
|
459 - | pub fn second_snapshot_id(&self) -> &str {
|
460 - | use std::ops::Deref;
|
461 - | self.second_snapshot_id.deref()
|
462 - | }
|
463 - | /// <p>The ID of the first snapshot to use for the comparison.</p><important>
|
464 - | /// <p>The <code>FirstSnapshotID</code> parameter must be specified with a <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
|
465 - | /// </important>
|
466 - | pub fn first_snapshot_id(&self) -> ::std::option::Option<&str> {
|
467 - | self.first_snapshot_id.as_deref()
|
468 - | }
|
330 + | #[pyo3(get, set)]
|
331 + | /// :type typing.Optional\[str\]:
|
469 332 | /// <p>The token to request the next page of results.</p>
|
470 - | pub fn next_token(&self) -> ::std::option::Option<&str> {
|
471 - | self.next_token.as_deref()
|
472 - | }
|
333 + | pub next_token: ::std::option::Option<::std::string::String>,
|
334 + | #[pyo3(get, set)]
|
335 + | /// :type str:
|
336 + | /// <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
|
337 + | pub snapshot_id: ::std::string::String,
|
338 + | }
|
339 + | impl ListSnapshotBlocksInput {
|
473 340 | /// <p>The number of results to return.</p>
|
474 341 | pub fn max_results(&self) -> ::std::option::Option<i32> {
|
475 342 | self.max_results
|
476 343 | }
|
477 - | /// <p>The block index from which the comparison should start.</p>
|
478 - | /// <p>The list in the response will start from this block index or the next valid block index in the snapshots.</p>
|
344 + | /// <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>
|
479 345 | pub fn starting_block_index(&self) -> ::std::option::Option<i32> {
|
480 346 | self.starting_block_index
|
481 347 | }
|
348 + | /// <p>The token to request the next page of results.</p>
|
349 + | pub fn next_token(&self) -> ::std::option::Option<&str> {
|
350 + | self.next_token.as_deref()
|
351 + | }
|
352 + | /// <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
|
353 + | pub fn snapshot_id(&self) -> &str {
|
354 + | use std::ops::Deref;
|
355 + | self.snapshot_id.deref()
|
356 + | }
|
482 357 | }
|
483 358 | #[allow(clippy::new_without_default)]
|
484 359 | #[allow(clippy::too_many_arguments)]
|
485 360 | #[::pyo3::pymethods]
|
486 - | impl ListChangedBlocksInput {
|
361 + | impl ListSnapshotBlocksInput {
|
487 362 | #[new]
|
488 363 | pub fn new(
|
489 - | second_snapshot_id: ::std::string::String,
|
490 - | first_snapshot_id: ::std::option::Option<::std::string::String>,
|
491 - | next_token: ::std::option::Option<::std::string::String>,
|
364 + | snapshot_id: ::std::string::String,
|
492 365 | max_results: ::std::option::Option<i32>,
|
493 366 | starting_block_index: ::std::option::Option<i32>,
|
367 + | next_token: ::std::option::Option<::std::string::String>,
|
494 368 | ) -> Self {
|
495 369 | Self {
|
496 - | second_snapshot_id,
|
497 - | first_snapshot_id,
|
498 - | next_token,
|
370 + | snapshot_id,
|
499 371 | max_results,
|
500 372 | starting_block_index,
|
373 + | next_token,
|
501 374 | }
|
502 375 | }
|
503 376 | fn __repr__(&self) -> String {
|
504 377 | format!("{self:?}")
|
505 378 | }
|
506 379 | fn __str__(&self) -> String {
|
507 380 | format!("{self:?}")
|
508 381 | }
|
509 382 | }
|
510 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ListChangedBlocksInput> {
|
383 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ListSnapshotBlocksInput> {
|
511 384 | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
512 - | ob.extract::<ListChangedBlocksInput>().map(Box::new)
|
385 + | ob.extract::<ListSnapshotBlocksInput>().map(Box::new)
|
513 386 | }
|
514 387 | }
|
515 388 |
|
516 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ListChangedBlocksInput> {
|
389 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ListSnapshotBlocksInput> {
|
517 390 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
518 391 | (*self).into_py(py)
|
519 392 | }
|
520 393 | }
|
521 - | impl crate::constrained::Constrained for crate::input::ListChangedBlocksInput {
|
522 - | type Unconstrained = crate::input::list_changed_blocks_input_internal::Builder;
|
394 + | impl crate::constrained::Constrained for crate::input::ListSnapshotBlocksInput {
|
395 + | type Unconstrained = crate::input::list_snapshot_blocks_input_internal::Builder;
|
523 396 | }
|
524 - | impl ListChangedBlocksInput {
|
525 - | /// Creates a new builder-style object to manufacture [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
526 - | pub fn builder() -> crate::input::list_changed_blocks_input::Builder {
|
527 - | crate::input::list_changed_blocks_input::Builder::default()
|
397 + | impl ListSnapshotBlocksInput {
|
398 + | /// Creates a new builder-style object to manufacture [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
399 + | pub fn builder() -> crate::input::list_snapshot_blocks_input::Builder {
|
400 + | crate::input::list_snapshot_blocks_input::Builder::default()
|
528 401 | }
|
529 402 | }
|
530 403 |
|
531 404 | #[::pyo3::pyclass]
|
532 405 | /// :param snapshot_id str:
|
533 - | /// :param block_token str:
|
534 406 | /// :param block_index int:
|
407 + | /// :param checksum str:
|
408 + | /// :param block_data ebs.types.ByteStream:
|
409 + | /// :param data_length int:
|
410 + | /// :param checksum_algorithm ebs.model.ChecksumAlgorithm:
|
411 + | /// :param progress typing.Optional\[int\]:
|
535 412 | /// :rtype None:
|
536 413 | #[allow(missing_docs)] // documentation missing in model
|
537 - | #[derive(
|
538 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
539 - | )]
|
540 - | pub struct GetSnapshotBlockInput {
|
414 + | #[derive(::std::clone::Clone)]
|
415 + | pub struct PutSnapshotBlockInput {
|
541 416 | #[pyo3(get, set)]
|
542 417 | /// :type str:
|
543 - | /// <p>The ID of the snapshot containing the block from which to get data.</p>
|
418 + | /// <p>The ID of the snapshot.</p>
|
544 419 | pub snapshot_id: ::std::string::String,
|
545 420 | #[pyo3(get, set)]
|
421 + | /// :type int:
|
422 + | /// <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>
|
423 + | pub block_index: i32,
|
424 + | #[pyo3(get, set)]
|
546 425 | /// :type str:
|
547 - | /// <p>The block token of the block from which to get data.</p>
|
548 - | /// <p>Obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
549 - | pub block_token: ::std::string::String,
|
426 + | /// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
|
427 + | pub checksum: ::std::string::String,
|
428 + | #[pyo3(get, set)]
|
429 + | /// :type typing.Optional\[int\]:
|
430 + | /// <p>The progress of the write process, as a percentage.</p>
|
431 + | pub progress: ::std::option::Option<i32>,
|
432 + | #[pyo3(get, set)]
|
433 + | /// :type ebs.types.ByteStream:
|
434 + | /// <p>The data to write to the block.</p>
|
435 + | /// <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>
|
436 + | pub block_data: ::aws_smithy_http_server_python::types::ByteStream,
|
550 437 | #[pyo3(get, set)]
|
551 438 | /// :type int:
|
552 - | /// <p>The block index of the block from which to get data.</p>
|
553 - | /// <p>Obtain the <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
554 - | pub block_index: i32,
|
439 + | /// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code>.</p>
|
440 + | /// <p>Valid values: <code>524288</code></p>
|
441 + | pub data_length: i32,
|
442 + | #[pyo3(get, set)]
|
443 + | /// :type ebs.model.ChecksumAlgorithm:
|
444 + | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
445 + | pub checksum_algorithm: crate::model::ChecksumAlgorithm,
|
555 446 | }
|
556 - | impl GetSnapshotBlockInput {
|
557 - | /// <p>The ID of the snapshot containing the block from which to get data.</p>
|
447 + | impl PutSnapshotBlockInput {
|
448 + | /// <p>The ID of the snapshot.</p>
|
558 449 | pub fn snapshot_id(&self) -> &str {
|
559 450 | use std::ops::Deref;
|
560 451 | self.snapshot_id.deref()
|
561 452 | }
|
562 - | /// <p>The block token of the block from which to get data.</p>
|
563 - | /// <p>Obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
564 - | pub fn block_token(&self) -> &str {
|
565 - | use std::ops::Deref;
|
566 - | self.block_token.deref()
|
567 - | }
|
568 - | /// <p>The block index of the block from which to get data.</p>
|
569 - | /// <p>Obtain the <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
453 + | /// <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>
|
570 454 | pub fn block_index(&self) -> i32 {
|
571 455 | self.block_index
|
572 456 | }
|
457 + | /// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
|
458 + | pub fn checksum(&self) -> &str {
|
459 + | use std::ops::Deref;
|
460 + | self.checksum.deref()
|
461 + | }
|
462 + | /// <p>The progress of the write process, as a percentage.</p>
|
463 + | pub fn progress(&self) -> ::std::option::Option<i32> {
|
464 + | self.progress
|
465 + | }
|
466 + | /// <p>The data to write to the block.</p>
|
467 + | /// <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>
|
468 + | pub fn block_data(&self) -> &::aws_smithy_http_server_python::types::ByteStream {
|
469 + | &self.block_data
|
470 + | }
|
471 + | /// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code>.</p>
|
472 + | /// <p>Valid values: <code>524288</code></p>
|
473 + | pub fn data_length(&self) -> i32 {
|
474 + | self.data_length
|
475 + | }
|
476 + | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
477 + | pub fn checksum_algorithm(&self) -> &crate::model::ChecksumAlgorithm {
|
478 + | &self.checksum_algorithm
|
479 + | }
|
480 + | }
|
481 + | impl ::std::fmt::Debug for PutSnapshotBlockInput {
|
482 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
483 + | let mut formatter = f.debug_struct("PutSnapshotBlockInput");
|
484 + | formatter.field("snapshot_id", &self.snapshot_id);
|
485 + | formatter.field("block_index", &self.block_index);
|
486 + | formatter.field("checksum", &self.checksum);
|
487 + | formatter.field("progress", &self.progress);
|
488 + | formatter.field("block_data", &"*** Sensitive Data Redacted ***");
|
489 + | formatter.field("data_length", &self.data_length);
|
490 + | formatter.field("checksum_algorithm", &self.checksum_algorithm);
|
491 + | formatter.finish()
|
492 + | }
|
573 493 | }
|
574 494 | #[allow(clippy::new_without_default)]
|
575 495 | #[allow(clippy::too_many_arguments)]
|
576 496 | #[::pyo3::pymethods]
|
577 - | impl GetSnapshotBlockInput {
|
497 + | impl PutSnapshotBlockInput {
|
578 498 | #[new]
|
579 499 | pub fn new(
|
580 500 | snapshot_id: ::std::string::String,
|
581 - | block_token: ::std::string::String,
|
582 501 | block_index: i32,
|
502 + | checksum: ::std::string::String,
|
503 + | block_data: ::aws_smithy_http_server_python::types::ByteStream,
|
504 + | data_length: i32,
|
505 + | checksum_algorithm: crate::model::ChecksumAlgorithm,
|
506 + | progress: ::std::option::Option<i32>,
|
583 507 | ) -> Self {
|
584 508 | Self {
|
585 509 | snapshot_id,
|
586 - | block_token,
|
587 510 | block_index,
|
511 + | checksum,
|
512 + | block_data,
|
513 + | data_length,
|
514 + | checksum_algorithm,
|
515 + | progress,
|
588 516 | }
|
589 517 | }
|
590 518 | fn __repr__(&self) -> String {
|
591 519 | format!("{self:?}")
|
592 520 | }
|
593 521 | fn __str__(&self) -> String {
|
594 522 | format!("{self:?}")
|
595 523 | }
|
596 524 | }
|
597 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<GetSnapshotBlockInput> {
|
525 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<PutSnapshotBlockInput> {
|
598 526 | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
599 - | ob.extract::<GetSnapshotBlockInput>().map(Box::new)
|
527 + | ob.extract::<PutSnapshotBlockInput>().map(Box::new)
|
600 528 | }
|
601 529 | }
|
602 530 |
|
603 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<GetSnapshotBlockInput> {
|
531 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<PutSnapshotBlockInput> {
|
604 532 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
605 533 | (*self).into_py(py)
|
606 534 | }
|
607 535 | }
|
608 - | impl crate::constrained::Constrained for crate::input::GetSnapshotBlockInput {
|
609 - | type Unconstrained = crate::input::get_snapshot_block_input_internal::Builder;
|
536 + | impl crate::constrained::Constrained for crate::input::PutSnapshotBlockInput {
|
537 + | type Unconstrained = crate::input::put_snapshot_block_input_internal::Builder;
|
610 538 | }
|
611 - | impl GetSnapshotBlockInput {
|
612 - | /// Creates a new builder-style object to manufacture [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
613 - | pub fn builder() -> crate::input::get_snapshot_block_input::Builder {
|
614 - | crate::input::get_snapshot_block_input::Builder::default()
|
539 + | impl PutSnapshotBlockInput {
|
540 + | /// Creates a new builder-style object to manufacture [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
541 + | pub fn builder() -> crate::input::put_snapshot_block_input::Builder {
|
542 + | crate::input::put_snapshot_block_input::Builder::default()
|
615 543 | }
|
616 544 | }
|
617 545 |
|
618 546 | #[::pyo3::pyclass]
|
619 - | /// :param changed_blocks_count int:
|
620 - | /// :param snapshot_id str:
|
621 - | /// :param checksum_aggregation_method typing.Optional\[ebs.model.ChecksumAggregationMethod\]:
|
622 - | /// :param checksum_algorithm typing.Optional\[ebs.model.ChecksumAlgorithm\]:
|
623 - | /// :param checksum typing.Optional\[str\]:
|
547 + | /// :param volume_size int:
|
548 + | /// :param timeout typing.Optional\[int\]:
|
549 + | /// :param client_token typing.Optional\[str\]:
|
550 + | /// :param tags typing.Optional\[typing.List\[ebs.model.Tag\]\]:
|
551 + | /// :param encrypted typing.Optional\[bool\]:
|
552 + | /// :param kms_key_arn typing.Optional\[str\]:
|
553 + | /// :param parent_snapshot_id typing.Optional\[str\]:
|
554 + | /// :param description typing.Optional\[str\]:
|
624 555 | /// :rtype None:
|
625 556 | #[allow(missing_docs)] // documentation missing in model
|
626 - | #[derive(
|
627 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
628 - | )]
|
629 - | pub struct CompleteSnapshotInput {
|
557 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::hash::Hash)]
|
558 + | pub struct StartSnapshotInput {
|
559 + | #[pyo3(get, set)]
|
560 + | /// :type typing.Optional\[int\]:
|
561 + | /// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
|
562 + | /// <ul>
|
563 + | /// <li>
|
564 + | /// <p>No blocks are written to the snapshot.</p></li>
|
565 + | /// <li>
|
566 + | /// <p>The snapshot is not completed after writing the last block of data.</p></li>
|
567 + | /// </ul>
|
568 + | /// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
|
569 + | pub timeout: ::std::option::Option<i32>,
|
570 + | #[pyo3(get, set)]
|
571 + | /// :type typing.Optional\[str\]:
|
572 + | /// <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>
|
573 + | /// <p>If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
|
574 + | /// <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>
|
575 + | pub client_token: ::std::option::Option<::std::string::String>,
|
630 576 | #[pyo3(get, set)]
|
631 577 | /// :type int:
|
632 - | /// <p>The number of blocks that were written to the snapshot.</p>
|
633 - | pub changed_blocks_count: i32,
|
578 + | /// <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
|
579 + | pub volume_size: i64,
|
634 580 | #[pyo3(get, set)]
|
635 - | /// :type typing.Optional\[ebs.model.ChecksumAggregationMethod\]:
|
636 - | /// <p>The aggregation method used to generate the checksum. Currently, the only supported aggregation method is <code>LINEAR</code>.</p>
|
637 - | pub checksum_aggregation_method: ::std::option::Option<crate::model::ChecksumAggregationMethod>,
|
581 + | /// :type typing.Optional\[typing.List\[ebs.model.Tag\]\]:
|
582 + | /// <p>The tags to apply to the snapshot.</p>
|
583 + | pub tags: ::std::option::Option<::std::vec::Vec<crate::model::Tag>>,
|
638 584 | #[pyo3(get, set)]
|
639 - | /// :type typing.Optional\[ebs.model.ChecksumAlgorithm\]:
|
640 - | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
641 - | pub checksum_algorithm: ::std::option::Option<crate::model::ChecksumAlgorithm>,
|
585 + | /// :type typing.Optional\[bool\]:
|
586 + | /// <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>
|
587 + | /// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
|
588 + | /// <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>
|
589 + | /// <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>
|
590 + | /// <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>
|
591 + | pub encrypted: ::std::option::Option<bool>,
|
642 592 | #[pyo3(get, set)]
|
643 - | /// :type str:
|
644 - | /// <p>The ID of the snapshot.</p>
|
645 - | pub snapshot_id: ::std::string::String,
|
593 + | /// :type typing.Optional\[str\]:
|
594 + | /// <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>
|
595 + | /// <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>
|
596 + | /// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN.</p>
|
597 + | pub kms_key_arn: ::std::option::Option<::std::string::String>,
|
646 598 | #[pyo3(get, set)]
|
647 599 | /// :type typing.Optional\[str\]:
|
648 - | /// <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written block.</p>
|
649 - | /// <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>
|
650 - | pub checksum: ::std::option::Option<::std::string::String>,
|
600 + | /// <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>
|
601 + | /// <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>
|
602 + | pub parent_snapshot_id: ::std::option::Option<::std::string::String>,
|
603 + | #[pyo3(get, set)]
|
604 + | /// :type typing.Optional\[str\]:
|
605 + | /// <p>A description for the snapshot.</p>
|
606 + | pub description: ::std::option::Option<::std::string::String>,
|
651 607 | }
|
652 - | impl CompleteSnapshotInput {
|
653 - | /// <p>The number of blocks that were written to the snapshot.</p>
|
654 - | pub fn changed_blocks_count(&self) -> i32 {
|
655 - | self.changed_blocks_count
|
608 + | impl StartSnapshotInput {
|
609 + | /// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
|
610 + | /// <ul>
|
611 + | /// <li>
|
612 + | /// <p>No blocks are written to the snapshot.</p></li>
|
613 + | /// <li>
|
614 + | /// <p>The snapshot is not completed after writing the last block of data.</p></li>
|
615 + | /// </ul>
|
616 + | /// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
|
617 + | pub fn timeout(&self) -> ::std::option::Option<i32> {
|
618 + | self.timeout
|
656 619 | }
|
657 - | /// <p>The aggregation method used to generate the checksum. Currently, the only supported aggregation method is <code>LINEAR</code>.</p>
|
658 - | pub fn checksum_aggregation_method(
|
659 - | &self,
|
660 - | ) -> ::std::option::Option<&crate::model::ChecksumAggregationMethod> {
|
661 - | self.checksum_aggregation_method.as_ref()
|
620 + | /// <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>
|
621 + | /// <p>If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
|
622 + | /// <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>
|
623 + | pub fn client_token(&self) -> ::std::option::Option<&str> {
|
624 + | self.client_token.as_deref()
|
625 + | }
|
626 + | /// <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
|
627 + | pub fn volume_size(&self) -> i64 {
|
628 + | self.volume_size
|
629 + | }
|
630 + | /// <p>The tags to apply to the snapshot.</p>
|
631 + | pub fn tags(&self) -> ::std::option::Option<&[crate::model::Tag]> {
|
632 + | self.tags.as_deref()
|
633 + | }
|
634 + | /// <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>
|
635 + | /// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
|
636 + | /// <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>
|
637 + | /// <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>
|
638 + | /// <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>
|
639 + | pub fn encrypted(&self) -> ::std::option::Option<bool> {
|
640 + | self.encrypted
|
662 641 | }
|
663 - | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
664 - | pub fn checksum_algorithm(&self) -> ::std::option::Option<&crate::model::ChecksumAlgorithm> {
|
665 - | self.checksum_algorithm.as_ref()
|
642 + | /// <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>
|
643 + | /// <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>
|
644 + | /// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN.</p>
|
645 + | pub fn kms_key_arn(&self) -> ::std::option::Option<&str> {
|
646 + | self.kms_key_arn.as_deref()
|
666 647 | }
|
667 - | /// <p>The ID of the snapshot.</p>
|
668 - | pub fn snapshot_id(&self) -> &str {
|
669 - | use std::ops::Deref;
|
670 - | self.snapshot_id.deref()
|
648 + | /// <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>
|
649 + | /// <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>
|
650 + | pub fn parent_snapshot_id(&self) -> ::std::option::Option<&str> {
|
651 + | self.parent_snapshot_id.as_deref()
|
671 652 | }
|
672 - | /// <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written block.</p>
|
673 - | /// <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>
|
674 - | pub fn checksum(&self) -> ::std::option::Option<&str> {
|
675 - | self.checksum.as_deref()
|
653 + | /// <p>A description for the snapshot.</p>
|
654 + | pub fn description(&self) -> ::std::option::Option<&str> {
|
655 + | self.description.as_deref()
|
656 + | }
|
657 + | }
|
658 + | impl ::std::fmt::Debug for StartSnapshotInput {
|
659 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
660 + | let mut formatter = f.debug_struct("StartSnapshotInput");
|
661 + | formatter.field("timeout", &self.timeout);
|
662 + | formatter.field("client_token", &self.client_token);
|
663 + | formatter.field("volume_size", &self.volume_size);
|
664 + | formatter.field("tags", &self.tags);
|
665 + | formatter.field("encrypted", &self.encrypted);
|
666 + | formatter.field("kms_key_arn", &"*** Sensitive Data Redacted ***");
|
667 + | formatter.field("parent_snapshot_id", &self.parent_snapshot_id);
|
668 + | formatter.field("description", &self.description);
|
669 + | formatter.finish()
|
676 670 | }
|
677 671 | }
|
678 672 | #[allow(clippy::new_without_default)]
|
679 673 | #[allow(clippy::too_many_arguments)]
|
680 674 | #[::pyo3::pymethods]
|
681 - | impl CompleteSnapshotInput {
|
675 + | impl StartSnapshotInput {
|
682 676 | #[new]
|
683 677 | pub fn new(
|
684 - | changed_blocks_count: i32,
|
685 - | snapshot_id: ::std::string::String,
|
686 - | checksum_aggregation_method: ::std::option::Option<crate::model::ChecksumAggregationMethod>,
|
687 - | checksum_algorithm: ::std::option::Option<crate::model::ChecksumAlgorithm>,
|
688 - | checksum: ::std::option::Option<::std::string::String>,
|
678 + | volume_size: i64,
|
679 + | timeout: ::std::option::Option<i32>,
|
680 + | client_token: ::std::option::Option<::std::string::String>,
|
681 + | tags: ::std::option::Option<::std::vec::Vec<crate::model::Tag>>,
|
682 + | encrypted: ::std::option::Option<bool>,
|
683 + | kms_key_arn: ::std::option::Option<::std::string::String>,
|
684 + | parent_snapshot_id: ::std::option::Option<::std::string::String>,
|
685 + | description: ::std::option::Option<::std::string::String>,
|
689 686 | ) -> Self {
|
690 687 | Self {
|
691 - | changed_blocks_count,
|
692 - | snapshot_id,
|
693 - | checksum_aggregation_method,
|
694 - | checksum_algorithm,
|
695 - | checksum,
|
688 + | volume_size,
|
689 + | timeout,
|
690 + | client_token,
|
691 + | tags,
|
692 + | encrypted,
|
693 + | kms_key_arn,
|
694 + | parent_snapshot_id,
|
695 + | description,
|
696 696 | }
|
697 697 | }
|
698 698 | fn __repr__(&self) -> String {
|
699 699 | format!("{self:?}")
|
700 700 | }
|
701 701 | fn __str__(&self) -> String {
|
702 702 | format!("{self:?}")
|
703 703 | }
|
704 704 | }
|
705 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<CompleteSnapshotInput> {
|
705 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<StartSnapshotInput> {
|
706 706 | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
707 - | ob.extract::<CompleteSnapshotInput>().map(Box::new)
|
707 + | ob.extract::<StartSnapshotInput>().map(Box::new)
|
708 708 | }
|
709 709 | }
|
710 710 |
|
711 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<CompleteSnapshotInput> {
|
711 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<StartSnapshotInput> {
|
712 712 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
713 713 | (*self).into_py(py)
|
714 714 | }
|
715 715 | }
|
716 - | impl crate::constrained::Constrained for crate::input::CompleteSnapshotInput {
|
717 - | type Unconstrained = crate::input::complete_snapshot_input_internal::Builder;
|
716 + | impl crate::constrained::Constrained for crate::input::StartSnapshotInput {
|
717 + | type Unconstrained = crate::input::start_snapshot_input_internal::Builder;
|
718 718 | }
|
719 - | impl CompleteSnapshotInput {
|
720 - | /// Creates a new builder-style object to manufacture [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
721 - | pub fn builder() -> crate::input::complete_snapshot_input::Builder {
|
722 - | crate::input::complete_snapshot_input::Builder::default()
|
719 + | impl StartSnapshotInput {
|
720 + | /// Creates a new builder-style object to manufacture [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
721 + | pub fn builder() -> crate::input::start_snapshot_input::Builder {
|
722 + | crate::input::start_snapshot_input::Builder::default()
|
723 723 | }
|
724 724 | }
|
725 - | /// See [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
726 - | pub(crate) mod start_snapshot_input_internal {
|
725 + | /// See [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
726 + | pub(crate) mod complete_snapshot_input_internal {
|
727 727 |
|
728 728 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
729 729 | /// Holds one variant for each of the ways the builder can fail.
|
730 730 | #[non_exhaustive]
|
731 731 | #[allow(clippy::enum_variant_names)]
|
732 732 | pub(crate) enum ConstraintViolation {
|
733 - | /// Constraint violation occurred building member `timeout` when building `StartSnapshotInput`.
|
734 - | #[doc(hidden)]
|
735 - | Timeout(crate::model::timeout_internal::ConstraintViolation),
|
736 - | /// Constraint violation occurred building member `client_token` when building `StartSnapshotInput`.
|
737 - | #[doc(hidden)]
|
738 - | ClientToken(crate::model::idempotency_token_internal::ConstraintViolation),
|
739 - | /// `volume_size` was not provided but it is required when building `StartSnapshotInput`.
|
740 - | MissingVolumeSize,
|
741 - | /// Constraint violation occurred building member `volume_size` when building `StartSnapshotInput`.
|
733 + | /// `changed_blocks_count` was not provided but it is required when building `CompleteSnapshotInput`.
|
734 + | MissingChangedBlocksCount,
|
735 + | /// Constraint violation occurred building member `changed_blocks_count` when building `CompleteSnapshotInput`.
|
742 736 | #[doc(hidden)]
|
743 - | VolumeSize(crate::model::volume_size_internal::ConstraintViolation),
|
744 - | /// Constraint violation occurred building member `tags` when building `StartSnapshotInput`.
|
737 + | ChangedBlocksCount(crate::model::changed_blocks_count_internal::ConstraintViolation),
|
738 + | /// Constraint violation occurred building member `checksum_aggregation_method` when building `CompleteSnapshotInput`.
|
745 739 | #[doc(hidden)]
|
746 - | Tags(crate::model::tags_internal::ConstraintViolation),
|
747 - | /// Constraint violation occurred building member `kms_key_arn` when building `StartSnapshotInput`.
|
740 + | ChecksumAggregationMethod(
|
741 + | crate::model::checksum_aggregation_method_internal::ConstraintViolation,
|
742 + | ),
|
743 + | /// Constraint violation occurred building member `checksum_algorithm` when building `CompleteSnapshotInput`.
|
748 744 | #[doc(hidden)]
|
749 - | KmsKeyArn(crate::model::kms_key_arn_internal::ConstraintViolation),
|
750 - | /// Constraint violation occurred building member `parent_snapshot_id` when building `StartSnapshotInput`.
|
745 + | ChecksumAlgorithm(crate::model::checksum_algorithm_internal::ConstraintViolation),
|
746 + | /// `snapshot_id` was not provided but it is required when building `CompleteSnapshotInput`.
|
747 + | MissingSnapshotId,
|
748 + | /// Constraint violation occurred building member `snapshot_id` when building `CompleteSnapshotInput`.
|
751 749 | #[doc(hidden)]
|
752 - | ParentSnapshotId(crate::model::snapshot_id_internal::ConstraintViolation),
|
753 - | /// Constraint violation occurred building member `description` when building `StartSnapshotInput`.
|
750 + | SnapshotId(crate::model::snapshot_id_internal::ConstraintViolation),
|
751 + | /// Constraint violation occurred building member `checksum` when building `CompleteSnapshotInput`.
|
754 752 | #[doc(hidden)]
|
755 - | Description(crate::model::description_internal::ConstraintViolation),
|
753 + | Checksum(crate::model::checksum_internal::ConstraintViolation),
|
756 754 | }
|
757 755 | impl ::std::fmt::Display for ConstraintViolation {
|
758 756 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
759 757 | match self {
|
760 - | ConstraintViolation::Timeout(_) => write!(f, "constraint violation occurred building member `timeout` when building `StartSnapshotInput`"),
|
761 - | ConstraintViolation::ClientToken(_) => write!(f, "constraint violation occurred building member `client_token` when building `StartSnapshotInput`"),
|
762 - | ConstraintViolation::MissingVolumeSize => write!(f, "`volume_size` was not provided but it is required when building `StartSnapshotInput`"),
|
763 - | ConstraintViolation::VolumeSize(_) => write!(f, "constraint violation occurred building member `volume_size` when building `StartSnapshotInput`"),
|
764 - | ConstraintViolation::Tags(_) => write!(f, "constraint violation occurred building member `tags` when building `StartSnapshotInput`"),
|
765 - | ConstraintViolation::KmsKeyArn(_) => write!(f, "constraint violation occurred building member `kms_key_arn` when building `StartSnapshotInput`"),
|
766 - | ConstraintViolation::ParentSnapshotId(_) => write!(f, "constraint violation occurred building member `parent_snapshot_id` when building `StartSnapshotInput`"),
|
767 - | ConstraintViolation::Description(_) => write!(f, "constraint violation occurred building member `description` when building `StartSnapshotInput`"),
|
758 + | ConstraintViolation::MissingChangedBlocksCount => write!(f, "`changed_blocks_count` was not provided but it is required when building `CompleteSnapshotInput`"),
|
759 + | ConstraintViolation::ChangedBlocksCount(_) => write!(f, "constraint violation occurred building member `changed_blocks_count` when building `CompleteSnapshotInput`"),
|
760 + | ConstraintViolation::ChecksumAggregationMethod(_) => write!(f, "constraint violation occurred building member `checksum_aggregation_method` when building `CompleteSnapshotInput`"),
|
761 + | ConstraintViolation::ChecksumAlgorithm(_) => write!(f, "constraint violation occurred building member `checksum_algorithm` when building `CompleteSnapshotInput`"),
|
762 + | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `CompleteSnapshotInput`"),
|
763 + | ConstraintViolation::SnapshotId(_) => write!(f, "constraint violation occurred building member `snapshot_id` when building `CompleteSnapshotInput`"),
|
764 + | ConstraintViolation::Checksum(_) => write!(f, "constraint violation occurred building member `checksum` when building `CompleteSnapshotInput`"),
|
768 765 | }
|
769 766 | }
|
770 767 | }
|
771 768 | impl ::std::error::Error for ConstraintViolation {}
|
772 769 | impl ConstraintViolation {
|
773 770 | pub(crate) fn as_validation_exception_field(
|
774 771 | self,
|
775 772 | path: ::std::string::String,
|
776 773 | ) -> crate::model::ValidationExceptionField {
|
777 774 | match self {
|
778 - | ConstraintViolation::Timeout(inner) => inner.as_validation_exception_field(path + "/Timeout"),
|
779 - | ConstraintViolation::ClientToken(inner) => inner.as_validation_exception_field(path + "/ClientToken"),
|
780 - | ConstraintViolation::MissingVolumeSize => crate::model::ValidationExceptionField {
|
781 - | message: format!("Value at '{}/VolumeSize' failed to satisfy constraint: Member must not be null", path),
|
782 - | path: path + "/VolumeSize",
|
775 + | ConstraintViolation::MissingChangedBlocksCount => crate::model::ValidationExceptionField {
|
776 + | message: format!("Value at '{}/ChangedBlocksCount' failed to satisfy constraint: Member must not be null", path),
|
777 + | path: path + "/ChangedBlocksCount",
|
783 778 | },
|
784 - | ConstraintViolation::VolumeSize(inner) => inner.as_validation_exception_field(path + "/VolumeSize"),
|
785 - | ConstraintViolation::Tags(inner) => inner.as_validation_exception_field(path + "/Tags"),
|
786 - | ConstraintViolation::KmsKeyArn(inner) => inner.as_validation_exception_field(path + "/KmsKeyArn"),
|
787 - | ConstraintViolation::ParentSnapshotId(inner) => inner.as_validation_exception_field(path + "/ParentSnapshotId"),
|
788 - | ConstraintViolation::Description(inner) => inner.as_validation_exception_field(path + "/Description"),
|
779 + | ConstraintViolation::ChangedBlocksCount(inner) => inner.as_validation_exception_field(path + "/ChangedBlocksCount"),
|
780 + | ConstraintViolation::ChecksumAggregationMethod(inner) => inner.as_validation_exception_field(path + "/ChecksumAggregationMethod"),
|
781 + | ConstraintViolation::ChecksumAlgorithm(inner) => inner.as_validation_exception_field(path + "/ChecksumAlgorithm"),
|
782 + | ConstraintViolation::MissingSnapshotId => crate::model::ValidationExceptionField {
|
783 + | message: format!("Value at '{}/SnapshotId' failed to satisfy constraint: Member must not be null", path),
|
784 + | path: path + "/SnapshotId",
|
785 + | },
|
786 + | ConstraintViolation::SnapshotId(inner) => inner.as_validation_exception_field(path + "/SnapshotId"),
|
787 + | ConstraintViolation::Checksum(inner) => inner.as_validation_exception_field(path + "/Checksum"),
|
789 788 | }
|
790 789 | }
|
791 790 | }
|
792 791 | impl ::std::convert::From<ConstraintViolation>
|
793 792 | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
794 793 | {
|
795 794 | fn from(constraint_violation: ConstraintViolation) -> Self {
|
796 795 | let first_validation_exception_field =
|
797 796 | constraint_violation.as_validation_exception_field("".to_owned());
|
798 797 | let validation_exception = crate::error::ValidationException {
|
799 798 | message: format!(
|
800 799 | "1 validation error detected. {}",
|
801 800 | &first_validation_exception_field.message
|
802 801 | ),
|
803 802 | field_list: Some(vec![first_validation_exception_field]),
|
804 803 | };
|
805 804 | Self::ConstraintViolation(
|
806 805 | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
807 806 | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
808 807 | )
|
809 808 | }
|
810 809 | }
|
811 810 | impl ::std::convert::From<Builder>
|
812 - | for crate::constrained::MaybeConstrained<crate::input::StartSnapshotInput>
|
811 + | for crate::constrained::MaybeConstrained<crate::input::CompleteSnapshotInput>
|
813 812 | {
|
814 813 | fn from(builder: Builder) -> Self {
|
815 814 | Self::Unconstrained(builder)
|
816 815 | }
|
817 816 | }
|
818 - | impl ::std::convert::TryFrom<Builder> for crate::input::StartSnapshotInput {
|
817 + | impl ::std::convert::TryFrom<Builder> for crate::input::CompleteSnapshotInput {
|
819 818 | type Error = ConstraintViolation;
|
820 819 |
|
821 820 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
822 821 | builder.build()
|
823 822 | }
|
824 823 | }
|
825 - | /// A builder for [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
826 - | #[derive(::std::clone::Clone, ::std::default::Default)]
|
824 + | /// A builder for [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
825 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
827 826 | pub(crate) struct Builder {
|
828 - | pub(crate) timeout:
|
829 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Timeout>>,
|
830 - | pub(crate) client_token: ::std::option::Option<
|
831 - | crate::constrained::MaybeConstrained<crate::model::IdempotencyToken>,
|
827 + | pub(crate) changed_blocks_count: ::std::option::Option<
|
828 + | crate::constrained::MaybeConstrained<crate::model::ChangedBlocksCount>,
|
832 829 | >,
|
833 - | pub(crate) volume_size:
|
834 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::VolumeSize>>,
|
835 - | pub(crate) tags: ::std::option::Option<
|
836 - | crate::constrained::MaybeConstrained<
|
837 - | crate::constrained::tags_constrained::TagsConstrained,
|
838 - | >,
|
830 + | pub(crate) checksum_aggregation_method: ::std::option::Option<
|
831 + | crate::constrained::MaybeConstrained<crate::model::ChecksumAggregationMethod>,
|
839 832 | >,
|
840 - | pub(crate) encrypted: ::std::option::Option<bool>,
|
841 - | pub(crate) kms_key_arn:
|
842 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::KmsKeyArn>>,
|
843 - | pub(crate) parent_snapshot_id:
|
833 + | pub(crate) checksum_algorithm: ::std::option::Option<
|
834 + | crate::constrained::MaybeConstrained<crate::model::ChecksumAlgorithm>,
|
835 + | >,
|
836 + | pub(crate) snapshot_id:
|
844 837 | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
845 - | pub(crate) description:
|
846 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Description>>,
|
838 + | pub(crate) checksum:
|
839 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Checksum>>,
|
847 840 | }
|
848 841 | impl Builder {
|
849 - | /// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
|
850 - | /// <ul>
|
851 - | /// <li>
|
852 - | /// <p>No blocks are written to the snapshot.</p></li>
|
853 - | /// <li>
|
854 - | /// <p>The snapshot is not completed after writing the last block of data.</p></li>
|
855 - | /// </ul>
|
856 - | /// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
|
857 - | pub(crate) fn set_timeout(
|
858 - | mut self,
|
859 - | input: Option<
|
860 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Timeout>>,
|
861 - | >,
|
862 - | ) -> Self {
|
863 - | self.timeout = input.map(|v| v.into());
|
864 - | self
|
865 - | }
|
866 - | /// <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>
|
867 - | /// <p>If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
|
868 - | /// <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>
|
869 - | pub(crate) fn set_client_token(
|
870 - | mut self,
|
871 - | input: Option<
|
872 - | impl ::std::convert::Into<
|
873 - | crate::constrained::MaybeConstrained<crate::model::IdempotencyToken>,
|
874 - | >,
|
875 - | >,
|
876 - | ) -> Self {
|
877 - | self.client_token = input.map(|v| v.into());
|
878 - | self
|
879 - | }
|
880 - | /// <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
|
881 - | pub(crate) fn set_volume_size(
|
842 + | /// <p>The number of blocks that were written to the snapshot.</p>
|
843 + | pub(crate) fn set_changed_blocks_count(
|
882 844 | mut self,
|
883 845 | input: impl ::std::convert::Into<
|
884 - | crate::constrained::MaybeConstrained<crate::model::VolumeSize>,
|
885 - | >,
|
886 - | ) -> Self {
|
887 - | self.volume_size = Some(input.into());
|
888 - | self
|
889 - | }
|
890 - | /// <p>The tags to apply to the snapshot.</p>
|
891 - | pub(crate) fn set_tags(
|
892 - | mut self,
|
893 - | input: Option<
|
894 - | impl ::std::convert::Into<
|
895 - | crate::constrained::MaybeConstrained<
|
896 - | crate::constrained::tags_constrained::TagsConstrained,
|
897 - | >,
|
898 - | >,
|
899 - | >,
|
900 - | ) -> Self {
|
901 - | self.tags = input.map(|v| v.into());
|
902 - | self
|
903 - | }
|
904 - | /// <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>
|
905 - | /// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
|
906 - | /// <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>
|
907 - | /// <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>
|
908 - | /// <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>
|
909 - | pub(crate) fn set_encrypted(
|
910 - | mut self,
|
911 - | input: Option<impl ::std::convert::Into<bool>>,
|
846 + | crate::constrained::MaybeConstrained<crate::model::ChangedBlocksCount>,
|
847 + | >,
|
912 848 | ) -> Self {
|
913 - | self.encrypted = input.map(|v| v.into());
|
849 + | self.changed_blocks_count = Some(input.into());
|
914 850 | self
|
915 851 | }
|
916 - | /// <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>
|
917 - | /// <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>
|
918 - | /// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN.</p>
|
919 - | pub(crate) fn set_kms_key_arn(
|
852 + | /// <p>The aggregation method used to generate the checksum. Currently, the only supported aggregation method is <code>LINEAR</code>.</p>
|
853 + | pub(crate) fn set_checksum_aggregation_method(
|
920 854 | mut self,
|
921 855 | input: Option<
|
922 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::KmsKeyArn>>,
|
856 + | impl ::std::convert::Into<
|
857 + | crate::constrained::MaybeConstrained<crate::model::ChecksumAggregationMethod>,
|
858 + | >,
|
923 859 | >,
|
924 860 | ) -> Self {
|
925 - | self.kms_key_arn = input.map(|v| v.into());
|
861 + | self.checksum_aggregation_method = input.map(|v| v.into());
|
926 862 | self
|
927 863 | }
|
928 - | /// <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>
|
929 - | /// <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>
|
930 - | pub(crate) fn set_parent_snapshot_id(
|
864 + | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
865 + | pub(crate) fn set_checksum_algorithm(
|
931 866 | mut self,
|
932 867 | input: Option<
|
933 868 | impl ::std::convert::Into<
|
934 - | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
869 + | crate::constrained::MaybeConstrained<crate::model::ChecksumAlgorithm>,
|
935 870 | >,
|
936 871 | >,
|
937 872 | ) -> Self {
|
938 - | self.parent_snapshot_id = input.map(|v| v.into());
|
873 + | self.checksum_algorithm = input.map(|v| v.into());
|
939 874 | self
|
940 875 | }
|
941 - | /// <p>A description for the snapshot.</p>
|
942 - | pub(crate) fn set_description(
|
876 + | /// <p>The ID of the snapshot.</p>
|
877 + | pub(crate) fn set_snapshot_id(
|
878 + | mut self,
|
879 + | input: impl ::std::convert::Into<
|
880 + | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
881 + | >,
|
882 + | ) -> Self {
|
883 + | self.snapshot_id = Some(input.into());
|
884 + | self
|
885 + | }
|
886 + | /// <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written block.</p>
|
887 + | /// <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>
|
888 + | pub(crate) fn set_checksum(
|
943 889 | mut self,
|
944 890 | input: Option<
|
945 - | impl ::std::convert::Into<
|
946 - | crate::constrained::MaybeConstrained<crate::model::Description>,
|
947 - | >,
|
891 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Checksum>>,
|
948 892 | >,
|
949 893 | ) -> Self {
|
950 - | self.description = input.map(|v| v.into());
|
894 + | self.checksum = input.map(|v| v.into());
|
951 895 | self
|
952 896 | }
|
953 - | /// Consumes the builder and constructs a [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
897 + | /// Consumes the builder and constructs a [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
954 898 | ///
|
955 - | /// The builder fails to construct a [`StartSnapshotInput`](crate::input::StartSnapshotInput) if a [`ConstraintViolation`] occurs.
|
899 + | /// The builder fails to construct a [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput) if a [`ConstraintViolation`] occurs.
|
956 900 | ///
|
957 901 | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
958 - | pub fn build(self) -> Result<crate::input::StartSnapshotInput, ConstraintViolation> {
|
902 + | pub fn build(self) -> Result<crate::input::CompleteSnapshotInput, ConstraintViolation> {
|
959 903 | self.build_enforcing_all_constraints()
|
960 904 | }
|
961 905 | fn build_enforcing_all_constraints(
|
962 906 | self,
|
963 - | ) -> Result<crate::input::StartSnapshotInput, ConstraintViolation> {
|
964 - | Ok(crate::input::StartSnapshotInput {
|
965 - | timeout: self
|
966 - | .timeout
|
967 - | .map(|v| match v {
|
968 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
969 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
970 - | })
|
971 - | .map(|res| res.map_err(ConstraintViolation::Timeout))
|
972 - | .transpose()?
|
973 - | .map(|v: crate::model::Timeout| v.into()),
|
974 - | client_token: self
|
975 - | .client_token
|
976 - | .map(|v| match v {
|
977 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
978 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
979 - | })
|
980 - | .map(|res| res.map_err(ConstraintViolation::ClientToken))
|
981 - | .transpose()?
|
982 - | .map(|v: crate::model::IdempotencyToken| v.into()),
|
983 - | volume_size: self
|
984 - | .volume_size
|
907 + | ) -> Result<crate::input::CompleteSnapshotInput, ConstraintViolation> {
|
908 + | Ok(crate::input::CompleteSnapshotInput {
|
909 + | changed_blocks_count: self
|
910 + | .changed_blocks_count
|
985 911 | .map(|v| match v {
|
986 912 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
987 913 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
988 914 | })
|
989 - | .map(|res| res.map_err(ConstraintViolation::VolumeSize))
|
915 + | .map(|res| res.map_err(ConstraintViolation::ChangedBlocksCount))
|
990 916 | .transpose()?
|
991 - | .map(|v: crate::model::VolumeSize| v.into())
|
992 - | .ok_or(ConstraintViolation::MissingVolumeSize)?,
|
993 - | tags: self
|
994 - | .tags
|
917 + | .map(|v: crate::model::ChangedBlocksCount| v.into())
|
918 + | .ok_or(ConstraintViolation::MissingChangedBlocksCount)?,
|
919 + | checksum_aggregation_method: self
|
920 + | .checksum_aggregation_method
|
995 921 | .map(|v| match v {
|
996 922 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
997 923 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
998 924 | })
|
999 - | .map(|res| res.map(|v| v.into()).map_err(ConstraintViolation::Tags))
|
925 + | .map(|res| res.map_err(ConstraintViolation::ChecksumAggregationMethod))
|
1000 926 | .transpose()?,
|
1001 - | encrypted: self.encrypted,
|
1002 - | kms_key_arn: self
|
1003 - | .kms_key_arn
|
927 + | checksum_algorithm: self
|
928 + | .checksum_algorithm
|
1004 929 | .map(|v| match v {
|
1005 930 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1006 931 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1007 932 | })
|
1008 - | .map(|res| res.map_err(ConstraintViolation::KmsKeyArn))
|
1009 - | .transpose()?
|
1010 - | .map(|v: crate::model::KmsKeyArn| v.into()),
|
1011 - | parent_snapshot_id: self
|
1012 - | .parent_snapshot_id
|
933 + | .map(|res| res.map_err(ConstraintViolation::ChecksumAlgorithm))
|
934 + | .transpose()?,
|
935 + | snapshot_id: self
|
936 + | .snapshot_id
|
1013 937 | .map(|v| match v {
|
1014 938 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1015 939 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1016 940 | })
|
1017 - | .map(|res| res.map_err(ConstraintViolation::ParentSnapshotId))
|
941 + | .map(|res| res.map_err(ConstraintViolation::SnapshotId))
|
1018 942 | .transpose()?
|
1019 - | .map(|v: crate::model::SnapshotId| v.into()),
|
1020 - | description: self
|
1021 - | .description
|
943 + | .map(|v: crate::model::SnapshotId| v.into())
|
944 + | .ok_or(ConstraintViolation::MissingSnapshotId)?,
|
945 + | checksum: self
|
946 + | .checksum
|
1022 947 | .map(|v| match v {
|
1023 948 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1024 949 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1025 950 | })
|
1026 - | .map(|res| res.map_err(ConstraintViolation::Description))
|
951 + | .map(|res| res.map_err(ConstraintViolation::Checksum))
|
1027 952 | .transpose()?
|
1028 - | .map(|v: crate::model::Description| v.into()),
|
953 + | .map(|v: crate::model::Checksum| v.into()),
|
1029 954 | })
|
1030 955 | }
|
1031 956 | }
|
1032 - | impl ::std::fmt::Debug for Builder {
|
1033 - | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
1034 - | let mut formatter = f.debug_struct("Builder");
|
1035 - | formatter.field("timeout", &self.timeout);
|
1036 - | formatter.field("client_token", &self.client_token);
|
1037 - | formatter.field("volume_size", &self.volume_size);
|
1038 - | formatter.field("tags", &self.tags);
|
1039 - | formatter.field("encrypted", &self.encrypted);
|
1040 - | formatter.field("kms_key_arn", &"*** Sensitive Data Redacted ***");
|
1041 - | formatter.field("parent_snapshot_id", &self.parent_snapshot_id);
|
1042 - | formatter.field("description", &self.description);
|
1043 - | formatter.finish()
|
1044 - | }
|
1045 - | }
|
1046 957 | }
|
1047 - | /// See [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
1048 - | pub mod start_snapshot_input {
|
958 + | /// See [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
959 + | pub mod complete_snapshot_input {
|
1049 960 |
|
1050 961 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1051 962 | /// Holds one variant for each of the ways the builder can fail.
|
1052 963 | #[allow(clippy::enum_variant_names)]
|
1053 964 | pub enum ConstraintViolation {
|
1054 - | /// `volume_size` was not provided but it is required when building `StartSnapshotInput`.
|
1055 - | MissingVolumeSize,
|
965 + | /// `changed_blocks_count` was not provided but it is required when building `CompleteSnapshotInput`.
|
966 + | MissingChangedBlocksCount,
|
967 + | /// `snapshot_id` was not provided but it is required when building `CompleteSnapshotInput`.
|
968 + | MissingSnapshotId,
|
1056 969 | }
|
1057 970 | impl ::std::fmt::Display for ConstraintViolation {
|
1058 971 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1059 972 | match self {
|
1060 - | ConstraintViolation::MissingVolumeSize => write!(f, "`volume_size` was not provided but it is required when building `StartSnapshotInput`"),
|
973 + | ConstraintViolation::MissingChangedBlocksCount => write!(f, "`changed_blocks_count` was not provided but it is required when building `CompleteSnapshotInput`"),
|
974 + | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `CompleteSnapshotInput`"),
|
1061 975 | }
|
1062 976 | }
|
1063 977 | }
|
1064 978 | impl ::std::error::Error for ConstraintViolation {}
|
1065 - | impl ::std::convert::TryFrom<Builder> for crate::input::StartSnapshotInput {
|
979 + | impl ::std::convert::TryFrom<Builder> for crate::input::CompleteSnapshotInput {
|
1066 980 | type Error = ConstraintViolation;
|
1067 981 |
|
1068 982 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1069 983 | builder.build()
|
1070 984 | }
|
1071 985 | }
|
1072 - | /// A builder for [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
1073 - | #[derive(::std::clone::Clone, ::std::default::Default)]
|
986 + | /// A builder for [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
987 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1074 988 | pub struct Builder {
|
1075 - | pub(crate) timeout: ::std::option::Option<i32>,
|
1076 - | pub(crate) client_token: ::std::option::Option<::std::string::String>,
|
1077 - | pub(crate) volume_size: ::std::option::Option<i64>,
|
1078 - | pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::model::Tag>>,
|
1079 - | pub(crate) encrypted: ::std::option::Option<bool>,
|
1080 - | pub(crate) kms_key_arn: ::std::option::Option<::std::string::String>,
|
1081 - | pub(crate) parent_snapshot_id: ::std::option::Option<::std::string::String>,
|
1082 - | pub(crate) description: ::std::option::Option<::std::string::String>,
|
989 + | pub(crate) changed_blocks_count: ::std::option::Option<i32>,
|
990 + | pub(crate) checksum_aggregation_method:
|
991 + | ::std::option::Option<crate::model::ChecksumAggregationMethod>,
|
992 + | pub(crate) checksum_algorithm: ::std::option::Option<crate::model::ChecksumAlgorithm>,
|
993 + | pub(crate) snapshot_id: ::std::option::Option<::std::string::String>,
|
994 + | pub(crate) checksum: ::std::option::Option<::std::string::String>,
|
1083 995 | }
|
1084 996 | impl Builder {
|
1085 - | /// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
|
1086 - | /// <ul>
|
1087 - | /// <li>
|
1088 - | /// <p>No blocks are written to the snapshot.</p></li>
|
1089 - | /// <li>
|
1090 - | /// <p>The snapshot is not completed after writing the last block of data.</p></li>
|
1091 - | /// </ul>
|
1092 - | /// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
|
1093 - | pub fn timeout(mut self, input: ::std::option::Option<i32>) -> Self {
|
1094 - | self.timeout = input;
|
1095 - | self
|
1096 - | }
|
1097 - | /// <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>
|
1098 - | /// <p>If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
|
1099 - | /// <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>
|
1100 - | pub fn client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1101 - | self.client_token = input;
|
1102 - | self
|
1103 - | }
|
1104 - | /// <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
|
1105 - | pub fn volume_size(mut self, input: i64) -> Self {
|
1106 - | self.volume_size = Some(input);
|
997 + | /// <p>The number of blocks that were written to the snapshot.</p>
|
998 + | pub fn changed_blocks_count(mut self, input: i32) -> Self {
|
999 + | self.changed_blocks_count = Some(input);
|
1107 1000 | self
|
1108 1001 | }
|
1109 - | /// <p>The tags to apply to the snapshot.</p>
|
1110 - | pub fn tags(
|
1002 + | /// <p>The aggregation method used to generate the checksum. Currently, the only supported aggregation method is <code>LINEAR</code>.</p>
|
1003 + | pub fn checksum_aggregation_method(
|
1111 1004 | mut self,
|
1112 - | input: ::std::option::Option<::std::vec::Vec<crate::model::Tag>>,
|
1005 + | input: ::std::option::Option<crate::model::ChecksumAggregationMethod>,
|
1113 1006 | ) -> Self {
|
1114 - | self.tags = input;
|
1115 - | self
|
1116 - | }
|
1117 - | /// <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>
|
1118 - | /// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
|
1119 - | /// <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>
|
1120 - | /// <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>
|
1121 - | /// <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>
|
1122 - | pub fn encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
|
1123 - | self.encrypted = input;
|
1124 - | self
|
1125 - | }
|
1126 - | /// <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>
|
1127 - | /// <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>
|
1128 - | /// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN.</p>
|
1129 - | pub fn kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1130 - | self.kms_key_arn = input;
|
1007 + | self.checksum_aggregation_method = input;
|
1131 1008 | self
|
1132 1009 | }
|
1133 - | /// <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>
|
1134 - | /// <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>
|
1135 - | pub fn parent_snapshot_id(
|
1010 + | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
1011 + | pub fn checksum_algorithm(
|
1136 1012 | mut self,
|
1137 - | input: ::std::option::Option<::std::string::String>,
|
1013 + | input: ::std::option::Option<crate::model::ChecksumAlgorithm>,
|
1138 1014 | ) -> Self {
|
1139 - | self.parent_snapshot_id = input;
|
1015 + | self.checksum_algorithm = input;
|
1140 1016 | self
|
1141 1017 | }
|
1142 - | /// <p>A description for the snapshot.</p>
|
1143 - | pub fn description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1144 - | self.description = input;
|
1018 + | /// <p>The ID of the snapshot.</p>
|
1019 + | pub fn snapshot_id(mut self, input: ::std::string::String) -> Self {
|
1020 + | self.snapshot_id = Some(input);
|
1145 1021 | self
|
1146 1022 | }
|
1147 - | /// Consumes the builder and constructs a [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
1023 + | /// <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written block.</p>
|
1024 + | /// <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>
|
1025 + | pub fn checksum(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1026 + | self.checksum = input;
|
1027 + | self
|
1028 + | }
|
1029 + | /// Consumes the builder and constructs a [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
1148 1030 | ///
|
1149 - | /// The builder fails to construct a [`StartSnapshotInput`](crate::input::StartSnapshotInput) if you do not provide a value for all non-`Option`al members.
|
1031 + | /// The builder fails to construct a [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput) if you do not provide a value for all non-`Option`al members.
|
1150 1032 | ///
|
1151 - | pub fn build(self) -> Result<crate::input::StartSnapshotInput, ConstraintViolation> {
|
1033 + | pub fn build(self) -> Result<crate::input::CompleteSnapshotInput, ConstraintViolation> {
|
1152 1034 | self.build_enforcing_required_and_enum_traits()
|
1153 1035 | }
|
1154 1036 | fn build_enforcing_required_and_enum_traits(
|
1155 1037 | self,
|
1156 - | ) -> Result<crate::input::StartSnapshotInput, ConstraintViolation> {
|
1157 - | Ok(crate::input::StartSnapshotInput {
|
1158 - | timeout: self.timeout,
|
1159 - | client_token: self.client_token,
|
1160 - | volume_size: self
|
1161 - | .volume_size
|
1162 - | .ok_or(ConstraintViolation::MissingVolumeSize)?,
|
1163 - | tags: self.tags,
|
1164 - | encrypted: self.encrypted,
|
1165 - | kms_key_arn: self.kms_key_arn,
|
1166 - | parent_snapshot_id: self.parent_snapshot_id,
|
1167 - | description: self.description,
|
1038 + | ) -> Result<crate::input::CompleteSnapshotInput, ConstraintViolation> {
|
1039 + | Ok(crate::input::CompleteSnapshotInput {
|
1040 + | changed_blocks_count: self
|
1041 + | .changed_blocks_count
|
1042 + | .ok_or(ConstraintViolation::MissingChangedBlocksCount)?,
|
1043 + | checksum_aggregation_method: self.checksum_aggregation_method,
|
1044 + | checksum_algorithm: self.checksum_algorithm,
|
1045 + | snapshot_id: self
|
1046 + | .snapshot_id
|
1047 + | .ok_or(ConstraintViolation::MissingSnapshotId)?,
|
1048 + | checksum: self.checksum,
|
1168 1049 | })
|
1169 1050 | }
|
1170 1051 | }
|
1171 1052 | }
|
1172 - | /// See [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
1173 - | pub(crate) mod put_snapshot_block_input_internal {
|
1053 + | /// See [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
1054 + | pub(crate) mod get_snapshot_block_input_internal {
|
1174 1055 |
|
1175 1056 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1176 1057 | /// Holds one variant for each of the ways the builder can fail.
|
1177 1058 | #[non_exhaustive]
|
1178 1059 | #[allow(clippy::enum_variant_names)]
|
1179 1060 | pub(crate) enum ConstraintViolation {
|
1180 - | /// `snapshot_id` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1061 + | /// `snapshot_id` was not provided but it is required when building `GetSnapshotBlockInput`.
|
1181 1062 | MissingSnapshotId,
|
1182 - | /// Constraint violation occurred building member `snapshot_id` when building `PutSnapshotBlockInput`.
|
1063 + | /// Constraint violation occurred building member `snapshot_id` when building `GetSnapshotBlockInput`.
|
1183 1064 | #[doc(hidden)]
|
1184 1065 | SnapshotId(crate::model::snapshot_id_internal::ConstraintViolation),
|
1185 - | /// `block_index` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1066 + | /// `block_token` was not provided but it is required when building `GetSnapshotBlockInput`.
|
1067 + | MissingBlockToken,
|
1068 + | /// Constraint violation occurred building member `block_token` when building `GetSnapshotBlockInput`.
|
1069 + | #[doc(hidden)]
|
1070 + | BlockToken(crate::model::block_token_internal::ConstraintViolation),
|
1071 + | /// `block_index` was not provided but it is required when building `GetSnapshotBlockInput`.
|
1186 1072 | MissingBlockIndex,
|
1187 - | /// Constraint violation occurred building member `block_index` when building `PutSnapshotBlockInput`.
|
1073 + | /// Constraint violation occurred building member `block_index` when building `GetSnapshotBlockInput`.
|
1188 1074 | #[doc(hidden)]
|
1189 1075 | BlockIndex(crate::model::block_index_internal::ConstraintViolation),
|
1190 - | /// `checksum` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1191 - | MissingChecksum,
|
1192 - | /// Constraint violation occurred building member `checksum` when building `PutSnapshotBlockInput`.
|
1193 - | #[doc(hidden)]
|
1194 - | Checksum(crate::model::checksum_internal::ConstraintViolation),
|
1195 - | /// Constraint violation occurred building member `progress` when building `PutSnapshotBlockInput`.
|
1196 - | #[doc(hidden)]
|
1197 - | Progress(crate::model::progress_internal::ConstraintViolation),
|
1198 - | /// `block_data` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1199 - | MissingBlockData,
|
1200 - | /// `data_length` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1201 - | MissingDataLength,
|
1202 - | /// `checksum_algorithm` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1203 - | MissingChecksumAlgorithm,
|
1204 - | /// Constraint violation occurred building member `checksum_algorithm` when building `PutSnapshotBlockInput`.
|
1205 - | #[doc(hidden)]
|
1206 - | ChecksumAlgorithm(crate::model::checksum_algorithm_internal::ConstraintViolation),
|
1207 1076 | }
|
1208 1077 | impl ::std::fmt::Display for ConstraintViolation {
|
1209 1078 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1210 1079 | match self {
|
1211 - | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1212 - | ConstraintViolation::SnapshotId(_) => write!(f, "constraint violation occurred building member `snapshot_id` when building `PutSnapshotBlockInput`"),
|
1213 - | ConstraintViolation::MissingBlockIndex => write!(f, "`block_index` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1214 - | ConstraintViolation::BlockIndex(_) => write!(f, "constraint violation occurred building member `block_index` when building `PutSnapshotBlockInput`"),
|
1215 - | ConstraintViolation::MissingChecksum => write!(f, "`checksum` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1216 - | ConstraintViolation::Checksum(_) => write!(f, "constraint violation occurred building member `checksum` when building `PutSnapshotBlockInput`"),
|
1217 - | ConstraintViolation::Progress(_) => write!(f, "constraint violation occurred building member `progress` when building `PutSnapshotBlockInput`"),
|
1218 - | ConstraintViolation::MissingBlockData => write!(f, "`block_data` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1219 - | ConstraintViolation::MissingDataLength => write!(f, "`data_length` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1220 - | ConstraintViolation::MissingChecksumAlgorithm => write!(f, "`checksum_algorithm` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1221 - | ConstraintViolation::ChecksumAlgorithm(_) => write!(f, "constraint violation occurred building member `checksum_algorithm` when building `PutSnapshotBlockInput`"),
|
1080 + | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `GetSnapshotBlockInput`"),
|
1081 + | ConstraintViolation::SnapshotId(_) => write!(f, "constraint violation occurred building member `snapshot_id` when building `GetSnapshotBlockInput`"),
|
1082 + | ConstraintViolation::MissingBlockToken => write!(f, "`block_token` was not provided but it is required when building `GetSnapshotBlockInput`"),
|
1083 + | ConstraintViolation::BlockToken(_) => write!(f, "constraint violation occurred building member `block_token` when building `GetSnapshotBlockInput`"),
|
1084 + | ConstraintViolation::MissingBlockIndex => write!(f, "`block_index` was not provided but it is required when building `GetSnapshotBlockInput`"),
|
1085 + | ConstraintViolation::BlockIndex(_) => write!(f, "constraint violation occurred building member `block_index` when building `GetSnapshotBlockInput`"),
|
1222 1086 | }
|
1223 1087 | }
|
1224 1088 | }
|
1225 1089 | impl ::std::error::Error for ConstraintViolation {}
|
1226 1090 | impl ConstraintViolation {
|
1227 1091 | pub(crate) fn as_validation_exception_field(
|
1228 1092 | self,
|
1229 1093 | path: ::std::string::String,
|
1230 1094 | ) -> crate::model::ValidationExceptionField {
|
1231 1095 | match self {
|
1232 1096 | ConstraintViolation::MissingSnapshotId => crate::model::ValidationExceptionField {
|
1233 1097 | message: format!("Value at '{}/SnapshotId' failed to satisfy constraint: Member must not be null", path),
|
1234 1098 | path: path + "/SnapshotId",
|
1235 1099 | },
|
1236 1100 | ConstraintViolation::SnapshotId(inner) => inner.as_validation_exception_field(path + "/SnapshotId"),
|
1101 + | ConstraintViolation::MissingBlockToken => crate::model::ValidationExceptionField {
|
1102 + | message: format!("Value at '{}/BlockToken' failed to satisfy constraint: Member must not be null", path),
|
1103 + | path: path + "/BlockToken",
|
1104 + | },
|
1105 + | ConstraintViolation::BlockToken(inner) => inner.as_validation_exception_field(path + "/BlockToken"),
|
1237 1106 | ConstraintViolation::MissingBlockIndex => crate::model::ValidationExceptionField {
|
1238 1107 | message: format!("Value at '{}/BlockIndex' failed to satisfy constraint: Member must not be null", path),
|
1239 1108 | path: path + "/BlockIndex",
|
1240 1109 | },
|
1241 1110 | ConstraintViolation::BlockIndex(inner) => inner.as_validation_exception_field(path + "/BlockIndex"),
|
1242 - | ConstraintViolation::MissingChecksum => crate::model::ValidationExceptionField {
|
1243 - | message: format!("Value at '{}/Checksum' failed to satisfy constraint: Member must not be null", path),
|
1244 - | path: path + "/Checksum",
|
1245 - | },
|
1246 - | ConstraintViolation::Checksum(inner) => inner.as_validation_exception_field(path + "/Checksum"),
|
1247 - | ConstraintViolation::Progress(inner) => inner.as_validation_exception_field(path + "/Progress"),
|
1248 - | ConstraintViolation::MissingBlockData => crate::model::ValidationExceptionField {
|
1249 - | message: format!("Value at '{}/BlockData' failed to satisfy constraint: Member must not be null", path),
|
1250 - | path: path + "/BlockData",
|
1251 - | },
|
1252 - | ConstraintViolation::MissingDataLength => crate::model::ValidationExceptionField {
|
1253 - | message: format!("Value at '{}/DataLength' failed to satisfy constraint: Member must not be null", path),
|
1254 - | path: path + "/DataLength",
|
1255 - | },
|
1256 - | ConstraintViolation::MissingChecksumAlgorithm => crate::model::ValidationExceptionField {
|
1257 - | message: format!("Value at '{}/ChecksumAlgorithm' failed to satisfy constraint: Member must not be null", path),
|
1258 - | path: path + "/ChecksumAlgorithm",
|
1259 - | },
|
1260 - | ConstraintViolation::ChecksumAlgorithm(inner) => inner.as_validation_exception_field(path + "/ChecksumAlgorithm"),
|
1261 1111 | }
|
1262 1112 | }
|
1263 1113 | }
|
1264 1114 | impl ::std::convert::From<ConstraintViolation>
|
1265 1115 | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
1266 1116 | {
|
1267 1117 | fn from(constraint_violation: ConstraintViolation) -> Self {
|
1268 1118 | let first_validation_exception_field =
|
1269 1119 | constraint_violation.as_validation_exception_field("".to_owned());
|
1270 1120 | let validation_exception = crate::error::ValidationException {
|
1271 1121 | message: format!(
|
1272 1122 | "1 validation error detected. {}",
|
1273 1123 | &first_validation_exception_field.message
|
1274 1124 | ),
|
1275 1125 | field_list: Some(vec![first_validation_exception_field]),
|
1276 1126 | };
|
1277 1127 | Self::ConstraintViolation(
|
1278 1128 | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
1279 1129 | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
1280 1130 | )
|
1281 1131 | }
|
1282 1132 | }
|
1283 1133 | impl ::std::convert::From<Builder>
|
1284 - | for crate::constrained::MaybeConstrained<crate::input::PutSnapshotBlockInput>
|
1134 + | for crate::constrained::MaybeConstrained<crate::input::GetSnapshotBlockInput>
|
1285 1135 | {
|
1286 1136 | fn from(builder: Builder) -> Self {
|
1287 1137 | Self::Unconstrained(builder)
|
1288 1138 | }
|
1289 1139 | }
|
1290 - | impl ::std::convert::TryFrom<Builder> for crate::input::PutSnapshotBlockInput {
|
1140 + | impl ::std::convert::TryFrom<Builder> for crate::input::GetSnapshotBlockInput {
|
1291 1141 | type Error = ConstraintViolation;
|
1292 1142 |
|
1293 1143 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1294 1144 | builder.build()
|
1295 1145 | }
|
1296 1146 | }
|
1297 - | /// A builder for [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
1298 - | #[derive(::std::clone::Clone, ::std::default::Default)]
|
1147 + | /// A builder for [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
1148 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1299 1149 | pub(crate) struct Builder {
|
1300 1150 | pub(crate) snapshot_id:
|
1301 1151 | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
1152 + | pub(crate) block_token:
|
1153 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::BlockToken>>,
|
1302 1154 | pub(crate) block_index:
|
1303 1155 | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::BlockIndex>>,
|
1304 - | pub(crate) checksum:
|
1305 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Checksum>>,
|
1306 - | pub(crate) progress:
|
1307 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Progress>>,
|
1308 - | pub(crate) block_data:
|
1309 - | ::std::option::Option<::aws_smithy_http_server_python::types::ByteStream>,
|
1310 - | pub(crate) data_length: ::std::option::Option<i32>,
|
1311 - | pub(crate) checksum_algorithm: ::std::option::Option<
|
1312 - | crate::constrained::MaybeConstrained<crate::model::ChecksumAlgorithm>,
|
1313 - | >,
|
1314 1156 | }
|
1315 1157 | impl Builder {
|
1316 - | /// <p>The ID of the snapshot.</p>
|
1158 + | /// <p>The ID of the snapshot containing the block from which to get data.</p>
|
1317 1159 | pub(crate) fn set_snapshot_id(
|
1318 1160 | mut self,
|
1319 1161 | input: impl ::std::convert::Into<
|
1320 1162 | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
1321 1163 | >,
|
1322 1164 | ) -> Self {
|
1323 1165 | self.snapshot_id = Some(input.into());
|
1324 1166 | self
|
1325 1167 | }
|
1326 - | /// <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>
|
1327 - | pub(crate) fn set_block_index(
|
1328 - | mut self,
|
1329 - | input: impl ::std::convert::Into<
|
1330 - | crate::constrained::MaybeConstrained<crate::model::BlockIndex>,
|
1331 - | >,
|
1332 - | ) -> Self {
|
1333 - | self.block_index = Some(input.into());
|
1334 - | self
|
1335 - | }
|
1336 - | /// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
|
1337 - | pub(crate) fn set_checksum(
|
1168 + | /// <p>The block token of the block from which to get data.</p>
|
1169 + | /// <p>Obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
1170 + | pub(crate) fn set_block_token(
|
1338 1171 | mut self,
|
1339 1172 | input: impl ::std::convert::Into<
|
1340 - | crate::constrained::MaybeConstrained<crate::model::Checksum>,
|
1341 - | >,
|
1342 - | ) -> Self {
|
1343 - | self.checksum = Some(input.into());
|
1344 - | self
|
1345 - | }
|
1346 - | /// <p>The progress of the write process, as a percentage.</p>
|
1347 - | pub(crate) fn set_progress(
|
1348 - | mut self,
|
1349 - | input: Option<
|
1350 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Progress>>,
|
1173 + | crate::constrained::MaybeConstrained<crate::model::BlockToken>,
|
1351 1174 | >,
|
1352 1175 | ) -> Self {
|
1353 - | self.progress = input.map(|v| v.into());
|
1354 - | self
|
1355 - | }
|
1356 - | /// <p>The data to write to the block.</p>
|
1357 - | /// <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>
|
1358 - | pub(crate) fn set_block_data(
|
1359 - | mut self,
|
1360 - | input: impl ::std::convert::Into<::aws_smithy_http_server_python::types::ByteStream>,
|
1361 - | ) -> Self {
|
1362 - | self.block_data = Some(input.into());
|
1363 - | self
|
1364 - | }
|
1365 - | /// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code>.</p>
|
1366 - | /// <p>Valid values: <code>524288</code></p>
|
1367 - | pub(crate) fn set_data_length(mut self, input: impl ::std::convert::Into<i32>) -> Self {
|
1368 - | self.data_length = Some(input.into());
|
1176 + | self.block_token = Some(input.into());
|
1369 1177 | self
|
1370 1178 | }
|
1371 - | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
1372 - | pub(crate) fn set_checksum_algorithm(
|
1179 + | /// <p>The block index of the block from which to get data.</p>
|
1180 + | /// <p>Obtain the <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
1181 + | pub(crate) fn set_block_index(
|
1373 1182 | mut self,
|
1374 1183 | input: impl ::std::convert::Into<
|
1375 - | crate::constrained::MaybeConstrained<crate::model::ChecksumAlgorithm>,
|
1184 + | crate::constrained::MaybeConstrained<crate::model::BlockIndex>,
|
1376 1185 | >,
|
1377 1186 | ) -> Self {
|
1378 - | self.checksum_algorithm = Some(input.into());
|
1187 + | self.block_index = Some(input.into());
|
1379 1188 | self
|
1380 1189 | }
|
1381 - | /// Consumes the builder and constructs a [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
1190 + | /// Consumes the builder and constructs a [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
1382 1191 | ///
|
1383 - | /// The builder fails to construct a [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput) if a [`ConstraintViolation`] occurs.
|
1192 + | /// The builder fails to construct a [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput) if a [`ConstraintViolation`] occurs.
|
1384 1193 | ///
|
1385 1194 | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
1386 - | pub fn build(self) -> Result<crate::input::PutSnapshotBlockInput, ConstraintViolation> {
|
1195 + | pub fn build(self) -> Result<crate::input::GetSnapshotBlockInput, ConstraintViolation> {
|
1387 1196 | self.build_enforcing_all_constraints()
|
1388 1197 | }
|
1389 1198 | fn build_enforcing_all_constraints(
|
1390 1199 | self,
|
1391 - | ) -> Result<crate::input::PutSnapshotBlockInput, ConstraintViolation> {
|
1392 - | Ok(crate::input::PutSnapshotBlockInput {
|
1200 + | ) -> Result<crate::input::GetSnapshotBlockInput, ConstraintViolation> {
|
1201 + | Ok(crate::input::GetSnapshotBlockInput {
|
1393 1202 | snapshot_id: self
|
1394 1203 | .snapshot_id
|
1395 1204 | .map(|v| match v {
|
1396 1205 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1397 1206 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1398 1207 | })
|
1399 1208 | .map(|res| res.map_err(ConstraintViolation::SnapshotId))
|
1400 1209 | .transpose()?
|
1401 1210 | .map(|v: crate::model::SnapshotId| v.into())
|
1402 1211 | .ok_or(ConstraintViolation::MissingSnapshotId)?,
|
1403 - | block_index: self
|
1404 - | .block_index
|
1405 - | .map(|v| match v {
|
1406 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1407 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1408 - | })
|
1409 - | .map(|res| res.map_err(ConstraintViolation::BlockIndex))
|
1410 - | .transpose()?
|
1411 - | .map(|v: crate::model::BlockIndex| v.into())
|
1412 - | .ok_or(ConstraintViolation::MissingBlockIndex)?,
|
1413 - | checksum: self
|
1414 - | .checksum
|
1415 - | .map(|v| match v {
|
1416 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1417 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1418 - | })
|
1419 - | .map(|res| res.map_err(ConstraintViolation::Checksum))
|
1420 - | .transpose()?
|
1421 - | .map(|v: crate::model::Checksum| v.into())
|
1422 - | .ok_or(ConstraintViolation::MissingChecksum)?,
|
1423 - | progress: self
|
1424 - | .progress
|
1212 + | block_token: self
|
1213 + | .block_token
|
1425 1214 | .map(|v| match v {
|
1426 1215 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1427 1216 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1428 1217 | })
|
1429 - | .map(|res| res.map_err(ConstraintViolation::Progress))
|
1218 + | .map(|res| res.map_err(ConstraintViolation::BlockToken))
|
1430 1219 | .transpose()?
|
1431 - | .map(|v: crate::model::Progress| v.into()),
|
1432 - | block_data: self
|
1433 - | .block_data
|
1434 - | .ok_or(ConstraintViolation::MissingBlockData)?,
|
1435 - | data_length: self
|
1436 - | .data_length
|
1437 - | .ok_or(ConstraintViolation::MissingDataLength)?,
|
1438 - | checksum_algorithm: self
|
1439 - | .checksum_algorithm
|
1220 + | .map(|v: crate::model::BlockToken| v.into())
|
1221 + | .ok_or(ConstraintViolation::MissingBlockToken)?,
|
1222 + | block_index: self
|
1223 + | .block_index
|
1440 1224 | .map(|v| match v {
|
1441 1225 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1442 1226 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1443 1227 | })
|
1444 - | .map(|res| res.map_err(ConstraintViolation::ChecksumAlgorithm))
|
1228 + | .map(|res| res.map_err(ConstraintViolation::BlockIndex))
|
1445 1229 | .transpose()?
|
1446 - | .ok_or(ConstraintViolation::MissingChecksumAlgorithm)?,
|
1230 + | .map(|v: crate::model::BlockIndex| v.into())
|
1231 + | .ok_or(ConstraintViolation::MissingBlockIndex)?,
|
1447 1232 | })
|
1448 1233 | }
|
1449 1234 | }
|
1450 - | impl ::std::fmt::Debug for Builder {
|
1451 - | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
1452 - | let mut formatter = f.debug_struct("Builder");
|
1453 - | formatter.field("snapshot_id", &self.snapshot_id);
|
1454 - | formatter.field("block_index", &self.block_index);
|
1455 - | formatter.field("checksum", &self.checksum);
|
1456 - | formatter.field("progress", &self.progress);
|
1457 - | formatter.field("block_data", &"*** Sensitive Data Redacted ***");
|
1458 - | formatter.field("data_length", &self.data_length);
|
1459 - | formatter.field("checksum_algorithm", &self.checksum_algorithm);
|
1460 - | formatter.finish()
|
1461 - | }
|
1462 - | }
|
1463 1235 | }
|
1464 - | /// See [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
1465 - | pub mod put_snapshot_block_input {
|
1236 + | /// See [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
1237 + | pub mod get_snapshot_block_input {
|
1466 1238 |
|
1467 1239 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1468 1240 | /// Holds one variant for each of the ways the builder can fail.
|
1469 1241 | #[allow(clippy::enum_variant_names)]
|
1470 1242 | pub enum ConstraintViolation {
|
1471 - | /// `snapshot_id` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1243 + | /// `snapshot_id` was not provided but it is required when building `GetSnapshotBlockInput`.
|
1472 1244 | MissingSnapshotId,
|
1473 - | /// `block_index` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1245 + | /// `block_token` was not provided but it is required when building `GetSnapshotBlockInput`.
|
1246 + | MissingBlockToken,
|
1247 + | /// `block_index` was not provided but it is required when building `GetSnapshotBlockInput`.
|
1474 1248 | MissingBlockIndex,
|
1475 - | /// `checksum` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1476 - | MissingChecksum,
|
1477 - | /// `block_data` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1478 - | MissingBlockData,
|
1479 - | /// `data_length` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1480 - | MissingDataLength,
|
1481 - | /// `checksum_algorithm` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1482 - | MissingChecksumAlgorithm,
|
1483 1249 | }
|
1484 1250 | impl ::std::fmt::Display for ConstraintViolation {
|
1485 1251 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1486 1252 | match self {
|
1487 - | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1488 - | ConstraintViolation::MissingBlockIndex => write!(f, "`block_index` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1489 - | ConstraintViolation::MissingChecksum => write!(f, "`checksum` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1490 - | ConstraintViolation::MissingBlockData => write!(f, "`block_data` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1491 - | ConstraintViolation::MissingDataLength => write!(f, "`data_length` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1492 - | ConstraintViolation::MissingChecksumAlgorithm => write!(f, "`checksum_algorithm` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1253 + | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `GetSnapshotBlockInput`"),
|
1254 + | ConstraintViolation::MissingBlockToken => write!(f, "`block_token` was not provided but it is required when building `GetSnapshotBlockInput`"),
|
1255 + | ConstraintViolation::MissingBlockIndex => write!(f, "`block_index` was not provided but it is required when building `GetSnapshotBlockInput`"),
|
1493 1256 | }
|
1494 1257 | }
|
1495 1258 | }
|
1496 1259 | impl ::std::error::Error for ConstraintViolation {}
|
1497 - | impl ::std::convert::TryFrom<Builder> for crate::input::PutSnapshotBlockInput {
|
1260 + | impl ::std::convert::TryFrom<Builder> for crate::input::GetSnapshotBlockInput {
|
1498 1261 | type Error = ConstraintViolation;
|
1499 1262 |
|
1500 1263 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1501 1264 | builder.build()
|
1502 1265 | }
|
1503 1266 | }
|
1504 - | /// A builder for [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
1505 - | #[derive(::std::clone::Clone, ::std::default::Default)]
|
1267 + | /// A builder for [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
1268 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1506 1269 | pub struct Builder {
|
1507 1270 | pub(crate) snapshot_id: ::std::option::Option<::std::string::String>,
|
1271 + | pub(crate) block_token: ::std::option::Option<::std::string::String>,
|
1508 1272 | pub(crate) block_index: ::std::option::Option<i32>,
|
1509 - | pub(crate) checksum: ::std::option::Option<::std::string::String>,
|
1510 - | pub(crate) progress: ::std::option::Option<i32>,
|
1511 - | pub(crate) block_data:
|
1512 - | ::std::option::Option<::aws_smithy_http_server_python::types::ByteStream>,
|
1513 - | pub(crate) data_length: ::std::option::Option<i32>,
|
1514 - | pub(crate) checksum_algorithm: ::std::option::Option<crate::model::ChecksumAlgorithm>,
|
1515 1273 | }
|
1516 1274 | impl Builder {
|
1517 - | /// <p>The ID of the snapshot.</p>
|
1275 + | /// <p>The ID of the snapshot containing the block from which to get data.</p>
|
1518 1276 | pub fn snapshot_id(mut self, input: ::std::string::String) -> Self {
|
1519 1277 | self.snapshot_id = Some(input);
|
1520 1278 | self
|
1521 1279 | }
|
1522 - | /// <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>
|
1523 - | pub fn block_index(mut self, input: i32) -> Self {
|
1524 - | self.block_index = Some(input);
|
1525 - | self
|
1526 - | }
|
1527 - | /// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
|
1528 - | pub fn checksum(mut self, input: ::std::string::String) -> Self {
|
1529 - | self.checksum = Some(input);
|
1530 - | self
|
1531 - | }
|
1532 - | /// <p>The progress of the write process, as a percentage.</p>
|
1533 - | pub fn progress(mut self, input: ::std::option::Option<i32>) -> Self {
|
1534 - | self.progress = input;
|
1535 - | self
|
1536 - | }
|
1537 - | /// <p>The data to write to the block.</p>
|
1538 - | /// <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>
|
1539 - | pub fn block_data(
|
1540 - | mut self,
|
1541 - | input: ::aws_smithy_http_server_python::types::ByteStream,
|
1542 - | ) -> Self {
|
1543 - | self.block_data = Some(input);
|
1544 - | self
|
1545 - | }
|
1546 - | /// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code>.</p>
|
1547 - | /// <p>Valid values: <code>524288</code></p>
|
1548 - | pub fn data_length(mut self, input: i32) -> Self {
|
1549 - | self.data_length = Some(input);
|
1280 + | /// <p>The block token of the block from which to get data.</p>
|
1281 + | /// <p>Obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
1282 + | pub fn block_token(mut self, input: ::std::string::String) -> Self {
|
1283 + | self.block_token = Some(input);
|
1550 1284 | self
|
1551 1285 | }
|
1552 - | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
1553 - | pub fn checksum_algorithm(mut self, input: crate::model::ChecksumAlgorithm) -> Self {
|
1554 - | self.checksum_algorithm = Some(input);
|
1286 + | /// <p>The block index of the block from which to get data.</p>
|
1287 + | /// <p>Obtain the <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
1288 + | pub fn block_index(mut self, input: i32) -> Self {
|
1289 + | self.block_index = Some(input);
|
1555 1290 | self
|
1556 1291 | }
|
1557 - | /// Consumes the builder and constructs a [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
1292 + | /// Consumes the builder and constructs a [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
1558 1293 | ///
|
1559 - | /// The builder fails to construct a [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput) if you do not provide a value for all non-`Option`al members.
|
1294 + | /// The builder fails to construct a [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput) if you do not provide a value for all non-`Option`al members.
|
1560 1295 | ///
|
1561 - | pub fn build(self) -> Result<crate::input::PutSnapshotBlockInput, ConstraintViolation> {
|
1296 + | pub fn build(self) -> Result<crate::input::GetSnapshotBlockInput, ConstraintViolation> {
|
1562 1297 | self.build_enforcing_required_and_enum_traits()
|
1563 1298 | }
|
1564 1299 | fn build_enforcing_required_and_enum_traits(
|
1565 1300 | self,
|
1566 - | ) -> Result<crate::input::PutSnapshotBlockInput, ConstraintViolation> {
|
1567 - | Ok(crate::input::PutSnapshotBlockInput {
|
1301 + | ) -> Result<crate::input::GetSnapshotBlockInput, ConstraintViolation> {
|
1302 + | Ok(crate::input::GetSnapshotBlockInput {
|
1568 1303 | snapshot_id: self
|
1569 1304 | .snapshot_id
|
1570 1305 | .ok_or(ConstraintViolation::MissingSnapshotId)?,
|
1306 + | block_token: self
|
1307 + | .block_token
|
1308 + | .ok_or(ConstraintViolation::MissingBlockToken)?,
|
1571 1309 | block_index: self
|
1572 1310 | .block_index
|
1573 1311 | .ok_or(ConstraintViolation::MissingBlockIndex)?,
|
1574 - | checksum: self.checksum.ok_or(ConstraintViolation::MissingChecksum)?,
|
1575 - | progress: self.progress,
|
1576 - | block_data: self
|
1577 - | .block_data
|
1578 - | .ok_or(ConstraintViolation::MissingBlockData)?,
|
1579 - | data_length: self
|
1580 - | .data_length
|
1581 - | .ok_or(ConstraintViolation::MissingDataLength)?,
|
1582 - | checksum_algorithm: self
|
1583 - | .checksum_algorithm
|
1584 - | .ok_or(ConstraintViolation::MissingChecksumAlgorithm)?,
|
1585 1312 | })
|
1586 1313 | }
|
1587 1314 | }
|
1588 1315 | }
|
1589 - | /// See [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
1590 - | pub(crate) mod list_snapshot_blocks_input_internal {
|
1316 + | /// See [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
1317 + | pub(crate) mod list_changed_blocks_input_internal {
|
1591 1318 |
|
1592 1319 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1593 1320 | /// Holds one variant for each of the ways the builder can fail.
|
1594 1321 | #[non_exhaustive]
|
1595 1322 | #[allow(clippy::enum_variant_names)]
|
1596 1323 | pub(crate) enum ConstraintViolation {
|
1597 - | /// Constraint violation occurred building member `max_results` when building `ListSnapshotBlocksInput`.
|
1324 + | /// `second_snapshot_id` was not provided but it is required when building `ListChangedBlocksInput`.
|
1325 + | MissingSecondSnapshotId,
|
1326 + | /// Constraint violation occurred building member `second_snapshot_id` when building `ListChangedBlocksInput`.
|
1598 1327 | #[doc(hidden)]
|
1599 - | MaxResults(crate::model::max_results_internal::ConstraintViolation),
|
1600 - | /// Constraint violation occurred building member `starting_block_index` when building `ListSnapshotBlocksInput`.
|
1328 + | SecondSnapshotId(crate::model::snapshot_id_internal::ConstraintViolation),
|
1329 + | /// Constraint violation occurred building member `first_snapshot_id` when building `ListChangedBlocksInput`.
|
1601 1330 | #[doc(hidden)]
|
1602 - | StartingBlockIndex(crate::model::block_index_internal::ConstraintViolation),
|
1603 - | /// Constraint violation occurred building member `next_token` when building `ListSnapshotBlocksInput`.
|
1331 + | FirstSnapshotId(crate::model::snapshot_id_internal::ConstraintViolation),
|
1332 + | /// Constraint violation occurred building member `next_token` when building `ListChangedBlocksInput`.
|
1604 1333 | #[doc(hidden)]
|
1605 1334 | NextToken(crate::model::page_token_internal::ConstraintViolation),
|
1606 - | /// `snapshot_id` was not provided but it is required when building `ListSnapshotBlocksInput`.
|
1607 - | MissingSnapshotId,
|
1608 - | /// Constraint violation occurred building member `snapshot_id` when building `ListSnapshotBlocksInput`.
|
1335 + | /// Constraint violation occurred building member `max_results` when building `ListChangedBlocksInput`.
|
1609 1336 | #[doc(hidden)]
|
1610 - | SnapshotId(crate::model::snapshot_id_internal::ConstraintViolation),
|
1337 + | MaxResults(crate::model::max_results_internal::ConstraintViolation),
|
1338 + | /// Constraint violation occurred building member `starting_block_index` when building `ListChangedBlocksInput`.
|
1339 + | #[doc(hidden)]
|
1340 + | StartingBlockIndex(crate::model::block_index_internal::ConstraintViolation),
|
1611 1341 | }
|
1612 1342 | impl ::std::fmt::Display for ConstraintViolation {
|
1613 1343 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1614 1344 | match self {
|
1615 - | ConstraintViolation::MaxResults(_) => write!(f, "constraint violation occurred building member `max_results` when building `ListSnapshotBlocksInput`"),
|
1616 - | ConstraintViolation::StartingBlockIndex(_) => write!(f, "constraint violation occurred building member `starting_block_index` when building `ListSnapshotBlocksInput`"),
|
1617 - | ConstraintViolation::NextToken(_) => write!(f, "constraint violation occurred building member `next_token` when building `ListSnapshotBlocksInput`"),
|
1618 - | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `ListSnapshotBlocksInput`"),
|
1619 - | ConstraintViolation::SnapshotId(_) => write!(f, "constraint violation occurred building member `snapshot_id` when building `ListSnapshotBlocksInput`"),
|
1345 + | ConstraintViolation::MissingSecondSnapshotId => write!(f, "`second_snapshot_id` was not provided but it is required when building `ListChangedBlocksInput`"),
|
1346 + | ConstraintViolation::SecondSnapshotId(_) => write!(f, "constraint violation occurred building member `second_snapshot_id` when building `ListChangedBlocksInput`"),
|
1347 + | ConstraintViolation::FirstSnapshotId(_) => write!(f, "constraint violation occurred building member `first_snapshot_id` when building `ListChangedBlocksInput`"),
|
1348 + | ConstraintViolation::NextToken(_) => write!(f, "constraint violation occurred building member `next_token` when building `ListChangedBlocksInput`"),
|
1349 + | ConstraintViolation::MaxResults(_) => write!(f, "constraint violation occurred building member `max_results` when building `ListChangedBlocksInput`"),
|
1350 + | ConstraintViolation::StartingBlockIndex(_) => write!(f, "constraint violation occurred building member `starting_block_index` when building `ListChangedBlocksInput`"),
|
1620 1351 | }
|
1621 1352 | }
|
1622 1353 | }
|
1623 1354 | impl ::std::error::Error for ConstraintViolation {}
|
1624 1355 | impl ConstraintViolation {
|
1625 1356 | pub(crate) fn as_validation_exception_field(
|
1626 1357 | self,
|
1627 1358 | path: ::std::string::String,
|
1628 1359 | ) -> crate::model::ValidationExceptionField {
|
1629 1360 | match self {
|
1361 + | ConstraintViolation::MissingSecondSnapshotId => crate::model::ValidationExceptionField {
|
1362 + | message: format!("Value at '{}/SecondSnapshotId' failed to satisfy constraint: Member must not be null", path),
|
1363 + | path: path + "/SecondSnapshotId",
|
1364 + | },
|
1365 + | ConstraintViolation::SecondSnapshotId(inner) => inner.as_validation_exception_field(path + "/SecondSnapshotId"),
|
1366 + | ConstraintViolation::FirstSnapshotId(inner) => inner.as_validation_exception_field(path + "/FirstSnapshotId"),
|
1367 + | ConstraintViolation::NextToken(inner) => inner.as_validation_exception_field(path + "/NextToken"),
|
1630 1368 | ConstraintViolation::MaxResults(inner) => inner.as_validation_exception_field(path + "/MaxResults"),
|
1631 1369 | ConstraintViolation::StartingBlockIndex(inner) => inner.as_validation_exception_field(path + "/StartingBlockIndex"),
|
1632 - | ConstraintViolation::NextToken(inner) => inner.as_validation_exception_field(path + "/NextToken"),
|
1633 - | ConstraintViolation::MissingSnapshotId => crate::model::ValidationExceptionField {
|
1634 - | message: format!("Value at '{}/SnapshotId' failed to satisfy constraint: Member must not be null", path),
|
1635 - | path: path + "/SnapshotId",
|
1636 - | },
|
1637 - | ConstraintViolation::SnapshotId(inner) => inner.as_validation_exception_field(path + "/SnapshotId"),
|
1638 1370 | }
|
1639 1371 | }
|
1640 1372 | }
|
1641 1373 | impl ::std::convert::From<ConstraintViolation>
|
1642 1374 | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
1643 1375 | {
|
1644 1376 | fn from(constraint_violation: ConstraintViolation) -> Self {
|
1645 1377 | let first_validation_exception_field =
|
1646 1378 | constraint_violation.as_validation_exception_field("".to_owned());
|
1647 1379 | let validation_exception = crate::error::ValidationException {
|
1648 1380 | message: format!(
|
1649 1381 | "1 validation error detected. {}",
|
1650 1382 | &first_validation_exception_field.message
|
1651 1383 | ),
|
1652 1384 | field_list: Some(vec![first_validation_exception_field]),
|
1653 1385 | };
|
1654 1386 | Self::ConstraintViolation(
|
1655 1387 | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
1656 1388 | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
1657 1389 | )
|
1658 1390 | }
|
1659 1391 | }
|
1660 1392 | impl ::std::convert::From<Builder>
|
1661 - | for crate::constrained::MaybeConstrained<crate::input::ListSnapshotBlocksInput>
|
1393 + | for crate::constrained::MaybeConstrained<crate::input::ListChangedBlocksInput>
|
1662 1394 | {
|
1663 1395 | fn from(builder: Builder) -> Self {
|
1664 1396 | Self::Unconstrained(builder)
|
1665 1397 | }
|
1666 1398 | }
|
1667 - | impl ::std::convert::TryFrom<Builder> for crate::input::ListSnapshotBlocksInput {
|
1399 + | impl ::std::convert::TryFrom<Builder> for crate::input::ListChangedBlocksInput {
|
1668 1400 | type Error = ConstraintViolation;
|
1669 1401 |
|
1670 1402 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1671 1403 | builder.build()
|
1672 1404 | }
|
1673 1405 | }
|
1674 - | /// A builder for [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
1406 + | /// A builder for [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
1675 1407 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1676 1408 | pub(crate) struct Builder {
|
1409 + | pub(crate) second_snapshot_id:
|
1410 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
1411 + | pub(crate) first_snapshot_id:
|
1412 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
1413 + | pub(crate) next_token:
|
1414 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::PageToken>>,
|
1677 1415 | pub(crate) max_results:
|
1678 1416 | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxResults>>,
|
1679 1417 | pub(crate) starting_block_index:
|
1680 1418 | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::BlockIndex>>,
|
1681 - | pub(crate) next_token:
|
1682 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::PageToken>>,
|
1683 - | pub(crate) snapshot_id:
|
1684 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
1685 1419 | }
|
1686 1420 | impl Builder {
|
1687 - | /// <p>The number of results to return.</p>
|
1688 - | pub(crate) fn set_max_results(
|
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(
|
1689 1425 | mut self,
|
1690 - | input: Option<
|
1691 - | impl ::std::convert::Into<
|
1692 - | crate::constrained::MaybeConstrained<crate::model::MaxResults>,
|
1693 - | >,
|
1426 + | input: impl ::std::convert::Into<
|
1427 + | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
1694 1428 | >,
|
1695 1429 | ) -> Self {
|
1696 - | self.max_results = input.map(|v| v.into());
|
1430 + | self.second_snapshot_id = Some(input.into());
|
1697 1431 | self
|
1698 1432 | }
|
1699 - | /// <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>
|
1700 - | pub(crate) fn set_starting_block_index(
|
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(crate) fn set_first_snapshot_id(
|
1701 1437 | mut self,
|
1702 1438 | input: Option<
|
1703 1439 | impl ::std::convert::Into<
|
1704 - | crate::constrained::MaybeConstrained<crate::model::BlockIndex>,
|
1440 + | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
1705 1441 | >,
|
1706 1442 | >,
|
1707 1443 | ) -> Self {
|
1708 - | self.starting_block_index = input.map(|v| v.into());
|
1444 + | self.first_snapshot_id = input.map(|v| v.into());
|
1709 1445 | self
|
1710 1446 | }
|
1711 1447 | /// <p>The token to request the next page of results.</p>
|
1712 1448 | pub(crate) fn set_next_token(
|
1713 1449 | mut self,
|
1714 1450 | input: Option<
|
1715 1451 | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::PageToken>>,
|
1716 1452 | >,
|
1717 1453 | ) -> Self {
|
1718 1454 | self.next_token = input.map(|v| v.into());
|
1719 1455 | self
|
1720 1456 | }
|
1721 - | /// <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
|
1722 - | pub(crate) fn set_snapshot_id(
|
1457 + | /// <p>The number of results to return.</p>
|
1458 + | pub(crate) fn set_max_results(
|
1723 1459 | mut self,
|
1724 - | input: impl ::std::convert::Into<
|
1725 - | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
1460 + | input: Option<
|
1461 + | impl ::std::convert::Into<
|
1462 + | crate::constrained::MaybeConstrained<crate::model::MaxResults>,
|
1463 + | >,
|
1726 1464 | >,
|
1727 1465 | ) -> Self {
|
1728 - | self.snapshot_id = Some(input.into());
|
1466 + | self.max_results = input.map(|v| v.into());
|
1729 1467 | self
|
1730 1468 | }
|
1731 - | /// Consumes the builder and constructs a [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
1469 + | /// <p>The block index from which the comparison should start.</p>
|
1470 + | /// <p>The list in the response will start from this block index or the next valid block index in the snapshots.</p>
|
1471 + | pub(crate) fn set_starting_block_index(
|
1472 + | mut self,
|
1473 + | input: Option<
|
1474 + | impl ::std::convert::Into<
|
1475 + | crate::constrained::MaybeConstrained<crate::model::BlockIndex>,
|
1476 + | >,
|
1477 + | >,
|
1478 + | ) -> Self {
|
1479 + | self.starting_block_index = input.map(|v| v.into());
|
1480 + | self
|
1481 + | }
|
1482 + | /// Consumes the builder and constructs a [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
1732 1483 | ///
|
1733 - | /// The builder fails to construct a [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput) if a [`ConstraintViolation`] occurs.
|
1484 + | /// The builder fails to construct a [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput) if a [`ConstraintViolation`] occurs.
|
1734 1485 | ///
|
1735 1486 | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
1736 - | pub fn build(self) -> Result<crate::input::ListSnapshotBlocksInput, ConstraintViolation> {
|
1487 + | pub fn build(self) -> Result<crate::input::ListChangedBlocksInput, ConstraintViolation> {
|
1737 1488 | self.build_enforcing_all_constraints()
|
1738 1489 | }
|
1739 1490 | fn build_enforcing_all_constraints(
|
1740 1491 | self,
|
1741 - | ) -> Result<crate::input::ListSnapshotBlocksInput, ConstraintViolation> {
|
1742 - | Ok(crate::input::ListSnapshotBlocksInput {
|
1743 - | max_results: self
|
1744 - | .max_results
|
1492 + | ) -> Result<crate::input::ListChangedBlocksInput, ConstraintViolation> {
|
1493 + | Ok(crate::input::ListChangedBlocksInput {
|
1494 + | second_snapshot_id: self
|
1495 + | .second_snapshot_id
|
1745 1496 | .map(|v| match v {
|
1746 1497 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1747 1498 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1748 1499 | })
|
1749 - | .map(|res| res.map_err(ConstraintViolation::MaxResults))
|
1500 + | .map(|res| res.map_err(ConstraintViolation::SecondSnapshotId))
|
1750 1501 | .transpose()?
|
1751 - | .map(|v: crate::model::MaxResults| v.into()),
|
1752 - | starting_block_index: self
|
1753 - | .starting_block_index
|
1502 + | .map(|v: crate::model::SnapshotId| v.into())
|
1503 + | .ok_or(ConstraintViolation::MissingSecondSnapshotId)?,
|
1504 + | first_snapshot_id: self
|
1505 + | .first_snapshot_id
|
1754 1506 | .map(|v| match v {
|
1755 1507 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1756 1508 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1757 1509 | })
|
1758 - | .map(|res| res.map_err(ConstraintViolation::StartingBlockIndex))
|
1510 + | .map(|res| res.map_err(ConstraintViolation::FirstSnapshotId))
|
1759 1511 | .transpose()?
|
1760 - | .map(|v: crate::model::BlockIndex| v.into()),
|
1512 + | .map(|v: crate::model::SnapshotId| v.into()),
|
1761 1513 | next_token: self
|
1762 1514 | .next_token
|
1763 1515 | .map(|v| match v {
|
1764 1516 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1765 1517 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1766 1518 | })
|
1767 1519 | .map(|res| res.map_err(ConstraintViolation::NextToken))
|
1768 1520 | .transpose()?
|
1769 1521 | .map(|v: crate::model::PageToken| v.into()),
|
1770 - | snapshot_id: self
|
1771 - | .snapshot_id
|
1522 + | max_results: self
|
1523 + | .max_results
|
1772 1524 | .map(|v| match v {
|
1773 1525 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1774 1526 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1775 1527 | })
|
1776 - | .map(|res| res.map_err(ConstraintViolation::SnapshotId))
|
1528 + | .map(|res| res.map_err(ConstraintViolation::MaxResults))
|
1777 1529 | .transpose()?
|
1778 - | .map(|v: crate::model::SnapshotId| v.into())
|
1779 - | .ok_or(ConstraintViolation::MissingSnapshotId)?,
|
1530 + | .map(|v: crate::model::MaxResults| v.into()),
|
1531 + | starting_block_index: self
|
1532 + | .starting_block_index
|
1533 + | .map(|v| match v {
|
1534 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1535 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1536 + | })
|
1537 + | .map(|res| res.map_err(ConstraintViolation::StartingBlockIndex))
|
1538 + | .transpose()?
|
1539 + | .map(|v: crate::model::BlockIndex| v.into()),
|
1780 1540 | })
|
1781 1541 | }
|
1782 1542 | }
|
1783 1543 | }
|
1784 - | /// See [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
1785 - | pub mod list_snapshot_blocks_input {
|
1544 + | /// See [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
1545 + | pub mod list_changed_blocks_input {
|
1786 1546 |
|
1787 1547 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1788 1548 | /// Holds one variant for each of the ways the builder can fail.
|
1789 1549 | #[allow(clippy::enum_variant_names)]
|
1790 1550 | pub enum ConstraintViolation {
|
1791 - | /// `snapshot_id` was not provided but it is required when building `ListSnapshotBlocksInput`.
|
1792 - | MissingSnapshotId,
|
1551 + | /// `second_snapshot_id` was not provided but it is required when building `ListChangedBlocksInput`.
|
1552 + | MissingSecondSnapshotId,
|
1793 1553 | }
|
1794 1554 | impl ::std::fmt::Display for ConstraintViolation {
|
1795 1555 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1796 1556 | match self {
|
1797 - | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `ListSnapshotBlocksInput`"),
|
1557 + | ConstraintViolation::MissingSecondSnapshotId => write!(f, "`second_snapshot_id` was not provided but it is required when building `ListChangedBlocksInput`"),
|
1798 1558 | }
|
1799 1559 | }
|
1800 1560 | }
|
1801 1561 | impl ::std::error::Error for ConstraintViolation {}
|
1802 - | impl ::std::convert::TryFrom<Builder> for crate::input::ListSnapshotBlocksInput {
|
1562 + | impl ::std::convert::TryFrom<Builder> for crate::input::ListChangedBlocksInput {
|
1803 1563 | type Error = ConstraintViolation;
|
1804 1564 |
|
1805 1565 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1806 1566 | builder.build()
|
1807 1567 | }
|
1808 1568 | }
|
1809 - | /// A builder for [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
1569 + | /// A builder for [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
1810 1570 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1811 1571 | pub struct Builder {
|
1572 + | pub(crate) second_snapshot_id: ::std::option::Option<::std::string::String>,
|
1573 + | pub(crate) first_snapshot_id: ::std::option::Option<::std::string::String>,
|
1574 + | pub(crate) next_token: ::std::option::Option<::std::string::String>,
|
1812 1575 | pub(crate) max_results: ::std::option::Option<i32>,
|
1813 1576 | pub(crate) starting_block_index: ::std::option::Option<i32>,
|
1814 - | pub(crate) next_token: ::std::option::Option<::std::string::String>,
|
1815 - | pub(crate) snapshot_id: ::std::option::Option<::std::string::String>,
|
1816 - | }
|
1817 - | impl Builder {
|
1818 - | /// <p>The number of results to return.</p>
|
1819 - | pub fn max_results(mut self, input: ::std::option::Option<i32>) -> Self {
|
1820 - | self.max_results = input;
|
1577 + | }
|
1578 + | impl Builder {
|
1579 + | /// <p>The ID of the second snapshot to use for the comparison.</p><important>
|
1580 + | /// <p>The <code>SecondSnapshotId</code> parameter must be specified with a <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
|
1581 + | /// </important>
|
1582 + | pub fn second_snapshot_id(mut self, input: ::std::string::String) -> Self {
|
1583 + | self.second_snapshot_id = Some(input);
|
1821 1584 | self
|
1822 1585 | }
|
1823 - | /// <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>
|
1824 - | pub fn starting_block_index(mut self, input: ::std::option::Option<i32>) -> Self {
|
1825 - | self.starting_block_index = input;
|
1586 + | /// <p>The ID of the first snapshot to use for the comparison.</p><important>
|
1587 + | /// <p>The <code>FirstSnapshotID</code> parameter must be specified with a <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
|
1588 + | /// </important>
|
1589 + | pub fn first_snapshot_id(
|
1590 + | mut self,
|
1591 + | input: ::std::option::Option<::std::string::String>,
|
1592 + | ) -> Self {
|
1593 + | self.first_snapshot_id = input;
|
1826 1594 | self
|
1827 1595 | }
|
1828 1596 | /// <p>The token to request the next page of results.</p>
|
1829 1597 | pub fn next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1830 1598 | self.next_token = input;
|
1831 1599 | self
|
1832 1600 | }
|
1833 - | /// <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
|
1834 - | pub fn snapshot_id(mut self, input: ::std::string::String) -> Self {
|
1835 - | self.snapshot_id = Some(input);
|
1601 + | /// <p>The number of results to return.</p>
|
1602 + | pub fn max_results(mut self, input: ::std::option::Option<i32>) -> Self {
|
1603 + | self.max_results = input;
|
1836 1604 | self
|
1837 1605 | }
|
1838 - | /// Consumes the builder and constructs a [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
1606 + | /// <p>The block index from which the comparison should start.</p>
|
1607 + | /// <p>The list in the response will start from this block index or the next valid block index in the snapshots.</p>
|
1608 + | pub fn starting_block_index(mut self, input: ::std::option::Option<i32>) -> Self {
|
1609 + | self.starting_block_index = input;
|
1610 + | self
|
1611 + | }
|
1612 + | /// Consumes the builder and constructs a [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
1839 1613 | ///
|
1840 - | /// The builder fails to construct a [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput) if you do not provide a value for all non-`Option`al members.
|
1614 + | /// The builder fails to construct a [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput) if you do not provide a value for all non-`Option`al members.
|
1841 1615 | ///
|
1842 - | pub fn build(self) -> Result<crate::input::ListSnapshotBlocksInput, ConstraintViolation> {
|
1616 + | pub fn build(self) -> Result<crate::input::ListChangedBlocksInput, ConstraintViolation> {
|
1843 1617 | self.build_enforcing_required_and_enum_traits()
|
1844 1618 | }
|
1845 1619 | fn build_enforcing_required_and_enum_traits(
|
1846 1620 | self,
|
1847 - | ) -> Result<crate::input::ListSnapshotBlocksInput, ConstraintViolation> {
|
1848 - | Ok(crate::input::ListSnapshotBlocksInput {
|
1621 + | ) -> Result<crate::input::ListChangedBlocksInput, ConstraintViolation> {
|
1622 + | Ok(crate::input::ListChangedBlocksInput {
|
1623 + | second_snapshot_id: self
|
1624 + | .second_snapshot_id
|
1625 + | .ok_or(ConstraintViolation::MissingSecondSnapshotId)?,
|
1626 + | first_snapshot_id: self.first_snapshot_id,
|
1627 + | next_token: self.next_token,
|
1849 1628 | max_results: self.max_results,
|
1850 1629 | starting_block_index: self.starting_block_index,
|
1851 - | next_token: self.next_token,
|
1852 - | snapshot_id: self
|
1853 - | .snapshot_id
|
1854 - | .ok_or(ConstraintViolation::MissingSnapshotId)?,
|
1855 1630 | })
|
1856 1631 | }
|
1857 1632 | }
|
1858 1633 | }
|
1859 - | /// See [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
1860 - | pub(crate) mod list_changed_blocks_input_internal {
|
1634 + | /// See [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
1635 + | pub(crate) mod list_snapshot_blocks_input_internal {
|
1861 1636 |
|
1862 1637 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1863 1638 | /// Holds one variant for each of the ways the builder can fail.
|
1864 1639 | #[non_exhaustive]
|
1865 1640 | #[allow(clippy::enum_variant_names)]
|
1866 1641 | pub(crate) enum ConstraintViolation {
|
1867 - | /// `second_snapshot_id` was not provided but it is required when building `ListChangedBlocksInput`.
|
1868 - | MissingSecondSnapshotId,
|
1869 - | /// Constraint violation occurred building member `second_snapshot_id` when building `ListChangedBlocksInput`.
|
1642 + | /// Constraint violation occurred building member `max_results` when building `ListSnapshotBlocksInput`.
|
1870 1643 | #[doc(hidden)]
|
1871 - | SecondSnapshotId(crate::model::snapshot_id_internal::ConstraintViolation),
|
1872 - | /// Constraint violation occurred building member `first_snapshot_id` when building `ListChangedBlocksInput`.
|
1644 + | MaxResults(crate::model::max_results_internal::ConstraintViolation),
|
1645 + | /// Constraint violation occurred building member `starting_block_index` when building `ListSnapshotBlocksInput`.
|
1873 1646 | #[doc(hidden)]
|
1874 - | FirstSnapshotId(crate::model::snapshot_id_internal::ConstraintViolation),
|
1875 - | /// Constraint violation occurred building member `next_token` when building `ListChangedBlocksInput`.
|
1647 + | StartingBlockIndex(crate::model::block_index_internal::ConstraintViolation),
|
1648 + | /// Constraint violation occurred building member `next_token` when building `ListSnapshotBlocksInput`.
|
1876 1649 | #[doc(hidden)]
|
1877 1650 | NextToken(crate::model::page_token_internal::ConstraintViolation),
|
1878 - | /// Constraint violation occurred building member `max_results` when building `ListChangedBlocksInput`.
|
1879 - | #[doc(hidden)]
|
1880 - | MaxResults(crate::model::max_results_internal::ConstraintViolation),
|
1881 - | /// Constraint violation occurred building member `starting_block_index` when building `ListChangedBlocksInput`.
|
1651 + | /// `snapshot_id` was not provided but it is required when building `ListSnapshotBlocksInput`.
|
1652 + | MissingSnapshotId,
|
1653 + | /// Constraint violation occurred building member `snapshot_id` when building `ListSnapshotBlocksInput`.
|
1882 1654 | #[doc(hidden)]
|
1883 - | StartingBlockIndex(crate::model::block_index_internal::ConstraintViolation),
|
1655 + | SnapshotId(crate::model::snapshot_id_internal::ConstraintViolation),
|
1884 1656 | }
|
1885 1657 | impl ::std::fmt::Display for ConstraintViolation {
|
1886 1658 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1887 1659 | match self {
|
1888 - | ConstraintViolation::MissingSecondSnapshotId => write!(f, "`second_snapshot_id` was not provided but it is required when building `ListChangedBlocksInput`"),
|
1889 - | ConstraintViolation::SecondSnapshotId(_) => write!(f, "constraint violation occurred building member `second_snapshot_id` when building `ListChangedBlocksInput`"),
|
1890 - | ConstraintViolation::FirstSnapshotId(_) => write!(f, "constraint violation occurred building member `first_snapshot_id` when building `ListChangedBlocksInput`"),
|
1891 - | ConstraintViolation::NextToken(_) => write!(f, "constraint violation occurred building member `next_token` when building `ListChangedBlocksInput`"),
|
1892 - | ConstraintViolation::MaxResults(_) => write!(f, "constraint violation occurred building member `max_results` when building `ListChangedBlocksInput`"),
|
1893 - | ConstraintViolation::StartingBlockIndex(_) => write!(f, "constraint violation occurred building member `starting_block_index` when building `ListChangedBlocksInput`"),
|
1660 + | ConstraintViolation::MaxResults(_) => write!(f, "constraint violation occurred building member `max_results` when building `ListSnapshotBlocksInput`"),
|
1661 + | ConstraintViolation::StartingBlockIndex(_) => write!(f, "constraint violation occurred building member `starting_block_index` when building `ListSnapshotBlocksInput`"),
|
1662 + | ConstraintViolation::NextToken(_) => write!(f, "constraint violation occurred building member `next_token` when building `ListSnapshotBlocksInput`"),
|
1663 + | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `ListSnapshotBlocksInput`"),
|
1664 + | ConstraintViolation::SnapshotId(_) => write!(f, "constraint violation occurred building member `snapshot_id` when building `ListSnapshotBlocksInput`"),
|
1894 1665 | }
|
1895 1666 | }
|
1896 1667 | }
|
1897 1668 | impl ::std::error::Error for ConstraintViolation {}
|
1898 1669 | impl ConstraintViolation {
|
1899 1670 | pub(crate) fn as_validation_exception_field(
|
1900 1671 | self,
|
1901 1672 | path: ::std::string::String,
|
1902 1673 | ) -> crate::model::ValidationExceptionField {
|
1903 1674 | match self {
|
1904 - | ConstraintViolation::MissingSecondSnapshotId => crate::model::ValidationExceptionField {
|
1905 - | message: format!("Value at '{}/SecondSnapshotId' failed to satisfy constraint: Member must not be null", path),
|
1906 - | path: path + "/SecondSnapshotId",
|
1907 - | },
|
1908 - | ConstraintViolation::SecondSnapshotId(inner) => inner.as_validation_exception_field(path + "/SecondSnapshotId"),
|
1909 - | ConstraintViolation::FirstSnapshotId(inner) => inner.as_validation_exception_field(path + "/FirstSnapshotId"),
|
1910 - | ConstraintViolation::NextToken(inner) => inner.as_validation_exception_field(path + "/NextToken"),
|
1911 1675 | ConstraintViolation::MaxResults(inner) => inner.as_validation_exception_field(path + "/MaxResults"),
|
1912 1676 | ConstraintViolation::StartingBlockIndex(inner) => inner.as_validation_exception_field(path + "/StartingBlockIndex"),
|
1677 + | ConstraintViolation::NextToken(inner) => inner.as_validation_exception_field(path + "/NextToken"),
|
1678 + | ConstraintViolation::MissingSnapshotId => crate::model::ValidationExceptionField {
|
1679 + | message: format!("Value at '{}/SnapshotId' failed to satisfy constraint: Member must not be null", path),
|
1680 + | path: path + "/SnapshotId",
|
1681 + | },
|
1682 + | ConstraintViolation::SnapshotId(inner) => inner.as_validation_exception_field(path + "/SnapshotId"),
|
1913 1683 | }
|
1914 1684 | }
|
1915 1685 | }
|
1916 1686 | impl ::std::convert::From<ConstraintViolation>
|
1917 1687 | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
1918 1688 | {
|
1919 1689 | fn from(constraint_violation: ConstraintViolation) -> Self {
|
1920 1690 | let first_validation_exception_field =
|
1921 1691 | constraint_violation.as_validation_exception_field("".to_owned());
|
1922 1692 | let validation_exception = crate::error::ValidationException {
|
1923 1693 | message: format!(
|
1924 1694 | "1 validation error detected. {}",
|
1925 1695 | &first_validation_exception_field.message
|
1926 1696 | ),
|
1927 1697 | field_list: Some(vec![first_validation_exception_field]),
|
1928 1698 | };
|
1929 1699 | Self::ConstraintViolation(
|
1930 1700 | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
1931 1701 | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
1932 1702 | )
|
1933 1703 | }
|
1934 1704 | }
|
1935 1705 | impl ::std::convert::From<Builder>
|
1936 - | for crate::constrained::MaybeConstrained<crate::input::ListChangedBlocksInput>
|
1706 + | for crate::constrained::MaybeConstrained<crate::input::ListSnapshotBlocksInput>
|
1937 1707 | {
|
1938 1708 | fn from(builder: Builder) -> Self {
|
1939 1709 | Self::Unconstrained(builder)
|
1940 1710 | }
|
1941 1711 | }
|
1942 - | impl ::std::convert::TryFrom<Builder> for crate::input::ListChangedBlocksInput {
|
1712 + | impl ::std::convert::TryFrom<Builder> for crate::input::ListSnapshotBlocksInput {
|
1943 1713 | type Error = ConstraintViolation;
|
1944 1714 |
|
1945 1715 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1946 1716 | builder.build()
|
1947 1717 | }
|
1948 1718 | }
|
1949 - | /// A builder for [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
1719 + | /// A builder for [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
1950 1720 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1951 1721 | pub(crate) struct Builder {
|
1952 - | pub(crate) second_snapshot_id:
|
1953 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
1954 - | pub(crate) first_snapshot_id:
|
1955 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
1956 - | pub(crate) next_token:
|
1957 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::PageToken>>,
|
1958 1722 | pub(crate) max_results:
|
1959 1723 | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxResults>>,
|
1960 1724 | pub(crate) starting_block_index:
|
1961 1725 | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::BlockIndex>>,
|
1726 + | pub(crate) next_token:
|
1727 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::PageToken>>,
|
1728 + | pub(crate) snapshot_id:
|
1729 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
1962 1730 | }
|
1963 1731 | impl Builder {
|
1964 - | /// <p>The ID of the second snapshot to use for the comparison.</p><important>
|
1965 - | /// <p>The <code>SecondSnapshotId</code> parameter must be specified with a <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
|
1966 - | /// </important>
|
1967 - | pub(crate) fn set_second_snapshot_id(
|
1732 + | /// <p>The number of results to return.</p>
|
1733 + | pub(crate) fn set_max_results(
|
1968 1734 | mut self,
|
1969 - | input: impl ::std::convert::Into<
|
1970 - | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
1735 + | input: Option<
|
1736 + | impl ::std::convert::Into<
|
1737 + | crate::constrained::MaybeConstrained<crate::model::MaxResults>,
|
1738 + | >,
|
1971 1739 | >,
|
1972 1740 | ) -> Self {
|
1973 - | self.second_snapshot_id = Some(input.into());
|
1741 + | self.max_results = input.map(|v| v.into());
|
1974 1742 | self
|
1975 1743 | }
|
1976 - | /// <p>The ID of the first snapshot to use for the comparison.</p><important>
|
1977 - | /// <p>The <code>FirstSnapshotID</code> parameter must be specified with a <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
|
1978 - | /// </important>
|
1979 - | pub(crate) fn set_first_snapshot_id(
|
1744 + | /// <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>
|
1745 + | pub(crate) fn set_starting_block_index(
|
1980 1746 | mut self,
|
1981 1747 | input: Option<
|
1982 1748 | impl ::std::convert::Into<
|
1983 - | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
1749 + | crate::constrained::MaybeConstrained<crate::model::BlockIndex>,
|
1984 1750 | >,
|
1985 1751 | >,
|
1986 1752 | ) -> Self {
|
1987 - | self.first_snapshot_id = input.map(|v| v.into());
|
1753 + | self.starting_block_index = input.map(|v| v.into());
|
1988 1754 | self
|
1989 1755 | }
|
1990 1756 | /// <p>The token to request the next page of results.</p>
|
1991 1757 | pub(crate) fn set_next_token(
|
1992 1758 | mut self,
|
1993 1759 | input: Option<
|
1994 1760 | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::PageToken>>,
|
1995 1761 | >,
|
1996 1762 | ) -> Self {
|
1997 1763 | self.next_token = input.map(|v| v.into());
|
1998 1764 | self
|
1999 1765 | }
|
2000 - | /// <p>The number of results to return.</p>
|
2001 - | pub(crate) fn set_max_results(
|
2002 - | mut self,
|
2003 - | input: Option<
|
2004 - | impl ::std::convert::Into<
|
2005 - | crate::constrained::MaybeConstrained<crate::model::MaxResults>,
|
2006 - | >,
|
2007 - | >,
|
2008 - | ) -> Self {
|
2009 - | self.max_results = input.map(|v| v.into());
|
2010 - | self
|
2011 - | }
|
2012 - | /// <p>The block index from which the comparison should start.</p>
|
2013 - | /// <p>The list in the response will start from this block index or the next valid block index in the snapshots.</p>
|
2014 - | pub(crate) fn set_starting_block_index(
|
1766 + | /// <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
|
1767 + | pub(crate) fn set_snapshot_id(
|
2015 1768 | mut self,
|
2016 - | input: Option<
|
2017 - | impl ::std::convert::Into<
|
2018 - | crate::constrained::MaybeConstrained<crate::model::BlockIndex>,
|
2019 - | >,
|
1769 + | input: impl ::std::convert::Into<
|
1770 + | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
2020 1771 | >,
|
2021 1772 | ) -> Self {
|
2022 - | self.starting_block_index = input.map(|v| v.into());
|
1773 + | self.snapshot_id = Some(input.into());
|
2023 1774 | self
|
2024 1775 | }
|
2025 - | /// Consumes the builder and constructs a [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
1776 + | /// Consumes the builder and constructs a [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
2026 1777 | ///
|
2027 - | /// The builder fails to construct a [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput) if a [`ConstraintViolation`] occurs.
|
1778 + | /// The builder fails to construct a [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput) if a [`ConstraintViolation`] occurs.
|
2028 1779 | ///
|
2029 1780 | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
2030 - | pub fn build(self) -> Result<crate::input::ListChangedBlocksInput, ConstraintViolation> {
|
1781 + | pub fn build(self) -> Result<crate::input::ListSnapshotBlocksInput, ConstraintViolation> {
|
2031 1782 | self.build_enforcing_all_constraints()
|
2032 1783 | }
|
2033 1784 | fn build_enforcing_all_constraints(
|
2034 1785 | self,
|
2035 - | ) -> Result<crate::input::ListChangedBlocksInput, ConstraintViolation> {
|
2036 - | Ok(crate::input::ListChangedBlocksInput {
|
2037 - | second_snapshot_id: self
|
2038 - | .second_snapshot_id
|
1786 + | ) -> Result<crate::input::ListSnapshotBlocksInput, ConstraintViolation> {
|
1787 + | Ok(crate::input::ListSnapshotBlocksInput {
|
1788 + | max_results: self
|
1789 + | .max_results
|
2039 1790 | .map(|v| match v {
|
2040 1791 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2041 1792 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2042 1793 | })
|
2043 - | .map(|res| res.map_err(ConstraintViolation::SecondSnapshotId))
|
1794 + | .map(|res| res.map_err(ConstraintViolation::MaxResults))
|
2044 1795 | .transpose()?
|
2045 - | .map(|v: crate::model::SnapshotId| v.into())
|
2046 - | .ok_or(ConstraintViolation::MissingSecondSnapshotId)?,
|
2047 - | first_snapshot_id: self
|
2048 - | .first_snapshot_id
|
1796 + | .map(|v: crate::model::MaxResults| v.into()),
|
1797 + | starting_block_index: self
|
1798 + | .starting_block_index
|
2049 1799 | .map(|v| match v {
|
2050 1800 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2051 1801 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2052 1802 | })
|
2053 - | .map(|res| res.map_err(ConstraintViolation::FirstSnapshotId))
|
1803 + | .map(|res| res.map_err(ConstraintViolation::StartingBlockIndex))
|
2054 1804 | .transpose()?
|
2055 - | .map(|v: crate::model::SnapshotId| v.into()),
|
1805 + | .map(|v: crate::model::BlockIndex| v.into()),
|
2056 1806 | next_token: self
|
2057 1807 | .next_token
|
2058 1808 | .map(|v| match v {
|
2059 1809 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2060 1810 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2061 1811 | })
|
2062 1812 | .map(|res| res.map_err(ConstraintViolation::NextToken))
|
2063 1813 | .transpose()?
|
2064 1814 | .map(|v: crate::model::PageToken| v.into()),
|
2065 - | max_results: self
|
2066 - | .max_results
|
2067 - | .map(|v| match v {
|
2068 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2069 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2070 - | })
|
2071 - | .map(|res| res.map_err(ConstraintViolation::MaxResults))
|
2072 - | .transpose()?
|
2073 - | .map(|v: crate::model::MaxResults| v.into()),
|
2074 - | starting_block_index: self
|
2075 - | .starting_block_index
|
1815 + | snapshot_id: self
|
1816 + | .snapshot_id
|
2076 1817 | .map(|v| match v {
|
2077 1818 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2078 1819 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2079 1820 | })
|
2080 - | .map(|res| res.map_err(ConstraintViolation::StartingBlockIndex))
|
1821 + | .map(|res| res.map_err(ConstraintViolation::SnapshotId))
|
2081 1822 | .transpose()?
|
2082 - | .map(|v: crate::model::BlockIndex| v.into()),
|
1823 + | .map(|v: crate::model::SnapshotId| v.into())
|
1824 + | .ok_or(ConstraintViolation::MissingSnapshotId)?,
|
2083 1825 | })
|
2084 1826 | }
|
2085 1827 | }
|
2086 1828 | }
|
2087 - | /// See [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
2088 - | pub mod list_changed_blocks_input {
|
1829 + | /// See [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
1830 + | pub mod list_snapshot_blocks_input {
|
2089 1831 |
|
2090 1832 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2091 1833 | /// Holds one variant for each of the ways the builder can fail.
|
2092 1834 | #[allow(clippy::enum_variant_names)]
|
2093 1835 | pub enum ConstraintViolation {
|
2094 - | /// `second_snapshot_id` was not provided but it is required when building `ListChangedBlocksInput`.
|
2095 - | MissingSecondSnapshotId,
|
1836 + | /// `snapshot_id` was not provided but it is required when building `ListSnapshotBlocksInput`.
|
1837 + | MissingSnapshotId,
|
2096 1838 | }
|
2097 1839 | impl ::std::fmt::Display for ConstraintViolation {
|
2098 1840 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2099 1841 | match self {
|
2100 - | ConstraintViolation::MissingSecondSnapshotId => write!(f, "`second_snapshot_id` was not provided but it is required when building `ListChangedBlocksInput`"),
|
1842 + | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `ListSnapshotBlocksInput`"),
|
2101 1843 | }
|
2102 1844 | }
|
2103 1845 | }
|
2104 1846 | impl ::std::error::Error for ConstraintViolation {}
|
2105 - | impl ::std::convert::TryFrom<Builder> for crate::input::ListChangedBlocksInput {
|
1847 + | impl ::std::convert::TryFrom<Builder> for crate::input::ListSnapshotBlocksInput {
|
2106 1848 | type Error = ConstraintViolation;
|
2107 1849 |
|
2108 1850 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
2109 1851 | builder.build()
|
2110 1852 | }
|
2111 1853 | }
|
2112 - | /// A builder for [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
1854 + | /// A builder for [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
2113 1855 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2114 1856 | pub struct Builder {
|
2115 - | pub(crate) second_snapshot_id: ::std::option::Option<::std::string::String>,
|
2116 - | pub(crate) first_snapshot_id: ::std::option::Option<::std::string::String>,
|
2117 - | pub(crate) next_token: ::std::option::Option<::std::string::String>,
|
2118 1857 | pub(crate) max_results: ::std::option::Option<i32>,
|
2119 1858 | pub(crate) starting_block_index: ::std::option::Option<i32>,
|
1859 + | pub(crate) next_token: ::std::option::Option<::std::string::String>,
|
1860 + | pub(crate) snapshot_id: ::std::option::Option<::std::string::String>,
|
2120 1861 | }
|
2121 1862 | impl Builder {
|
2122 - | /// <p>The ID of the second snapshot to use for the comparison.</p><important>
|
2123 - | /// <p>The <code>SecondSnapshotId</code> parameter must be specified with a <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
|
2124 - | /// </important>
|
2125 - | pub fn second_snapshot_id(mut self, input: ::std::string::String) -> Self {
|
2126 - | self.second_snapshot_id = Some(input);
|
1863 + | /// <p>The number of results to return.</p>
|
1864 + | pub fn max_results(mut self, input: ::std::option::Option<i32>) -> Self {
|
1865 + | self.max_results = input;
|
2127 1866 | self
|
2128 1867 | }
|
2129 - | /// <p>The ID of the first snapshot to use for the comparison.</p><important>
|
2130 - | /// <p>The <code>FirstSnapshotID</code> parameter must be specified with a <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
|
2131 - | /// </important>
|
2132 - | pub fn first_snapshot_id(
|
2133 - | mut self,
|
2134 - | input: ::std::option::Option<::std::string::String>,
|
2135 - | ) -> Self {
|
2136 - | self.first_snapshot_id = input;
|
1868 + | /// <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>
|
1869 + | pub fn starting_block_index(mut self, input: ::std::option::Option<i32>) -> Self {
|
1870 + | self.starting_block_index = input;
|
2137 1871 | self
|
2138 1872 | }
|
2139 1873 | /// <p>The token to request the next page of results.</p>
|
2140 1874 | pub fn next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
2141 1875 | self.next_token = input;
|
2142 1876 | self
|
2143 - | }
|
2144 - | /// <p>The number of results to return.</p>
|
2145 - | pub fn max_results(mut self, input: ::std::option::Option<i32>) -> Self {
|
2146 - | self.max_results = input;
|
2147 - | self
|
2148 - | }
|
2149 - | /// <p>The block index from which the comparison should start.</p>
|
2150 - | /// <p>The list in the response will start from this block index or the next valid block index in the snapshots.</p>
|
2151 - | pub fn starting_block_index(mut self, input: ::std::option::Option<i32>) -> Self {
|
2152 - | self.starting_block_index = input;
|
1877 + | }
|
1878 + | /// <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
|
1879 + | pub fn snapshot_id(mut self, input: ::std::string::String) -> Self {
|
1880 + | self.snapshot_id = Some(input);
|
2153 1881 | self
|
2154 1882 | }
|
2155 - | /// Consumes the builder and constructs a [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput).
|
1883 + | /// Consumes the builder and constructs a [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput).
|
2156 1884 | ///
|
2157 - | /// The builder fails to construct a [`ListChangedBlocksInput`](crate::input::ListChangedBlocksInput) if you do not provide a value for all non-`Option`al members.
|
1885 + | /// The builder fails to construct a [`ListSnapshotBlocksInput`](crate::input::ListSnapshotBlocksInput) if you do not provide a value for all non-`Option`al members.
|
2158 1886 | ///
|
2159 - | pub fn build(self) -> Result<crate::input::ListChangedBlocksInput, ConstraintViolation> {
|
1887 + | pub fn build(self) -> Result<crate::input::ListSnapshotBlocksInput, ConstraintViolation> {
|
2160 1888 | self.build_enforcing_required_and_enum_traits()
|
2161 1889 | }
|
2162 1890 | fn build_enforcing_required_and_enum_traits(
|
2163 1891 | self,
|
2164 - | ) -> Result<crate::input::ListChangedBlocksInput, ConstraintViolation> {
|
2165 - | Ok(crate::input::ListChangedBlocksInput {
|
2166 - | second_snapshot_id: self
|
2167 - | .second_snapshot_id
|
2168 - | .ok_or(ConstraintViolation::MissingSecondSnapshotId)?,
|
2169 - | first_snapshot_id: self.first_snapshot_id,
|
2170 - | next_token: self.next_token,
|
1892 + | ) -> Result<crate::input::ListSnapshotBlocksInput, ConstraintViolation> {
|
1893 + | Ok(crate::input::ListSnapshotBlocksInput {
|
2171 1894 | max_results: self.max_results,
|
2172 1895 | starting_block_index: self.starting_block_index,
|
1896 + | next_token: self.next_token,
|
1897 + | snapshot_id: self
|
1898 + | .snapshot_id
|
1899 + | .ok_or(ConstraintViolation::MissingSnapshotId)?,
|
2173 1900 | })
|
2174 1901 | }
|
2175 1902 | }
|
2176 1903 | }
|
2177 - | /// See [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
2178 - | pub(crate) mod get_snapshot_block_input_internal {
|
1904 + | /// See [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
1905 + | pub(crate) mod put_snapshot_block_input_internal {
|
2179 1906 |
|
2180 1907 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2181 1908 | /// Holds one variant for each of the ways the builder can fail.
|
2182 1909 | #[non_exhaustive]
|
2183 1910 | #[allow(clippy::enum_variant_names)]
|
2184 1911 | pub(crate) enum ConstraintViolation {
|
2185 - | /// `snapshot_id` was not provided but it is required when building `GetSnapshotBlockInput`.
|
1912 + | /// `snapshot_id` was not provided but it is required when building `PutSnapshotBlockInput`.
|
2186 1913 | MissingSnapshotId,
|
2187 - | /// Constraint violation occurred building member `snapshot_id` when building `GetSnapshotBlockInput`.
|
1914 + | /// Constraint violation occurred building member `snapshot_id` when building `PutSnapshotBlockInput`.
|
2188 1915 | #[doc(hidden)]
|
2189 1916 | SnapshotId(crate::model::snapshot_id_internal::ConstraintViolation),
|
2190 - | /// `block_token` was not provided but it is required when building `GetSnapshotBlockInput`.
|
2191 - | MissingBlockToken,
|
2192 - | /// Constraint violation occurred building member `block_token` when building `GetSnapshotBlockInput`.
|
2193 - | #[doc(hidden)]
|
2194 - | BlockToken(crate::model::block_token_internal::ConstraintViolation),
|
2195 - | /// `block_index` was not provided but it is required when building `GetSnapshotBlockInput`.
|
1917 + | /// `block_index` was not provided but it is required when building `PutSnapshotBlockInput`.
|
2196 1918 | MissingBlockIndex,
|
2197 - | /// Constraint violation occurred building member `block_index` when building `GetSnapshotBlockInput`.
|
1919 + | /// Constraint violation occurred building member `block_index` when building `PutSnapshotBlockInput`.
|
2198 1920 | #[doc(hidden)]
|
2199 1921 | BlockIndex(crate::model::block_index_internal::ConstraintViolation),
|
1922 + | /// `checksum` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1923 + | MissingChecksum,
|
1924 + | /// Constraint violation occurred building member `checksum` when building `PutSnapshotBlockInput`.
|
1925 + | #[doc(hidden)]
|
1926 + | Checksum(crate::model::checksum_internal::ConstraintViolation),
|
1927 + | /// Constraint violation occurred building member `progress` when building `PutSnapshotBlockInput`.
|
1928 + | #[doc(hidden)]
|
1929 + | Progress(crate::model::progress_internal::ConstraintViolation),
|
1930 + | /// `block_data` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1931 + | MissingBlockData,
|
1932 + | /// `data_length` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1933 + | MissingDataLength,
|
1934 + | /// `checksum_algorithm` was not provided but it is required when building `PutSnapshotBlockInput`.
|
1935 + | MissingChecksumAlgorithm,
|
1936 + | /// Constraint violation occurred building member `checksum_algorithm` when building `PutSnapshotBlockInput`.
|
1937 + | #[doc(hidden)]
|
1938 + | ChecksumAlgorithm(crate::model::checksum_algorithm_internal::ConstraintViolation),
|
2200 1939 | }
|
2201 1940 | impl ::std::fmt::Display for ConstraintViolation {
|
2202 1941 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2203 1942 | match self {
|
2204 - | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `GetSnapshotBlockInput`"),
|
2205 - | ConstraintViolation::SnapshotId(_) => write!(f, "constraint violation occurred building member `snapshot_id` when building `GetSnapshotBlockInput`"),
|
2206 - | ConstraintViolation::MissingBlockToken => write!(f, "`block_token` was not provided but it is required when building `GetSnapshotBlockInput`"),
|
2207 - | ConstraintViolation::BlockToken(_) => write!(f, "constraint violation occurred building member `block_token` when building `GetSnapshotBlockInput`"),
|
2208 - | ConstraintViolation::MissingBlockIndex => write!(f, "`block_index` was not provided but it is required when building `GetSnapshotBlockInput`"),
|
2209 - | ConstraintViolation::BlockIndex(_) => write!(f, "constraint violation occurred building member `block_index` when building `GetSnapshotBlockInput`"),
|
1943 + | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1944 + | ConstraintViolation::SnapshotId(_) => write!(f, "constraint violation occurred building member `snapshot_id` when building `PutSnapshotBlockInput`"),
|
1945 + | ConstraintViolation::MissingBlockIndex => write!(f, "`block_index` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1946 + | ConstraintViolation::BlockIndex(_) => write!(f, "constraint violation occurred building member `block_index` when building `PutSnapshotBlockInput`"),
|
1947 + | ConstraintViolation::MissingChecksum => write!(f, "`checksum` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1948 + | ConstraintViolation::Checksum(_) => write!(f, "constraint violation occurred building member `checksum` when building `PutSnapshotBlockInput`"),
|
1949 + | ConstraintViolation::Progress(_) => write!(f, "constraint violation occurred building member `progress` when building `PutSnapshotBlockInput`"),
|
1950 + | ConstraintViolation::MissingBlockData => write!(f, "`block_data` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1951 + | ConstraintViolation::MissingDataLength => write!(f, "`data_length` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1952 + | ConstraintViolation::MissingChecksumAlgorithm => write!(f, "`checksum_algorithm` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
1953 + | ConstraintViolation::ChecksumAlgorithm(_) => write!(f, "constraint violation occurred building member `checksum_algorithm` when building `PutSnapshotBlockInput`"),
|
2210 1954 | }
|
2211 1955 | }
|
2212 1956 | }
|
2213 1957 | impl ::std::error::Error for ConstraintViolation {}
|
2214 1958 | impl ConstraintViolation {
|
2215 1959 | pub(crate) fn as_validation_exception_field(
|
2216 1960 | self,
|
2217 1961 | path: ::std::string::String,
|
2218 1962 | ) -> crate::model::ValidationExceptionField {
|
2219 1963 | match self {
|
2220 1964 | ConstraintViolation::MissingSnapshotId => crate::model::ValidationExceptionField {
|
2221 1965 | message: format!("Value at '{}/SnapshotId' failed to satisfy constraint: Member must not be null", path),
|
2222 1966 | path: path + "/SnapshotId",
|
2223 1967 | },
|
2224 1968 | ConstraintViolation::SnapshotId(inner) => inner.as_validation_exception_field(path + "/SnapshotId"),
|
2225 - | ConstraintViolation::MissingBlockToken => crate::model::ValidationExceptionField {
|
2226 - | message: format!("Value at '{}/BlockToken' failed to satisfy constraint: Member must not be null", path),
|
2227 - | path: path + "/BlockToken",
|
2228 - | },
|
2229 - | ConstraintViolation::BlockToken(inner) => inner.as_validation_exception_field(path + "/BlockToken"),
|
2230 1969 | ConstraintViolation::MissingBlockIndex => crate::model::ValidationExceptionField {
|
2231 1970 | message: format!("Value at '{}/BlockIndex' failed to satisfy constraint: Member must not be null", path),
|
2232 1971 | path: path + "/BlockIndex",
|
2233 1972 | },
|
2234 1973 | ConstraintViolation::BlockIndex(inner) => inner.as_validation_exception_field(path + "/BlockIndex"),
|
1974 + | ConstraintViolation::MissingChecksum => crate::model::ValidationExceptionField {
|
1975 + | message: format!("Value at '{}/Checksum' failed to satisfy constraint: Member must not be null", path),
|
1976 + | path: path + "/Checksum",
|
1977 + | },
|
1978 + | ConstraintViolation::Checksum(inner) => inner.as_validation_exception_field(path + "/Checksum"),
|
1979 + | ConstraintViolation::Progress(inner) => inner.as_validation_exception_field(path + "/Progress"),
|
1980 + | ConstraintViolation::MissingBlockData => crate::model::ValidationExceptionField {
|
1981 + | message: format!("Value at '{}/BlockData' failed to satisfy constraint: Member must not be null", path),
|
1982 + | path: path + "/BlockData",
|
1983 + | },
|
1984 + | ConstraintViolation::MissingDataLength => crate::model::ValidationExceptionField {
|
1985 + | message: format!("Value at '{}/DataLength' failed to satisfy constraint: Member must not be null", path),
|
1986 + | path: path + "/DataLength",
|
1987 + | },
|
1988 + | ConstraintViolation::MissingChecksumAlgorithm => crate::model::ValidationExceptionField {
|
1989 + | message: format!("Value at '{}/ChecksumAlgorithm' failed to satisfy constraint: Member must not be null", path),
|
1990 + | path: path + "/ChecksumAlgorithm",
|
1991 + | },
|
1992 + | ConstraintViolation::ChecksumAlgorithm(inner) => inner.as_validation_exception_field(path + "/ChecksumAlgorithm"),
|
2235 1993 | }
|
2236 1994 | }
|
2237 1995 | }
|
2238 1996 | impl ::std::convert::From<ConstraintViolation>
|
2239 1997 | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
2240 1998 | {
|
2241 1999 | fn from(constraint_violation: ConstraintViolation) -> Self {
|
2242 2000 | let first_validation_exception_field =
|
2243 2001 | constraint_violation.as_validation_exception_field("".to_owned());
|
2244 2002 | let validation_exception = crate::error::ValidationException {
|
2245 2003 | message: format!(
|
2246 2004 | "1 validation error detected. {}",
|
2247 2005 | &first_validation_exception_field.message
|
2248 2006 | ),
|
2249 2007 | field_list: Some(vec![first_validation_exception_field]),
|
2250 2008 | };
|
2251 2009 | Self::ConstraintViolation(
|
2252 2010 | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
2253 2011 | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
2254 2012 | )
|
2255 2013 | }
|
2256 2014 | }
|
2257 2015 | impl ::std::convert::From<Builder>
|
2258 - | for crate::constrained::MaybeConstrained<crate::input::GetSnapshotBlockInput>
|
2016 + | for crate::constrained::MaybeConstrained<crate::input::PutSnapshotBlockInput>
|
2259 2017 | {
|
2260 2018 | fn from(builder: Builder) -> Self {
|
2261 2019 | Self::Unconstrained(builder)
|
2262 2020 | }
|
2263 2021 | }
|
2264 - | impl ::std::convert::TryFrom<Builder> for crate::input::GetSnapshotBlockInput {
|
2022 + | impl ::std::convert::TryFrom<Builder> for crate::input::PutSnapshotBlockInput {
|
2265 2023 | type Error = ConstraintViolation;
|
2266 2024 |
|
2267 2025 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
2268 2026 | builder.build()
|
2269 2027 | }
|
2270 2028 | }
|
2271 - | /// A builder for [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
2272 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2029 + | /// A builder for [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
2030 + | #[derive(::std::clone::Clone, ::std::default::Default)]
|
2273 2031 | pub(crate) struct Builder {
|
2274 2032 | pub(crate) snapshot_id:
|
2275 2033 | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
2276 - | pub(crate) block_token:
|
2277 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::BlockToken>>,
|
2278 2034 | pub(crate) block_index:
|
2279 2035 | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::BlockIndex>>,
|
2036 + | pub(crate) checksum:
|
2037 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Checksum>>,
|
2038 + | pub(crate) progress:
|
2039 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Progress>>,
|
2040 + | pub(crate) block_data:
|
2041 + | ::std::option::Option<::aws_smithy_http_server_python::types::ByteStream>,
|
2042 + | pub(crate) data_length: ::std::option::Option<i32>,
|
2043 + | pub(crate) checksum_algorithm: ::std::option::Option<
|
2044 + | crate::constrained::MaybeConstrained<crate::model::ChecksumAlgorithm>,
|
2045 + | >,
|
2280 2046 | }
|
2281 2047 | impl Builder {
|
2282 - | /// <p>The ID of the snapshot containing the block from which to get data.</p>
|
2048 + | /// <p>The ID of the snapshot.</p>
|
2283 2049 | pub(crate) fn set_snapshot_id(
|
2284 2050 | mut self,
|
2285 2051 | input: impl ::std::convert::Into<
|
2286 2052 | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
2287 2053 | >,
|
2288 2054 | ) -> Self {
|
2289 2055 | self.snapshot_id = Some(input.into());
|
2290 2056 | self
|
2291 2057 | }
|
2292 - | /// <p>The block token of the block from which to get data.</p>
|
2293 - | /// <p>Obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
2294 - | pub(crate) fn set_block_token(
|
2058 + | /// <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>
|
2059 + | pub(crate) fn set_block_index(
|
2295 2060 | mut self,
|
2296 2061 | input: impl ::std::convert::Into<
|
2297 - | crate::constrained::MaybeConstrained<crate::model::BlockToken>,
|
2062 + | crate::constrained::MaybeConstrained<crate::model::BlockIndex>,
|
2298 2063 | >,
|
2299 2064 | ) -> Self {
|
2300 - | self.block_token = Some(input.into());
|
2065 + | self.block_index = Some(input.into());
|
2301 2066 | self
|
2302 2067 | }
|
2303 - | /// <p>The block index of the block from which to get data.</p>
|
2304 - | /// <p>Obtain the <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
2305 - | pub(crate) fn set_block_index(
|
2068 + | /// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
|
2069 + | pub(crate) fn set_checksum(
|
2306 2070 | mut self,
|
2307 2071 | input: impl ::std::convert::Into<
|
2308 - | crate::constrained::MaybeConstrained<crate::model::BlockIndex>,
|
2072 + | crate::constrained::MaybeConstrained<crate::model::Checksum>,
|
2309 2073 | >,
|
2310 2074 | ) -> Self {
|
2311 - | self.block_index = Some(input.into());
|
2075 + | self.checksum = Some(input.into());
|
2312 2076 | self
|
2313 2077 | }
|
2314 - | /// Consumes the builder and constructs a [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
2078 + | /// <p>The progress of the write process, as a percentage.</p>
|
2079 + | pub(crate) fn set_progress(
|
2080 + | mut self,
|
2081 + | input: Option<
|
2082 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Progress>>,
|
2083 + | >,
|
2084 + | ) -> Self {
|
2085 + | self.progress = input.map(|v| v.into());
|
2086 + | self
|
2087 + | }
|
2088 + | /// <p>The data to write to the block.</p>
|
2089 + | /// <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>
|
2090 + | pub(crate) fn set_block_data(
|
2091 + | mut self,
|
2092 + | input: impl ::std::convert::Into<::aws_smithy_http_server_python::types::ByteStream>,
|
2093 + | ) -> Self {
|
2094 + | self.block_data = Some(input.into());
|
2095 + | self
|
2096 + | }
|
2097 + | /// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code>.</p>
|
2098 + | /// <p>Valid values: <code>524288</code></p>
|
2099 + | pub(crate) fn set_data_length(mut self, input: impl ::std::convert::Into<i32>) -> Self {
|
2100 + | self.data_length = Some(input.into());
|
2101 + | self
|
2102 + | }
|
2103 + | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
2104 + | pub(crate) fn set_checksum_algorithm(
|
2105 + | mut self,
|
2106 + | input: impl ::std::convert::Into<
|
2107 + | crate::constrained::MaybeConstrained<crate::model::ChecksumAlgorithm>,
|
2108 + | >,
|
2109 + | ) -> Self {
|
2110 + | self.checksum_algorithm = Some(input.into());
|
2111 + | self
|
2112 + | }
|
2113 + | /// Consumes the builder and constructs a [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
2315 2114 | ///
|
2316 - | /// The builder fails to construct a [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput) if a [`ConstraintViolation`] occurs.
|
2115 + | /// The builder fails to construct a [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput) if a [`ConstraintViolation`] occurs.
|
2317 2116 | ///
|
2318 2117 | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
2319 - | pub fn build(self) -> Result<crate::input::GetSnapshotBlockInput, ConstraintViolation> {
|
2118 + | pub fn build(self) -> Result<crate::input::PutSnapshotBlockInput, ConstraintViolation> {
|
2320 2119 | self.build_enforcing_all_constraints()
|
2321 2120 | }
|
2322 2121 | fn build_enforcing_all_constraints(
|
2323 2122 | self,
|
2324 - | ) -> Result<crate::input::GetSnapshotBlockInput, ConstraintViolation> {
|
2325 - | Ok(crate::input::GetSnapshotBlockInput {
|
2123 + | ) -> Result<crate::input::PutSnapshotBlockInput, ConstraintViolation> {
|
2124 + | Ok(crate::input::PutSnapshotBlockInput {
|
2326 2125 | snapshot_id: self
|
2327 2126 | .snapshot_id
|
2328 2127 | .map(|v| match v {
|
2329 2128 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2330 2129 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2331 2130 | })
|
2332 2131 | .map(|res| res.map_err(ConstraintViolation::SnapshotId))
|
2333 2132 | .transpose()?
|
2334 2133 | .map(|v: crate::model::SnapshotId| v.into())
|
2335 2134 | .ok_or(ConstraintViolation::MissingSnapshotId)?,
|
2336 - | block_token: self
|
2337 - | .block_token
|
2338 - | .map(|v| match v {
|
2339 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2340 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2341 - | })
|
2342 - | .map(|res| res.map_err(ConstraintViolation::BlockToken))
|
2343 - | .transpose()?
|
2344 - | .map(|v: crate::model::BlockToken| v.into())
|
2345 - | .ok_or(ConstraintViolation::MissingBlockToken)?,
|
2346 2135 | block_index: self
|
2347 2136 | .block_index
|
2348 2137 | .map(|v| match v {
|
2349 2138 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2350 2139 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2351 2140 | })
|
2352 2141 | .map(|res| res.map_err(ConstraintViolation::BlockIndex))
|
2353 2142 | .transpose()?
|
2354 2143 | .map(|v: crate::model::BlockIndex| v.into())
|
2355 2144 | .ok_or(ConstraintViolation::MissingBlockIndex)?,
|
2145 + | checksum: self
|
2146 + | .checksum
|
2147 + | .map(|v| match v {
|
2148 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2149 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2150 + | })
|
2151 + | .map(|res| res.map_err(ConstraintViolation::Checksum))
|
2152 + | .transpose()?
|
2153 + | .map(|v: crate::model::Checksum| v.into())
|
2154 + | .ok_or(ConstraintViolation::MissingChecksum)?,
|
2155 + | progress: self
|
2156 + | .progress
|
2157 + | .map(|v| match v {
|
2158 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2159 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2160 + | })
|
2161 + | .map(|res| res.map_err(ConstraintViolation::Progress))
|
2162 + | .transpose()?
|
2163 + | .map(|v: crate::model::Progress| v.into()),
|
2164 + | block_data: self
|
2165 + | .block_data
|
2166 + | .ok_or(ConstraintViolation::MissingBlockData)?,
|
2167 + | data_length: self
|
2168 + | .data_length
|
2169 + | .ok_or(ConstraintViolation::MissingDataLength)?,
|
2170 + | checksum_algorithm: self
|
2171 + | .checksum_algorithm
|
2172 + | .map(|v| match v {
|
2173 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2174 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2175 + | })
|
2176 + | .map(|res| res.map_err(ConstraintViolation::ChecksumAlgorithm))
|
2177 + | .transpose()?
|
2178 + | .ok_or(ConstraintViolation::MissingChecksumAlgorithm)?,
|
2356 2179 | })
|
2357 2180 | }
|
2358 2181 | }
|
2182 + | impl ::std::fmt::Debug for Builder {
|
2183 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
2184 + | let mut formatter = f.debug_struct("Builder");
|
2185 + | formatter.field("snapshot_id", &self.snapshot_id);
|
2186 + | formatter.field("block_index", &self.block_index);
|
2187 + | formatter.field("checksum", &self.checksum);
|
2188 + | formatter.field("progress", &self.progress);
|
2189 + | formatter.field("block_data", &"*** Sensitive Data Redacted ***");
|
2190 + | formatter.field("data_length", &self.data_length);
|
2191 + | formatter.field("checksum_algorithm", &self.checksum_algorithm);
|
2192 + | formatter.finish()
|
2193 + | }
|
2194 + | }
|
2359 2195 | }
|
2360 - | /// See [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
2361 - | pub mod get_snapshot_block_input {
|
2196 + | /// See [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
2197 + | pub mod put_snapshot_block_input {
|
2362 2198 |
|
2363 2199 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2364 2200 | /// Holds one variant for each of the ways the builder can fail.
|
2365 2201 | #[allow(clippy::enum_variant_names)]
|
2366 2202 | pub enum ConstraintViolation {
|
2367 - | /// `snapshot_id` was not provided but it is required when building `GetSnapshotBlockInput`.
|
2203 + | /// `snapshot_id` was not provided but it is required when building `PutSnapshotBlockInput`.
|
2368 2204 | MissingSnapshotId,
|
2369 - | /// `block_token` was not provided but it is required when building `GetSnapshotBlockInput`.
|
2370 - | MissingBlockToken,
|
2371 - | /// `block_index` was not provided but it is required when building `GetSnapshotBlockInput`.
|
2205 + | /// `block_index` was not provided but it is required when building `PutSnapshotBlockInput`.
|
2372 2206 | MissingBlockIndex,
|
2207 + | /// `checksum` was not provided but it is required when building `PutSnapshotBlockInput`.
|
2208 + | MissingChecksum,
|
2209 + | /// `block_data` was not provided but it is required when building `PutSnapshotBlockInput`.
|
2210 + | MissingBlockData,
|
2211 + | /// `data_length` was not provided but it is required when building `PutSnapshotBlockInput`.
|
2212 + | MissingDataLength,
|
2213 + | /// `checksum_algorithm` was not provided but it is required when building `PutSnapshotBlockInput`.
|
2214 + | MissingChecksumAlgorithm,
|
2373 2215 | }
|
2374 2216 | impl ::std::fmt::Display for ConstraintViolation {
|
2375 2217 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2376 2218 | match self {
|
2377 - | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `GetSnapshotBlockInput`"),
|
2378 - | ConstraintViolation::MissingBlockToken => write!(f, "`block_token` was not provided but it is required when building `GetSnapshotBlockInput`"),
|
2379 - | ConstraintViolation::MissingBlockIndex => write!(f, "`block_index` was not provided but it is required when building `GetSnapshotBlockInput`"),
|
2219 + | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
2220 + | ConstraintViolation::MissingBlockIndex => write!(f, "`block_index` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
2221 + | ConstraintViolation::MissingChecksum => write!(f, "`checksum` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
2222 + | ConstraintViolation::MissingBlockData => write!(f, "`block_data` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
2223 + | ConstraintViolation::MissingDataLength => write!(f, "`data_length` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
2224 + | ConstraintViolation::MissingChecksumAlgorithm => write!(f, "`checksum_algorithm` was not provided but it is required when building `PutSnapshotBlockInput`"),
|
2380 2225 | }
|
2381 2226 | }
|
2382 2227 | }
|
2383 2228 | impl ::std::error::Error for ConstraintViolation {}
|
2384 - | impl ::std::convert::TryFrom<Builder> for crate::input::GetSnapshotBlockInput {
|
2229 + | impl ::std::convert::TryFrom<Builder> for crate::input::PutSnapshotBlockInput {
|
2385 2230 | type Error = ConstraintViolation;
|
2386 2231 |
|
2387 2232 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
2388 2233 | builder.build()
|
2389 2234 | }
|
2390 2235 | }
|
2391 - | /// A builder for [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
2392 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2236 + | /// A builder for [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
2237 + | #[derive(::std::clone::Clone, ::std::default::Default)]
|
2393 2238 | pub struct Builder {
|
2394 2239 | pub(crate) snapshot_id: ::std::option::Option<::std::string::String>,
|
2395 - | pub(crate) block_token: ::std::option::Option<::std::string::String>,
|
2396 2240 | pub(crate) block_index: ::std::option::Option<i32>,
|
2241 + | pub(crate) checksum: ::std::option::Option<::std::string::String>,
|
2242 + | pub(crate) progress: ::std::option::Option<i32>,
|
2243 + | pub(crate) block_data:
|
2244 + | ::std::option::Option<::aws_smithy_http_server_python::types::ByteStream>,
|
2245 + | pub(crate) data_length: ::std::option::Option<i32>,
|
2246 + | pub(crate) checksum_algorithm: ::std::option::Option<crate::model::ChecksumAlgorithm>,
|
2397 2247 | }
|
2398 2248 | impl Builder {
|
2399 - | /// <p>The ID of the snapshot containing the block from which to get data.</p>
|
2249 + | /// <p>The ID of the snapshot.</p>
|
2400 2250 | pub fn snapshot_id(mut self, input: ::std::string::String) -> Self {
|
2401 2251 | self.snapshot_id = Some(input);
|
2402 2252 | self
|
2403 2253 | }
|
2404 - | /// <p>The block token of the block from which to get data.</p>
|
2405 - | /// <p>Obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
2406 - | pub fn block_token(mut self, input: ::std::string::String) -> Self {
|
2407 - | self.block_token = Some(input);
|
2408 - | self
|
2409 - | }
|
2410 - | /// <p>The block index of the block from which to get data.</p>
|
2411 - | /// <p>Obtain the <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
|
2254 + | /// <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>
|
2412 2255 | pub fn block_index(mut self, input: i32) -> Self {
|
2413 2256 | self.block_index = Some(input);
|
2414 2257 | self
|
2415 2258 | }
|
2416 - | /// Consumes the builder and constructs a [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput).
|
2259 + | /// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
|
2260 + | pub fn checksum(mut self, input: ::std::string::String) -> Self {
|
2261 + | self.checksum = Some(input);
|
2262 + | self
|
2263 + | }
|
2264 + | /// <p>The progress of the write process, as a percentage.</p>
|
2265 + | pub fn progress(mut self, input: ::std::option::Option<i32>) -> Self {
|
2266 + | self.progress = input;
|
2267 + | self
|
2268 + | }
|
2269 + | /// <p>The data to write to the block.</p>
|
2270 + | /// <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>
|
2271 + | pub fn block_data(
|
2272 + | mut self,
|
2273 + | input: ::aws_smithy_http_server_python::types::ByteStream,
|
2274 + | ) -> Self {
|
2275 + | self.block_data = Some(input);
|
2276 + | self
|
2277 + | }
|
2278 + | /// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code>.</p>
|
2279 + | /// <p>Valid values: <code>524288</code></p>
|
2280 + | pub fn data_length(mut self, input: i32) -> Self {
|
2281 + | self.data_length = Some(input);
|
2282 + | self
|
2283 + | }
|
2284 + | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
2285 + | pub fn checksum_algorithm(mut self, input: crate::model::ChecksumAlgorithm) -> Self {
|
2286 + | self.checksum_algorithm = Some(input);
|
2287 + | self
|
2288 + | }
|
2289 + | /// Consumes the builder and constructs a [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput).
|
2417 2290 | ///
|
2418 - | /// The builder fails to construct a [`GetSnapshotBlockInput`](crate::input::GetSnapshotBlockInput) if you do not provide a value for all non-`Option`al members.
|
2291 + | /// The builder fails to construct a [`PutSnapshotBlockInput`](crate::input::PutSnapshotBlockInput) if you do not provide a value for all non-`Option`al members.
|
2419 2292 | ///
|
2420 - | pub fn build(self) -> Result<crate::input::GetSnapshotBlockInput, ConstraintViolation> {
|
2293 + | pub fn build(self) -> Result<crate::input::PutSnapshotBlockInput, ConstraintViolation> {
|
2421 2294 | self.build_enforcing_required_and_enum_traits()
|
2422 2295 | }
|
2423 2296 | fn build_enforcing_required_and_enum_traits(
|
2424 2297 | self,
|
2425 - | ) -> Result<crate::input::GetSnapshotBlockInput, ConstraintViolation> {
|
2426 - | Ok(crate::input::GetSnapshotBlockInput {
|
2298 + | ) -> Result<crate::input::PutSnapshotBlockInput, ConstraintViolation> {
|
2299 + | Ok(crate::input::PutSnapshotBlockInput {
|
2427 2300 | snapshot_id: self
|
2428 2301 | .snapshot_id
|
2429 2302 | .ok_or(ConstraintViolation::MissingSnapshotId)?,
|
2430 - | block_token: self
|
2431 - | .block_token
|
2432 - | .ok_or(ConstraintViolation::MissingBlockToken)?,
|
2433 2303 | block_index: self
|
2434 2304 | .block_index
|
2435 2305 | .ok_or(ConstraintViolation::MissingBlockIndex)?,
|
2306 + | checksum: self.checksum.ok_or(ConstraintViolation::MissingChecksum)?,
|
2307 + | progress: self.progress,
|
2308 + | block_data: self
|
2309 + | .block_data
|
2310 + | .ok_or(ConstraintViolation::MissingBlockData)?,
|
2311 + | data_length: self
|
2312 + | .data_length
|
2313 + | .ok_or(ConstraintViolation::MissingDataLength)?,
|
2314 + | checksum_algorithm: self
|
2315 + | .checksum_algorithm
|
2316 + | .ok_or(ConstraintViolation::MissingChecksumAlgorithm)?,
|
2436 2317 | })
|
2437 2318 | }
|
2438 2319 | }
|
2439 2320 | }
|
2440 - | /// See [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
2441 - | pub(crate) mod complete_snapshot_input_internal {
|
2321 + | /// See [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
2322 + | pub(crate) mod start_snapshot_input_internal {
|
2442 2323 |
|
2443 2324 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2444 2325 | /// Holds one variant for each of the ways the builder can fail.
|
2445 2326 | #[non_exhaustive]
|
2446 2327 | #[allow(clippy::enum_variant_names)]
|
2447 2328 | pub(crate) enum ConstraintViolation {
|
2448 - | /// `changed_blocks_count` was not provided but it is required when building `CompleteSnapshotInput`.
|
2449 - | MissingChangedBlocksCount,
|
2450 - | /// Constraint violation occurred building member `changed_blocks_count` when building `CompleteSnapshotInput`.
|
2329 + | /// Constraint violation occurred building member `timeout` when building `StartSnapshotInput`.
|
2451 2330 | #[doc(hidden)]
|
2452 - | ChangedBlocksCount(crate::model::changed_blocks_count_internal::ConstraintViolation),
|
2453 - | /// Constraint violation occurred building member `checksum_aggregation_method` when building `CompleteSnapshotInput`.
|
2331 + | Timeout(crate::model::timeout_internal::ConstraintViolation),
|
2332 + | /// Constraint violation occurred building member `client_token` when building `StartSnapshotInput`.
|
2454 2333 | #[doc(hidden)]
|
2455 - | ChecksumAggregationMethod(
|
2456 - | crate::model::checksum_aggregation_method_internal::ConstraintViolation,
|
2457 - | ),
|
2458 - | /// Constraint violation occurred building member `checksum_algorithm` when building `CompleteSnapshotInput`.
|
2334 + | ClientToken(crate::model::idempotency_token_internal::ConstraintViolation),
|
2335 + | /// `volume_size` was not provided but it is required when building `StartSnapshotInput`.
|
2336 + | MissingVolumeSize,
|
2337 + | /// Constraint violation occurred building member `volume_size` when building `StartSnapshotInput`.
|
2459 2338 | #[doc(hidden)]
|
2460 - | ChecksumAlgorithm(crate::model::checksum_algorithm_internal::ConstraintViolation),
|
2461 - | /// `snapshot_id` was not provided but it is required when building `CompleteSnapshotInput`.
|
2462 - | MissingSnapshotId,
|
2463 - | /// Constraint violation occurred building member `snapshot_id` when building `CompleteSnapshotInput`.
|
2339 + | VolumeSize(crate::model::volume_size_internal::ConstraintViolation),
|
2340 + | /// Constraint violation occurred building member `tags` when building `StartSnapshotInput`.
|
2464 2341 | #[doc(hidden)]
|
2465 - | SnapshotId(crate::model::snapshot_id_internal::ConstraintViolation),
|
2466 - | /// Constraint violation occurred building member `checksum` when building `CompleteSnapshotInput`.
|
2342 + | Tags(crate::model::tags_internal::ConstraintViolation),
|
2343 + | /// Constraint violation occurred building member `kms_key_arn` when building `StartSnapshotInput`.
|
2467 2344 | #[doc(hidden)]
|
2468 - | Checksum(crate::model::checksum_internal::ConstraintViolation),
|
2345 + | KmsKeyArn(crate::model::kms_key_arn_internal::ConstraintViolation),
|
2346 + | /// Constraint violation occurred building member `parent_snapshot_id` when building `StartSnapshotInput`.
|
2347 + | #[doc(hidden)]
|
2348 + | ParentSnapshotId(crate::model::snapshot_id_internal::ConstraintViolation),
|
2349 + | /// Constraint violation occurred building member `description` when building `StartSnapshotInput`.
|
2350 + | #[doc(hidden)]
|
2351 + | Description(crate::model::description_internal::ConstraintViolation),
|
2469 2352 | }
|
2470 2353 | impl ::std::fmt::Display for ConstraintViolation {
|
2471 2354 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2472 2355 | match self {
|
2473 - | ConstraintViolation::MissingChangedBlocksCount => write!(f, "`changed_blocks_count` was not provided but it is required when building `CompleteSnapshotInput`"),
|
2474 - | ConstraintViolation::ChangedBlocksCount(_) => write!(f, "constraint violation occurred building member `changed_blocks_count` when building `CompleteSnapshotInput`"),
|
2475 - | ConstraintViolation::ChecksumAggregationMethod(_) => write!(f, "constraint violation occurred building member `checksum_aggregation_method` when building `CompleteSnapshotInput`"),
|
2476 - | ConstraintViolation::ChecksumAlgorithm(_) => write!(f, "constraint violation occurred building member `checksum_algorithm` when building `CompleteSnapshotInput`"),
|
2477 - | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `CompleteSnapshotInput`"),
|
2478 - | ConstraintViolation::SnapshotId(_) => write!(f, "constraint violation occurred building member `snapshot_id` when building `CompleteSnapshotInput`"),
|
2479 - | ConstraintViolation::Checksum(_) => write!(f, "constraint violation occurred building member `checksum` when building `CompleteSnapshotInput`"),
|
2356 + | ConstraintViolation::Timeout(_) => write!(f, "constraint violation occurred building member `timeout` when building `StartSnapshotInput`"),
|
2357 + | ConstraintViolation::ClientToken(_) => write!(f, "constraint violation occurred building member `client_token` when building `StartSnapshotInput`"),
|
2358 + | ConstraintViolation::MissingVolumeSize => write!(f, "`volume_size` was not provided but it is required when building `StartSnapshotInput`"),
|
2359 + | ConstraintViolation::VolumeSize(_) => write!(f, "constraint violation occurred building member `volume_size` when building `StartSnapshotInput`"),
|
2360 + | ConstraintViolation::Tags(_) => write!(f, "constraint violation occurred building member `tags` when building `StartSnapshotInput`"),
|
2361 + | ConstraintViolation::KmsKeyArn(_) => write!(f, "constraint violation occurred building member `kms_key_arn` when building `StartSnapshotInput`"),
|
2362 + | ConstraintViolation::ParentSnapshotId(_) => write!(f, "constraint violation occurred building member `parent_snapshot_id` when building `StartSnapshotInput`"),
|
2363 + | ConstraintViolation::Description(_) => write!(f, "constraint violation occurred building member `description` when building `StartSnapshotInput`"),
|
2480 2364 | }
|
2481 2365 | }
|
2482 2366 | }
|
2483 2367 | impl ::std::error::Error for ConstraintViolation {}
|
2484 2368 | impl ConstraintViolation {
|
2485 2369 | pub(crate) fn as_validation_exception_field(
|
2486 2370 | self,
|
2487 2371 | path: ::std::string::String,
|
2488 2372 | ) -> crate::model::ValidationExceptionField {
|
2489 2373 | match self {
|
2490 - | ConstraintViolation::MissingChangedBlocksCount => crate::model::ValidationExceptionField {
|
2491 - | message: format!("Value at '{}/ChangedBlocksCount' failed to satisfy constraint: Member must not be null", path),
|
2492 - | path: path + "/ChangedBlocksCount",
|
2493 - | },
|
2494 - | ConstraintViolation::ChangedBlocksCount(inner) => inner.as_validation_exception_field(path + "/ChangedBlocksCount"),
|
2495 - | ConstraintViolation::ChecksumAggregationMethod(inner) => inner.as_validation_exception_field(path + "/ChecksumAggregationMethod"),
|
2496 - | ConstraintViolation::ChecksumAlgorithm(inner) => inner.as_validation_exception_field(path + "/ChecksumAlgorithm"),
|
2497 - | ConstraintViolation::MissingSnapshotId => crate::model::ValidationExceptionField {
|
2498 - | message: format!("Value at '{}/SnapshotId' failed to satisfy constraint: Member must not be null", path),
|
2499 - | path: path + "/SnapshotId",
|
2374 + | ConstraintViolation::Timeout(inner) => inner.as_validation_exception_field(path + "/Timeout"),
|
2375 + | ConstraintViolation::ClientToken(inner) => inner.as_validation_exception_field(path + "/ClientToken"),
|
2376 + | ConstraintViolation::MissingVolumeSize => crate::model::ValidationExceptionField {
|
2377 + | message: format!("Value at '{}/VolumeSize' failed to satisfy constraint: Member must not be null", path),
|
2378 + | path: path + "/VolumeSize",
|
2500 2379 | },
|
2501 - | ConstraintViolation::SnapshotId(inner) => inner.as_validation_exception_field(path + "/SnapshotId"),
|
2502 - | ConstraintViolation::Checksum(inner) => inner.as_validation_exception_field(path + "/Checksum"),
|
2380 + | ConstraintViolation::VolumeSize(inner) => inner.as_validation_exception_field(path + "/VolumeSize"),
|
2381 + | ConstraintViolation::Tags(inner) => inner.as_validation_exception_field(path + "/Tags"),
|
2382 + | ConstraintViolation::KmsKeyArn(inner) => inner.as_validation_exception_field(path + "/KmsKeyArn"),
|
2383 + | ConstraintViolation::ParentSnapshotId(inner) => inner.as_validation_exception_field(path + "/ParentSnapshotId"),
|
2384 + | ConstraintViolation::Description(inner) => inner.as_validation_exception_field(path + "/Description"),
|
2503 2385 | }
|
2504 2386 | }
|
2505 2387 | }
|
2506 2388 | impl ::std::convert::From<ConstraintViolation>
|
2507 2389 | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
2508 2390 | {
|
2509 2391 | fn from(constraint_violation: ConstraintViolation) -> Self {
|
2510 2392 | let first_validation_exception_field =
|
2511 2393 | constraint_violation.as_validation_exception_field("".to_owned());
|
2512 2394 | let validation_exception = crate::error::ValidationException {
|
2513 2395 | message: format!(
|
2514 2396 | "1 validation error detected. {}",
|
2515 2397 | &first_validation_exception_field.message
|
2516 2398 | ),
|
2517 2399 | field_list: Some(vec![first_validation_exception_field]),
|
2518 2400 | };
|
2519 2401 | Self::ConstraintViolation(
|
2520 2402 | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
2521 2403 | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
2522 2404 | )
|
2523 2405 | }
|
2524 2406 | }
|
2525 2407 | impl ::std::convert::From<Builder>
|
2526 - | for crate::constrained::MaybeConstrained<crate::input::CompleteSnapshotInput>
|
2408 + | for crate::constrained::MaybeConstrained<crate::input::StartSnapshotInput>
|
2527 2409 | {
|
2528 2410 | fn from(builder: Builder) -> Self {
|
2529 2411 | Self::Unconstrained(builder)
|
2530 2412 | }
|
2531 2413 | }
|
2532 - | impl ::std::convert::TryFrom<Builder> for crate::input::CompleteSnapshotInput {
|
2414 + | impl ::std::convert::TryFrom<Builder> for crate::input::StartSnapshotInput {
|
2533 2415 | type Error = ConstraintViolation;
|
2534 2416 |
|
2535 2417 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
2536 2418 | builder.build()
|
2537 2419 | }
|
2538 2420 | }
|
2539 - | /// A builder for [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
2540 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2421 + | /// A builder for [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
2422 + | #[derive(::std::clone::Clone, ::std::default::Default)]
|
2541 2423 | pub(crate) struct Builder {
|
2542 - | pub(crate) changed_blocks_count: ::std::option::Option<
|
2543 - | crate::constrained::MaybeConstrained<crate::model::ChangedBlocksCount>,
|
2544 - | >,
|
2545 - | pub(crate) checksum_aggregation_method: ::std::option::Option<
|
2546 - | crate::constrained::MaybeConstrained<crate::model::ChecksumAggregationMethod>,
|
2424 + | pub(crate) timeout:
|
2425 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Timeout>>,
|
2426 + | pub(crate) client_token: ::std::option::Option<
|
2427 + | crate::constrained::MaybeConstrained<crate::model::IdempotencyToken>,
|
2547 2428 | >,
|
2548 - | pub(crate) checksum_algorithm: ::std::option::Option<
|
2549 - | crate::constrained::MaybeConstrained<crate::model::ChecksumAlgorithm>,
|
2429 + | pub(crate) volume_size:
|
2430 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::VolumeSize>>,
|
2431 + | pub(crate) tags: ::std::option::Option<
|
2432 + | crate::constrained::MaybeConstrained<
|
2433 + | crate::constrained::tags_constrained::TagsConstrained,
|
2434 + | >,
|
2550 2435 | >,
|
2551 - | pub(crate) snapshot_id:
|
2436 + | pub(crate) encrypted: ::std::option::Option<bool>,
|
2437 + | pub(crate) kms_key_arn:
|
2438 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::KmsKeyArn>>,
|
2439 + | pub(crate) parent_snapshot_id:
|
2552 2440 | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SnapshotId>>,
|
2553 - | pub(crate) checksum:
|
2554 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Checksum>>,
|
2441 + | pub(crate) description:
|
2442 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Description>>,
|
2555 2443 | }
|
2556 2444 | impl Builder {
|
2557 - | /// <p>The number of blocks that were written to the snapshot.</p>
|
2558 - | pub(crate) fn set_changed_blocks_count(
|
2445 + | /// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
|
2446 + | /// <ul>
|
2447 + | /// <li>
|
2448 + | /// <p>No blocks are written to the snapshot.</p></li>
|
2449 + | /// <li>
|
2450 + | /// <p>The snapshot is not completed after writing the last block of data.</p></li>
|
2451 + | /// </ul>
|
2452 + | /// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
|
2453 + | pub(crate) fn set_timeout(
|
2454 + | mut self,
|
2455 + | input: Option<
|
2456 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Timeout>>,
|
2457 + | >,
|
2458 + | ) -> Self {
|
2459 + | self.timeout = input.map(|v| v.into());
|
2460 + | self
|
2461 + | }
|
2462 + | /// <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>
|
2463 + | /// <p>If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
|
2464 + | /// <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>
|
2465 + | pub(crate) fn set_client_token(
|
2466 + | mut self,
|
2467 + | input: Option<
|
2468 + | impl ::std::convert::Into<
|
2469 + | crate::constrained::MaybeConstrained<crate::model::IdempotencyToken>,
|
2470 + | >,
|
2471 + | >,
|
2472 + | ) -> Self {
|
2473 + | self.client_token = input.map(|v| v.into());
|
2474 + | self
|
2475 + | }
|
2476 + | /// <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
|
2477 + | pub(crate) fn set_volume_size(
|
2559 2478 | mut self,
|
2560 2479 | input: impl ::std::convert::Into<
|
2561 - | crate::constrained::MaybeConstrained<crate::model::ChangedBlocksCount>,
|
2480 + | crate::constrained::MaybeConstrained<crate::model::VolumeSize>,
|
2562 2481 | >,
|
2563 2482 | ) -> Self {
|
2564 - | self.changed_blocks_count = Some(input.into());
|
2483 + | self.volume_size = Some(input.into());
|
2565 2484 | self
|
2566 2485 | }
|
2567 - | /// <p>The aggregation method used to generate the checksum. Currently, the only supported aggregation method is <code>LINEAR</code>.</p>
|
2568 - | pub(crate) fn set_checksum_aggregation_method(
|
2486 + | /// <p>The tags to apply to the snapshot.</p>
|
2487 + | pub(crate) fn set_tags(
|
2569 2488 | mut self,
|
2570 2489 | input: Option<
|
2571 2490 | impl ::std::convert::Into<
|
2572 - | crate::constrained::MaybeConstrained<crate::model::ChecksumAggregationMethod>,
|
2491 + | crate::constrained::MaybeConstrained<
|
2492 + | crate::constrained::tags_constrained::TagsConstrained,
|
2493 + | >,
|
2573 2494 | >,
|
2574 2495 | >,
|
2575 2496 | ) -> Self {
|
2576 - | self.checksum_aggregation_method = input.map(|v| v.into());
|
2497 + | self.tags = input.map(|v| v.into());
|
2498 + | self
|
2499 + | }
|
2500 + | /// <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>
|
2501 + | /// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
|
2502 + | /// <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>
|
2503 + | /// <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>
|
2504 + | /// <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>
|
2505 + | pub(crate) fn set_encrypted(
|
2506 + | mut self,
|
2507 + | input: Option<impl ::std::convert::Into<bool>>,
|
2508 + | ) -> Self {
|
2509 + | self.encrypted = input.map(|v| v.into());
|
2577 2510 | self
|
2578 2511 | }
|
2579 - | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
2580 - | pub(crate) fn set_checksum_algorithm(
|
2512 + | /// <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>
|
2513 + | /// <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>
|
2514 + | /// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN.</p>
|
2515 + | pub(crate) fn set_kms_key_arn(
|
2581 2516 | mut self,
|
2582 2517 | input: Option<
|
2583 - | impl ::std::convert::Into<
|
2584 - | crate::constrained::MaybeConstrained<crate::model::ChecksumAlgorithm>,
|
2585 - | >,
|
2518 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::KmsKeyArn>>,
|
2586 2519 | >,
|
2587 2520 | ) -> Self {
|
2588 - | self.checksum_algorithm = input.map(|v| v.into());
|
2521 + | self.kms_key_arn = input.map(|v| v.into());
|
2589 2522 | self
|
2590 2523 | }
|
2591 - | /// <p>The ID of the snapshot.</p>
|
2592 - | pub(crate) fn set_snapshot_id(
|
2524 + | /// <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>
|
2525 + | /// <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>
|
2526 + | pub(crate) fn set_parent_snapshot_id(
|
2593 2527 | mut self,
|
2594 - | input: impl ::std::convert::Into<
|
2595 - | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
2528 + | input: Option<
|
2529 + | impl ::std::convert::Into<
|
2530 + | crate::constrained::MaybeConstrained<crate::model::SnapshotId>,
|
2531 + | >,
|
2596 2532 | >,
|
2597 2533 | ) -> Self {
|
2598 - | self.snapshot_id = Some(input.into());
|
2534 + | self.parent_snapshot_id = input.map(|v| v.into());
|
2599 2535 | self
|
2600 2536 | }
|
2601 - | /// <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written block.</p>
|
2602 - | /// <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>
|
2603 - | pub(crate) fn set_checksum(
|
2537 + | /// <p>A description for the snapshot.</p>
|
2538 + | pub(crate) fn set_description(
|
2604 2539 | mut self,
|
2605 2540 | input: Option<
|
2606 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Checksum>>,
|
2541 + | impl ::std::convert::Into<
|
2542 + | crate::constrained::MaybeConstrained<crate::model::Description>,
|
2543 + | >,
|
2607 2544 | >,
|
2608 2545 | ) -> Self {
|
2609 - | self.checksum = input.map(|v| v.into());
|
2546 + | self.description = input.map(|v| v.into());
|
2610 2547 | self
|
2611 2548 | }
|
2612 - | /// Consumes the builder and constructs a [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
2549 + | /// Consumes the builder and constructs a [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
2613 2550 | ///
|
2614 - | /// The builder fails to construct a [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput) if a [`ConstraintViolation`] occurs.
|
2551 + | /// The builder fails to construct a [`StartSnapshotInput`](crate::input::StartSnapshotInput) if a [`ConstraintViolation`] occurs.
|
2615 2552 | ///
|
2616 2553 | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
2617 - | pub fn build(self) -> Result<crate::input::CompleteSnapshotInput, ConstraintViolation> {
|
2554 + | pub fn build(self) -> Result<crate::input::StartSnapshotInput, ConstraintViolation> {
|
2618 2555 | self.build_enforcing_all_constraints()
|
2619 2556 | }
|
2620 2557 | fn build_enforcing_all_constraints(
|
2621 2558 | self,
|
2622 - | ) -> Result<crate::input::CompleteSnapshotInput, ConstraintViolation> {
|
2623 - | Ok(crate::input::CompleteSnapshotInput {
|
2624 - | changed_blocks_count: self
|
2625 - | .changed_blocks_count
|
2559 + | ) -> Result<crate::input::StartSnapshotInput, ConstraintViolation> {
|
2560 + | Ok(crate::input::StartSnapshotInput {
|
2561 + | timeout: self
|
2562 + | .timeout
|
2626 2563 | .map(|v| match v {
|
2627 2564 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2628 2565 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2629 2566 | })
|
2630 - | .map(|res| res.map_err(ConstraintViolation::ChangedBlocksCount))
|
2567 + | .map(|res| res.map_err(ConstraintViolation::Timeout))
|
2631 2568 | .transpose()?
|
2632 - | .map(|v: crate::model::ChangedBlocksCount| v.into())
|
2633 - | .ok_or(ConstraintViolation::MissingChangedBlocksCount)?,
|
2634 - | checksum_aggregation_method: self
|
2635 - | .checksum_aggregation_method
|
2569 + | .map(|v: crate::model::Timeout| v.into()),
|
2570 + | client_token: self
|
2571 + | .client_token
|
2636 2572 | .map(|v| match v {
|
2637 2573 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2638 2574 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2639 2575 | })
|
2640 - | .map(|res| res.map_err(ConstraintViolation::ChecksumAggregationMethod))
|
2641 - | .transpose()?,
|
2642 - | checksum_algorithm: self
|
2643 - | .checksum_algorithm
|
2576 + | .map(|res| res.map_err(ConstraintViolation::ClientToken))
|
2577 + | .transpose()?
|
2578 + | .map(|v: crate::model::IdempotencyToken| v.into()),
|
2579 + | volume_size: self
|
2580 + | .volume_size
|
2644 2581 | .map(|v| match v {
|
2645 2582 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2646 2583 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2647 2584 | })
|
2648 - | .map(|res| res.map_err(ConstraintViolation::ChecksumAlgorithm))
|
2585 + | .map(|res| res.map_err(ConstraintViolation::VolumeSize))
|
2586 + | .transpose()?
|
2587 + | .map(|v: crate::model::VolumeSize| v.into())
|
2588 + | .ok_or(ConstraintViolation::MissingVolumeSize)?,
|
2589 + | tags: self
|
2590 + | .tags
|
2591 + | .map(|v| match v {
|
2592 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2593 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2594 + | })
|
2595 + | .map(|res| res.map(|v| v.into()).map_err(ConstraintViolation::Tags))
|
2649 2596 | .transpose()?,
|
2650 - | snapshot_id: self
|
2651 - | .snapshot_id
|
2597 + | encrypted: self.encrypted,
|
2598 + | kms_key_arn: self
|
2599 + | .kms_key_arn
|
2652 2600 | .map(|v| match v {
|
2653 2601 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2654 2602 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2655 2603 | })
|
2656 - | .map(|res| res.map_err(ConstraintViolation::SnapshotId))
|
2604 + | .map(|res| res.map_err(ConstraintViolation::KmsKeyArn))
|
2657 2605 | .transpose()?
|
2658 - | .map(|v: crate::model::SnapshotId| v.into())
|
2659 - | .ok_or(ConstraintViolation::MissingSnapshotId)?,
|
2660 - | checksum: self
|
2661 - | .checksum
|
2606 + | .map(|v: crate::model::KmsKeyArn| v.into()),
|
2607 + | parent_snapshot_id: self
|
2608 + | .parent_snapshot_id
|
2662 2609 | .map(|v| match v {
|
2663 2610 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2664 2611 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2665 2612 | })
|
2666 - | .map(|res| res.map_err(ConstraintViolation::Checksum))
|
2613 + | .map(|res| res.map_err(ConstraintViolation::ParentSnapshotId))
|
2667 2614 | .transpose()?
|
2668 - | .map(|v: crate::model::Checksum| v.into()),
|
2615 + | .map(|v: crate::model::SnapshotId| v.into()),
|
2616 + | description: self
|
2617 + | .description
|
2618 + | .map(|v| match v {
|
2619 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2620 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2621 + | })
|
2622 + | .map(|res| res.map_err(ConstraintViolation::Description))
|
2623 + | .transpose()?
|
2624 + | .map(|v: crate::model::Description| v.into()),
|
2669 2625 | })
|
2670 2626 | }
|
2671 2627 | }
|
2628 + | impl ::std::fmt::Debug for Builder {
|
2629 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
2630 + | let mut formatter = f.debug_struct("Builder");
|
2631 + | formatter.field("timeout", &self.timeout);
|
2632 + | formatter.field("client_token", &self.client_token);
|
2633 + | formatter.field("volume_size", &self.volume_size);
|
2634 + | formatter.field("tags", &self.tags);
|
2635 + | formatter.field("encrypted", &self.encrypted);
|
2636 + | formatter.field("kms_key_arn", &"*** Sensitive Data Redacted ***");
|
2637 + | formatter.field("parent_snapshot_id", &self.parent_snapshot_id);
|
2638 + | formatter.field("description", &self.description);
|
2639 + | formatter.finish()
|
2640 + | }
|
2641 + | }
|
2672 2642 | }
|
2673 - | /// See [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
2674 - | pub mod complete_snapshot_input {
|
2643 + | /// See [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
2644 + | pub mod start_snapshot_input {
|
2675 2645 |
|
2676 2646 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2677 2647 | /// Holds one variant for each of the ways the builder can fail.
|
2678 2648 | #[allow(clippy::enum_variant_names)]
|
2679 2649 | pub enum ConstraintViolation {
|
2680 - | /// `changed_blocks_count` was not provided but it is required when building `CompleteSnapshotInput`.
|
2681 - | MissingChangedBlocksCount,
|
2682 - | /// `snapshot_id` was not provided but it is required when building `CompleteSnapshotInput`.
|
2683 - | MissingSnapshotId,
|
2650 + | /// `volume_size` was not provided but it is required when building `StartSnapshotInput`.
|
2651 + | MissingVolumeSize,
|
2684 2652 | }
|
2685 2653 | impl ::std::fmt::Display for ConstraintViolation {
|
2686 2654 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2687 2655 | match self {
|
2688 - | ConstraintViolation::MissingChangedBlocksCount => write!(f, "`changed_blocks_count` was not provided but it is required when building `CompleteSnapshotInput`"),
|
2689 - | ConstraintViolation::MissingSnapshotId => write!(f, "`snapshot_id` was not provided but it is required when building `CompleteSnapshotInput`"),
|
2656 + | ConstraintViolation::MissingVolumeSize => write!(f, "`volume_size` was not provided but it is required when building `StartSnapshotInput`"),
|
2690 2657 | }
|
2691 2658 | }
|
2692 2659 | }
|
2693 2660 | impl ::std::error::Error for ConstraintViolation {}
|
2694 - | impl ::std::convert::TryFrom<Builder> for crate::input::CompleteSnapshotInput {
|
2661 + | impl ::std::convert::TryFrom<Builder> for crate::input::StartSnapshotInput {
|
2695 2662 | type Error = ConstraintViolation;
|
2696 2663 |
|
2697 2664 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
2698 2665 | builder.build()
|
2699 2666 | }
|
2700 2667 | }
|
2701 - | /// A builder for [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
2702 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2668 + | /// A builder for [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
2669 + | #[derive(::std::clone::Clone, ::std::default::Default)]
|
2703 2670 | pub struct Builder {
|
2704 - | pub(crate) changed_blocks_count: ::std::option::Option<i32>,
|
2705 - | pub(crate) checksum_aggregation_method:
|
2706 - | ::std::option::Option<crate::model::ChecksumAggregationMethod>,
|
2707 - | pub(crate) checksum_algorithm: ::std::option::Option<crate::model::ChecksumAlgorithm>,
|
2708 - | pub(crate) snapshot_id: ::std::option::Option<::std::string::String>,
|
2709 - | pub(crate) checksum: ::std::option::Option<::std::string::String>,
|
2671 + | pub(crate) timeout: ::std::option::Option<i32>,
|
2672 + | pub(crate) client_token: ::std::option::Option<::std::string::String>,
|
2673 + | pub(crate) volume_size: ::std::option::Option<i64>,
|
2674 + | pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::model::Tag>>,
|
2675 + | pub(crate) encrypted: ::std::option::Option<bool>,
|
2676 + | pub(crate) kms_key_arn: ::std::option::Option<::std::string::String>,
|
2677 + | pub(crate) parent_snapshot_id: ::std::option::Option<::std::string::String>,
|
2678 + | pub(crate) description: ::std::option::Option<::std::string::String>,
|
2710 2679 | }
|
2711 2680 | impl Builder {
|
2712 - | /// <p>The number of blocks that were written to the snapshot.</p>
|
2713 - | pub fn changed_blocks_count(mut self, input: i32) -> Self {
|
2714 - | self.changed_blocks_count = Some(input);
|
2681 + | /// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
|
2682 + | /// <ul>
|
2683 + | /// <li>
|
2684 + | /// <p>No blocks are written to the snapshot.</p></li>
|
2685 + | /// <li>
|
2686 + | /// <p>The snapshot is not completed after writing the last block of data.</p></li>
|
2687 + | /// </ul>
|
2688 + | /// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
|
2689 + | pub fn timeout(mut self, input: ::std::option::Option<i32>) -> Self {
|
2690 + | self.timeout = input;
|
2715 2691 | self
|
2716 2692 | }
|
2717 - | /// <p>The aggregation method used to generate the checksum. Currently, the only supported aggregation method is <code>LINEAR</code>.</p>
|
2718 - | pub fn checksum_aggregation_method(
|
2719 - | mut self,
|
2720 - | input: ::std::option::Option<crate::model::ChecksumAggregationMethod>,
|
2721 - | ) -> Self {
|
2722 - | self.checksum_aggregation_method = input;
|
2693 + | /// <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>
|
2694 + | /// <p>If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
|
2695 + | /// <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>
|
2696 + | pub fn client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
2697 + | self.client_token = input;
|
2723 2698 | self
|
2724 2699 | }
|
2725 - | /// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
|
2726 - | pub fn checksum_algorithm(
|
2700 + | /// <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
|
2701 + | pub fn volume_size(mut self, input: i64) -> Self {
|
2702 + | self.volume_size = Some(input);
|
2703 + | self
|
2704 + | }
|
2705 + | /// <p>The tags to apply to the snapshot.</p>
|
2706 + | pub fn tags(
|
2727 2707 | mut self,
|
2728 - | input: ::std::option::Option<crate::model::ChecksumAlgorithm>,
|
2708 + | input: ::std::option::Option<::std::vec::Vec<crate::model::Tag>>,
|
2729 2709 | ) -> Self {
|
2730 - | self.checksum_algorithm = input;
|
2710 + | self.tags = input;
|
2731 2711 | self
|
2732 2712 | }
|
2733 - | /// <p>The ID of the snapshot.</p>
|
2734 - | pub fn snapshot_id(mut self, input: ::std::string::String) -> Self {
|
2735 - | self.snapshot_id = Some(input);
|
2713 + | /// <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>
|
2714 + | /// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
|
2715 + | /// <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>
|
2716 + | /// <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>
|
2717 + | /// <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>
|
2718 + | pub fn encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
|
2719 + | self.encrypted = input;
|
2736 2720 | self
|
2737 2721 | }
|
2738 - | /// <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written block.</p>
|
2739 - | /// <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>
|
2740 - | pub fn checksum(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
2741 - | self.checksum = input;
|
2722 + | /// <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>
|
2723 + | /// <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>
|
2724 + | /// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN.</p>
|
2725 + | pub fn kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
2726 + | self.kms_key_arn = input;
|
2742 2727 | self
|
2743 2728 | }
|
2744 - | /// Consumes the builder and constructs a [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput).
|
2729 + | /// <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>
|
2730 + | /// <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>
|
2731 + | pub fn parent_snapshot_id(
|
2732 + | mut self,
|
2733 + | input: ::std::option::Option<::std::string::String>,
|
2734 + | ) -> Self {
|
2735 + | self.parent_snapshot_id = input;
|
2736 + | self
|
2737 + | }
|
2738 + | /// <p>A description for the snapshot.</p>
|
2739 + | pub fn description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
2740 + | self.description = input;
|
2741 + | self
|
2742 + | }
|
2743 + | /// Consumes the builder and constructs a [`StartSnapshotInput`](crate::input::StartSnapshotInput).
|
2745 2744 | ///
|
2746 - | /// The builder fails to construct a [`CompleteSnapshotInput`](crate::input::CompleteSnapshotInput) if you do not provide a value for all non-`Option`al members.
|
2745 + | /// The builder fails to construct a [`StartSnapshotInput`](crate::input::StartSnapshotInput) if you do not provide a value for all non-`Option`al members.
|
2747 2746 | ///
|
2748 - | pub fn build(self) -> Result<crate::input::CompleteSnapshotInput, ConstraintViolation> {
|
2747 + | pub fn build(self) -> Result<crate::input::StartSnapshotInput, ConstraintViolation> {
|
2749 2748 | self.build_enforcing_required_and_enum_traits()
|
2750 2749 | }
|
2751 2750 | fn build_enforcing_required_and_enum_traits(
|
2752 2751 | self,
|
2753 - | ) -> Result<crate::input::CompleteSnapshotInput, ConstraintViolation> {
|
2754 - | Ok(crate::input::CompleteSnapshotInput {
|
2755 - | changed_blocks_count: self
|
2756 - | .changed_blocks_count
|
2757 - | .ok_or(ConstraintViolation::MissingChangedBlocksCount)?,
|
2758 - | checksum_aggregation_method: self.checksum_aggregation_method,
|
2759 - | checksum_algorithm: self.checksum_algorithm,
|
2760 - | snapshot_id: self
|
2761 - | .snapshot_id
|
2762 - | .ok_or(ConstraintViolation::MissingSnapshotId)?,
|
2763 - | checksum: self.checksum,
|
2752 + | ) -> Result<crate::input::StartSnapshotInput, ConstraintViolation> {
|
2753 + | Ok(crate::input::StartSnapshotInput {
|
2754 + | timeout: self.timeout,
|
2755 + | client_token: self.client_token,
|
2756 + | volume_size: self
|
2757 + | .volume_size
|
2758 + | .ok_or(ConstraintViolation::MissingVolumeSize)?,
|
2759 + | tags: self.tags,
|
2760 + | encrypted: self.encrypted,
|
2761 + | kms_key_arn: self.kms_key_arn,
|
2762 + | parent_snapshot_id: self.parent_snapshot_id,
|
2763 + | description: self.description,
|
2764 2764 | })
|
2765 2765 | }
|
2766 2766 | }
|
2767 2767 | }
|