1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /* RustType.kt:534 */
|
3 + | #[allow(clippy::unnecessary_wraps)]
|
4 + | /* ServerHttpBoundProtocolGenerator.kt:408 */
|
5 + | pub async fn de_constant_query_string_http_request<B>(
|
6 + | #[allow(unused_variables)] request: ::http::Request<B>,
|
7 + | ) -> std::result::Result<
|
8 + | crate::input::ConstantQueryStringInput,
|
9 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
|
10 + | >
|
11 + | where
|
12 + | B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
|
13 + | B::Data: Send,
|
14 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
15 + | From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
|
16 + | {
|
17 + | /* ServerHttpBoundProtocolGenerator.kt:424 */
|
18 + | Ok({
|
19 + | /* RustType.kt:534 */
|
20 + | #[allow(unused_mut)]
|
21 + | /* ServerHttpBoundProtocolGenerator.kt:759 */
|
22 + | let mut input = crate::input::constant_query_string_input::Builder::default();
|
23 + | /* RustType.kt:534 */
|
24 + | #[allow(unused_variables)]
|
25 + | /* ServerHttpBoundProtocolGenerator.kt:764 */
|
26 + | let ::aws_smithy_runtime_api::http::RequestParts {
|
27 + | uri, headers, body, ..
|
28 + | } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
|
29 + | /* ServerHttpBoundProtocolGenerator.kt:1134 */
|
30 + | let input_string = uri.path();
|
31 + | /* ServerHttpBoundProtocolGenerator.kt:1146 */
|
32 + | let (input_string, (_, m1)) =
|
33 + | ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
|
34 + | ::nom::sequence::preceded(
|
35 + | ::nom::bytes::complete::tag("/"),
|
36 + | ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>(
|
37 + | "ConstantQueryString",
|
38 + | ),
|
39 + | ),
|
40 + | ::nom::sequence::preceded(
|
41 + | ::nom::bytes::complete::tag("/"),
|
42 + | ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
|
43 + | ::nom::bytes::complete::take_until("/"),
|
44 + | ::nom::combinator::rest,
|
45 + | )),
|
46 + | ),
|
47 + | ))(input_string)?;
|
48 + | debug_assert_eq!("", input_string);
|
49 + | /* ServerHttpBoundProtocolGenerator.kt:1157 */
|
50 + | input = input
|
51 + | .set_hello(crate::protocol_serde::shape_constant_query_string_input::de_hello(m1)?);
|
52 + | /* ServerHttpBoundProtocolGenerator.kt:896 */
|
53 + | input.build()?
|
54 + | /* ServerHttpBoundProtocolGenerator.kt:424 */
|
55 + | })
|
56 + | /* ServerHttpBoundProtocolGenerator.kt:408 */
|
57 + | }
|
58 + |
|
59 + | /* RustType.kt:534 */
|
60 + | #[allow(clippy::unnecessary_wraps)]
|
61 + | /* ServerHttpBoundProtocolGenerator.kt:445 */
|
62 + | pub fn ser_constant_query_string_http_response(
|
63 + | #[allow(unused_variables)] output: crate::output::ConstantQueryStringOutput,
|
64 + | ) -> std::result::Result<
|
65 + | ::aws_smithy_legacy_http_server::response::Response,
|
66 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
67 + | > {
|
68 + | /* ServerHttpBoundProtocolGenerator.kt:457 */
|
69 + | Ok({
|
70 + | /* RustType.kt:534 */
|
71 + | #[allow(unused_mut)]
|
72 + | /* ServerHttpBoundProtocolGenerator.kt:547 */
|
73 + | let mut builder = ::http::Response::builder();
|
74 + | /* ServerHttpBoundProtocolGenerator.kt:633 */
|
75 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
76 + | builder,
|
77 + | ::http::header::CONTENT_TYPE,
|
78 + | "application/json",
|
79 + | );
|
80 + | /* ServerHttpBoundProtocolGenerator.kt:718 */
|
81 + | let http_status: u16 = 200;
|
82 + | builder = builder.status(http_status);
|
83 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
84 + | let payload =
|
85 + | /* HttpBoundProtocolPayloadGenerator.kt:233 */""
|
86 + | /* ServerHttpBoundProtocolGenerator.kt:597 */;
|
87 + | /* ServerHttpBoundProtocolGenerator.kt:699 */
|
88 + | let content_length = payload.len();
|
89 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
90 + | builder,
|
91 + | ::http::header::CONTENT_LENGTH,
|
92 + | content_length,
|
93 + | );
|
94 + | /* ServerHttpBoundProtocolGenerator.kt:603 */
|
95 + | let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
|
96 + | /* ServerHttpBoundProtocolGenerator.kt:611 */
|
97 + | builder.body(body)?
|
98 + | /* ServerHttpBoundProtocolGenerator.kt:457 */
|
99 + | })
|
100 + | /* ServerHttpBoundProtocolGenerator.kt:445 */
|
101 + | }
|
102 + |
|
103 + | /* RustType.kt:534 */
|
104 + | #[allow(clippy::unnecessary_wraps)]
|
105 + | /* ServerHttpBoundProtocolGenerator.kt:471 */
|
106 + | pub fn ser_constant_query_string_http_error(
|
107 + | error: &crate::error::ConstantQueryStringError,
|
108 + | ) -> std::result::Result<
|
109 + | ::aws_smithy_legacy_http_server::response::Response,
|
110 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
111 + | > {
|
112 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
113 + | Ok({
|
114 + | /* ServerHttpBoundProtocolGenerator.kt:492 */
|
115 + | match error {
|
116 + | /* ServerHttpBoundProtocolGenerator.kt:500 */
|
117 + | crate::error::ConstantQueryStringError::ValidationException(output) => {
|
118 + | /* ServerHttpBoundProtocolGenerator.kt:501 */
|
119 + | let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
|
120 + | /* RustType.kt:534 */
|
121 + | #[allow(unused_mut)]
|
122 + | /* ServerHttpBoundProtocolGenerator.kt:511 */
|
123 + | let mut builder = ::http::Response::builder();
|
124 + | /* ServerHttpBoundProtocolGenerator.kt:633 */
|
125 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
126 + | builder,
|
127 + | ::http::header::CONTENT_TYPE,
|
128 + | "application/json",
|
129 + | );
|
130 + | /* ServerHttpBoundProtocolGenerator.kt:633 */
|
131 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
132 + | builder,
|
133 + | ::http::header::HeaderName::from_static("x-amzn-errortype"),
|
134 + | "ValidationException",
|
135 + | );
|
136 + | /* ServerHttpBoundProtocolGenerator.kt:699 */
|
137 + | let content_length = payload.len();
|
138 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
139 + | builder,
|
140 + | ::http::header::CONTENT_LENGTH,
|
141 + | content_length,
|
142 + | );
|
143 + | /* ServerHttpBoundProtocolGenerator.kt:528 */
|
144 + | builder
|
145 + | .status(400)
|
146 + | .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
|
147 + | /* ServerHttpBoundProtocolGenerator.kt:500 */
|
148 + | } /* ServerHttpBoundProtocolGenerator.kt:492 */
|
149 + | }
|
150 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
151 + | })
|
152 + | /* ServerHttpBoundProtocolGenerator.kt:471 */
|
153 + | }
|