1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | static CONTENT_TYPE_HTTPSTRINGPAYLOAD2: ::once_cell::sync::Lazy<::mime::Mime> =
|
3 - | ::once_cell::sync::Lazy::new(|| {
|
4 - | "text/plain"
|
5 - | .parse::<::mime::Mime>()
|
6 - | .expect("BUG: MIME parsing failed, content_type is not valid")
|
7 - | });
|
8 - | ::pin_project_lite::pin_project! {
|
9 - | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
10 - | /// [`HttpStringPayload2Input`](crate::input::HttpStringPayload2Input) using modelled bindings.
|
11 - | pub struct HttpStringPayload2InputFuture {
|
12 - | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpStringPayload2Input, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
13 - | }
|
14 - | }
|
15 - |
|
16 - | impl std::future::Future for HttpStringPayload2InputFuture {
|
17 - | type Output = Result<
|
18 - | crate::input::HttpStringPayload2Input,
|
19 - | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
|
20 - | >;
|
21 - |
|
22 - | fn poll(
|
23 - | self: std::pin::Pin<&mut Self>,
|
24 - | cx: &mut std::task::Context<'_>,
|
25 - | ) -> std::task::Poll<Self::Output> {
|
26 - | let this = self.project();
|
27 - | this.inner.as_mut().poll(cx)
|
28 - | }
|
29 - | }
|
30 - |
|
31 - | impl<B>
|
32 - | ::aws_smithy_http_server::request::FromRequest<
|
33 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
34 - | B,
|
35 - | > for crate::input::HttpStringPayload2Input
|
36 - | where
|
37 - | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
38 - | B: 'static,
|
39 - |
|
40 - | B::Data: Send,
|
41 - | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
42 - | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
43 - | {
|
44 - | type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
45 - | type Future = HttpStringPayload2InputFuture;
|
46 - |
|
47 - | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
48 - | let fut = async move {
|
49 - | if !::aws_smithy_http_server::protocol::accept_header_classifier(
|
50 - | request.headers(),
|
51 - | &CONTENT_TYPE_HTTPSTRINGPAYLOAD2,
|
52 - | ) {
|
53 - | return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
54 - | }
|
55 - | crate::protocol_serde::shape_http_string_payload2::de_http_string_payload2_http_request(
|
56 - | request,
|
57 - | )
|
58 - | .await
|
59 - | .map_err(Into::into)
|
60 - | };
|
61 - | use ::futures_util::future::TryFutureExt;
|
62 - | let fut = fut.map_err(
|
63 - | |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
64 - | ::tracing::debug!(error = %e, "failed to deserialize request");
|
65 - | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
|
66 - | e,
|
67 - | )
|
68 - | },
|
69 - | );
|
70 - | HttpStringPayload2InputFuture {
|
71 - | inner: Box::pin(fut),
|
72 - | }
|
73 - | }
|
74 - | }
|
75 - | impl
|
76 - | ::aws_smithy_http_server::response::IntoResponse<
|
77 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
78 - | > for crate::output::HttpStringPayload2Output
|
79 - | {
|
80 - | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
81 - | match crate::protocol_serde::shape_http_string_payload2::ser_http_string_payload2_http_response(self) {
|
82 - | Ok(response) => response,
|
83 - | Err(e) => {
|
84 - | ::tracing::error!(error = %e, "failed to serialize response");
|
85 - | ::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))
|
86 - | }
|
87 - | }
|
88 - | }
|
89 - | }
|
90 - | impl
|
91 - | ::aws_smithy_http_server::response::IntoResponse<
|
92 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
93 - | > for crate::error::HttpStringPayload2Error
|
94 - | {
|
95 - | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
96 - | match crate::protocol_serde::shape_http_string_payload2::ser_http_string_payload2_http_error(
|
97 - | &self,
|
98 - | ) {
|
99 - | Ok(mut response) => {
|
100 - | response.extensions_mut().insert(
|
101 - | ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
|
102 - | );
|
103 - | response
|
104 - | }
|
105 - | Err(e) => {
|
106 - | ::tracing::error!(error = %e, "failed to serialize response");
|
107 - | ::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))
|
108 - | }
|
109 - | }
|
110 - | }
|
111 - | }
|
112 - |
|
113 - | #[allow(unreachable_code, unused_variables)]
|
114 - | #[cfg(test)]
|
115 - | mod http_string_payload2_test {
|
116 - |
|
117 - | /// Test ID: RestJsonStringPayloadRequest2
|
118 - | #[::tokio::test]
|
119 - | #[::tracing_test::traced_test]
|
120 - | async fn rest_json_string_payload_request2_request() {
|
121 - | #[allow(unused_mut)]
|
122 - | let mut http_request = http::Request::builder()
|
123 - | .uri("/StringPayload2")
|
124 - | .method("POST")
|
125 - | .header("Content-Type", "text/plain")
|
126 - | .body(::aws_smithy_http_server::body::Body::from(
|
127 - | ::bytes::Bytes::from_static("rawstring".as_bytes()),
|
128 - | ))
|
129 - | .unwrap();
|
130 - | #[allow(unused_mut)]
|
131 - | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
132 - | let config = crate::service::RestJsonExtrasConfig::builder().build();
|
133 - | let service =
|
134 - | crate::service::RestJsonExtras::builder::<::hyper::body::Body, _, _, _>(config)
|
135 - | .http_string_payload2(move |input: crate::input::HttpStringPayload2Input| {
|
136 - | let sender = sender.clone();
|
137 - | async move {
|
138 - | let result = {
|
139 - | let expected = crate::input::HttpStringPayload2Input {
|
140 - | payload: ::std::option::Option::Some("rawstring".to_owned()),
|
141 - | };
|
142 - | ::pretty_assertions::assert_eq!(input, expected);
|
143 - | let response = crate::output::HttpStringPayload2Output {
|
144 - | payload: ::std::option::Option::None,
|
145 - | };
|
146 - | Ok(response)
|
147 - | };
|
148 - | sender.send(()).await.expect("receiver dropped early");
|
149 - | result
|
150 - | }
|
151 - | })
|
152 - | .build_unchecked();
|
153 - | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
154 - | .await
|
155 - | .expect("unable to make an HTTP request");
|
156 - | assert!(
|
157 - | receiver.recv().await.is_some(),
|
158 - | "we expected operation handler to be invoked but it was not entered"
|
159 - | );
|
160 - | }
|
161 - | /// Test ID: RestJsonStringPayloadResponse2
|
162 - | #[::tokio::test]
|
163 - | #[::tracing_test::traced_test]
|
164 - | async fn rest_json_string_payload_response2_response() {
|
165 - | let output = crate::output::HttpStringPayload2Output {
|
166 - | payload: ::std::option::Option::Some("rawstring".to_owned()),
|
167 - | };
|
168 - | use ::aws_smithy_http_server::response::IntoResponse;
|
169 - | let http_response = output.into_response();
|
170 - | ::pretty_assertions::assert_eq!(
|
171 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
172 - | http_response.status()
|
173 - | );
|
174 - | let expected_headers = [("Content-Type", "text/plain")];
|
175 - | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
176 - | http_response.headers(),
|
177 - | expected_headers,
|
178 - | ));
|
179 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
180 - | .await
|
181 - | .expect("unable to extract body to bytes");
|
182 - | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
183 - | &body,
|
184 - | "rawstring",
|
185 - | ::aws_smithy_protocol_test::MediaType::from("text/plain"),
|
186 - | ));
|
187 - | }
|
188 - | /// Upper case error modeled lower case.
|
189 - | /// Test ID: ServiceLevelErrorServer
|
190 - | #[::tokio::test]
|
191 - | #[::tracing_test::traced_test]
|
192 - | async fn service_level_error_server_response() {
|
193 - | let output = crate::error::ExtraError {};
|
194 - | let output = crate::error::HttpStringPayload2Error::ExtraError(output);
|
195 - | use ::aws_smithy_http_server::response::IntoResponse;
|
196 - | let http_response = output.into_response();
|
197 - | ::pretty_assertions::assert_eq!(
|
198 - | http::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
|
199 - | http_response.status()
|
200 - | );
|
201 - | let expected_headers = [("X-Amzn-Errortype", "ExtraError")];
|
202 - | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
203 - | http_response.headers(),
|
204 - | expected_headers,
|
205 - | ));
|
206 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
207 - | .await
|
208 - | .expect("unable to extract body to bytes");
|
209 - | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
210 - | &body,
|
211 - | "{}",
|
212 - | ::aws_smithy_protocol_test::MediaType::from("unknown"),
|
213 - | ));
|
214 - | }
|
215 - | /// Serializes a string in the HTTP payload without a content-type header
|
216 - | /// Test ID: RestJsonStringPayloadNoContentType2
|
217 - | #[::tokio::test]
|
218 - | #[::tracing_test::traced_test]
|
219 - | async fn rest_json_string_payload_no_content_type2_malformed_request() {
|
220 - | {
|
221 - | #[allow(unused_mut)]
|
222 - | let mut http_request = http::Request::builder()
|
223 - | .uri("/StringPayload2")
|
224 - | .method("POST")
|
225 - | .body(::aws_smithy_http_server::body::Body::from(
|
226 - | ::bytes::Bytes::from_static("rawstring".as_bytes()),
|
227 - | ))
|
228 - | .unwrap();
|
229 - | #[allow(unused_mut)]
|
230 - | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
231 - | let config = crate::service::RestJsonExtrasConfig::builder().build();
|
232 - | let service = crate::service::RestJsonExtras::builder::<::hyper::body::Body, _, _, _>(config)
|
233 - | .http_string_payload2(move |input: crate::input::HttpStringPayload2Input| {
|
234 - | let sender = sender.clone();
|
235 - | async move {
|
236 - | let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::HttpStringPayload2Output, crate::error::HttpStringPayload2Error> };
|
237 - | sender.send(()).await.expect("receiver dropped early");
|
238 - | result
|
239 - | }
|
240 - | })
|
241 - | .build_unchecked();
|
242 - | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
243 - | .await
|
244 - | .expect("unable to make an HTTP request");
|
245 - | ::pretty_assertions::assert_eq!(
|
246 - | http::StatusCode::from_u16(415).expect("invalid expected HTTP status code"),
|
247 - | http_response.status()
|
248 - | );
|
249 - | let expected_headers = [("x-amzn-errortype", "UnsupportedMediaTypeException")];
|
250 - | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
251 - | http_response.headers(),
|
252 - | expected_headers,
|
253 - | ));
|
254 - | }
|
255 - | }
|
256 - | /// Serializes a string in the HTTP payload without the expected content-type header
|
257 - | /// Test ID: RestJsonStringPayloadWrongContentType2
|
258 - | #[::tokio::test]
|
259 - | #[::tracing_test::traced_test]
|
260 - | async fn rest_json_string_payload_wrong_content_type2_malformed_request() {
|
261 - | {
|
262 - | #[allow(unused_mut)]
|
263 - | let mut http_request = http::Request::builder()
|
264 - | .uri("/StringPayload2")
|
265 - | .method("POST")
|
266 - | .header("Content-Type", "application/json")
|
267 - | .body(::aws_smithy_http_server::body::Body::from(
|
268 - | ::bytes::Bytes::from_static("rawstring".as_bytes()),
|
269 - | ))
|
270 - | .unwrap();
|
271 - | #[allow(unused_mut)]
|
272 - | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
273 - | let config = crate::service::RestJsonExtrasConfig::builder().build();
|
274 - | let service = crate::service::RestJsonExtras::builder::<::hyper::body::Body, _, _, _>(config)
|
275 - | .http_string_payload2(move |input: crate::input::HttpStringPayload2Input| {
|
276 - | let sender = sender.clone();
|
277 - | async move {
|
278 - | let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::HttpStringPayload2Output, crate::error::HttpStringPayload2Error> };
|
279 - | sender.send(()).await.expect("receiver dropped early");
|
280 - | result
|
281 - | }
|
282 - | })
|
283 - | .build_unchecked();
|
284 - | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
285 - | .await
|
286 - | .expect("unable to make an HTTP request");
|
287 - | ::pretty_assertions::assert_eq!(
|
288 - | http::StatusCode::from_u16(415).expect("invalid expected HTTP status code"),
|
289 - | http_response.status()
|
290 - | );
|
291 - | let expected_headers = [("x-amzn-errortype", "UnsupportedMediaTypeException")];
|
292 - | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
293 - | http_response.headers(),
|
294 - | expected_headers,
|
295 - | ));
|
296 - | }
|
297 - | }
|
298 - | /// Serializes a string in the HTTP payload with an unstatisfiable accept header
|
299 - | /// Test ID: RestJsonStringPayloadUnsatisfiableAccept2
|
300 - | #[::tokio::test]
|
301 - | #[::tracing_test::traced_test]
|
302 - | async fn rest_json_string_payload_unsatisfiable_accept2_malformed_request() {
|
303 - | {
|
304 - | #[allow(unused_mut)]
|
305 - | let mut http_request = http::Request::builder()
|
306 - | .uri("/StringPayload2")
|
307 - | .method("POST")
|
308 - | .header("Accept", "application/json")
|
309 - | .header("Content-Type", "text/plain")
|
310 - | .body(::aws_smithy_http_server::body::Body::from(
|
311 - | ::bytes::Bytes::from_static("rawstring".as_bytes()),
|
312 - | ))
|
313 - | .unwrap();
|
314 - | #[allow(unused_mut)]
|
315 - | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
316 - | let config = crate::service::RestJsonExtrasConfig::builder().build();
|
317 - | let service = crate::service::RestJsonExtras::builder::<::hyper::body::Body, _, _, _>(config)
|
318 - | .http_string_payload2(move |input: crate::input::HttpStringPayload2Input| {
|
319 - | let sender = sender.clone();
|
320 - | async move {
|
321 - | let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::HttpStringPayload2Output, crate::error::HttpStringPayload2Error> };
|
322 - | sender.send(()).await.expect("receiver dropped early");
|
323 - | result
|
324 - | }
|
325 - | })
|
326 - | .build_unchecked();
|
327 - | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
328 - | .await
|
329 - | .expect("unable to make an HTTP request");
|
330 - | ::pretty_assertions::assert_eq!(
|
331 - | http::StatusCode::from_u16(406).expect("invalid expected HTTP status code"),
|
332 - | http_response.status()
|
333 - | );
|
334 - | let expected_headers = [("x-amzn-errortype", "NotAcceptableException")];
|
335 - | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
336 - | http_response.headers(),
|
337 - | expected_headers,
|
338 - | ));
|
339 - | }
|
340 - | }
|
341 - | }
|
342 - |
|
343 - | static CONTENT_TYPE_HTTPENUMPAYLOAD2: ::once_cell::sync::Lazy<::mime::Mime> =
|
344 - | ::once_cell::sync::Lazy::new(|| {
|
345 - | "text/plain"
|
346 - | .parse::<::mime::Mime>()
|
347 - | .expect("BUG: MIME parsing failed, content_type is not valid")
|
348 - | });
|
349 - | ::pin_project_lite::pin_project! {
|
350 - | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
351 - | /// [`HttpEnumPayload2Input`](crate::input::HttpEnumPayload2Input) using modelled bindings.
|
352 - | pub struct HttpEnumPayload2InputFuture {
|
353 - | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpEnumPayload2Input, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
354 - | }
|
355 - | }
|
356 - |
|
357 - | impl std::future::Future for HttpEnumPayload2InputFuture {
|
358 - | type Output = Result<
|
359 - | crate::input::HttpEnumPayload2Input,
|
360 - | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
|
361 - | >;
|
362 - |
|
363 - | fn poll(
|
364 - | self: std::pin::Pin<&mut Self>,
|
365 - | cx: &mut std::task::Context<'_>,
|
366 - | ) -> std::task::Poll<Self::Output> {
|
367 - | let this = self.project();
|
368 - | this.inner.as_mut().poll(cx)
|
369 - | }
|
370 - | }
|
371 - |
|
372 - | impl<B>
|
373 - | ::aws_smithy_http_server::request::FromRequest<
|
374 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
375 - | B,
|
376 - | > for crate::input::HttpEnumPayload2Input
|
377 - | where
|
378 - | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
379 - | B: 'static,
|
380 - |
|
381 - | B::Data: Send,
|
382 - | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
383 - | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
384 - | {
|
385 - | type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
386 - | type Future = HttpEnumPayload2InputFuture;
|
387 - |
|
388 - | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
389 - | let fut = async move {
|
390 - | if !::aws_smithy_http_server::protocol::accept_header_classifier(
|
391 - | request.headers(),
|
392 - | &CONTENT_TYPE_HTTPENUMPAYLOAD2,
|
393 - | ) {
|
394 - | return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
395 - | }
|
396 - | crate::protocol_serde::shape_http_enum_payload2::de_http_enum_payload2_http_request(
|
397 - | request,
|
398 - | )
|
399 - | .await
|
400 - | .map_err(Into::into)
|
401 - | };
|
402 - | use ::futures_util::future::TryFutureExt;
|
403 - | let fut = fut.map_err(
|
404 - | |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
405 - | ::tracing::debug!(error = %e, "failed to deserialize request");
|
406 - | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
|
407 - | e,
|
408 - | )
|
409 - | },
|
410 - | );
|
411 - | HttpEnumPayload2InputFuture {
|
412 - | inner: Box::pin(fut),
|
413 - | }
|
414 - | }
|
415 - | }
|
416 - | impl
|
417 - | ::aws_smithy_http_server::response::IntoResponse<
|
418 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
419 - | > for crate::output::HttpEnumPayload2Output
|
420 - | {
|
421 - | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
422 - | match crate::protocol_serde::shape_http_enum_payload2::ser_http_enum_payload2_http_response(
|
423 - | self,
|
424 - | ) {
|
425 - | Ok(response) => response,
|
426 - | Err(e) => {
|
427 - | ::tracing::error!(error = %e, "failed to serialize response");
|
428 - | ::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))
|
429 - | }
|
430 - | }
|
431 - | }
|
432 - | }
|
433 - | impl
|
434 - | ::aws_smithy_http_server::response::IntoResponse<
|
435 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
436 - | > for crate::error::HttpEnumPayload2Error
|
437 - | {
|
438 - | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
439 - | match crate::protocol_serde::shape_http_enum_payload2::ser_http_enum_payload2_http_error(
|
440 - | &self,
|
441 - | ) {
|
442 - | Ok(mut response) => {
|
443 - | response.extensions_mut().insert(
|
444 - | ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
|
445 - | );
|
446 - | response
|
447 - | }
|
448 - | Err(e) => {
|
449 - | ::tracing::error!(error = %e, "failed to serialize response");
|
450 - | ::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))
|
451 - | }
|
452 - | }
|
453 - | }
|
454 - | }
|
455 - |
|
456 - | #[allow(unreachable_code, unused_variables)]
|
457 - | #[cfg(test)]
|
458 - | mod http_enum_payload2_test {
|
459 - |
|
460 - | /// Test ID: RestJsonEnumPayloadRequest2
|
461 - | #[::tokio::test]
|
462 - | #[::tracing_test::traced_test]
|
463 - | async fn rest_json_enum_payload_request2_request() {
|
464 - | #[allow(unused_mut)]
|
465 - | let mut http_request = http::Request::builder()
|
466 - | .uri("/EnumPayload2")
|
467 - | .method("POST")
|
468 - | .header("Content-Type", "text/plain")
|
469 - | .body(::aws_smithy_http_server::body::Body::from(
|
470 - | ::bytes::Bytes::from_static("enumvalue".as_bytes()),
|
471 - | ))
|
472 - | .unwrap();
|
473 - | #[allow(unused_mut)]
|
474 - | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
475 - | let config = crate::service::RestJsonExtrasConfig::builder().build();
|
476 - | let service =
|
477 - | crate::service::RestJsonExtras::builder::<::hyper::body::Body, _, _, _>(config)
|
478 - | .http_enum_payload2(move |input: crate::input::HttpEnumPayload2Input| {
|
479 - | let sender = sender.clone();
|
480 - | async move {
|
481 - | let result = {
|
482 - | let expected = crate::input::HttpEnumPayload2Input {
|
483 - | payload: ::std::option::Option::Some(
|
484 - | "enumvalue"
|
485 - | .parse::<crate::model::StringEnum>()
|
486 - | .expect("static value validated to member"),
|
487 - | ),
|
488 - | };
|
489 - | ::pretty_assertions::assert_eq!(input, expected);
|
490 - | let response = crate::output::HttpEnumPayload2Output {
|
491 - | payload: ::std::option::Option::None,
|
492 - | };
|
493 - | Ok(response)
|
494 - | };
|
495 - | sender.send(()).await.expect("receiver dropped early");
|
496 - | result
|
497 - | }
|
498 - | })
|
499 - | .build_unchecked();
|
500 - | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
501 - | .await
|
502 - | .expect("unable to make an HTTP request");
|
503 - | assert!(
|
504 - | receiver.recv().await.is_some(),
|
505 - | "we expected operation handler to be invoked but it was not entered"
|
506 - | );
|
507 - | }
|
508 - | /// Test ID: RestJsonEnumPayloadResponse2
|
509 - | #[::tokio::test]
|
510 - | #[::tracing_test::traced_test]
|
511 - | async fn rest_json_enum_payload_response2_response() {
|
512 - | let output = crate::output::HttpEnumPayload2Output {
|
513 - | payload: ::std::option::Option::Some(
|
514 - | "enumvalue"
|
515 - | .parse::<crate::model::StringEnum>()
|
516 - | .expect("static value validated to member"),
|
517 - | ),
|
518 - | };
|
519 - | use ::aws_smithy_http_server::response::IntoResponse;
|
520 - | let http_response = output.into_response();
|
521 - | ::pretty_assertions::assert_eq!(
|
522 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
523 - | http_response.status()
|
524 - | );
|
525 - | let expected_headers = [("Content-Type", "text/plain")];
|
526 - | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
527 - | http_response.headers(),
|
528 - | expected_headers,
|
529 - | ));
|
530 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
531 - | .await
|
532 - | .expect("unable to extract body to bytes");
|
533 - | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
534 - | &body,
|
535 - | "enumvalue",
|
536 - | ::aws_smithy_protocol_test::MediaType::from("unknown"),
|
537 - | ));
|
538 - | }
|
539 - | /// Upper case error modeled lower case.
|
540 - | /// Test ID: ServiceLevelErrorServer
|
541 - | #[::tokio::test]
|
542 - | #[::tracing_test::traced_test]
|
543 - | async fn service_level_error_server_response() {
|
544 - | let output = crate::error::ExtraError {};
|
545 - | let output = crate::error::HttpEnumPayload2Error::ExtraError(output);
|
546 - | use ::aws_smithy_http_server::response::IntoResponse;
|
547 - | let http_response = output.into_response();
|
548 - | ::pretty_assertions::assert_eq!(
|
549 - | http::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
|
550 - | http_response.status()
|
551 - | );
|
552 - | let expected_headers = [("X-Amzn-Errortype", "ExtraError")];
|
553 - | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
554 - | http_response.headers(),
|
555 - | expected_headers,
|
556 - | ));
|
557 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
558 - | .await
|
559 - | .expect("unable to extract body to bytes");
|
560 - | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
561 - | &body,
|
562 - | "{}",
|
563 - | ::aws_smithy_protocol_test::MediaType::from("unknown"),
|
564 - | ));
|
565 - | }
|
566 - | }
|
567 - |
|
568 - | const CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHBODY2: ::mime::Mime = ::mime::APPLICATION_JSON;
|
569 - | ::pin_project_lite::pin_project! {
|
570 - | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
571 - | /// [`MalformedContentTypeWithBody2Input`](crate::input::MalformedContentTypeWithBody2Input) using modelled bindings.
|
572 - | pub struct MalformedContentTypeWithBody2InputFuture {
|
573 - | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedContentTypeWithBody2Input, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
574 - | }
|
575 - | }
|
576 - |
|
577 - | impl std::future::Future for MalformedContentTypeWithBody2InputFuture {
|
578 - | type Output = Result<
|
579 - | crate::input::MalformedContentTypeWithBody2Input,
|
580 - | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
|
581 - | >;
|
582 - |
|
583 - | fn poll(
|
584 - | self: std::pin::Pin<&mut Self>,
|
585 - | cx: &mut std::task::Context<'_>,
|
586 - | ) -> std::task::Poll<Self::Output> {
|
587 - | let this = self.project();
|
588 - | this.inner.as_mut().poll(cx)
|
589 - | }
|
590 - | }
|
591 - |
|
592 - | impl<B>
|
593 - | ::aws_smithy_http_server::request::FromRequest<
|
594 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
595 - | B,
|
596 - | > for crate::input::MalformedContentTypeWithBody2Input
|
597 - | where
|
598 - | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
599 - | B: 'static,
|
600 - |
|
601 - | B::Data: Send,
|
602 - | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
603 - | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
604 - | {
|
605 - | type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
606 - | type Future = MalformedContentTypeWithBody2InputFuture;
|
607 - |
|
608 - | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
609 - | let fut = async move {
|
610 - | if !::aws_smithy_http_server::protocol::accept_header_classifier(
|
611 - | request.headers(),
|
612 - | &CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHBODY2,
|
613 - | ) {
|
614 - | return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
|
615 - | }
|
616 - | crate::protocol_serde::shape_malformed_content_type_with_body2::de_malformed_content_type_with_body2_http_request(request)
|
617 - | .await
|
618 - | .map_err(Into::into)
|
619 - | };
|
620 - | use ::futures_util::future::TryFutureExt;
|
621 - | let fut = fut.map_err(
|
622 - | |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
623 - | ::tracing::debug!(error = %e, "failed to deserialize request");
|
624 - | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
|
625 - | e,
|
626 - | )
|
627 - | },
|
628 - | );
|
629 - | MalformedContentTypeWithBody2InputFuture {
|
630 - | inner: Box::pin(fut),
|
631 - | }
|
632 - | }
|
633 - | }
|
634 - | impl
|
635 - | ::aws_smithy_http_server::response::IntoResponse<
|
636 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
637 - | > for crate::output::MalformedContentTypeWithBody2Output
|
638 - | {
|
639 - | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
640 - | match crate::protocol_serde::shape_malformed_content_type_with_body2::ser_malformed_content_type_with_body2_http_response(self) {
|
641 - | Ok(response) => response,
|
642 - | Err(e) => {
|
643 - | ::tracing::error!(error = %e, "failed to serialize response");
|
644 - | ::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))
|
645 - | }
|
646 - | }
|
647 - | }
|
648 - | }
|
649 - | impl
|
650 - | ::aws_smithy_http_server::response::IntoResponse<
|
651 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
652 - | > for crate::error::MalformedContentTypeWithBody2Error
|
653 - | {
|
654 - | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
655 - | match crate::protocol_serde::shape_malformed_content_type_with_body2::ser_malformed_content_type_with_body2_http_error(&self) {
|
656 - | Ok(mut response) => {
|
657 - | response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
|
658 - | response
|
659 - | },
|
660 - | Err(e) => {
|
661 - | ::tracing::error!(error = %e, "failed to serialize response");
|
662 - | ::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))
|
663 - | }
|
664 - | }
|
665 - | }
|
666 - | }
|
667 - |
|
668 - | #[allow(unreachable_code, unused_variables)]
|
669 - | #[cfg(test)]
|
670 - | mod malformed_content_type_with_body2_test {
|
671 - |
|
672 - | /// Upper case error modeled lower case.
|
673 - | /// Test ID: ServiceLevelErrorServer
|
674 - | #[::tokio::test]
|
675 - | #[::tracing_test::traced_test]
|
676 - | async fn service_level_error_server_response() {
|
677 - | let output = crate::error::ExtraError {};
|
678 - | let output = crate::error::MalformedContentTypeWithBody2Error::ExtraError(output);
|
679 - | use ::aws_smithy_http_server::response::IntoResponse;
|
680 - | let http_response = output.into_response();
|
681 - | ::pretty_assertions::assert_eq!(
|
682 - | http::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
|
683 - | http_response.status()
|
684 - | );
|
685 - | let expected_headers = [("X-Amzn-Errortype", "ExtraError")];
|
686 - | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
687 - | http_response.headers(),
|
688 - | expected_headers,
|
689 - | ));
|
690 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
691 - | .await
|
692 - | .expect("unable to extract body to bytes");
|
693 - | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
694 - | &body,
|
695 - | "{}",
|
696 - | ::aws_smithy_protocol_test::MediaType::from("unknown"),
|
697 - | ));
|
698 - | }
|
699 - | /// When there is modeled input, the content type must be application/json
|
700 - | /// Test ID: RestJsonWithBodyExpectsApplicationJsonContentTypeNoHeaders
|
701 - | #[::tokio::test]
|
702 - | #[::tracing_test::traced_test]
|
703 - | async fn rest_json_with_body_expects_application_json_content_type_no_headers_malformed_request(
|
704 - | ) {
|
705 - | {
|
706 - | #[allow(unused_mut)]
|
707 - | let mut http_request = http::Request::builder()
|
708 - | .uri("/MalformedContentTypeWithBody")
|
709 - | .method("POST")
|
710 - | .body(::aws_smithy_http_server::body::Body::from(
|
711 - | ::bytes::Bytes::from_static("{}".as_bytes()),
|
712 - | ))
|
713 - | .unwrap();
|
714 - | #[allow(unused_mut)]
|
715 - | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
716 - | let config = crate::service::RestJsonExtrasConfig::builder().build();
|
717 - | let service = crate::service::RestJsonExtras::builder::<::hyper::body::Body, _, _, _>(config)
|
718 - | .malformed_content_type_with_body2(move |input: crate::input::MalformedContentTypeWithBody2Input| {
|
719 - | let sender = sender.clone();
|
720 - | async move {
|
721 - | let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedContentTypeWithBody2Output, crate::error::MalformedContentTypeWithBody2Error> };
|
722 - | sender.send(()).await.expect("receiver dropped early");
|
723 - | result
|
724 - | }
|
725 - | })
|
726 - | .build_unchecked();
|
727 - | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
728 - | .await
|
729 - | .expect("unable to make an HTTP request");
|
730 - | ::pretty_assertions::assert_eq!(
|
731 - | http::StatusCode::from_u16(415).expect("invalid expected HTTP status code"),
|
732 - | http_response.status()
|
733 - | );
|
734 - | let expected_headers = [("x-amzn-errortype", "UnsupportedMediaTypeException")];
|
735 - | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
736 - | http_response.headers(),
|
737 - | expected_headers,
|
738 - | ));
|
739 - | }
|
740 - | }
|
741 - | }
|
742 - |
|
743 - | ::pin_project_lite::pin_project! {
|
744 - | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
745 - | /// [`HttpPayloadTraits2Input`](crate::input::HttpPayloadTraits2Input) using modelled bindings.
|
746 - | pub struct HttpPayloadTraits2InputFuture {
|
747 - | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpPayloadTraits2Input, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
748 - | }
|
749 - | }
|
750 - |
|
751 - | impl std::future::Future for HttpPayloadTraits2InputFuture {
|
752 - | type Output = Result<
|
753 - | crate::input::HttpPayloadTraits2Input,
|
754 - | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
|
755 - | >;
|
756 - |
|
757 - | fn poll(
|
758 - | self: std::pin::Pin<&mut Self>,
|
759 - | cx: &mut std::task::Context<'_>,
|
760 - | ) -> std::task::Poll<Self::Output> {
|
761 - | let this = self.project();
|
762 - | this.inner.as_mut().poll(cx)
|
763 - | }
|
764 - | }
|
765 - |
|
766 - | impl<B>
|
767 - | ::aws_smithy_http_server::request::FromRequest<
|
768 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
769 - | B,
|
770 - | > for crate::input::HttpPayloadTraits2Input
|
771 - | where
|
772 - | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
773 - | B: 'static,
|
774 - |
|
775 - | B::Data: Send,
|
776 - | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
777 - | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
778 - | {
|
779 - | type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
|
780 - | type Future = HttpPayloadTraits2InputFuture;
|
781 - |
|
782 - | fn from_request(request: ::http::Request<B>) -> Self::Future {
|
783 - | let fut = async move {
|
784 - | crate::protocol_serde::shape_http_payload_traits2::de_http_payload_traits2_http_request(
|
785 - | request,
|
786 - | )
|
787 - | .await
|
788 - | .map_err(Into::into)
|
789 - | };
|
790 - | use ::futures_util::future::TryFutureExt;
|
791 - | let fut = fut.map_err(
|
792 - | |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
|
793 - | ::tracing::debug!(error = %e, "failed to deserialize request");
|
794 - | ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
|
795 - | e,
|
796 - | )
|
797 - | },
|
798 - | );
|
799 - | HttpPayloadTraits2InputFuture {
|
800 - | inner: Box::pin(fut),
|
801 - | }
|
802 - | }
|
803 - | }
|
804 - | impl
|
805 - | ::aws_smithy_http_server::response::IntoResponse<
|
806 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
807 - | > for crate::output::HttpPayloadTraits2Output
|
808 - | {
|
809 - | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
810 - | match crate::protocol_serde::shape_http_payload_traits2::ser_http_payload_traits2_http_response(self) {
|
811 - | Ok(response) => response,
|
812 - | Err(e) => {
|
813 - | ::tracing::error!(error = %e, "failed to serialize response");
|
814 - | ::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))
|
815 - | }
|
816 - | }
|
817 - | }
|
818 - | }
|
819 - | impl
|
820 - | ::aws_smithy_http_server::response::IntoResponse<
|
821 - | ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
|
822 - | > for crate::error::HttpPayloadTraits2Error
|
823 - | {
|
824 - | fn into_response(self) -> ::aws_smithy_http_server::response::Response {
|
825 - | match crate::protocol_serde::shape_http_payload_traits2::ser_http_payload_traits2_http_error(
|
826 - | &self,
|
827 - | ) {
|
828 - | Ok(mut response) => {
|
829 - | response.extensions_mut().insert(
|
830 - | ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
|
831 - | );
|
832 - | response
|
833 - | }
|
834 - | Err(e) => {
|
835 - | ::tracing::error!(error = %e, "failed to serialize response");
|
836 - | ::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))
|
837 - | }
|
838 - | }
|
839 - | }
|
840 - | }
|
841 - |
|
842 - | #[allow(unreachable_code, unused_variables)]
|
843 - | #[cfg(test)]
|
844 - | mod http_payload_traits2_test {
|
845 - |
|
846 - | /// Servers must accept no content type for blob inputs
|
847 - | /// without the media type trait.
|
848 - | /// Test ID: RestJsonHttpPayloadTraitsWithBlobAcceptsNoContentType
|
849 - | #[::tokio::test]
|
850 - | #[::tracing_test::traced_test]
|
851 - | async fn rest_json_http_payload_traits_with_blob_accepts_no_content_type_request() {
|
852 - | #[allow(unused_mut)]
|
853 - | let mut http_request = http::Request::builder()
|
854 - | .uri("/HttpPayloadTraits")
|
855 - | .method("POST")
|
856 - | .header("X-Foo", "Foo")
|
857 - | .body(::aws_smithy_http_server::body::Body::from(
|
858 - | ::bytes::Bytes::from_static("This is definitely a jpeg".as_bytes()),
|
859 - | ))
|
860 - | .unwrap();
|
861 - | #[allow(unused_mut)]
|
862 - | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
863 - | let config = crate::service::RestJsonExtrasConfig::builder().build();
|
864 - | let service =
|
865 - | crate::service::RestJsonExtras::builder::<::hyper::body::Body, _, _, _>(config)
|
866 - | .http_payload_traits2(move |input: crate::input::HttpPayloadTraits2Input| {
|
867 - | let sender = sender.clone();
|
868 - | async move {
|
869 - | let result = {
|
870 - | let expected = crate::input::HttpPayloadTraits2Input {
|
871 - | foo: ::std::option::Option::Some("Foo".to_owned()),
|
872 - | blob: ::std::option::Option::Some(::aws_smithy_types::Blob::new(
|
873 - | "This is definitely a jpeg",
|
874 - | )),
|
875 - | };
|
876 - | ::pretty_assertions::assert_eq!(input, expected);
|
877 - | let response = crate::output::HttpPayloadTraits2Output {
|
878 - | foo: ::std::option::Option::None,
|
879 - | blob: ::std::option::Option::None,
|
880 - | };
|
881 - | Ok(response)
|
882 - | };
|
883 - | sender.send(()).await.expect("receiver dropped early");
|
884 - | result
|
885 - | }
|
886 - | })
|
887 - | .build_unchecked();
|
888 - | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
889 - | .await
|
890 - | .expect("unable to make an HTTP request");
|
891 - | assert!(
|
892 - | receiver.recv().await.is_some(),
|
893 - | "we expected operation handler to be invoked but it was not entered"
|
894 - | );
|
895 - | }
|
896 - | /// Upper case error modeled lower case.
|
897 - | /// Test ID: ServiceLevelErrorServer
|
898 - | #[::tokio::test]
|
899 - | #[::tracing_test::traced_test]
|
900 - | async fn service_level_error_server_response() {
|
901 - | let output = crate::error::ExtraError {};
|
902 - | let output = crate::error::HttpPayloadTraits2Error::ExtraError(output);
|
903 - | use ::aws_smithy_http_server::response::IntoResponse;
|
904 - | let http_response = output.into_response();
|
905 - | ::pretty_assertions::assert_eq!(
|
906 - | http::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
|
907 - | http_response.status()
|
908 - | );
|
909 - | let expected_headers = [("X-Amzn-Errortype", "ExtraError")];
|
910 - | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
911 - | http_response.headers(),
|
912 - | expected_headers,
|
913 - | ));
|
914 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
915 - | .await
|
916 - | .expect("unable to extract body to bytes");
|
917 - | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
918 - | &body,
|
919 - | "{}",
|
920 - | ::aws_smithy_protocol_test::MediaType::from("unknown"),
|
921 - | ));
|
922 - | }
|
923 - | }
|
924 - |
|
925 2 | const CONTENT_TYPE_QUERYPRECEDENCE: ::mime::Mime = ::mime::APPLICATION_JSON;
|
926 3 | ::pin_project_lite::pin_project! {
|
927 4 | /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
|
928 5 | /// [`QueryPrecedenceInput`](crate::input::QueryPrecedenceInput) using modelled bindings.
|
929 6 | pub struct QueryPrecedenceInputFuture {
|
930 7 | inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::QueryPrecedenceInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
|
931 8 | }
|
932 9 | }
|
933 10 |
|
934 11 | impl std::future::Future for QueryPrecedenceInputFuture {
|