157 157 |
|
158 158 | // From the httpChecksum trait
|
159 159 | let http_checksum_required = false;
|
160 160 |
|
161 161 | let is_presigned_req = cfg.load::<crate::presigning::PresigningMarker>().is_some();
|
162 162 |
|
163 163 | // If the request is presigned we do not set a default.
|
164 164 | // If the RequestChecksumCalculation is WhenSupported and the user has not set a checksum value or algo
|
165 165 | // we set the default. If it is WhenRequired and a checksum is required by the trait and the user has not
|
166 166 | // set a checksum value or algo we also set the default. In all other cases we do nothing.
|
167 167 | match (
|
168 168 | request_checksum_calculation,
|
169 169 | http_checksum_required,
|
170 170 | user_set_checksum_value,
|
171 171 | user_set_checksum_algo,
|
172 172 | is_presigned_req,
|
173 173 | ) {
|
174 174 | (_, _, _, _, true) => {}
|
175 175 | (::aws_smithy_types::checksum_config::RequestChecksumCalculation::WhenSupported, _, false, false, _)
|
176 176 | | (::aws_smithy_types::checksum_config::RequestChecksumCalculation::WhenRequired, true, false, false, _) => {
|
177 177 | request.headers_mut().insert("x-amz-sdk-checksum-algorithm", "CRC32");
|
178 178 | }
|
179 179 | _ => {}
|
180 180 | }
|
181 181 |
|
182 182 | // We return a bool indicating if the user did set the checksum value, if they did
|
183 183 | // we can short circuit and exit the interceptor early.
|
184 184 | Ok(user_set_checksum_value)
|
185 185 | },
|
186 186 | ))
|
187 + | .with_interceptor(crate::aws_chunked::AwsChunkedContentEncodingInterceptor)
|
187 188 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
|
188 189 | crate::operation::put_object::PutObjectError,
|
189 190 | >::new())
|
190 191 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
|
191 192 | crate::operation::put_object::PutObjectError,
|
192 193 | >::new())
|
193 194 | .with_retry_classifier(
|
194 195 | ::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<crate::operation::put_object::PutObjectError>::builder()
|
195 196 | .transient_errors({
|
196 197 | let mut transient_errors: Vec<&'static str> = ::aws_runtime::retries::classifiers::TRANSIENT_ERRORS.into();
|
197 198 | transient_errors.push("InternalError");
|
198 199 | ::std::borrow::Cow::Owned(transient_errors)
|
199 200 | })
|
200 201 | .build(),
|
201 202 | );
|
202 203 |
|
203 204 | ::std::borrow::Cow::Owned(rcb)
|
204 205 | }
|
205 206 | }
|
206 207 |
|
207 208 | #[derive(Debug)]
|
208 209 | struct PutObjectResponseDeserializer;
|
209 210 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for PutObjectResponseDeserializer {
|
210 211 | fn deserialize_nonstreaming(
|
211 212 | &self,
|
212 213 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
213 214 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
214 215 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
215 216 | let headers = response.headers();
|
216 217 | let body = response.body().bytes().expect("body loaded");
|