1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 2 | #[allow(clippy::unnecessary_wraps)]
|
3 3 | pub async fn de_sparse_json_maps_http_request<B>(
|
4 4 | #[allow(unused_variables)] request: ::http::Request<B>,
|
5 5 | ) -> std::result::Result<
|
6 6 | crate::input::SparseJsonMapsInput,
|
7 - | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
|
7 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
|
8 8 | >
|
9 9 | where
|
10 - | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
10 + | B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
|
11 11 | B::Data: Send,
|
12 - | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
13 - | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
12 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
13 + | From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
|
14 14 | {
|
15 15 | Ok({
|
16 16 | #[allow(unused_mut)]
|
17 17 | let mut input = crate::input::sparse_json_maps_input_internal::Builder::default();
|
18 18 | #[allow(unused_variables)]
|
19 19 | let ::aws_smithy_runtime_api::http::RequestParts {
|
20 20 | uri, headers, body, ..
|
21 21 | } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
|
22 22 | let bytes = ::hyper::body::to_bytes(body).await?;
|
23 23 | if !bytes.is_empty() {
|
24 - | ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
|
24 + | ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
|
25 25 | &headers,
|
26 26 | Some("application/json"),
|
27 27 | )?;
|
28 28 | input = crate::protocol_serde::shape_sparse_json_maps::de_sparse_json_maps(
|
29 29 | bytes.as_ref(),
|
30 30 | input,
|
31 31 | )?;
|
32 32 | }
|
33 33 | input.build()?
|
34 34 | })
|
35 35 | }
|
36 36 |
|
37 37 | #[allow(clippy::unnecessary_wraps)]
|
38 38 | pub fn ser_sparse_json_maps_http_response(
|
39 39 | #[allow(unused_variables)] output: crate::output::SparseJsonMapsOutput,
|
40 40 | ) -> std::result::Result<
|
41 - | ::aws_smithy_http_server::response::Response,
|
42 - | ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
41 + | ::aws_smithy_legacy_http_server::response::Response,
|
42 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
43 43 | > {
|
44 44 | Ok({
|
45 45 | #[allow(unused_mut)]
|
46 46 | let mut builder = ::http::Response::builder();
|
47 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
47 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
48 48 | builder,
|
49 49 | ::http::header::CONTENT_TYPE,
|
50 50 | "application/json",
|
51 51 | );
|
52 52 | let http_status: u16 = 200;
|
53 53 | builder = builder.status(http_status);
|
54 54 | let payload =
|
55 55 | crate::protocol_serde::shape_sparse_json_maps_output::ser_sparse_json_maps_output_output_output(&output)?
|
56 56 | ;
|
57 57 | let content_length = payload.len();
|
58 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
58 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
59 59 | builder,
|
60 60 | ::http::header::CONTENT_LENGTH,
|
61 61 | content_length,
|
62 62 | );
|
63 - | let body = ::aws_smithy_http_server::body::to_boxed(payload);
|
63 + | let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
|
64 64 | builder.body(body)?
|
65 65 | })
|
66 66 | }
|
67 67 |
|
68 68 | #[allow(clippy::unnecessary_wraps)]
|
69 69 | pub fn ser_sparse_json_maps_http_error(
|
70 70 | error: &crate::error::SparseJsonMapsError,
|
71 71 | ) -> std::result::Result<
|
72 - | ::aws_smithy_http_server::response::Response,
|
73 - | ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
72 + | ::aws_smithy_legacy_http_server::response::Response,
|
73 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
74 74 | > {
|
75 75 | Ok({
|
76 76 | match error {
|
77 77 | crate::error::SparseJsonMapsError::ValidationException(output) => {
|
78 78 | let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
|
79 79 | #[allow(unused_mut)]
|
80 80 | let mut builder = ::http::Response::builder();
|
81 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
81 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
82 82 | builder,
|
83 83 | ::http::header::CONTENT_TYPE,
|
84 84 | "application/json",
|
85 85 | );
|
86 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
86 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
87 87 | builder,
|
88 88 | ::http::header::HeaderName::from_static("x-amzn-errortype"),
|
89 89 | "ValidationException",
|
90 90 | );
|
91 91 | let content_length = payload.len();
|
92 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
92 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
93 93 | builder,
|
94 94 | ::http::header::CONTENT_LENGTH,
|
95 95 | content_length,
|
96 96 | );
|
97 97 | builder
|
98 98 | .status(400)
|
99 - | .body(::aws_smithy_http_server::body::to_boxed(payload))?
|
99 + | .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
|
100 100 | }
|
101 101 | crate::error::SparseJsonMapsError::InternalServerError(output) => {
|
102 102 | let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
|
103 103 | #[allow(unused_mut)]
|
104 104 | let mut builder = ::http::Response::builder();
|
105 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
105 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
106 106 | builder,
|
107 107 | ::http::header::CONTENT_TYPE,
|
108 108 | "application/json",
|
109 109 | );
|
110 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
110 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
111 111 | builder,
|
112 112 | ::http::header::HeaderName::from_static("x-amzn-errortype"),
|
113 113 | "InternalServerError",
|
114 114 | );
|
115 115 | let content_length = payload.len();
|
116 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
116 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
117 117 | builder,
|
118 118 | ::http::header::CONTENT_LENGTH,
|
119 119 | content_length,
|
120 120 | );
|
121 121 | builder
|
122 122 | .status(500)
|
123 - | .body(::aws_smithy_http_server::body::to_boxed(payload))?
|
123 + | .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
|
124 124 | }
|
125 125 | }
|
126 126 | })
|
127 127 | }
|
128 128 |
|
129 129 | pub(crate) fn de_sparse_json_maps(
|
130 130 | value: &[u8],
|
131 131 | mut builder: crate::input::sparse_json_maps_input_internal::Builder,
|
132 132 | ) -> ::std::result::Result<
|
133 133 | crate::input::sparse_json_maps_input_internal::Builder,
|