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