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_http_request_with_float_labels_http_request<B>(
|
4 4 | #[allow(unused_variables)] request: ::http::Request<B>,
|
5 5 | ) -> std::result::Result<
|
6 6 | crate::input::HttpRequestWithFloatLabelsInput,
|
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 =
|
18 18 | crate::input::http_request_with_float_labels_input_internal::Builder::default();
|
19 19 | #[allow(unused_variables)]
|
20 20 | let ::aws_smithy_runtime_api::http::RequestParts {
|
21 21 | uri, headers, body, ..
|
22 22 | } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
|
23 23 | let input_string = uri.path();
|
24 24 | let (input_string, (_, m1, m2)) =
|
25 25 | ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
|
26 26 | ::nom::sequence::preceded(
|
27 27 | ::nom::bytes::complete::tag("/"),
|
28 28 | ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>(
|
29 29 | "FloatHttpLabels",
|
30 30 | ),
|
31 31 | ),
|
32 32 | ::nom::sequence::preceded(
|
33 33 | ::nom::bytes::complete::tag("/"),
|
34 34 | ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
|
35 35 | ::nom::bytes::complete::take_until("/"),
|
36 36 | ::nom::combinator::rest,
|
37 37 | )),
|
38 38 | ),
|
39 39 | ::nom::sequence::preceded(
|
40 40 | ::nom::bytes::complete::tag("/"),
|
41 41 | ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
|
42 42 | ::nom::bytes::complete::take_until("/"),
|
43 43 | ::nom::combinator::rest,
|
44 44 | )),
|
45 45 | ),
|
46 46 | ))(input_string)?;
|
47 47 | debug_assert_eq!("", input_string);
|
48 48 | input = input.set_float(
|
49 49 | crate::protocol_serde::shape_http_request_with_float_labels_input::de_float(m1)?,
|
50 50 | );
|
51 51 | input = input.set_double(
|
52 52 | crate::protocol_serde::shape_http_request_with_float_labels_input::de_double(m2)?,
|
53 53 | );
|
54 54 | input.build()?
|
55 55 | })
|
56 56 | }
|
57 57 |
|
58 58 | #[allow(clippy::unnecessary_wraps)]
|
59 59 | pub fn ser_http_request_with_float_labels_http_response(
|
60 60 | #[allow(unused_variables)] output: crate::output::HttpRequestWithFloatLabelsOutput,
|
61 61 | ) -> std::result::Result<
|
62 - | ::aws_smithy_http_server::response::Response,
|
63 - | ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
62 + | ::aws_smithy_legacy_http_server::response::Response,
|
63 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
64 64 | > {
|
65 65 | Ok({
|
66 66 | #[allow(unused_mut)]
|
67 67 | let mut builder = ::http::Response::builder();
|
68 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
68 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
69 69 | builder,
|
70 70 | ::http::header::CONTENT_TYPE,
|
71 71 | "application/json",
|
72 72 | );
|
73 73 | let http_status: u16 = 200;
|
74 74 | builder = builder.status(http_status);
|
75 75 | let payload = "";
|
76 76 | let content_length = payload.len();
|
77 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
77 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
78 78 | builder,
|
79 79 | ::http::header::CONTENT_LENGTH,
|
80 80 | content_length,
|
81 81 | );
|
82 - | let body = ::aws_smithy_http_server::body::to_boxed(payload);
|
82 + | let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
|
83 83 | builder.body(body)?
|
84 84 | })
|
85 85 | }
|
86 86 |
|
87 87 | #[allow(clippy::unnecessary_wraps)]
|
88 88 | pub fn ser_http_request_with_float_labels_http_error(
|
89 89 | error: &crate::error::HttpRequestWithFloatLabelsError,
|
90 90 | ) -> std::result::Result<
|
91 - | ::aws_smithy_http_server::response::Response,
|
92 - | ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
91 + | ::aws_smithy_legacy_http_server::response::Response,
|
92 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
93 93 | > {
|
94 94 | Ok({
|
95 95 | match error {
|
96 96 | crate::error::HttpRequestWithFloatLabelsError::ValidationException(output) => {
|
97 97 | let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
|
98 98 | #[allow(unused_mut)]
|
99 99 | let mut builder = ::http::Response::builder();
|
100 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
100 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
101 101 | builder,
|
102 102 | ::http::header::CONTENT_TYPE,
|
103 103 | "application/json",
|
104 104 | );
|
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::HeaderName::from_static("x-amzn-errortype"),
|
108 108 | "ValidationException",
|
109 109 | );
|
110 110 | let content_length = payload.len();
|
111 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
111 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
112 112 | builder,
|
113 113 | ::http::header::CONTENT_LENGTH,
|
114 114 | content_length,
|
115 115 | );
|
116 116 | builder
|
117 117 | .status(400)
|
118 - | .body(::aws_smithy_http_server::body::to_boxed(payload))?
|
118 + | .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
|
119 119 | }
|
120 120 | crate::error::HttpRequestWithFloatLabelsError::InternalServerError(output) => {
|
121 121 | let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
|
122 122 | #[allow(unused_mut)]
|
123 123 | let mut builder = ::http::Response::builder();
|
124 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
124 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
125 125 | builder,
|
126 126 | ::http::header::CONTENT_TYPE,
|
127 127 | "application/json",
|
128 128 | );
|
129 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
129 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
130 130 | builder,
|
131 131 | ::http::header::HeaderName::from_static("x-amzn-errortype"),
|
132 132 | "InternalServerError",
|
133 133 | );
|
134 134 | let content_length = payload.len();
|
135 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
135 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
136 136 | builder,
|
137 137 | ::http::header::CONTENT_LENGTH,
|
138 138 | content_length,
|
139 139 | );
|
140 140 | builder
|
141 141 | .status(500)
|
142 - | .body(::aws_smithy_http_server::body::to_boxed(payload))?
|
142 + | .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
|
143 143 | }
|
144 144 | }
|
145 145 | })
|
146 146 | }
|