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