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