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_http_request_with_labels_and_timestamp_format_http_request<B>(
|
4 6 | #[allow(unused_variables)] request: ::http::Request<B>,
|
5 7 | ) -> std::result::Result<
|
6 8 | crate::input::HttpRequestWithLabelsAndTimestampFormatInput,
|
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 =
|
18 23 | crate::input::http_request_with_labels_and_timestamp_format_input::Builder::default();
|
24 + | /* RustType.kt:516 */
|
19 25 | #[allow(unused_variables)]
|
26 + | /* ServerHttpBoundProtocolGenerator.kt:728 */
|
20 27 | let ::aws_smithy_runtime_api::http::RequestParts {
|
21 28 | uri, headers, body, ..
|
22 29 | } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
|
30 + | /* ServerHttpBoundProtocolGenerator.kt:986 */
|
23 31 | let input_string = uri.path();
|
32 + | /* ServerHttpBoundProtocolGenerator.kt:998 */
|
24 33 | let (input_string, (_, m1, m2, m3, m4, m5, m6, m7)) =
|
25 34 | ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
|
26 35 | ::nom::sequence::preceded(
|
27 36 | ::nom::bytes::complete::tag("/"),
|
28 37 | ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>(
|
29 38 | "HttpRequestWithLabelsAndTimestampFormat",
|
30 39 | ),
|
31 40 | ),
|
32 41 | ::nom::sequence::preceded(
|
33 42 | ::nom::bytes::complete::tag("/"),
|
34 43 | ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
|
35 44 | ::nom::bytes::complete::take_until("/"),
|
36 45 | ::nom::combinator::rest,
|
37 46 | )),
|
38 47 | ),
|
39 48 | ::nom::sequence::preceded(
|
40 49 | ::nom::bytes::complete::tag("/"),
|
41 50 | ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
|
42 51 | ::nom::bytes::complete::take_until("/"),
|
43 52 | ::nom::combinator::rest,
|
44 53 | )),
|
45 54 | ),
|
46 55 | ::nom::sequence::preceded(
|
47 56 | ::nom::bytes::complete::tag("/"),
|
48 57 | ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
|
49 58 | ::nom::bytes::complete::take_until("/"),
|
50 59 | ::nom::combinator::rest,
|
51 60 | )),
|
52 61 | ),
|
53 62 | ::nom::sequence::preceded(
|
54 63 | ::nom::bytes::complete::tag("/"),
|
55 64 | ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
|
56 65 | ::nom::bytes::complete::take_until("/"),
|
57 66 | ::nom::combinator::rest,
|
58 67 | )),
|
59 68 | ),
|
60 69 | ::nom::sequence::preceded(
|
61 70 | ::nom::bytes::complete::tag("/"),
|
62 71 | ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
|
63 72 | ::nom::bytes::complete::take_until("/"),
|
64 73 | ::nom::combinator::rest,
|
65 74 | )),
|
66 75 | ),
|
67 76 | ::nom::sequence::preceded(
|
68 77 | ::nom::bytes::complete::tag("/"),
|
69 78 | ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
|
70 79 | ::nom::bytes::complete::take_until("/"),
|
71 80 | ::nom::combinator::rest,
|
72 81 | )),
|
73 82 | ),
|
74 83 | ::nom::sequence::preceded(
|
75 84 | ::nom::bytes::complete::tag("/"),
|
76 85 | ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
|
77 86 | ::nom::bytes::complete::take_until("/"),
|
78 87 | ::nom::combinator::rest,
|
79 88 | )),
|
80 89 | ),
|
81 90 | ))(input_string)?;
|
82 91 | debug_assert_eq!("", input_string);
|
92 + | /* ServerHttpBoundProtocolGenerator.kt:1009 */
|
83 93 | input = input.set_member_epoch_seconds(
|
84 94 | crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_member_epoch_seconds(m1)?
|
85 95 | );
|
96 + | /* ServerHttpBoundProtocolGenerator.kt:1009 */
|
86 97 | input = input.set_member_http_date(
|
87 98 | crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_member_http_date(m2)?
|
88 99 | );
|
100 + | /* ServerHttpBoundProtocolGenerator.kt:1009 */
|
89 101 | input = input.set_member_date_time(
|
90 102 | crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_member_date_time(m3)?
|
91 103 | );
|
104 + | /* ServerHttpBoundProtocolGenerator.kt:1009 */
|
92 105 | input = input.set_default_format(
|
93 106 | crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_default_format(m4)?
|
94 107 | );
|
108 + | /* ServerHttpBoundProtocolGenerator.kt:1009 */
|
95 109 | input = input.set_target_epoch_seconds(
|
96 110 | crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_target_epoch_seconds(m5)?
|
97 111 | );
|
112 + | /* ServerHttpBoundProtocolGenerator.kt:1009 */
|
98 113 | input = input.set_target_http_date(
|
99 114 | crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_target_http_date(m6)?
|
100 115 | );
|
116 + | /* ServerHttpBoundProtocolGenerator.kt:1009 */
|
101 117 | input = input.set_target_date_time(
|
102 118 | crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_target_date_time(m7)?
|
103 119 | );
|
120 + | /* ServerHttpBoundProtocolGenerator.kt:834 */
|
104 121 | input.build()?
|
122 + | /* ServerHttpBoundProtocolGenerator.kt:399 */
|
105 123 | })
|
124 + | /* ServerHttpBoundProtocolGenerator.kt:383 */
|
106 125 | }
|
107 126 |
|
127 + | /* RustType.kt:516 */
|
108 128 | #[allow(clippy::unnecessary_wraps)]
|
129 + | /* ServerHttpBoundProtocolGenerator.kt:421 */
|
109 130 | pub fn ser_http_request_with_labels_and_timestamp_format_http_response(
|
110 131 | #[allow(unused_variables)] output: crate::output::HttpRequestWithLabelsAndTimestampFormatOutput,
|
111 132 | ) -> std::result::Result<
|
112 133 | ::aws_smithy_http_server::response::Response,
|
113 134 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
114 135 | > {
|
136 + | /* ServerHttpBoundProtocolGenerator.kt:433 */
|
115 137 | Ok({
|
138 + | /* RustType.kt:516 */
|
116 139 | #[allow(unused_mut)]
|
140 + | /* ServerHttpBoundProtocolGenerator.kt:523 */
|
117 141 | let mut builder = ::http::Response::builder();
|
142 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
118 143 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
119 144 | builder,
|
120 145 | ::http::header::CONTENT_TYPE,
|
121 146 | "application/json",
|
122 147 | );
|
148 + | /* ServerHttpBoundProtocolGenerator.kt:682 */
|
123 149 | let http_status: u16 = 200;
|
124 150 | builder = builder.status(http_status);
|
125 - | let payload = "";
|
151 + | /* ServerHttpBoundProtocolGenerator.kt:561 */
|
152 + | let payload =
|
153 + | /* HttpBoundProtocolPayloadGenerator.kt:235 */""
|
154 + | /* ServerHttpBoundProtocolGenerator.kt:561 */;
|
155 + | /* ServerHttpBoundProtocolGenerator.kt:663 */
|
126 156 | let content_length = payload.len();
|
127 157 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
128 158 | builder,
|
129 159 | ::http::header::CONTENT_LENGTH,
|
130 160 | content_length,
|
131 161 | );
|
162 + | /* ServerHttpBoundProtocolGenerator.kt:567 */
|
132 163 | let body = ::aws_smithy_http_server::body::to_boxed(payload);
|
164 + | /* ServerHttpBoundProtocolGenerator.kt:575 */
|
133 165 | builder.body(body)?
|
166 + | /* ServerHttpBoundProtocolGenerator.kt:433 */
|
134 167 | })
|
168 + | /* ServerHttpBoundProtocolGenerator.kt:421 */
|
135 169 | }
|
136 170 |
|
171 + | /* RustType.kt:516 */
|
137 172 | #[allow(clippy::unnecessary_wraps)]
|
173 + | /* ServerHttpBoundProtocolGenerator.kt:447 */
|
138 174 | pub fn ser_http_request_with_labels_and_timestamp_format_http_error(
|
139 175 | error: &crate::error::HttpRequestWithLabelsAndTimestampFormatError,
|
140 176 | ) -> std::result::Result<
|
141 177 | ::aws_smithy_http_server::response::Response,
|
142 178 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
143 179 | > {
|
180 + | /* ServerHttpBoundProtocolGenerator.kt:452 */
|
144 181 | Ok({
|
182 + | /* ServerHttpBoundProtocolGenerator.kt:468 */
|
145 183 | match error {
|
184 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
146 185 | crate::error::HttpRequestWithLabelsAndTimestampFormatError::ValidationException(
|
147 186 | output,
|
148 187 | ) => {
|
188 + | /* ServerHttpBoundProtocolGenerator.kt:477 */
|
149 189 | let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
|
190 + | /* RustType.kt:516 */
|
150 191 | #[allow(unused_mut)]
|
192 + | /* ServerHttpBoundProtocolGenerator.kt:487 */
|
151 193 | let mut builder = ::http::Response::builder();
|
194 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
152 195 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
153 196 | builder,
|
154 197 | ::http::header::CONTENT_TYPE,
|
155 198 | "application/json",
|
156 199 | );
|
200 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
157 201 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
158 202 | builder,
|
159 203 | ::http::header::HeaderName::from_static("x-amzn-errortype"),
|
160 204 | "ValidationException",
|
161 205 | );
|
206 + | /* ServerHttpBoundProtocolGenerator.kt:663 */
|
162 207 | let content_length = payload.len();
|
163 208 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
164 209 | builder,
|
165 210 | ::http::header::CONTENT_LENGTH,
|
166 211 | content_length,
|
167 212 | );
|
213 + | /* ServerHttpBoundProtocolGenerator.kt:504 */
|
168 214 | builder
|
169 215 | .status(400)
|
170 216 | .body(::aws_smithy_http_server::body::to_boxed(payload))?
|
217 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
218 + | } /* ServerHttpBoundProtocolGenerator.kt:468 */
|
171 219 | }
|
172 - | }
|
220 + | /* ServerHttpBoundProtocolGenerator.kt:452 */
|
173 221 | })
|
222 + | /* ServerHttpBoundProtocolGenerator.kt:447 */
|
174 223 | }
|