31 31 | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
32 32 | B: 'static,
|
33 33 |
|
34 34 | B::Data: Send,
|
35 35 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
36 36 | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
37 37 | {
|
38 38 | type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
39 39 | type Future = ResponseCodeDefaultOperationInputFuture;
|
40 40 |
|
41 - | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
41 + | fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
|
42 42 | let fut = async move {
|
43 43 | if !::aws_smithy_http_server::protocol::accept_header_classifier(
|
44 44 | request.headers(),
|
45 45 | &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
|
46 46 | ) {
|
47 47 | return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
48 48 | }
|
49 49 | crate::protocol_serde::shape_response_code_default_operation::de_response_code_default_operation_http_request(request)
|
50 50 | .await
|
51 51 | };
|
52 52 | use ::futures_util::future::TryFutureExt;
|
53 53 | let fut = fut.map_err(
|
54 54 | |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
55 55 | ::tracing::debug!(error = %e, "failed to deserialize request");
|
56 56 | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
|
57 57 | e,
|
58 58 | )
|
59 59 | },
|
60 60 | );
|
61 61 | ResponseCodeDefaultOperationInputFuture {
|
62 62 | inner: Box::pin(fut),
|
63 63 | }
|
64 64 | }
|
65 65 | }
|
66 66 | impl
|
67 67 | ::aws_smithy_http_server::response::IntoResponse<
|
68 68 | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
69 69 | > for crate::output::ResponseCodeDefaultOperationOutput
|
70 70 | {
|
71 71 | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
72 72 | match crate::protocol_serde::shape_response_code_default_operation::ser_response_code_default_operation_http_response(self) {
|
73 73 | Ok(response) => response,
|
74 74 | Err(e) => {
|
75 75 | ::tracing::error!(error = %e, "failed to serialize response");
|
76 76 | ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
77 77 | }
|
78 78 | }
|
79 79 | }
|
80 80 | }
|
81 81 |
|
82 82 | #[allow(unreachable_code, unused_variables)]
|
83 83 | #[cfg(test)]
|
84 84 | mod response_code_default_operation_test {
|
85 85 |
|
86 86 | /// Test ID: ResponseCodeDefaultOperation
|
87 87 | #[::tokio::test]
|
88 88 | #[::tracing_test::traced_test]
|
89 89 | async fn response_code_default_operation_response() {
|
90 90 | let output = crate::output::ResponseCodeDefaultOperationOutput {};
|
91 91 | use ::aws_smithy_http_server::response::IntoResponse;
|
92 92 | let http_response = output.into_response();
|
93 93 | ::pretty_assertions::assert_eq!(
|
94 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
94 + | ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
95 95 | http_response.status()
|
96 96 | );
|
97 97 | }
|
98 98 | }
|
99 99 |
|
100 100 | ::pin_project_lite::pin_project! {
|
101 101 | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
102 102 | /// [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput) using modelled bindings.
|
103 103 | pub struct ResponseCodeHttpFallbackOperationInputFuture {
|
104 104 | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResponseCodeHttpFallbackOperationInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
105 105 | }
|
106 106 | }
|
107 107 |
|
108 108 | impl std::future::Future for ResponseCodeHttpFallbackOperationInputFuture {
|
109 109 | type Output = Result<
|
110 110 | crate::input::ResponseCodeHttpFallbackOperationInput,
|
111 111 | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
|
112 112 | >;
|
113 113 |
|
114 114 | fn poll(
|
115 115 | self: std::pin::Pin<&mut Self>,
|
116 116 | cx: &mut std::task::Context<'_>,
|
117 117 | ) -> std::task::Poll<Self::Output> {
|
118 118 | let this = self.project();
|
119 119 | this.inner.as_mut().poll(cx)
|
120 120 | }
|
121 121 | }
|
122 122 |
|
123 123 | impl<B>
|
124 124 | ::aws_smithy_http_server::request::FromRequest<
|
125 125 | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
126 126 | B,
|
127 127 | > for crate::input::ResponseCodeHttpFallbackOperationInput
|
128 128 | where
|
129 129 | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
130 130 | B: 'static,
|
131 131 |
|
132 132 | B::Data: Send,
|
133 133 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
134 134 | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
135 135 | {
|
136 136 | type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
137 137 | type Future = ResponseCodeHttpFallbackOperationInputFuture;
|
138 138 |
|
139 - | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
139 + | fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
|
140 140 | let fut = async move {
|
141 141 | if !::aws_smithy_http_server::protocol::accept_header_classifier(
|
142 142 | request.headers(),
|
143 143 | &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
|
144 144 | ) {
|
145 145 | return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
146 146 | }
|
147 147 | crate::protocol_serde::shape_response_code_http_fallback_operation::de_response_code_http_fallback_operation_http_request(request)
|
148 148 | .await
|
149 149 | };
|
150 150 | use ::futures_util::future::TryFutureExt;
|
151 151 | let fut = fut.map_err(
|
152 152 | |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
153 153 | ::tracing::debug!(error = %e, "failed to deserialize request");
|
154 154 | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
|
155 155 | e,
|
156 156 | )
|
157 157 | },
|
158 158 | );
|
159 159 | ResponseCodeHttpFallbackOperationInputFuture {
|
160 160 | inner: Box::pin(fut),
|
161 161 | }
|
162 162 | }
|
163 163 | }
|
164 164 | impl
|
165 165 | ::aws_smithy_http_server::response::IntoResponse<
|
166 166 | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
167 167 | > for crate::output::ResponseCodeHttpFallbackOperationOutput
|
168 168 | {
|
169 169 | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
170 170 | match crate::protocol_serde::shape_response_code_http_fallback_operation::ser_response_code_http_fallback_operation_http_response(self) {
|
171 171 | Ok(response) => response,
|
172 172 | Err(e) => {
|
173 173 | ::tracing::error!(error = %e, "failed to serialize response");
|
174 174 | ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
175 175 | }
|
176 176 | }
|
177 177 | }
|
178 178 | }
|
179 179 |
|
180 180 | #[allow(unreachable_code, unused_variables)]
|
181 181 | #[cfg(test)]
|
182 182 | mod response_code_http_fallback_operation_test {
|
183 183 |
|
184 184 | /// Test ID: ResponseCodeHttpFallbackOperation
|
185 185 | #[::tokio::test]
|
186 186 | #[::tracing_test::traced_test]
|
187 187 | async fn response_code_http_fallback_operation_response() {
|
188 188 | let output = crate::output::ResponseCodeHttpFallbackOperationOutput {};
|
189 189 | use ::aws_smithy_http_server::response::IntoResponse;
|
190 190 | let http_response = output.into_response();
|
191 191 | ::pretty_assertions::assert_eq!(
|
192 - | http::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
|
192 + | ::http_1x::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
|
193 193 | http_response.status()
|
194 194 | );
|
195 195 | let expected_headers = [("Content-Length", "2")];
|
196 196 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
197 197 | http_response.headers(),
|
198 198 | expected_headers,
|
199 199 | ));
|
200 200 | }
|
201 201 | }
|
202 202 |
|
203 203 | ::pin_project_lite::pin_project! {
|
204 204 | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
205 205 | /// [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput) using modelled bindings.
|
206 206 | pub struct ResponseCodeRequiredOperationInputFuture {
|
207 207 | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResponseCodeRequiredOperationInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
208 208 | }
|
209 209 | }
|
210 210 |
|
211 211 | impl std::future::Future for ResponseCodeRequiredOperationInputFuture {
|
212 212 | type Output = Result<
|
213 213 | crate::input::ResponseCodeRequiredOperationInput,
|
214 214 | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
|
215 215 | >;
|
216 216 |
|
217 217 | fn poll(
|
218 218 | self: std::pin::Pin<&mut Self>,
|
219 219 | cx: &mut std::task::Context<'_>,
|
220 220 | ) -> std::task::Poll<Self::Output> {
|
221 221 | let this = self.project();
|
222 222 | this.inner.as_mut().poll(cx)
|
223 223 | }
|
224 224 | }
|
225 225 |
|
226 226 | impl<B>
|
227 227 | ::aws_smithy_http_server::request::FromRequest<
|
228 228 | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
229 229 | B,
|
230 230 | > for crate::input::ResponseCodeRequiredOperationInput
|
231 231 | where
|
232 232 | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
233 233 | B: 'static,
|
234 234 |
|
235 235 | B::Data: Send,
|
236 236 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
237 237 | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
238 238 | {
|
239 239 | type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
240 240 | type Future = ResponseCodeRequiredOperationInputFuture;
|
241 241 |
|
242 - | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
242 + | fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
|
243 243 | let fut = async move {
|
244 244 | if !::aws_smithy_http_server::protocol::accept_header_classifier(
|
245 245 | request.headers(),
|
246 246 | &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
|
247 247 | ) {
|
248 248 | return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
249 249 | }
|
250 250 | crate::protocol_serde::shape_response_code_required_operation::de_response_code_required_operation_http_request(request)
|
251 251 | .await
|
252 252 | };
|
253 253 | use ::futures_util::future::TryFutureExt;
|
254 254 | let fut = fut.map_err(
|
255 255 | |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
256 256 | ::tracing::debug!(error = %e, "failed to deserialize request");
|
257 257 | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
|
258 258 | e,
|
259 259 | )
|
260 260 | },
|
261 261 | );
|
262 262 | ResponseCodeRequiredOperationInputFuture {
|
263 263 | inner: Box::pin(fut),
|
264 264 | }
|
265 265 | }
|
266 266 | }
|
267 267 | impl
|
268 268 | ::aws_smithy_http_server::response::IntoResponse<
|
269 269 | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
270 270 | > for crate::output::ResponseCodeRequiredOperationOutput
|
271 271 | {
|
272 272 | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
273 273 | match crate::protocol_serde::shape_response_code_required_operation::ser_response_code_required_operation_http_response(self) {
|
274 274 | Ok(response) => response,
|
275 275 | Err(e) => {
|
276 276 | ::tracing::error!(error = %e, "failed to serialize response");
|
277 277 | ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
|
278 278 | }
|
279 279 | }
|
280 280 | }
|
281 281 | }
|
282 282 |
|
283 283 | #[allow(unreachable_code, unused_variables)]
|
284 284 | #[cfg(test)]
|
285 285 | mod response_code_required_operation_test {
|
286 286 |
|
287 287 | /// Test ID: ResponseCodeRequiredOperation
|
288 288 | #[::tokio::test]
|
289 289 | #[::tracing_test::traced_test]
|
290 290 | async fn response_code_required_operation_response() {
|
291 291 | let output = crate::output::ResponseCodeRequiredOperationOutput { response_code: 201 };
|
292 292 | use ::aws_smithy_http_server::response::IntoResponse;
|
293 293 | let http_response = output.into_response();
|
294 294 | ::pretty_assertions::assert_eq!(
|
295 - | http::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
|
295 + | ::http_1x::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
|
296 296 | http_response.status()
|
297 297 | );
|
298 298 | let expected_headers = [("Content-Length", "2")];
|
299 299 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
300 300 | http_response.headers(),
|
301 301 | expected_headers,
|
302 302 | ));
|
303 303 | }
|
304 304 | }
|
305 305 |
|
306 306 | ::pin_project_lite::pin_project! {
|
307 307 | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
308 308 | /// [`RequiredHeaderCollectionOperationInput`](crate::input::RequiredHeaderCollectionOperationInput) using modelled bindings.
|
309 309 | pub struct RequiredHeaderCollectionOperationInputFuture {
|
310 310 | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::RequiredHeaderCollectionOperationInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
311 311 | }
|
312 312 | }
|
313 313 |
|
314 314 | impl std::future::Future for RequiredHeaderCollectionOperationInputFuture {
|
315 315 | type Output = Result<
|
316 316 | crate::input::RequiredHeaderCollectionOperationInput,
|
317 317 | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
|
318 318 | >;
|
319 319 |
|
320 320 | fn poll(
|
321 321 | self: std::pin::Pin<&mut Self>,
|
322 322 | cx: &mut std::task::Context<'_>,
|
323 323 | ) -> std::task::Poll<Self::Output> {
|
324 324 | let this = self.project();
|
325 325 | this.inner.as_mut().poll(cx)
|
326 326 | }
|
327 327 | }
|
328 328 |
|
329 329 | impl<B>
|
330 330 | ::aws_smithy_http_server::request::FromRequest<
|
331 331 | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
332 332 | B,
|
333 333 | > for crate::input::RequiredHeaderCollectionOperationInput
|
334 334 | where
|
335 335 | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
336 336 | B: 'static,
|
337 337 |
|
338 338 | B::Data: Send,
|
339 339 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
340 340 | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
341 341 | {
|
342 342 | type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
343 343 | type Future = RequiredHeaderCollectionOperationInputFuture;
|
344 344 |
|
345 - | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
345 + | fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
|
346 346 | let fut = async move {
|
347 347 | if !::aws_smithy_http_server::protocol::accept_header_classifier(
|
348 348 | request.headers(),
|
349 349 | &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
|
350 350 | ) {
|
351 351 | return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
352 352 | }
|
353 353 | crate::protocol_serde::shape_required_header_collection_operation::de_required_header_collection_operation_http_request(request)
|
354 354 | .await
|
355 355 | };
|