1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /* RustType.kt:516 */
|
2 3 | #[allow(clippy::unnecessary_wraps)]
|
4 + | /* ServerHttpBoundProtocolGenerator.kt:383 */
|
3 5 | pub async fn de_malformed_timestamp_path_default_http_request<B>(
|
4 6 | #[allow(unused_variables)] request: ::http::Request<B>,
|
5 7 | ) -> std::result::Result<
|
6 8 | crate::input::MalformedTimestampPathDefaultInput,
|
7 9 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
|
8 10 | >
|
9 11 | where
|
10 12 | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
11 13 | B::Data: Send,
|
12 14 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
13 15 | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
14 16 | {
|
17 + | /* ServerHttpBoundProtocolGenerator.kt:399 */
|
15 18 | Ok({
|
19 + | /* RustType.kt:516 */
|
16 20 | #[allow(unused_mut)]
|
21 + | /* ServerHttpBoundProtocolGenerator.kt:723 */
|
17 22 | let mut input = crate::input::malformed_timestamp_path_default_input::Builder::default();
|
23 + | /* RustType.kt:516 */
|
18 24 | #[allow(unused_variables)]
|
25 + | /* ServerHttpBoundProtocolGenerator.kt:728 */
|
19 26 | let ::aws_smithy_runtime_api::http::RequestParts {
|
20 27 | uri, headers, body, ..
|
21 28 | } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
|
29 + | /* ServerHttpBoundProtocolGenerator.kt:986 */
|
22 30 | let input_string = uri.path();
|
31 + | /* ServerHttpBoundProtocolGenerator.kt:998 */
|
23 32 | let (input_string, (_, m1)) =
|
24 33 | ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
|
25 34 | ::nom::sequence::preceded(
|
26 35 | ::nom::bytes::complete::tag("/"),
|
27 36 | ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>(
|
28 37 | "MalformedTimestampPathDefault",
|
29 38 | ),
|
30 39 | ),
|
31 40 | ::nom::sequence::preceded(
|
32 41 | ::nom::bytes::complete::tag("/"),
|
33 42 | ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
|
34 43 | ::nom::bytes::complete::take_until("/"),
|
35 44 | ::nom::combinator::rest,
|
36 45 | )),
|
37 46 | ),
|
38 47 | ))(input_string)?;
|
39 48 | debug_assert_eq!("", input_string);
|
49 + | /* ServerHttpBoundProtocolGenerator.kt:1009 */
|
40 50 | input = input.set_timestamp(
|
41 51 | crate::protocol_serde::shape_malformed_timestamp_path_default_input::de_timestamp(m1)?,
|
42 52 | );
|
53 + | /* ServerHttpBoundProtocolGenerator.kt:834 */
|
43 54 | input.build()?
|
55 + | /* ServerHttpBoundProtocolGenerator.kt:399 */
|
44 56 | })
|
57 + | /* ServerHttpBoundProtocolGenerator.kt:383 */
|
45 58 | }
|
46 59 |
|
60 + | /* RustType.kt:516 */
|
47 61 | #[allow(clippy::unnecessary_wraps)]
|
62 + | /* ServerHttpBoundProtocolGenerator.kt:421 */
|
48 63 | pub fn ser_malformed_timestamp_path_default_http_response(
|
49 64 | #[allow(unused_variables)] output: crate::output::MalformedTimestampPathDefaultOutput,
|
50 65 | ) -> std::result::Result<
|
51 66 | ::aws_smithy_http_server::response::Response,
|
52 67 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
53 68 | > {
|
69 + | /* ServerHttpBoundProtocolGenerator.kt:433 */
|
54 70 | Ok({
|
71 + | /* RustType.kt:516 */
|
55 72 | #[allow(unused_mut)]
|
73 + | /* ServerHttpBoundProtocolGenerator.kt:523 */
|
56 74 | let mut builder = ::http::Response::builder();
|
75 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
57 76 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
58 77 | builder,
|
59 78 | ::http::header::CONTENT_TYPE,
|
60 79 | "application/json",
|
61 80 | );
|
81 + | /* ServerHttpBoundProtocolGenerator.kt:682 */
|
62 82 | let http_status: u16 = 200;
|
63 83 | builder = builder.status(http_status);
|
64 - | let payload = "";
|
84 + | /* ServerHttpBoundProtocolGenerator.kt:561 */
|
85 + | let payload =
|
86 + | /* HttpBoundProtocolPayloadGenerator.kt:235 */""
|
87 + | /* ServerHttpBoundProtocolGenerator.kt:561 */;
|
88 + | /* ServerHttpBoundProtocolGenerator.kt:663 */
|
65 89 | let content_length = payload.len();
|
66 90 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
67 91 | builder,
|
68 92 | ::http::header::CONTENT_LENGTH,
|
69 93 | content_length,
|
70 94 | );
|
95 + | /* ServerHttpBoundProtocolGenerator.kt:567 */
|
71 96 | let body = ::aws_smithy_http_server::body::to_boxed(payload);
|
97 + | /* ServerHttpBoundProtocolGenerator.kt:575 */
|
72 98 | builder.body(body)?
|
99 + | /* ServerHttpBoundProtocolGenerator.kt:433 */
|
73 100 | })
|
101 + | /* ServerHttpBoundProtocolGenerator.kt:421 */
|
74 102 | }
|
75 103 |
|
104 + | /* RustType.kt:516 */
|
76 105 | #[allow(clippy::unnecessary_wraps)]
|
106 + | /* ServerHttpBoundProtocolGenerator.kt:447 */
|
77 107 | pub fn ser_malformed_timestamp_path_default_http_error(
|
78 108 | error: &crate::error::MalformedTimestampPathDefaultError,
|
79 109 | ) -> std::result::Result<
|
80 110 | ::aws_smithy_http_server::response::Response,
|
81 111 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
82 112 | > {
|
113 + | /* ServerHttpBoundProtocolGenerator.kt:452 */
|
83 114 | Ok({
|
115 + | /* ServerHttpBoundProtocolGenerator.kt:468 */
|
84 116 | match error {
|
117 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
85 118 | crate::error::MalformedTimestampPathDefaultError::ValidationException(output) => {
|
119 + | /* ServerHttpBoundProtocolGenerator.kt:477 */
|
86 120 | let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
|
121 + | /* RustType.kt:516 */
|
87 122 | #[allow(unused_mut)]
|
123 + | /* ServerHttpBoundProtocolGenerator.kt:487 */
|
88 124 | let mut builder = ::http::Response::builder();
|
125 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
89 126 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
90 127 | builder,
|
91 128 | ::http::header::CONTENT_TYPE,
|
92 129 | "application/json",
|
93 130 | );
|
131 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
94 132 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
95 133 | builder,
|
96 134 | ::http::header::HeaderName::from_static("x-amzn-errortype"),
|
97 135 | "ValidationException",
|
98 136 | );
|
137 + | /* ServerHttpBoundProtocolGenerator.kt:663 */
|
99 138 | let content_length = payload.len();
|
100 139 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
101 140 | builder,
|
102 141 | ::http::header::CONTENT_LENGTH,
|
103 142 | content_length,
|
104 143 | );
|
144 + | /* ServerHttpBoundProtocolGenerator.kt:504 */
|
105 145 | builder
|
106 146 | .status(400)
|
107 147 | .body(::aws_smithy_http_server::body::to_boxed(payload))?
|
148 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
149 + | } /* ServerHttpBoundProtocolGenerator.kt:468 */
|
108 150 | }
|
109 - | }
|
151 + | /* ServerHttpBoundProtocolGenerator.kt:452 */
|
110 152 | })
|
153 + | /* ServerHttpBoundProtocolGenerator.kt:447 */
|
111 154 | }
|