1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | ::pin_project_lite::pin_project! {
|
3 + | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
4 + | /// [`GetObjectInput`](crate::input::GetObjectInput) using modelled bindings.
|
5 + | pub struct GetObjectInputFuture {
|
6 + | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GetObjectInput, ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError>> + Send>>
|
7 + | }
|
8 + | }
|
9 + |
|
10 + | impl std::future::Future for GetObjectInputFuture {
|
11 + | type Output = Result<
|
12 + | crate::input::GetObjectInput,
|
13 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError,
|
14 + | >;
|
15 + |
|
16 + | fn poll(
|
17 + | self: std::pin::Pin<&mut Self>,
|
18 + | cx: &mut std::task::Context<'_>,
|
19 + | ) -> std::task::Poll<Self::Output> {
|
20 + | let this = self.project();
|
21 + | this.inner.as_mut().poll(cx)
|
22 + | }
|
23 + | }
|
24 + |
|
25 + | impl<B>
|
26 + | ::aws_smithy_legacy_http_server::request::FromRequest<
|
27 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
|
28 + | B,
|
29 + | > for crate::input::GetObjectInput
|
30 + | where
|
31 + | B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
|
32 + | B: 'static,
|
33 + |
|
34 + | B::Data: Send,
|
35 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection:
|
36 + | From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
|
37 + | {
|
38 + | type Rejection =
|
39 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError;
|
40 + | type Future = GetObjectInputFuture;
|
41 + |
|
42 + | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
43 + | let fut = async move {
|
44 + | crate::protocol_serde::shape_get_object::de_get_object_http_request(request).await
|
45 + | };
|
46 + | use ::futures_util::future::TryFutureExt;
|
47 + | let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection| {
|
48 + | ::tracing::debug!(error = %e, "failed to deserialize request");
|
49 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e)
|
50 + | });
|
51 + | GetObjectInputFuture {
|
52 + | inner: Box::pin(fut),
|
53 + | }
|
54 + | }
|
55 + | }
|
56 + | impl
|
57 + | ::aws_smithy_legacy_http_server::response::IntoResponse<
|
58 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
|
59 + | > for crate::output::GetObjectOutput
|
60 + | {
|
61 + | fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
|
62 + | match crate::protocol_serde::shape_get_object::ser_get_object_http_response(self) {
|
63 + | Ok(response) => response,
|
64 + | Err(e) => {
|
65 + | ::tracing::error!(error = %e, "failed to serialize response");
|
66 + | ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
|
67 + | }
|
68 + | }
|
69 + | }
|
70 + | }
|
71 + | impl
|
72 + | ::aws_smithy_legacy_http_server::response::IntoResponse<
|
73 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
|
74 + | > for crate::error::GetObjectError
|
75 + | {
|
76 + | fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
|
77 + | match crate::protocol_serde::shape_get_object::ser_get_object_http_error(&self) {
|
78 + | Ok(mut response) => {
|
79 + | response.extensions_mut().insert(
|
80 + | ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
|
81 + | self.name(),
|
82 + | ),
|
83 + | );
|
84 + | response
|
85 + | }
|
86 + | Err(e) => {
|
87 + | ::tracing::error!(error = %e, "failed to serialize response");
|
88 + | ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
|
89 + | }
|
90 + | }
|
91 + | }
|
92 + | }
|
93 + |
|
94 + | ::pin_project_lite::pin_project! {
|
95 + | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
96 + | /// [`DeleteObjectTaggingInput`](crate::input::DeleteObjectTaggingInput) using modelled bindings.
|
97 + | pub struct DeleteObjectTaggingInputFuture {
|
98 + | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::DeleteObjectTaggingInput, ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError>> + Send>>
|
99 + | }
|
100 + | }
|
101 + |
|
102 + | impl std::future::Future for DeleteObjectTaggingInputFuture {
|
103 + | type Output = Result<
|
104 + | crate::input::DeleteObjectTaggingInput,
|
105 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError,
|
106 + | >;
|
107 + |
|
108 + | fn poll(
|
109 + | self: std::pin::Pin<&mut Self>,
|
110 + | cx: &mut std::task::Context<'_>,
|
111 + | ) -> std::task::Poll<Self::Output> {
|
112 + | let this = self.project();
|
113 + | this.inner.as_mut().poll(cx)
|
114 + | }
|
115 + | }
|
116 + |
|
117 + | impl<B>
|
118 + | ::aws_smithy_legacy_http_server::request::FromRequest<
|
119 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
|
120 + | B,
|
121 + | > for crate::input::DeleteObjectTaggingInput
|
122 + | where
|
123 + | B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
|
124 + | B: 'static,
|
125 + |
|
126 + | B::Data: Send,
|
127 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection:
|
128 + | From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
|
129 + | {
|
130 + | type Rejection =
|
131 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError;
|
132 + | type Future = DeleteObjectTaggingInputFuture;
|
133 + |
|
134 + | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
135 + | let fut = async move {
|
136 + | crate::protocol_serde::shape_delete_object_tagging::de_delete_object_tagging_http_request(request)
|
137 + | .await
|
138 + | };
|
139 + | use ::futures_util::future::TryFutureExt;
|
140 + | let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection| {
|
141 + | ::tracing::debug!(error = %e, "failed to deserialize request");
|
142 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e)
|
143 + | });
|
144 + | DeleteObjectTaggingInputFuture {
|
145 + | inner: Box::pin(fut),
|
146 + | }
|
147 + | }
|
148 + | }
|
149 + | impl
|
150 + | ::aws_smithy_legacy_http_server::response::IntoResponse<
|
151 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
|
152 + | > for crate::output::DeleteObjectTaggingOutput
|
153 + | {
|
154 + | fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
|
155 + | match crate::protocol_serde::shape_delete_object_tagging::ser_delete_object_tagging_http_response(self) {
|
156 + | Ok(response) => response,
|
157 + | Err(e) => {
|
158 + | ::tracing::error!(error = %e, "failed to serialize response");
|
159 + | ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
|
160 + | }
|
161 + | }
|
162 + | }
|
163 + | }
|
164 + | impl
|
165 + | ::aws_smithy_legacy_http_server::response::IntoResponse<
|
166 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
|
167 + | > for crate::error::DeleteObjectTaggingError
|
168 + | {
|
169 + | fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
|
170 + | match crate::protocol_serde::shape_delete_object_tagging::ser_delete_object_tagging_http_error(&self) {
|
171 + | Ok(mut response) => {
|
172 + | response.extensions_mut().insert(::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(self.name()));
|
173 + | response
|
174 + | },
|
175 + | Err(e) => {
|
176 + | ::tracing::error!(error = %e, "failed to serialize response");
|
177 + | ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
|
178 + | }
|
179 + | }
|
180 + | }
|
181 + | }
|
182 + |
|
183 + | ::pin_project_lite::pin_project! {
|
184 + | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
185 + | /// [`GetBucketLocationInput`](crate::input::GetBucketLocationInput) using modelled bindings.
|
186 + | pub struct GetBucketLocationInputFuture {
|
187 + | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GetBucketLocationInput, ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError>> + Send>>
|
188 + | }
|
189 + | }
|
190 + |
|
191 + | impl std::future::Future for GetBucketLocationInputFuture {
|
192 + | type Output = Result<
|
193 + | crate::input::GetBucketLocationInput,
|
194 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError,
|
195 + | >;
|
196 + |
|
197 + | fn poll(
|
198 + | self: std::pin::Pin<&mut Self>,
|
199 + | cx: &mut std::task::Context<'_>,
|
200 + | ) -> std::task::Poll<Self::Output> {
|
201 + | let this = self.project();
|
202 + | this.inner.as_mut().poll(cx)
|
203 + | }
|
204 + | }
|
205 + |
|
206 + | impl<B>
|
207 + | ::aws_smithy_legacy_http_server::request::FromRequest<
|
208 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
|
209 + | B,
|
210 + | > for crate::input::GetBucketLocationInput
|
211 + | where
|
212 + | B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
|
213 + | B: 'static,
|
214 + |
|
215 + | B::Data: Send,
|
216 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection:
|
217 + | From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
|
218 + | {
|
219 + | type Rejection =
|
220 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError;
|
221 + | type Future = GetBucketLocationInputFuture;
|
222 + |
|
223 + | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
224 + | let fut = async move {
|
225 + | if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
|
226 + | request.headers(),
|
227 + | &crate::mimes::CONTENT_TYPE_APPLICATION_XML,
|
228 + | ) {
|
229 + | return Err(::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection::NotAcceptable);
|
230 + | }
|
231 + | crate::protocol_serde::shape_get_bucket_location::de_get_bucket_location_http_request(
|
232 + | request,
|
233 + | )
|
234 + | .await
|
235 + | };
|
236 + | use ::futures_util::future::TryFutureExt;
|
237 + | let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection| {
|
238 + | ::tracing::debug!(error = %e, "failed to deserialize request");
|
239 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e)
|
240 + | });
|
241 + | GetBucketLocationInputFuture {
|
242 + | inner: Box::pin(fut),
|
243 + | }
|
244 + | }
|
245 + | }
|
246 + | impl
|
247 + | ::aws_smithy_legacy_http_server::response::IntoResponse<
|
248 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
|
249 + | > for crate::output::GetBucketLocationOutput
|
250 + | {
|
251 + | fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
|
252 + | match crate::protocol_serde::shape_get_bucket_location::ser_get_bucket_location_http_response(self) {
|
253 + | Ok(response) => response,
|
254 + | Err(e) => {
|
255 + | ::tracing::error!(error = %e, "failed to serialize response");
|
256 + | ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
|
257 + | }
|
258 + | }
|
259 + | }
|
260 + | }
|
261 + | impl
|
262 + | ::aws_smithy_legacy_http_server::response::IntoResponse<
|
263 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
|
264 + | > for crate::error::GetBucketLocationError
|
265 + | {
|
266 + | fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
|
267 + | match crate::protocol_serde::shape_get_bucket_location::ser_get_bucket_location_http_error(
|
268 + | &self,
|
269 + | ) {
|
270 + | Ok(mut response) => {
|
271 + | response.extensions_mut().insert(
|
272 + | ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
|
273 + | self.name(),
|
274 + | ),
|
275 + | );
|
276 + | response
|
277 + | }
|
278 + | Err(e) => {
|
279 + | ::tracing::error!(error = %e, "failed to serialize response");
|
280 + | ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
|
281 + | }
|
282 + | }
|
283 + | }
|
284 + | }
|
285 + |
|
286 + | #[allow(unreachable_code, unused_variables)]
|
287 + | #[cfg(test)]
|
288 + | mod get_bucket_location_test {
|
289 + |
|
290 + | /// S3 clients should use the @s3UnwrappedXmlOutput trait to determine
|
291 + | /// that the response shape is not wrapped in a restxml operation-level XML node.
|
292 + | ///
|
293 + | /// Test ID: GetBucketLocationUnwrappedOutput
|
294 + | #[::tokio::test]
|
295 + | #[::tracing_test::traced_test]
|
296 + | #[should_panic]
|
297 + | async fn get_bucket_location_unwrapped_output_response() {
|
298 + | let output = crate::output::GetBucketLocationOutput {
|
299 + | location_constraint: ::std::option::Option::Some(
|
300 + | "us-west-2"
|
301 + | .parse::<crate::model::BucketLocationConstraint>()
|
302 + | .expect("static value validated to member"),
|
303 + | ),
|
304 + | };
|
305 + | use ::aws_smithy_legacy_http_server::response::IntoResponse;
|
306 + | let http_response = output.into_response();
|
307 + | ::pretty_assertions::assert_eq!(
|
308 + | ::http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
309 + | http_response.status()
|
310 + | );
|
311 + | let body = ::hyper::body::to_bytes(http_response.into_body())
|
312 + | .await
|
313 + | .expect("unable to extract body to bytes");
|
314 + | ::aws_smithy_protocol_test::assert_ok(
|
315 + | ::aws_smithy_protocol_test::validate_body(&body, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<LocationConstraint xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">us-west-2</LocationConstraint>", ::aws_smithy_protocol_test::MediaType::from("unknown"))
|
316 + | );
|
317 + | }
|
318 + | }
|
319 + |
|
320 + | ::pin_project_lite::pin_project! {
|
321 + | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
322 + | /// [`ListObjectsV2Input`](crate::input::ListObjectsV2Input) using modelled bindings.
|
323 + | pub struct ListObjectsV2InputFuture {
|
324 + | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ListObjectsV2Input, ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError>> + Send>>
|
325 + | }
|
326 + | }
|
327 + |
|
328 + | impl std::future::Future for ListObjectsV2InputFuture {
|
329 + | type Output = Result<
|
330 + | crate::input::ListObjectsV2Input,
|
331 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError,
|
332 + | >;
|
333 + |
|
334 + | fn poll(
|
335 + | self: std::pin::Pin<&mut Self>,
|
336 + | cx: &mut std::task::Context<'_>,
|
337 + | ) -> std::task::Poll<Self::Output> {
|
338 + | let this = self.project();
|
339 + | this.inner.as_mut().poll(cx)
|
340 + | }
|
341 + | }
|
342 + |
|
343 + | impl<B>
|
344 + | ::aws_smithy_legacy_http_server::request::FromRequest<
|
345 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
|
346 + | B,
|
347 + | > for crate::input::ListObjectsV2Input
|
348 + | where
|
349 + | B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
|
350 + | B: 'static,
|
351 + |
|
352 + | B::Data: Send,
|
353 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection:
|
354 + | From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
|
355 + | {
|
356 + | type Rejection =
|
357 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError;
|
358 + | type Future = ListObjectsV2InputFuture;
|
359 + |
|
360 + | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
361 + | let fut = async move {
|
362 + | if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
|
363 + | request.headers(),
|
364 + | &crate::mimes::CONTENT_TYPE_APPLICATION_XML,
|
365 + | ) {
|
366 + | return Err(::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection::NotAcceptable);
|
367 + | }
|
368 + | crate::protocol_serde::shape_list_objects_v2::de_list_objects_v2_http_request(request)
|
369 + | .await
|
370 + | };
|
371 + | use ::futures_util::future::TryFutureExt;
|
372 + | let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection| {
|
373 + | ::tracing::debug!(error = %e, "failed to deserialize request");
|
374 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e)
|
375 + | });
|
376 + | ListObjectsV2InputFuture {
|
377 + | inner: Box::pin(fut),
|
378 + | }
|
379 + | }
|
380 + | }
|
381 + | impl
|
382 + | ::aws_smithy_legacy_http_server::response::IntoResponse<
|
383 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
|
384 + | > for crate::output::ListObjectsV2Output
|
385 + | {
|
386 + | fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
|
387 + | match crate::protocol_serde::shape_list_objects_v2::ser_list_objects_v2_http_response(self)
|
388 + | {
|
389 + | Ok(response) => response,
|
390 + | Err(e) => {
|
391 + | ::tracing::error!(error = %e, "failed to serialize response");
|
392 + | ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
|
393 + | }
|
394 + | }
|
395 + | }
|
396 + | }
|
397 + | impl
|
398 + | ::aws_smithy_legacy_http_server::response::IntoResponse<
|
399 + | ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
|
400 + | > for crate::error::ListObjectsV2Error
|
401 + | {
|
402 + | fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
|
403 + | match crate::protocol_serde::shape_list_objects_v2::ser_list_objects_v2_http_error(&self) {
|
404 + | Ok(mut response) => {
|
405 + | response.extensions_mut().insert(
|
406 + | ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
|
407 + | self.name(),
|
408 + | ),
|
409 + | );
|
410 + | response
|
411 + | }
|
412 + | Err(e) => {
|
413 + | ::tracing::error!(error = %e, "failed to serialize response");
|
414 + | ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
|
415 + | }
|
416 + | }
|
417 + | }
|
418 + | }
|
419 + |
|
420 + | #[allow(unreachable_code, unused_variables)]
|
421 + | #[cfg(test)]
|
422 + | mod list_objects_v2_test {
|
423 + |
|
424 + | /// S3 clients should map the default addressing style to virtual host.
|
425 + | /// Test ID: S3DefaultAddressing
|
426 + | #[::tokio::test]
|
427 + | #[::tracing_test::traced_test]
|
428 + | #[should_panic]
|
429 + | async fn s3_default_addressing_request() {
|
430 + | #[allow(unused_mut)]
|
431 + | let mut http_request = ::http::Request::builder()
|
432 + | .uri("/")
|
433 + | .method("GET")
|
434 + | .body(::aws_smithy_legacy_http_server::body::Body::from(
|
435 + | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
436 + | "".as_bytes(),
|
437 + | ::aws_smithy_protocol_test::MediaType::from("unknown"),
|
438 + | )),
|
439 + | ))
|
440 + | .unwrap();
|
441 + | *http_request.uri_mut() = "/?list-type=2".parse().unwrap();
|
442 + | todo!("endpoint trait not supported yet");
|
443 + | #[allow(unused_mut)]
|
444 + | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
445 + | let config = crate::service::AmazonS3Config::builder().build();
|
446 + | let service = crate::service::AmazonS3::builder::<::hyper::body::Body, _, _, _>(config)
|
447 + | .list_objects_v2(move |input: crate::input::ListObjectsV2Input| {
|
448 + | let sender = sender.clone();
|
449 + | async move {
|
450 + | let result = {
|
451 + | let expected = crate::input::ListObjectsV2Input {
|
452 + | bucket: "mybucket".to_owned(),
|
453 + | delimiter: ::std::option::Option::None,
|
454 + | encoding_type: ::std::option::Option::None,
|
455 + | max_keys: ::std::option::Option::None,
|
456 + | prefix: ::std::option::Option::None,
|
457 + | continuation_token: ::std::option::Option::None,
|
458 + | fetch_owner: ::std::option::Option::None,
|
459 + | start_after: ::std::option::Option::None,
|
460 + | request_payer: ::std::option::Option::None,
|
461 + | expected_bucket_owner: ::std::option::Option::None,
|
462 + | };
|
463 + | ::pretty_assertions::assert_eq!(input, expected);
|
464 + | let output = crate::output::ListObjectsV2Output {
|
465 + | is_truncated: ::std::option::Option::None,
|
466 + | contents: ::std::option::Option::None,
|
467 + | name: ::std::option::Option::None,
|
468 + | prefix: ::std::option::Option::None,
|
469 + | delimiter: ::std::option::Option::None,
|
470 + | max_keys: ::std::option::Option::None,
|
471 + | common_prefixes: ::std::option::Option::None,
|
472 + | encoding_type: ::std::option::Option::None,
|
473 + | key_count: ::std::option::Option::None,
|
474 + | continuation_token: ::std::option::Option::None,
|
475 + | next_continuation_token: ::std::option::Option::None,
|
476 + | start_after: ::std::option::Option::None,
|
477 + | };
|
478 + | Ok(output)
|
479 + | };
|
480 + | sender.send(()).await.expect("receiver dropped early");
|
481 + | result
|
482 + | }
|
483 + | })
|
484 + | .build_unchecked();
|
485 + | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
486 + | .await
|
487 + | .expect("unable to make an HTTP request");
|
488 + | assert!(
|
489 + | receiver.recv().await.is_some(),
|
490 + | "we expected operation handler to be invoked but it was not entered"
|
491 + | );
|
492 + | }
|
493 + |
|
494 + | /// S3 clients should support the explicit virtual host addressing style.
|
495 + | /// Test ID: S3VirtualHostAddressing
|
496 + | #[::tokio::test]
|
497 + | #[::tracing_test::traced_test]
|
498 + | #[should_panic]
|
499 + | async fn s3_virtual_host_addressing_request() {
|
500 + | #[allow(unused_mut)]
|
501 + | let mut http_request = ::http::Request::builder()
|
502 + | .uri("/")
|
503 + | .method("GET")
|
504 + | .body(::aws_smithy_legacy_http_server::body::Body::from(
|
505 + | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
506 + | "".as_bytes(),
|
507 + | ::aws_smithy_protocol_test::MediaType::from("unknown"),
|
508 + | )),
|
509 + | ))
|
510 + | .unwrap();
|
511 + | *http_request.uri_mut() = "/?list-type=2".parse().unwrap();
|
512 + | todo!("endpoint trait not supported yet");
|
513 + | #[allow(unused_mut)]
|
514 + | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
515 + | let config = crate::service::AmazonS3Config::builder().build();
|
516 + | let service = crate::service::AmazonS3::builder::<::hyper::body::Body, _, _, _>(config)
|
517 + | .list_objects_v2(move |input: crate::input::ListObjectsV2Input| {
|
518 + | let sender = sender.clone();
|
519 + | async move {
|
520 + | let result = {
|
521 + | let expected = crate::input::ListObjectsV2Input {
|
522 + | bucket: "mybucket".to_owned(),
|
523 + | delimiter: ::std::option::Option::None,
|
524 + | encoding_type: ::std::option::Option::None,
|
525 + | max_keys: ::std::option::Option::None,
|
526 + | prefix: ::std::option::Option::None,
|
527 + | continuation_token: ::std::option::Option::None,
|
528 + | fetch_owner: ::std::option::Option::None,
|
529 + | start_after: ::std::option::Option::None,
|
530 + | request_payer: ::std::option::Option::None,
|
531 + | expected_bucket_owner: ::std::option::Option::None,
|
532 + | };
|
533 + | ::pretty_assertions::assert_eq!(input, expected);
|
534 + | let output = crate::output::ListObjectsV2Output {
|
535 + | is_truncated: ::std::option::Option::None,
|
536 + | contents: ::std::option::Option::None,
|
537 + | name: ::std::option::Option::None,
|
538 + | prefix: ::std::option::Option::None,
|
539 + | delimiter: ::std::option::Option::None,
|
540 + | max_keys: ::std::option::Option::None,
|
541 + | common_prefixes: ::std::option::Option::None,
|
542 + | encoding_type: ::std::option::Option::None,
|
543 + | key_count: ::std::option::Option::None,
|
544 + | continuation_token: ::std::option::Option::None,
|
545 + | next_continuation_token: ::std::option::Option::None,
|
546 + | start_after: ::std::option::Option::None,
|
547 + | };
|
548 + | Ok(output)
|
549 + | };
|
550 + | sender.send(()).await.expect("receiver dropped early");
|
551 + | result
|
552 + | }
|
553 + | })
|
554 + | .build_unchecked();
|
555 + | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
556 + | .await
|
557 + | .expect("unable to make an HTTP request");
|
558 + | assert!(
|
559 + | receiver.recv().await.is_some(),
|
560 + | "we expected operation handler to be invoked but it was not entered"
|
561 + | );
|
562 + | }
|
563 + |
|
564 + | /// S3 clients should support the explicit path addressing style.
|
565 + | /// Test ID: S3PathAddressing
|
566 + | #[::tokio::test]
|
567 + | #[::tracing_test::traced_test]
|
568 + | #[should_panic]
|
569 + | async fn s3_path_addressing_request() {
|
570 + | #[allow(unused_mut)]
|
571 + | let mut http_request = ::http::Request::builder()
|
572 + | .uri("/mybucket")
|
573 + | .method("GET")
|
574 + | .body(::aws_smithy_legacy_http_server::body::Body::from(
|
575 + | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
576 + | "".as_bytes(),
|
577 + | ::aws_smithy_protocol_test::MediaType::from("unknown"),
|
578 + | )),
|
579 + | ))
|
580 + | .unwrap();
|
581 + | *http_request.uri_mut() = "/mybucket?list-type=2".parse().unwrap();
|
582 + | todo!("endpoint trait not supported yet");
|
583 + | #[allow(unused_mut)]
|
584 + | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
585 + | let config = crate::service::AmazonS3Config::builder().build();
|
586 + | let service = crate::service::AmazonS3::builder::<::hyper::body::Body, _, _, _>(config)
|
587 + | .list_objects_v2(move |input: crate::input::ListObjectsV2Input| {
|
588 + | let sender = sender.clone();
|
589 + | async move {
|
590 + | let result = {
|
591 + | let expected = crate::input::ListObjectsV2Input {
|
592 + | bucket: "mybucket".to_owned(),
|
593 + | delimiter: ::std::option::Option::None,
|
594 + | encoding_type: ::std::option::Option::None,
|
595 + | max_keys: ::std::option::Option::None,
|
596 + | prefix: ::std::option::Option::None,
|
597 + | continuation_token: ::std::option::Option::None,
|
598 + | fetch_owner: ::std::option::Option::None,
|
599 + | start_after: ::std::option::Option::None,
|
600 + | request_payer: ::std::option::Option::None,
|
601 + | expected_bucket_owner: ::std::option::Option::None,
|
602 + | };
|
603 + | ::pretty_assertions::assert_eq!(input, expected);
|
604 + | let output = crate::output::ListObjectsV2Output {
|
605 + | is_truncated: ::std::option::Option::None,
|
606 + | contents: ::std::option::Option::None,
|
607 + | name: ::std::option::Option::None,
|
608 + | prefix: ::std::option::Option::None,
|
609 + | delimiter: ::std::option::Option::None,
|
610 + | max_keys: ::std::option::Option::None,
|
611 + | common_prefixes: ::std::option::Option::None,
|
612 + | encoding_type: ::std::option::Option::None,
|
613 + | key_count: ::std::option::Option::None,
|
614 + | continuation_token: ::std::option::Option::None,
|
615 + | next_continuation_token: ::std::option::Option::None,
|
616 + | start_after: ::std::option::Option::None,
|
617 + | };
|
618 + | Ok(output)
|
619 + | };
|
620 + | sender.send(()).await.expect("receiver dropped early");
|
621 + | result
|
622 + | }
|
623 + | })
|
624 + | .build_unchecked();
|
625 + | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
626 + | .await
|
627 + | .expect("unable to make an HTTP request");
|
628 + | assert!(
|
629 + | receiver.recv().await.is_some(),
|
630 + | "we expected operation handler to be invoked but it was not entered"
|
631 + | );
|
632 + | }
|
633 + |
|
634 + | /// S3 clients should support the explicit virtual host
|
635 + | /// addressing style with Dualstack.
|
636 + | /// Test ID: S3VirtualHostDualstackAddressing
|
637 + | #[::tokio::test]
|
638 + | #[::tracing_test::traced_test]
|
639 + | #[should_panic]
|
640 + | async fn s3_virtual_host_dualstack_addressing_request() {
|
641 + | #[allow(unused_mut)]
|
642 + | let mut http_request = ::http::Request::builder()
|
643 + | .uri("/")
|
644 + | .method("GET")
|
645 + | .body(::aws_smithy_legacy_http_server::body::Body::from(
|
646 + | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
647 + | "".as_bytes(),
|
648 + | ::aws_smithy_protocol_test::MediaType::from("unknown"),
|
649 + | )),
|
650 + | ))
|
651 + | .unwrap();
|
652 + | *http_request.uri_mut() = "/?list-type=2".parse().unwrap();
|
653 + | todo!("endpoint trait not supported yet");
|
654 + | #[allow(unused_mut)]
|
655 + | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
656 + | let config = crate::service::AmazonS3Config::builder().build();
|
657 + | let service = crate::service::AmazonS3::builder::<::hyper::body::Body, _, _, _>(config)
|
658 + | .list_objects_v2(move |input: crate::input::ListObjectsV2Input| {
|
659 + | let sender = sender.clone();
|
660 + | async move {
|
661 + | let result = {
|
662 + | let expected = crate::input::ListObjectsV2Input {
|
663 + | bucket: "mybucket".to_owned(),
|
664 + | delimiter: ::std::option::Option::None,
|
665 + | encoding_type: ::std::option::Option::None,
|
666 + | max_keys: ::std::option::Option::None,
|
667 + | prefix: ::std::option::Option::None,
|
668 + | continuation_token: ::std::option::Option::None,
|
669 + | fetch_owner: ::std::option::Option::None,
|
670 + | start_after: ::std::option::Option::None,
|
671 + | request_payer: ::std::option::Option::None,
|
672 + | expected_bucket_owner: ::std::option::Option::None,
|
673 + | };
|
674 + | ::pretty_assertions::assert_eq!(input, expected);
|
675 + | let output = crate::output::ListObjectsV2Output {
|
676 + | is_truncated: ::std::option::Option::None,
|
677 + | contents: ::std::option::Option::None,
|
678 + | name: ::std::option::Option::None,
|
679 + | prefix: ::std::option::Option::None,
|
680 + | delimiter: ::std::option::Option::None,
|
681 + | max_keys: ::std::option::Option::None,
|
682 + | common_prefixes: ::std::option::Option::None,
|
683 + | encoding_type: ::std::option::Option::None,
|
684 + | key_count: ::std::option::Option::None,
|
685 + | continuation_token: ::std::option::Option::None,
|
686 + | next_continuation_token: ::std::option::Option::None,
|
687 + | start_after: ::std::option::Option::None,
|
688 + | };
|
689 + | Ok(output)
|
690 + | };
|
691 + | sender.send(()).await.expect("receiver dropped early");
|
692 + | result
|
693 + | }
|
694 + | })
|
695 + | .build_unchecked();
|
696 + | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
697 + | .await
|
698 + | .expect("unable to make an HTTP request");
|
699 + | assert!(
|
700 + | receiver.recv().await.is_some(),
|
701 + | "we expected operation handler to be invoked but it was not entered"
|
702 + | );
|
703 + | }
|
704 + |
|
705 + | /// S3 clients should support the explicit virtual host
|
706 + | /// addressing style with S3 Accelerate.
|
707 + | /// Test ID: S3VirtualHostAccelerateAddressing
|
708 + | #[::tokio::test]
|
709 + | #[::tracing_test::traced_test]
|
710 + | #[should_panic]
|
711 + | async fn s3_virtual_host_accelerate_addressing_request() {
|
712 + | #[allow(unused_mut)]
|
713 + | let mut http_request = ::http::Request::builder()
|
714 + | .uri("/")
|
715 + | .method("GET")
|
716 + | .body(::aws_smithy_legacy_http_server::body::Body::from(
|
717 + | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
718 + | "".as_bytes(),
|
719 + | ::aws_smithy_protocol_test::MediaType::from("unknown"),
|
720 + | )),
|
721 + | ))
|
722 + | .unwrap();
|
723 + | *http_request.uri_mut() = "/?list-type=2".parse().unwrap();
|
724 + | todo!("endpoint trait not supported yet");
|
725 + | #[allow(unused_mut)]
|
726 + | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
727 + | let config = crate::service::AmazonS3Config::builder().build();
|
728 + | let service = crate::service::AmazonS3::builder::<::hyper::body::Body, _, _, _>(config)
|
729 + | .list_objects_v2(move |input: crate::input::ListObjectsV2Input| {
|
730 + | let sender = sender.clone();
|
731 + | async move {
|
732 + | let result = {
|
733 + | let expected = crate::input::ListObjectsV2Input {
|
734 + | bucket: "mybucket".to_owned(),
|
735 + | delimiter: ::std::option::Option::None,
|
736 + | encoding_type: ::std::option::Option::None,
|
737 + | max_keys: ::std::option::Option::None,
|
738 + | prefix: ::std::option::Option::None,
|
739 + | continuation_token: ::std::option::Option::None,
|
740 + | fetch_owner: ::std::option::Option::None,
|
741 + | start_after: ::std::option::Option::None,
|
742 + | request_payer: ::std::option::Option::None,
|
743 + | expected_bucket_owner: ::std::option::Option::None,
|
744 + | };
|
745 + | ::pretty_assertions::assert_eq!(input, expected);
|
746 + | let output = crate::output::ListObjectsV2Output {
|
747 + | is_truncated: ::std::option::Option::None,
|
748 + | contents: ::std::option::Option::None,
|
749 + | name: ::std::option::Option::None,
|
750 + | prefix: ::std::option::Option::None,
|
751 + | delimiter: ::std::option::Option::None,
|
752 + | max_keys: ::std::option::Option::None,
|
753 + | common_prefixes: ::std::option::Option::None,
|
754 + | encoding_type: ::std::option::Option::None,
|
755 + | key_count: ::std::option::Option::None,
|
756 + | continuation_token: ::std::option::Option::None,
|
757 + | next_continuation_token: ::std::option::Option::None,
|
758 + | start_after: ::std::option::Option::None,
|
759 + | };
|
760 + | Ok(output)
|
761 + | };
|
762 + | sender.send(()).await.expect("receiver dropped early");
|
763 + | result
|
764 + | }
|
765 + | })
|
766 + | .build_unchecked();
|
767 + | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
768 + | .await
|
769 + | .expect("unable to make an HTTP request");
|
770 + | assert!(
|
771 + | receiver.recv().await.is_some(),
|
772 + | "we expected operation handler to be invoked but it was not entered"
|
773 + | );
|
774 + | }
|
775 + |
|
776 + | /// S3 clients should support the explicit virtual host
|
777 + | /// addressing style with Dualstack and S3 Accelerate.
|
778 + | /// Test ID: S3VirtualHostDualstackAccelerateAddressing
|
779 + | #[::tokio::test]
|
780 + | #[::tracing_test::traced_test]
|
781 + | #[should_panic]
|
782 + | async fn s3_virtual_host_dualstack_accelerate_addressing_request() {
|
783 + | #[allow(unused_mut)]
|
784 + | let mut http_request = ::http::Request::builder()
|
785 + | .uri("/")
|
786 + | .method("GET")
|
787 + | .body(::aws_smithy_legacy_http_server::body::Body::from(
|
788 + | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
789 + | "".as_bytes(),
|
790 + | ::aws_smithy_protocol_test::MediaType::from("unknown"),
|
791 + | )),
|
792 + | ))
|
793 + | .unwrap();
|
794 + | *http_request.uri_mut() = "/?list-type=2".parse().unwrap();
|
795 + | todo!("endpoint trait not supported yet");
|
796 + | #[allow(unused_mut)]
|
797 + | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
798 + | let config = crate::service::AmazonS3Config::builder().build();
|
799 + | let service = crate::service::AmazonS3::builder::<::hyper::body::Body, _, _, _>(config)
|
800 + | .list_objects_v2(move |input: crate::input::ListObjectsV2Input| {
|
801 + | let sender = sender.clone();
|
802 + | async move {
|
803 + | let result = {
|
804 + | let expected = crate::input::ListObjectsV2Input {
|
805 + | bucket: "mybucket".to_owned(),
|
806 + | delimiter: ::std::option::Option::None,
|
807 + | encoding_type: ::std::option::Option::None,
|
808 + | max_keys: ::std::option::Option::None,
|
809 + | prefix: ::std::option::Option::None,
|
810 + | continuation_token: ::std::option::Option::None,
|
811 + | fetch_owner: ::std::option::Option::None,
|
812 + | start_after: ::std::option::Option::None,
|
813 + | request_payer: ::std::option::Option::None,
|
814 + | expected_bucket_owner: ::std::option::Option::None,
|
815 + | };
|
816 + | ::pretty_assertions::assert_eq!(input, expected);
|
817 + | let output = crate::output::ListObjectsV2Output {
|
818 + | is_truncated: ::std::option::Option::None,
|
819 + | contents: ::std::option::Option::None,
|
820 + | name: ::std::option::Option::None,
|
821 + | prefix: ::std::option::Option::None,
|
822 + | delimiter: ::std::option::Option::None,
|
823 + | max_keys: ::std::option::Option::None,
|
824 + | common_prefixes: ::std::option::Option::None,
|
825 + | encoding_type: ::std::option::Option::None,
|
826 + | key_count: ::std::option::Option::None,
|
827 + | continuation_token: ::std::option::Option::None,
|
828 + | next_continuation_token: ::std::option::Option::None,
|
829 + | start_after: ::std::option::Option::None,
|
830 + | };
|
831 + | Ok(output)
|
832 + | };
|
833 + | sender.send(()).await.expect("receiver dropped early");
|
834 + | result
|
835 + | }
|
836 + | })
|
837 + | .build_unchecked();
|
838 + | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
839 + | .await
|
840 + | .expect("unable to make an HTTP request");
|
841 + | assert!(
|
842 + | receiver.recv().await.is_some(),
|
843 + | "we expected operation handler to be invoked but it was not entered"
|
844 + | );
|
845 + | }
|
846 + |
|
847 + | /// S3 clients should resolve to the addressing style of the
|
848 + | /// operation if defined on both the client and operation.
|
849 + | /// Test ID: S3OperationAddressingPreferred
|
850 + | #[::tokio::test]
|
851 + | #[::tracing_test::traced_test]
|
852 + | #[should_panic]
|
853 + | async fn s3_operation_addressing_preferred_request() {
|
854 + | #[allow(unused_mut)]
|
855 + | let mut http_request = ::http::Request::builder()
|
856 + | .uri("/")
|
857 + | .method("GET")
|
858 + | .body(::aws_smithy_legacy_http_server::body::Body::from(
|
859 + | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
860 + | "".as_bytes(),
|
861 + | ::aws_smithy_protocol_test::MediaType::from("unknown"),
|
862 + | )),
|
863 + | ))
|
864 + | .unwrap();
|
865 + | *http_request.uri_mut() = "/?list-type=2".parse().unwrap();
|
866 + | todo!("endpoint trait not supported yet");
|
867 + | #[allow(unused_mut)]
|
868 + | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
869 + | let config = crate::service::AmazonS3Config::builder().build();
|
870 + | let service = crate::service::AmazonS3::builder::<::hyper::body::Body, _, _, _>(config)
|
871 + | .list_objects_v2(move |input: crate::input::ListObjectsV2Input| {
|
872 + | let sender = sender.clone();
|
873 + | async move {
|
874 + | let result = {
|
875 + | let expected = crate::input::ListObjectsV2Input {
|
876 + | bucket: "mybucket".to_owned(),
|
877 + | delimiter: ::std::option::Option::None,
|
878 + | encoding_type: ::std::option::Option::None,
|
879 + | max_keys: ::std::option::Option::None,
|
880 + | prefix: ::std::option::Option::None,
|
881 + | continuation_token: ::std::option::Option::None,
|
882 + | fetch_owner: ::std::option::Option::None,
|
883 + | start_after: ::std::option::Option::None,
|
884 + | request_payer: ::std::option::Option::None,
|
885 + | expected_bucket_owner: ::std::option::Option::None,
|
886 + | };
|
887 + | ::pretty_assertions::assert_eq!(input, expected);
|
888 + | let output = crate::output::ListObjectsV2Output {
|
889 + | is_truncated: ::std::option::Option::None,
|
890 + | contents: ::std::option::Option::None,
|
891 + | name: ::std::option::Option::None,
|
892 + | prefix: ::std::option::Option::None,
|
893 + | delimiter: ::std::option::Option::None,
|
894 + | max_keys: ::std::option::Option::None,
|
895 + | common_prefixes: ::std::option::Option::None,
|
896 + | encoding_type: ::std::option::Option::None,
|
897 + | key_count: ::std::option::Option::None,
|
898 + | continuation_token: ::std::option::Option::None,
|
899 + | next_continuation_token: ::std::option::Option::None,
|
900 + | start_after: ::std::option::Option::None,
|
901 + | };
|
902 + | Ok(output)
|
903 + | };
|
904 + | sender.send(()).await.expect("receiver dropped early");
|
905 + | result
|
906 + | }
|
907 + | })
|
908 + | .build_unchecked();
|
909 + | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
910 + | .await
|
911 + | .expect("unable to make an HTTP request");
|
912 + | assert!(
|
913 + | receiver.recv().await.is_some(),
|
914 + | "we expected operation handler to be invoked but it was not entered"
|
915 + | );
|
916 + | }
|
917 + |
|
918 + | /// S3 operations return Error XML nodes unwrapped by
|
919 + | /// the ErrorResponse XML node.
|
920 + | ///
|
921 + | /// Test ID: S3OperationNoErrorWrappingResponse
|
922 + | #[::tokio::test]
|
923 + | #[::tracing_test::traced_test]
|
924 + | #[should_panic]
|
925 + | async fn s3_operation_no_error_wrapping_response_response() {
|
926 + | let output = crate::error::NoSuchBucket {};
|
927 + | let output = crate::error::ListObjectsV2Error::NoSuchBucket(output);
|
928 + | use ::aws_smithy_legacy_http_server::response::IntoResponse;
|
929 + | let http_response = output.into_response();
|
930 + | ::pretty_assertions::assert_eq!(
|
931 + | ::http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
|
932 + | http_response.status()
|
933 + | );
|
934 + | let expected_headers = [("Content-Type", "application/xml")];
|
935 + | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
936 + | http_response.headers(),
|
937 + | expected_headers,
|
938 + | ));
|
939 + | let body = ::hyper::body::to_bytes(http_response.into_body())
|
940 + | .await
|
941 + | .expect("unable to extract body to bytes");
|
942 + | ::aws_smithy_protocol_test::assert_ok(
|
943 + | ::aws_smithy_protocol_test::validate_body(&body, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error>\n\t<Type>Sender</Type>\n\t<Code>NoSuchBucket</Code>\n</Error>", ::aws_smithy_protocol_test::MediaType::from("application/xml"))
|
944 + | );
|
945 + | }
|
946 + | }
|