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 + | /// [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput) using modelled bindings.
|
5 + | pub struct ResponseCodeDefaultOperationInputFuture {
|
6 + | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResponseCodeDefaultOperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
7 + | }
|
8 + | }
|
9 + |
|
10 + | impl std::future::Future for ResponseCodeDefaultOperationInputFuture {
|
11 + | type Output = Result<
|
12 + | crate::input::ResponseCodeDefaultOperationInput,
|
13 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::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_json_1::RestJson1,
|
28 + | B,
|
29 + | > for crate::input::ResponseCodeDefaultOperationInput
|
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_json_1::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_json_1::runtime_error::RuntimeError;
|
40 + | type Future = ResponseCodeDefaultOperationInputFuture;
|
41 + |
|
42 + | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
43 + | let fut = async move {
|
44 + | if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
|
45 + | request.headers(),
|
46 + | &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
|
47 + | ) {
|
48 + | return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
49 + | }
|
50 + | crate::protocol_serde::shape_response_code_default_operation::de_response_code_default_operation_http_request(request)
|
51 + | .await
|
52 + | };
|
53 + | use ::futures_util::future::TryFutureExt;
|
54 + | let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
55 + | ::tracing::debug!(error = %e, "failed to deserialize request");
|
56 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
|
57 + | });
|
58 + | ResponseCodeDefaultOperationInputFuture {
|
59 + | inner: Box::pin(fut),
|
60 + | }
|
61 + | }
|
62 + | }
|
63 + | impl
|
64 + | ::aws_smithy_legacy_http_server::response::IntoResponse<
|
65 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
66 + | > for crate::output::ResponseCodeDefaultOperationOutput
|
67 + | {
|
68 + | fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
|
69 + | match crate::protocol_serde::shape_response_code_default_operation::ser_response_code_default_operation_http_response(self) {
|
70 + | Ok(response) => response,
|
71 + | Err(e) => {
|
72 + | ::tracing::error!(error = %e, "failed to serialize response");
|
73 + | ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
74 + | }
|
75 + | }
|
76 + | }
|
77 + | }
|
78 + |
|
79 + | #[allow(unreachable_code, unused_variables)]
|
80 + | #[cfg(test)]
|
81 + | mod response_code_default_operation_test {
|
82 + |
|
83 + | /// Test ID: ResponseCodeDefaultOperation
|
84 + | #[::tokio::test]
|
85 + | #[::tracing_test::traced_test]
|
86 + | async fn response_code_default_operation_response() {
|
87 + | let output = crate::output::ResponseCodeDefaultOperationOutput {};
|
88 + | use ::aws_smithy_legacy_http_server::response::IntoResponse;
|
89 + | let http_response = output.into_response();
|
90 + | ::pretty_assertions::assert_eq!(
|
91 + | ::http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
92 + | http_response.status()
|
93 + | );
|
94 + | }
|
95 + | }
|
96 + |
|
97 + | ::pin_project_lite::pin_project! {
|
98 + | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
99 + | /// [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput) using modelled bindings.
|
100 + | pub struct ResponseCodeHttpFallbackOperationInputFuture {
|
101 + | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResponseCodeHttpFallbackOperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
102 + | }
|
103 + | }
|
104 + |
|
105 + | impl std::future::Future for ResponseCodeHttpFallbackOperationInputFuture {
|
106 + | type Output = Result<
|
107 + | crate::input::ResponseCodeHttpFallbackOperationInput,
|
108 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
|
109 + | >;
|
110 + |
|
111 + | fn poll(
|
112 + | self: std::pin::Pin<&mut Self>,
|
113 + | cx: &mut std::task::Context<'_>,
|
114 + | ) -> std::task::Poll<Self::Output> {
|
115 + | let this = self.project();
|
116 + | this.inner.as_mut().poll(cx)
|
117 + | }
|
118 + | }
|
119 + |
|
120 + | impl<B>
|
121 + | ::aws_smithy_legacy_http_server::request::FromRequest<
|
122 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
123 + | B,
|
124 + | > for crate::input::ResponseCodeHttpFallbackOperationInput
|
125 + | where
|
126 + | B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
|
127 + | B: 'static,
|
128 + |
|
129 + | B::Data: Send,
|
130 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
131 + | From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
|
132 + | {
|
133 + | type Rejection =
|
134 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
135 + | type Future = ResponseCodeHttpFallbackOperationInputFuture;
|
136 + |
|
137 + | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
138 + | let fut = async move {
|
139 + | if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
|
140 + | request.headers(),
|
141 + | &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
|
142 + | ) {
|
143 + | return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
144 + | }
|
145 + | crate::protocol_serde::shape_response_code_http_fallback_operation::de_response_code_http_fallback_operation_http_request(request)
|
146 + | .await
|
147 + | };
|
148 + | use ::futures_util::future::TryFutureExt;
|
149 + | let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
150 + | ::tracing::debug!(error = %e, "failed to deserialize request");
|
151 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
|
152 + | });
|
153 + | ResponseCodeHttpFallbackOperationInputFuture {
|
154 + | inner: Box::pin(fut),
|
155 + | }
|
156 + | }
|
157 + | }
|
158 + | impl
|
159 + | ::aws_smithy_legacy_http_server::response::IntoResponse<
|
160 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
161 + | > for crate::output::ResponseCodeHttpFallbackOperationOutput
|
162 + | {
|
163 + | fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
|
164 + | match crate::protocol_serde::shape_response_code_http_fallback_operation::ser_response_code_http_fallback_operation_http_response(self) {
|
165 + | Ok(response) => response,
|
166 + | Err(e) => {
|
167 + | ::tracing::error!(error = %e, "failed to serialize response");
|
168 + | ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
169 + | }
|
170 + | }
|
171 + | }
|
172 + | }
|
173 + |
|
174 + | #[allow(unreachable_code, unused_variables)]
|
175 + | #[cfg(test)]
|
176 + | mod response_code_http_fallback_operation_test {
|
177 + |
|
178 + | /// Test ID: ResponseCodeHttpFallbackOperation
|
179 + | #[::tokio::test]
|
180 + | #[::tracing_test::traced_test]
|
181 + | async fn response_code_http_fallback_operation_response() {
|
182 + | let output = crate::output::ResponseCodeHttpFallbackOperationOutput {};
|
183 + | use ::aws_smithy_legacy_http_server::response::IntoResponse;
|
184 + | let http_response = output.into_response();
|
185 + | ::pretty_assertions::assert_eq!(
|
186 + | ::http::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
|
187 + | http_response.status()
|
188 + | );
|
189 + | let expected_headers = [("Content-Length", "2")];
|
190 + | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
191 + | http_response.headers(),
|
192 + | expected_headers,
|
193 + | ));
|
194 + | }
|
195 + | }
|
196 + |
|
197 + | ::pin_project_lite::pin_project! {
|
198 + | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
199 + | /// [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput) using modelled bindings.
|
200 + | pub struct ResponseCodeRequiredOperationInputFuture {
|
201 + | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResponseCodeRequiredOperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
202 + | }
|
203 + | }
|
204 + |
|
205 + | impl std::future::Future for ResponseCodeRequiredOperationInputFuture {
|
206 + | type Output = Result<
|
207 + | crate::input::ResponseCodeRequiredOperationInput,
|
208 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
|
209 + | >;
|
210 + |
|
211 + | fn poll(
|
212 + | self: std::pin::Pin<&mut Self>,
|
213 + | cx: &mut std::task::Context<'_>,
|
214 + | ) -> std::task::Poll<Self::Output> {
|
215 + | let this = self.project();
|
216 + | this.inner.as_mut().poll(cx)
|
217 + | }
|
218 + | }
|
219 + |
|
220 + | impl<B>
|
221 + | ::aws_smithy_legacy_http_server::request::FromRequest<
|
222 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
223 + | B,
|
224 + | > for crate::input::ResponseCodeRequiredOperationInput
|
225 + | where
|
226 + | B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
|
227 + | B: 'static,
|
228 + |
|
229 + | B::Data: Send,
|
230 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
231 + | From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
|
232 + | {
|
233 + | type Rejection =
|
234 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
235 + | type Future = ResponseCodeRequiredOperationInputFuture;
|
236 + |
|
237 + | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
238 + | let fut = async move {
|
239 + | if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
|
240 + | request.headers(),
|
241 + | &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
|
242 + | ) {
|
243 + | return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
244 + | }
|
245 + | crate::protocol_serde::shape_response_code_required_operation::de_response_code_required_operation_http_request(request)
|
246 + | .await
|
247 + | };
|
248 + | use ::futures_util::future::TryFutureExt;
|
249 + | let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
250 + | ::tracing::debug!(error = %e, "failed to deserialize request");
|
251 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
|
252 + | });
|
253 + | ResponseCodeRequiredOperationInputFuture {
|
254 + | inner: Box::pin(fut),
|
255 + | }
|
256 + | }
|
257 + | }
|
258 + | impl
|
259 + | ::aws_smithy_legacy_http_server::response::IntoResponse<
|
260 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
261 + | > for crate::output::ResponseCodeRequiredOperationOutput
|
262 + | {
|
263 + | fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
|
264 + | match crate::protocol_serde::shape_response_code_required_operation::ser_response_code_required_operation_http_response(self) {
|
265 + | Ok(response) => response,
|
266 + | Err(e) => {
|
267 + | ::tracing::error!(error = %e, "failed to serialize response");
|
268 + | ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
269 + | }
|
270 + | }
|
271 + | }
|
272 + | }
|
273 + |
|
274 + | #[allow(unreachable_code, unused_variables)]
|
275 + | #[cfg(test)]
|
276 + | mod response_code_required_operation_test {
|
277 + |
|
278 + | /// Test ID: ResponseCodeRequiredOperation
|
279 + | #[::tokio::test]
|
280 + | #[::tracing_test::traced_test]
|
281 + | async fn response_code_required_operation_response() {
|
282 + | let output = crate::output::ResponseCodeRequiredOperationOutput { response_code: 201 };
|
283 + | use ::aws_smithy_legacy_http_server::response::IntoResponse;
|
284 + | let http_response = output.into_response();
|
285 + | ::pretty_assertions::assert_eq!(
|
286 + | ::http::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
|
287 + | http_response.status()
|
288 + | );
|
289 + | let expected_headers = [("Content-Length", "2")];
|
290 + | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
291 + | http_response.headers(),
|
292 + | expected_headers,
|
293 + | ));
|
294 + | }
|
295 + | }
|
296 + |
|
297 + | ::pin_project_lite::pin_project! {
|
298 + | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
299 + | /// [`RequiredHeaderCollectionOperationInput`](crate::input::RequiredHeaderCollectionOperationInput) using modelled bindings.
|
300 + | pub struct RequiredHeaderCollectionOperationInputFuture {
|
301 + | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::RequiredHeaderCollectionOperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
302 + | }
|
303 + | }
|
304 + |
|
305 + | impl std::future::Future for RequiredHeaderCollectionOperationInputFuture {
|
306 + | type Output = Result<
|
307 + | crate::input::RequiredHeaderCollectionOperationInput,
|
308 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
|
309 + | >;
|
310 + |
|
311 + | fn poll(
|
312 + | self: std::pin::Pin<&mut Self>,
|
313 + | cx: &mut std::task::Context<'_>,
|
314 + | ) -> std::task::Poll<Self::Output> {
|
315 + | let this = self.project();
|
316 + | this.inner.as_mut().poll(cx)
|
317 + | }
|
318 + | }
|
319 + |
|
320 + | impl<B>
|
321 + | ::aws_smithy_legacy_http_server::request::FromRequest<
|
322 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
323 + | B,
|
324 + | > for crate::input::RequiredHeaderCollectionOperationInput
|
325 + | where
|
326 + | B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
|
327 + | B: 'static,
|
328 + |
|
329 + | B::Data: Send,
|
330 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
331 + | From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
|
332 + | {
|
333 + | type Rejection =
|
334 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
335 + | type Future = RequiredHeaderCollectionOperationInputFuture;
|
336 + |
|
337 + | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
338 + | let fut = async move {
|
339 + | if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
|
340 + | request.headers(),
|
341 + | &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
|
342 + | ) {
|
343 + | return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
344 + | }
|
345 + | crate::protocol_serde::shape_required_header_collection_operation::de_required_header_collection_operation_http_request(request)
|
346 + | .await
|
347 + | };
|
348 + | use ::futures_util::future::TryFutureExt;
|
349 + | let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
350 + | ::tracing::debug!(error = %e, "failed to deserialize request");
|
351 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
|
352 + | });
|
353 + | RequiredHeaderCollectionOperationInputFuture {
|
354 + | inner: Box::pin(fut),
|
355 + | }
|
356 + | }
|
357 + | }
|
358 + | impl
|
359 + | ::aws_smithy_legacy_http_server::response::IntoResponse<
|
360 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
361 + | > for crate::output::RequiredHeaderCollectionOperationOutput
|
362 + | {
|
363 + | fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
|
364 + | match crate::protocol_serde::shape_required_header_collection_operation::ser_required_header_collection_operation_http_response(self) {
|
365 + | Ok(response) => response,
|
366 + | Err(e) => {
|
367 + | ::tracing::error!(error = %e, "failed to serialize response");
|
368 + | ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
369 + | }
|
370 + | }
|
371 + | }
|
372 + | }
|
373 + | impl
|
374 + | ::aws_smithy_legacy_http_server::response::IntoResponse<
|
375 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
376 + | > for crate::error::RequiredHeaderCollectionOperationError
|
377 + | {
|
378 + | fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
|
379 + | match crate::protocol_serde::shape_required_header_collection_operation::ser_required_header_collection_operation_http_error(&self) {
|
380 + | Ok(mut response) => {
|
381 + | response.extensions_mut().insert(::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(self.name()));
|
382 + | response
|
383 + | },
|
384 + | Err(e) => {
|
385 + | ::tracing::error!(error = %e, "failed to serialize response");
|
386 + | ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
387 + | }
|
388 + | }
|
389 + | }
|
390 + | }
|
391 + |
|
392 + | ::pin_project_lite::pin_project! {
|
393 + | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
394 + | /// [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput) using modelled bindings.
|
395 + | pub struct RequiredInnerShapeOperationInputFuture {
|
396 + | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::RequiredInnerShapeOperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
397 + | }
|
398 + | }
|
399 + |
|
400 + | impl std::future::Future for RequiredInnerShapeOperationInputFuture {
|
401 + | type Output = Result<
|
402 + | crate::input::RequiredInnerShapeOperationInput,
|
403 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
|
404 + | >;
|
405 + |
|
406 + | fn poll(
|
407 + | self: std::pin::Pin<&mut Self>,
|
408 + | cx: &mut std::task::Context<'_>,
|
409 + | ) -> std::task::Poll<Self::Output> {
|
410 + | let this = self.project();
|
411 + | this.inner.as_mut().poll(cx)
|
412 + | }
|
413 + | }
|
414 + |
|
415 + | impl<B>
|
416 + | ::aws_smithy_legacy_http_server::request::FromRequest<
|
417 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
418 + | B,
|
419 + | > for crate::input::RequiredInnerShapeOperationInput
|
420 + | where
|
421 + | B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
|
422 + | B: 'static,
|
423 + |
|
424 + | B::Data: Send,
|
425 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
426 + | From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
|
427 + | {
|
428 + | type Rejection =
|
429 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
430 + | type Future = RequiredInnerShapeOperationInputFuture;
|
431 + |
|
432 + | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
433 + | let fut = async move {
|
434 + | if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
|
435 + | request.headers(),
|
436 + | &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
|
437 + | ) {
|
438 + | return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
439 + | }
|
440 + | crate::protocol_serde::shape_required_inner_shape_operation::de_required_inner_shape_operation_http_request(request)
|
441 + | .await
|
442 + | };
|
443 + | use ::futures_util::future::TryFutureExt;
|
444 + | let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
445 + | ::tracing::debug!(error = %e, "failed to deserialize request");
|
446 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
|
447 + | });
|
448 + | RequiredInnerShapeOperationInputFuture {
|
449 + | inner: Box::pin(fut),
|
450 + | }
|
451 + | }
|
452 + | }
|
453 + | impl
|
454 + | ::aws_smithy_legacy_http_server::response::IntoResponse<
|
455 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
456 + | > for crate::output::RequiredInnerShapeOperationOutput
|
457 + | {
|
458 + | fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
|
459 + | match crate::protocol_serde::shape_required_inner_shape_operation::ser_required_inner_shape_operation_http_response(self) {
|
460 + | Ok(response) => response,
|
461 + | Err(e) => {
|
462 + | ::tracing::error!(error = %e, "failed to serialize response");
|
463 + | ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
464 + | }
|
465 + | }
|
466 + | }
|
467 + | }
|
468 + | impl
|
469 + | ::aws_smithy_legacy_http_server::response::IntoResponse<
|
470 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
471 + | > for crate::error::RequiredInnerShapeOperationError
|
472 + | {
|
473 + | fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
|
474 + | match crate::protocol_serde::shape_required_inner_shape_operation::ser_required_inner_shape_operation_http_error(&self) {
|
475 + | Ok(mut response) => {
|
476 + | response.extensions_mut().insert(::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(self.name()));
|
477 + | response
|
478 + | },
|
479 + | Err(e) => {
|
480 + | ::tracing::error!(error = %e, "failed to serialize response");
|
481 + | ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
482 + | }
|
483 + | }
|
484 + | }
|
485 + | }
|
486 + |
|
487 + | ::pin_project_lite::pin_project! {
|
488 + | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
489 + | /// [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput) using modelled bindings.
|
490 + | pub struct TypeComplexityOperationInputFuture {
|
491 + | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::TypeComplexityOperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
492 + | }
|
493 + | }
|
494 + |
|
495 + | impl std::future::Future for TypeComplexityOperationInputFuture {
|
496 + | type Output = Result<
|
497 + | crate::input::TypeComplexityOperationInput,
|
498 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
|
499 + | >;
|
500 + |
|
501 + | fn poll(
|
502 + | self: std::pin::Pin<&mut Self>,
|
503 + | cx: &mut std::task::Context<'_>,
|
504 + | ) -> std::task::Poll<Self::Output> {
|
505 + | let this = self.project();
|
506 + | this.inner.as_mut().poll(cx)
|
507 + | }
|
508 + | }
|
509 + |
|
510 + | impl<B>
|
511 + | ::aws_smithy_legacy_http_server::request::FromRequest<
|
512 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
513 + | B,
|
514 + | > for crate::input::TypeComplexityOperationInput
|
515 + | where
|
516 + | B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
|
517 + | B: 'static,
|
518 + |
|
519 + | B::Data: Send,
|
520 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
521 + | From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
|
522 + | {
|
523 + | type Rejection =
|
524 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
525 + | type Future = TypeComplexityOperationInputFuture;
|
526 + |
|
527 + | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
528 + | let fut = async move {
|
529 + | if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
|
530 + | request.headers(),
|
531 + | &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
|
532 + | ) {
|
533 + | return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
534 + | }
|
535 + | crate::protocol_serde::shape_type_complexity_operation::de_type_complexity_operation_http_request(request)
|
536 + | .await
|
537 + | };
|
538 + | use ::futures_util::future::TryFutureExt;
|
539 + | let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
540 + | ::tracing::debug!(error = %e, "failed to deserialize request");
|
541 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
|
542 + | });
|
543 + | TypeComplexityOperationInputFuture {
|
544 + | inner: Box::pin(fut),
|
545 + | }
|
546 + | }
|
547 + | }
|
548 + | impl
|
549 + | ::aws_smithy_legacy_http_server::response::IntoResponse<
|
550 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
|
551 + | > for crate::output::TypeComplexityOperationOutput
|
552 + | {
|
553 + | fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
|
554 + | match crate::protocol_serde::shape_type_complexity_operation::ser_type_complexity_operation_http_response(self) {
|
555 + | Ok(response) => response,
|
556 + | Err(e) => {
|
557 + | ::tracing::error!(error = %e, "failed to serialize response");
|
558 + | ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
559 + | }
|
560 + | }
|
561 + | }
|
562 + | }
|