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_malformed_timestamp_path_default_http_request<B>(
|
6 + | #[allow(unused_variables)] request: ::http::Request<B>,
|
7 + | ) -> std::result::Result<
|
8 + | crate::input::MalformedTimestampPathDefaultInput,
|
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::malformed_timestamp_path_default_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 + | "MalformedTimestampPathDefault",
|
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.set_timestamp(
|
51 + | crate::protocol_serde::shape_malformed_timestamp_path_default_input::de_timestamp(m1)?,
|
52 + | );
|
53 + | /* ServerHttpBoundProtocolGenerator.kt:896 */
|
54 + | input.build()?
|
55 + | /* ServerHttpBoundProtocolGenerator.kt:424 */
|
56 + | })
|
57 + | /* ServerHttpBoundProtocolGenerator.kt:408 */
|
58 + | }
|
59 + |
|
60 + | /* RustType.kt:534 */
|
61 + | #[allow(clippy::unnecessary_wraps)]
|
62 + | /* ServerHttpBoundProtocolGenerator.kt:445 */
|
63 + | pub fn ser_malformed_timestamp_path_default_http_response(
|
64 + | #[allow(unused_variables)] output: crate::output::MalformedTimestampPathDefaultOutput,
|
65 + | ) -> std::result::Result<
|
66 + | ::aws_smithy_legacy_http_server::response::Response,
|
67 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
68 + | > {
|
69 + | /* ServerHttpBoundProtocolGenerator.kt:457 */
|
70 + | Ok({
|
71 + | /* RustType.kt:534 */
|
72 + | #[allow(unused_mut)]
|
73 + | /* ServerHttpBoundProtocolGenerator.kt:547 */
|
74 + | let mut builder = ::http::Response::builder();
|
75 + | /* ServerHttpBoundProtocolGenerator.kt:633 */
|
76 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
77 + | builder,
|
78 + | ::http::header::CONTENT_TYPE,
|
79 + | "application/json",
|
80 + | );
|
81 + | /* ServerHttpBoundProtocolGenerator.kt:718 */
|
82 + | let http_status: u16 = 200;
|
83 + | builder = builder.status(http_status);
|
84 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
85 + | let payload =
|
86 + | /* HttpBoundProtocolPayloadGenerator.kt:233 */""
|
87 + | /* ServerHttpBoundProtocolGenerator.kt:597 */;
|
88 + | /* ServerHttpBoundProtocolGenerator.kt:699 */
|
89 + | let content_length = payload.len();
|
90 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
91 + | builder,
|
92 + | ::http::header::CONTENT_LENGTH,
|
93 + | content_length,
|
94 + | );
|
95 + | /* ServerHttpBoundProtocolGenerator.kt:603 */
|
96 + | let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
|
97 + | /* ServerHttpBoundProtocolGenerator.kt:611 */
|
98 + | builder.body(body)?
|
99 + | /* ServerHttpBoundProtocolGenerator.kt:457 */
|
100 + | })
|
101 + | /* ServerHttpBoundProtocolGenerator.kt:445 */
|
102 + | }
|
103 + |
|
104 + | /* RustType.kt:534 */
|
105 + | #[allow(clippy::unnecessary_wraps)]
|
106 + | /* ServerHttpBoundProtocolGenerator.kt:471 */
|
107 + | pub fn ser_malformed_timestamp_path_default_http_error(
|
108 + | error: &crate::error::MalformedTimestampPathDefaultError,
|
109 + | ) -> std::result::Result<
|
110 + | ::aws_smithy_legacy_http_server::response::Response,
|
111 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
112 + | > {
|
113 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
114 + | Ok({
|
115 + | /* ServerHttpBoundProtocolGenerator.kt:492 */
|
116 + | match error {
|
117 + | /* ServerHttpBoundProtocolGenerator.kt:500 */
|
118 + | crate::error::MalformedTimestampPathDefaultError::ValidationException(output) => {
|
119 + | /* ServerHttpBoundProtocolGenerator.kt:501 */
|
120 + | let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
|
121 + | /* RustType.kt:534 */
|
122 + | #[allow(unused_mut)]
|
123 + | /* ServerHttpBoundProtocolGenerator.kt:511 */
|
124 + | let mut builder = ::http::Response::builder();
|
125 + | /* ServerHttpBoundProtocolGenerator.kt:633 */
|
126 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
127 + | builder,
|
128 + | ::http::header::CONTENT_TYPE,
|
129 + | "application/json",
|
130 + | );
|
131 + | /* ServerHttpBoundProtocolGenerator.kt:633 */
|
132 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
133 + | builder,
|
134 + | ::http::header::HeaderName::from_static("x-amzn-errortype"),
|
135 + | "ValidationException",
|
136 + | );
|
137 + | /* ServerHttpBoundProtocolGenerator.kt:699 */
|
138 + | let content_length = payload.len();
|
139 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
140 + | builder,
|
141 + | ::http::header::CONTENT_LENGTH,
|
142 + | content_length,
|
143 + | );
|
144 + | /* ServerHttpBoundProtocolGenerator.kt:528 */
|
145 + | builder
|
146 + | .status(400)
|
147 + | .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
|
148 + | /* ServerHttpBoundProtocolGenerator.kt:500 */
|
149 + | } /* ServerHttpBoundProtocolGenerator.kt:492 */
|
150 + | }
|
151 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
152 + | })
|
153 + | /* ServerHttpBoundProtocolGenerator.kt:471 */
|
154 + | }
|