21 21 | /// <p>The Base64 encoded, 32-bit <code>CRC32 checksum</code> of the object. This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums"> Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
|
22 22 | pub fn checksum_crc32(&self) -> ::std::option::Option<&str> {
|
23 23 | self.checksum_crc32.as_deref()
|
24 24 | }
|
25 25 | /// <p>The Base64 encoded, 32-bit <code>CRC32C</code> checksum of the object. This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums"> Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
|
26 26 | pub fn checksum_crc32_c(&self) -> ::std::option::Option<&str> {
|
27 27 | self.checksum_crc32_c.as_deref()
|
28 28 | }
|
29 29 | /// <p>The Base64 encoded, 64-bit <code>CRC64NVME</code> checksum of the object. This checksum is present if the object was uploaded with the <code>CRC64NVME</code> checksum algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the default checksum, <code>CRC64NVME</code>, to the uploaded object). For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
|
30 30 | pub fn checksum_crc64_nvme(&self) -> ::std::option::Option<&str> {
|
31 31 | self.checksum_crc64_nvme.as_deref()
|
32 32 | }
|
33 33 | /// <p>The Base64 encoded, 160-bit <code>SHA1</code> digest of the object. This checksum is only present if the checksum was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums"> Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
|
34 34 | pub fn checksum_sha1(&self) -> ::std::option::Option<&str> {
|
35 35 | self.checksum_sha1.as_deref()
|
36 36 | }
|
37 37 | /// <p>The Base64 encoded, 256-bit <code>SHA256</code> digest of the object. This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums"> Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
|
38 38 | pub fn checksum_sha256(&self) -> ::std::option::Option<&str> {
|
39 39 | self.checksum_sha256.as_deref()
|
40 40 | }
|
41 41 | /// <p>The checksum type that is used to calculate the object’s checksum value. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
|
42 42 | pub fn checksum_type(&self) -> ::std::option::Option<&crate::types::ChecksumType> {
|
43 43 | self.checksum_type.as_ref()
|
44 44 | }
|
45 45 | }
|
46 46 | static CHECKSUM_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
|
47 47 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#Checksum", "com.amazonaws.s3", "Checksum");
|
48 48 | static CHECKSUM_MEMBER_CHECKSUM_CRC32: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
49 49 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#Checksum$ChecksumCRC32", "com.amazonaws.s3", "Checksum"),
|
50 50 | ::aws_smithy_schema::ShapeType::String,
|
51 - | "checksum_crc32",
|
51 + | "ChecksumCRC32",
|
52 52 | 0,
|
53 53 | );
|
54 54 | static CHECKSUM_MEMBER_CHECKSUM_CRC32_C: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
55 55 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#Checksum$ChecksumCRC32C", "com.amazonaws.s3", "Checksum"),
|
56 56 | ::aws_smithy_schema::ShapeType::String,
|
57 - | "checksum_crc32_c",
|
57 + | "ChecksumCRC32C",
|
58 58 | 1,
|
59 59 | );
|
60 60 | static CHECKSUM_MEMBER_CHECKSUM_CRC64_NVME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
61 61 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#Checksum$ChecksumCRC64NVME", "com.amazonaws.s3", "Checksum"),
|
62 62 | ::aws_smithy_schema::ShapeType::String,
|
63 - | "checksum_crc64_nvme",
|
63 + | "ChecksumCRC64NVME",
|
64 64 | 2,
|
65 65 | );
|
66 66 | static CHECKSUM_MEMBER_CHECKSUM_SHA1: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
67 67 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#Checksum$ChecksumSHA1", "com.amazonaws.s3", "Checksum"),
|
68 68 | ::aws_smithy_schema::ShapeType::String,
|
69 - | "checksum_sha1",
|
69 + | "ChecksumSHA1",
|
70 70 | 3,
|
71 71 | );
|
72 72 | static CHECKSUM_MEMBER_CHECKSUM_SHA256: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
73 73 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#Checksum$ChecksumSHA256", "com.amazonaws.s3", "Checksum"),
|
74 74 | ::aws_smithy_schema::ShapeType::String,
|
75 - | "checksum_sha256",
|
75 + | "ChecksumSHA256",
|
76 76 | 4,
|
77 77 | );
|
78 78 | static CHECKSUM_MEMBER_CHECKSUM_TYPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
79 79 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#Checksum$ChecksumType", "com.amazonaws.s3", "Checksum"),
|
80 80 | ::aws_smithy_schema::ShapeType::String,
|
81 - | "checksum_type",
|
81 + | "ChecksumType",
|
82 82 | 5,
|
83 83 | );
|
84 84 | static CHECKSUM_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
85 85 | CHECKSUM_SCHEMA_ID,
|
86 86 | ::aws_smithy_schema::ShapeType::Structure,
|
87 87 | &[
|
88 88 | &CHECKSUM_MEMBER_CHECKSUM_CRC32,
|
89 89 | &CHECKSUM_MEMBER_CHECKSUM_CRC32_C,
|
90 90 | &CHECKSUM_MEMBER_CHECKSUM_CRC64_NVME,
|
91 91 | &CHECKSUM_MEMBER_CHECKSUM_SHA1,
|
92 92 | &CHECKSUM_MEMBER_CHECKSUM_SHA256,
|
93 93 | &CHECKSUM_MEMBER_CHECKSUM_TYPE,
|
94 94 | ],
|
95 95 | );
|
96 96 | impl Checksum {
|
97 97 | /// The schema for this shape.
|
98 98 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CHECKSUM_SCHEMA;
|
99 99 | }
|
100 100 | impl ::aws_smithy_schema::serde::SerializableStruct for Checksum {
|
101 101 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
102 102 | fn serialize_members(
|
103 103 | &self,
|
104 104 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
105 105 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
106 106 | if let Some(ref val) = self.checksum_crc32 {
|
107 107 | ser.write_string(&CHECKSUM_MEMBER_CHECKSUM_CRC32, val)?;
|
108 108 | }
|
109 109 | if let Some(ref val) = self.checksum_crc32_c {
|
110 110 | ser.write_string(&CHECKSUM_MEMBER_CHECKSUM_CRC32_C, val)?;
|
111 111 | }
|
112 112 | if let Some(ref val) = self.checksum_crc64_nvme {
|
113 113 | ser.write_string(&CHECKSUM_MEMBER_CHECKSUM_CRC64_NVME, val)?;
|
114 114 | }
|
115 115 | if let Some(ref val) = self.checksum_sha1 {
|
116 116 | ser.write_string(&CHECKSUM_MEMBER_CHECKSUM_SHA1, val)?;
|
117 117 | }
|
118 118 | if let Some(ref val) = self.checksum_sha256 {
|
119 119 | ser.write_string(&CHECKSUM_MEMBER_CHECKSUM_SHA256, val)?;
|
120 120 | }
|
121 121 | if let Some(ref val) = self.checksum_type {
|
122 122 | ser.write_string(&CHECKSUM_MEMBER_CHECKSUM_TYPE, val.as_str())?;
|
123 123 | }
|
124 124 | Ok(())
|
125 125 | }
|
126 126 | }
|
127 127 | impl Checksum {
|
128 128 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
129 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
130 - | deserializer: &mut D,
|
129 + | pub fn deserialize(
|
130 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
131 131 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
132 132 | #[allow(unused_variables, unused_mut)]
|
133 133 | let mut builder = Self::builder();
|
134 134 | #[allow(
|
135 135 | unused_variables,
|
136 136 | unreachable_code,
|
137 137 | clippy::single_match,
|
138 138 | clippy::match_single_binding,
|
139 139 | clippy::diverging_sub_expression
|
140 140 | )]
|
141 - | deserializer.read_struct(&CHECKSUM_SCHEMA, (), |_, member, deser| {
|
141 + | deserializer.read_struct(&CHECKSUM_SCHEMA, &mut |member, deser| {
|
142 142 | match member.member_index() {
|
143 143 | Some(0) => {
|
144 144 | builder.checksum_crc32 = Some(deser.read_string(member)?);
|
145 145 | }
|
146 146 | Some(1) => {
|
147 147 | builder.checksum_crc32_c = Some(deser.read_string(member)?);
|
148 148 | }
|
149 149 | Some(2) => {
|
150 150 | builder.checksum_crc64_nvme = Some(deser.read_string(member)?);
|
151 151 | }
|
152 152 | Some(3) => {
|
153 153 | builder.checksum_sha1 = Some(deser.read_string(member)?);
|
154 154 | }
|
155 155 | Some(4) => {
|
156 156 | builder.checksum_sha256 = Some(deser.read_string(member)?);
|
157 157 | }
|
158 158 | Some(5) => {
|
159 159 | builder.checksum_type = Some(crate::types::ChecksumType::from(deser.read_string(member)?.as_str()));
|
160 160 | }
|
161 161 | _ => {}
|
162 162 | }
|
163 163 | Ok(())
|
164 164 | })?;
|
165 165 | Ok(builder.build())
|
166 166 | }
|
167 167 | }
|
168 + | impl Checksum {
|
169 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
170 + | pub fn deserialize_with_response(
|
171 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
172 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
173 + | _status: u16,
|
174 + | _body: &[u8],
|
175 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
176 + | Self::deserialize(deserializer)
|
177 + | }
|
178 + | }
|
168 179 | impl Checksum {
|
169 180 | /// Creates a new builder-style object to manufacture [`Checksum`](crate::types::Checksum).
|
170 181 | pub fn builder() -> crate::types::builders::ChecksumBuilder {
|
171 182 | crate::types::builders::ChecksumBuilder::default()
|
172 183 | }
|
173 184 | }
|
174 185 |
|
175 186 | /// A builder for [`Checksum`](crate::types::Checksum).
|
176 187 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
177 188 | #[non_exhaustive]
|
178 189 | pub struct ChecksumBuilder {
|
179 190 | pub(crate) checksum_crc32: ::std::option::Option<::std::string::String>,
|
180 191 | pub(crate) checksum_crc32_c: ::std::option::Option<::std::string::String>,
|
181 192 | pub(crate) checksum_crc64_nvme: ::std::option::Option<::std::string::String>,
|
182 193 | pub(crate) checksum_sha1: ::std::option::Option<::std::string::String>,
|
183 194 | pub(crate) checksum_sha256: ::std::option::Option<::std::string::String>,
|
184 195 | pub(crate) checksum_type: ::std::option::Option<crate::types::ChecksumType>,
|
185 196 | }
|
186 197 | impl ChecksumBuilder {
|
187 198 | /// <p>The Base64 encoded, 32-bit <code>CRC32 checksum</code> of the object. This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums"> Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
|
188 199 | pub fn checksum_crc32(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
189 200 | self.checksum_crc32 = ::std::option::Option::Some(input.into());
|
190 201 | self
|
191 202 | }
|
192 203 | /// <p>The Base64 encoded, 32-bit <code>CRC32 checksum</code> of the object. This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums"> Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
|
193 204 | pub fn set_checksum_crc32(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
194 205 | self.checksum_crc32 = input;
|
195 206 | self
|
196 207 | }
|
197 208 | /// <p>The Base64 encoded, 32-bit <code>CRC32 checksum</code> of the object. This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums"> Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
|