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_all_query_string_types_http_request<B>(
|
6 + | #[allow(unused_variables)] request: ::http::Request<B>,
|
7 + | ) -> std::result::Result<
|
8 + | crate::input::AllQueryStringTypesInput,
|
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::all_query_string_types_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:1221 */
|
30 + | let query_string = uri.query().unwrap_or("");
|
31 + | let pairs = ::form_urlencoded::parse(query_string.as_bytes());
|
32 + | /* ServerHttpBoundProtocolGenerator.kt:1236 */
|
33 + | let mut query_params: ::std::collections::HashMap::<::std::string::String, ::std::vec::Vec::<::std::string::String>> =
|
34 + | /* ServerHttpBoundProtocolGenerator.kt:1238 */::std::collections::HashMap::new()
|
35 + | /* ServerHttpBoundProtocolGenerator.kt:1236 */;
|
36 + | /* ServerHttpBoundProtocolGenerator.kt:1247 */
|
37 + | let mut query_boolean_seen = false;
|
38 + | /* ServerHttpBoundProtocolGenerator.kt:1247 */
|
39 + | let mut query_byte_seen = false;
|
40 + | /* ServerHttpBoundProtocolGenerator.kt:1247 */
|
41 + | let mut query_double_seen = false;
|
42 + | /* ServerHttpBoundProtocolGenerator.kt:1247 */
|
43 + | let mut query_enum_seen = false;
|
44 + | /* ServerHttpBoundProtocolGenerator.kt:1247 */
|
45 + | let mut query_float_seen = false;
|
46 + | /* ServerHttpBoundProtocolGenerator.kt:1247 */
|
47 + | let mut query_integer_seen = false;
|
48 + | /* ServerHttpBoundProtocolGenerator.kt:1247 */
|
49 + | let mut query_integer_enum_seen = false;
|
50 + | /* ServerHttpBoundProtocolGenerator.kt:1247 */
|
51 + | let mut query_long_seen = false;
|
52 + | /* ServerHttpBoundProtocolGenerator.kt:1247 */
|
53 + | let mut query_short_seen = false;
|
54 + | /* ServerHttpBoundProtocolGenerator.kt:1247 */
|
55 + | let mut query_string_seen = false;
|
56 + | /* ServerHttpBoundProtocolGenerator.kt:1247 */
|
57 + | let mut query_timestamp_seen = false;
|
58 + | /* ServerHttpBoundProtocolGenerator.kt:1250 */
|
59 + | let mut query_boolean_list = Vec::new();
|
60 + | /* ServerHttpBoundProtocolGenerator.kt:1250 */
|
61 + | let mut query_double_list = Vec::new();
|
62 + | /* ServerHttpBoundProtocolGenerator.kt:1250 */
|
63 + | let mut query_enum_list = Vec::new();
|
64 + | /* ServerHttpBoundProtocolGenerator.kt:1250 */
|
65 + | let mut query_integer_enum_list = Vec::new();
|
66 + | /* ServerHttpBoundProtocolGenerator.kt:1250 */
|
67 + | let mut query_integer_list = Vec::new();
|
68 + | /* ServerHttpBoundProtocolGenerator.kt:1250 */
|
69 + | let mut query_integer_set = Vec::new();
|
70 + | /* ServerHttpBoundProtocolGenerator.kt:1250 */
|
71 + | let mut query_string_list = Vec::new();
|
72 + | /* ServerHttpBoundProtocolGenerator.kt:1250 */
|
73 + | let mut query_string_set = Vec::new();
|
74 + | /* ServerHttpBoundProtocolGenerator.kt:1250 */
|
75 + | let mut query_timestamp_list = Vec::new();
|
76 + | /* ServerHttpBoundProtocolGenerator.kt:1253 */
|
77 + | for (k, v) in pairs {
|
78 + | /* ServerHttpBoundProtocolGenerator.kt:1257 */
|
79 + | if !query_boolean_seen && k == "Boolean" {
|
80 + | input = input.set_query_boolean(
|
81 + | crate::protocol_serde::shape_all_query_string_types_input::de_query_boolean(
|
82 + | &v,
|
83 + | )?,
|
84 + | );
|
85 + | query_boolean_seen = true;
|
86 + | }
|
87 + | /* ServerHttpBoundProtocolGenerator.kt:1257 */
|
88 + | if !query_byte_seen && k == "Byte" {
|
89 + | input = input.set_query_byte(
|
90 + | crate::protocol_serde::shape_all_query_string_types_input::de_query_byte(&v)?,
|
91 + | );
|
92 + | query_byte_seen = true;
|
93 + | }
|
94 + | /* ServerHttpBoundProtocolGenerator.kt:1257 */
|
95 + | if !query_double_seen && k == "Double" {
|
96 + | input = input.set_query_double(
|
97 + | crate::protocol_serde::shape_all_query_string_types_input::de_query_double(&v)?,
|
98 + | );
|
99 + | query_double_seen = true;
|
100 + | }
|
101 + | /* ServerHttpBoundProtocolGenerator.kt:1257 */
|
102 + | if !query_enum_seen && k == "Enum" {
|
103 + | input = input.set_query_enum(
|
104 + | crate::protocol_serde::shape_all_query_string_types_input::de_query_enum(&v)?,
|
105 + | );
|
106 + | query_enum_seen = true;
|
107 + | }
|
108 + | /* ServerHttpBoundProtocolGenerator.kt:1257 */
|
109 + | if !query_float_seen && k == "Float" {
|
110 + | input = input.set_query_float(
|
111 + | crate::protocol_serde::shape_all_query_string_types_input::de_query_float(&v)?,
|
112 + | );
|
113 + | query_float_seen = true;
|
114 + | }
|
115 + | /* ServerHttpBoundProtocolGenerator.kt:1257 */
|
116 + | if !query_integer_seen && k == "Integer" {
|
117 + | input = input.set_query_integer(
|
118 + | crate::protocol_serde::shape_all_query_string_types_input::de_query_integer(
|
119 + | &v,
|
120 + | )?,
|
121 + | );
|
122 + | query_integer_seen = true;
|
123 + | }
|
124 + | /* ServerHttpBoundProtocolGenerator.kt:1257 */
|
125 + | if !query_integer_enum_seen && k == "IntegerEnum" {
|
126 + | input = input.set_query_integer_enum(
|
127 + | crate::protocol_serde::shape_all_query_string_types_input::de_query_integer_enum(&v)?
|
128 + | );
|
129 + | query_integer_enum_seen = true;
|
130 + | }
|
131 + | /* ServerHttpBoundProtocolGenerator.kt:1257 */
|
132 + | if !query_long_seen && k == "Long" {
|
133 + | input = input.set_query_long(
|
134 + | crate::protocol_serde::shape_all_query_string_types_input::de_query_long(&v)?,
|
135 + | );
|
136 + | query_long_seen = true;
|
137 + | }
|
138 + | /* ServerHttpBoundProtocolGenerator.kt:1257 */
|
139 + | if !query_short_seen && k == "Short" {
|
140 + | input = input.set_query_short(
|
141 + | crate::protocol_serde::shape_all_query_string_types_input::de_query_short(&v)?,
|
142 + | );
|
143 + | query_short_seen = true;
|
144 + | }
|
145 + | /* ServerHttpBoundProtocolGenerator.kt:1257 */
|
146 + | if !query_string_seen && k == "String" {
|
147 + | input = input.set_query_string(
|
148 + | crate::protocol_serde::shape_all_query_string_types_input::de_query_string(&v)?,
|
149 + | );
|
150 + | query_string_seen = true;
|
151 + | }
|
152 + | /* ServerHttpBoundProtocolGenerator.kt:1257 */
|
153 + | if !query_timestamp_seen && k == "Timestamp" {
|
154 + | input = input.set_query_timestamp(
|
155 + | crate::protocol_serde::shape_all_query_string_types_input::de_query_timestamp(
|
156 + | &v,
|
157 + | )?,
|
158 + | );
|
159 + | query_timestamp_seen = true;
|
160 + | }
|
161 + | /* ServerHttpBoundProtocolGenerator.kt:1270 */
|
162 + | if k == "BooleanList" {
|
163 + | /* ServerHttpBoundProtocolGenerator.kt:1318 */
|
164 + | let v = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(&v)?;
|
165 + | /* ServerHttpBoundProtocolGenerator.kt:1327 */
|
166 + | query_boolean_list.push(v);
|
167 + | /* ServerHttpBoundProtocolGenerator.kt:1270 */
|
168 + | }
|
169 + | /* ServerHttpBoundProtocolGenerator.kt:1270 */
|
170 + | else if k == "DoubleList" {
|
171 + | /* ServerHttpBoundProtocolGenerator.kt:1318 */
|
172 + | let v = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(&v)?;
|
173 + | /* ServerHttpBoundProtocolGenerator.kt:1327 */
|
174 + | query_double_list.push(v);
|
175 + | /* ServerHttpBoundProtocolGenerator.kt:1270 */
|
176 + | }
|
177 + | /* ServerHttpBoundProtocolGenerator.kt:1270 */
|
178 + | else if k == "EnumList" {
|
179 + | /* ServerHttpBoundProtocolGenerator.kt:1280 */
|
180 + | let v = v.clone().into_owned();
|
181 + | /* ServerHttpBoundProtocolGenerator.kt:1327 */
|
182 + | query_enum_list.push(v);
|
183 + | /* ServerHttpBoundProtocolGenerator.kt:1270 */
|
184 + | }
|
185 + | /* ServerHttpBoundProtocolGenerator.kt:1270 */
|
186 + | else if k == "IntegerEnumList" {
|
187 + | /* ServerHttpBoundProtocolGenerator.kt:1318 */
|
188 + | let v = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(&v)?;
|
189 + | /* ServerHttpBoundProtocolGenerator.kt:1327 */
|
190 + | query_integer_enum_list.push(v);
|
191 + | /* ServerHttpBoundProtocolGenerator.kt:1270 */
|
192 + | }
|
193 + | /* ServerHttpBoundProtocolGenerator.kt:1270 */
|
194 + | else if k == "IntegerList" {
|
195 + | /* ServerHttpBoundProtocolGenerator.kt:1318 */
|
196 + | let v = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(&v)?;
|
197 + | /* ServerHttpBoundProtocolGenerator.kt:1327 */
|
198 + | query_integer_list.push(v);
|
199 + | /* ServerHttpBoundProtocolGenerator.kt:1270 */
|
200 + | }
|
201 + | /* ServerHttpBoundProtocolGenerator.kt:1270 */
|
202 + | else if k == "IntegerSet" {
|
203 + | /* ServerHttpBoundProtocolGenerator.kt:1318 */
|
204 + | let v = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(&v)?;
|
205 + | /* ServerHttpBoundProtocolGenerator.kt:1327 */
|
206 + | query_integer_set.push(v);
|
207 + | /* ServerHttpBoundProtocolGenerator.kt:1270 */
|
208 + | }
|
209 + | /* ServerHttpBoundProtocolGenerator.kt:1270 */
|
210 + | else if k == "StringList" {
|
211 + | /* ServerHttpBoundProtocolGenerator.kt:1280 */
|
212 + | let v = v.clone().into_owned();
|
213 + | /* ServerHttpBoundProtocolGenerator.kt:1327 */
|
214 + | query_string_list.push(v);
|
215 + | /* ServerHttpBoundProtocolGenerator.kt:1270 */
|
216 + | }
|
217 + | /* ServerHttpBoundProtocolGenerator.kt:1270 */
|
218 + | else if k == "StringSet" {
|
219 + | /* ServerHttpBoundProtocolGenerator.kt:1280 */
|
220 + | let v = v.clone().into_owned();
|
221 + | /* ServerHttpBoundProtocolGenerator.kt:1327 */
|
222 + | query_string_set.push(v);
|
223 + | /* ServerHttpBoundProtocolGenerator.kt:1270 */
|
224 + | }
|
225 + | /* ServerHttpBoundProtocolGenerator.kt:1270 */
|
226 + | else if k == "TimestampList" {
|
227 + | /* ServerHttpBoundProtocolGenerator.kt:1300 */
|
228 + | let v = ::aws_smithy_types::DateTime::from_str(&v, ::aws_smithy_types::date_time::Format::DateTime)?
|
229 + | /* ServerHttpBoundProtocolGenerator.kt:1314 */;
|
230 + | /* ServerHttpBoundProtocolGenerator.kt:1327 */
|
231 + | query_timestamp_list.push(v);
|
232 + | /* ServerHttpBoundProtocolGenerator.kt:1270 */
|
233 + | }
|
234 + | /* ServerHttpBoundProtocolGenerator.kt:1358 */
|
235 + | let entry = query_params.entry(String::from(k)).or_default();
|
236 + | entry.push(String::from(v));
|
237 + | /* ServerHttpBoundProtocolGenerator.kt:1253 */
|
238 + | }
|
239 + | /* ServerHttpBoundProtocolGenerator.kt:1374 */
|
240 + | input = input.set_query_params_map_of_string_list(
|
241 + | /* ServerHttpBoundProtocolGenerator.kt:1375 */
|
242 + | Some(
|
243 + | /* ServerHttpBoundProtocolGenerator.kt:1376 */
|
244 + | query_params, /* ServerHttpBoundProtocolGenerator.kt:1375 */
|
245 + | ), /* ServerHttpBoundProtocolGenerator.kt:1374 */
|
246 + | );
|
247 + | /* ServerHttpBoundProtocolGenerator.kt:1389 */
|
248 + | if !query_boolean_list.is_empty() {
|
249 + | /* ServerHttpBoundProtocolGenerator.kt:1390 */
|
250 + | input = input.set_query_boolean_list(
|
251 + | /* ServerHttpBoundProtocolGenerator.kt:1396 */
|
252 + | Some(
|
253 + | /* ServerHttpBoundProtocolGenerator.kt:1405 */
|
254 + | query_boolean_list, /* ServerHttpBoundProtocolGenerator.kt:1396 */
|
255 + | ), /* ServerHttpBoundProtocolGenerator.kt:1390 */
|
256 + | );
|
257 + | /* ServerHttpBoundProtocolGenerator.kt:1389 */
|
258 + | }
|
259 + | /* ServerHttpBoundProtocolGenerator.kt:1389 */
|
260 + | if !query_double_list.is_empty() {
|
261 + | /* ServerHttpBoundProtocolGenerator.kt:1390 */
|
262 + | input = input.set_query_double_list(
|
263 + | /* ServerHttpBoundProtocolGenerator.kt:1396 */
|
264 + | Some(
|
265 + | /* ServerHttpBoundProtocolGenerator.kt:1405 */
|
266 + | query_double_list, /* ServerHttpBoundProtocolGenerator.kt:1396 */
|
267 + | ), /* ServerHttpBoundProtocolGenerator.kt:1390 */
|
268 + | );
|
269 + | /* ServerHttpBoundProtocolGenerator.kt:1389 */
|
270 + | }
|
271 + | /* ServerHttpBoundProtocolGenerator.kt:1389 */
|
272 + | if !query_enum_list.is_empty() {
|
273 + | /* ServerHttpBoundProtocolGenerator.kt:1390 */
|
274 + | input = input.set_query_enum_list(
|
275 + | /* ServerHttpBoundProtocolGenerator.kt:1396 */
|
276 + | Some(
|
277 + | /* ServerHttpBoundProtocolGenerator.kt:1397 */
|
278 + | crate::unconstrained::foo_enum_list_unconstrained::FooEnumListUnconstrained(
|
279 + | /* ServerHttpBoundProtocolGenerator.kt:1405 */
|
280 + | query_enum_list, /* ServerHttpBoundProtocolGenerator.kt:1397 */
|
281 + | ), /* ServerHttpBoundProtocolGenerator.kt:1396 */
|
282 + | ), /* ServerHttpBoundProtocolGenerator.kt:1390 */
|
283 + | );
|
284 + | /* ServerHttpBoundProtocolGenerator.kt:1389 */
|
285 + | }
|
286 + | /* ServerHttpBoundProtocolGenerator.kt:1389 */
|
287 + | if !query_integer_enum_list.is_empty() {
|
288 + | /* ServerHttpBoundProtocolGenerator.kt:1390 */
|
289 + | input = input.set_query_integer_enum_list(
|
290 + | /* ServerHttpBoundProtocolGenerator.kt:1396 */
|
291 + | Some(
|
292 + | /* ServerHttpBoundProtocolGenerator.kt:1405 */
|
293 + | query_integer_enum_list, /* ServerHttpBoundProtocolGenerator.kt:1396 */
|
294 + | ), /* ServerHttpBoundProtocolGenerator.kt:1390 */
|
295 + | );
|
296 + | /* ServerHttpBoundProtocolGenerator.kt:1389 */
|
297 + | }
|
298 + | /* ServerHttpBoundProtocolGenerator.kt:1389 */
|
299 + | if !query_integer_list.is_empty() {
|
300 + | /* ServerHttpBoundProtocolGenerator.kt:1390 */
|
301 + | input = input.set_query_integer_list(
|
302 + | /* ServerHttpBoundProtocolGenerator.kt:1396 */
|
303 + | Some(
|
304 + | /* ServerHttpBoundProtocolGenerator.kt:1405 */
|
305 + | query_integer_list, /* ServerHttpBoundProtocolGenerator.kt:1396 */
|
306 + | ), /* ServerHttpBoundProtocolGenerator.kt:1390 */
|
307 + | );
|
308 + | /* ServerHttpBoundProtocolGenerator.kt:1389 */
|
309 + | }
|
310 + | /* ServerHttpBoundProtocolGenerator.kt:1389 */
|
311 + | if !query_integer_set.is_empty() {
|
312 + | /* ServerHttpBoundProtocolGenerator.kt:1390 */
|
313 + | input = input.set_query_integer_set(
|
314 + | /* ServerHttpBoundProtocolGenerator.kt:1396 */
|
315 + | Some(
|
316 + | /* ServerHttpBoundProtocolGenerator.kt:1397 */
|
317 + | crate::unconstrained::integer_set_unconstrained::IntegerSetUnconstrained(
|
318 + | /* ServerHttpBoundProtocolGenerator.kt:1405 */
|
319 + | query_integer_set, /* ServerHttpBoundProtocolGenerator.kt:1397 */
|
320 + | ), /* ServerHttpBoundProtocolGenerator.kt:1396 */
|
321 + | ), /* ServerHttpBoundProtocolGenerator.kt:1390 */
|
322 + | );
|
323 + | /* ServerHttpBoundProtocolGenerator.kt:1389 */
|
324 + | }
|
325 + | /* ServerHttpBoundProtocolGenerator.kt:1389 */
|
326 + | if !query_string_list.is_empty() {
|
327 + | /* ServerHttpBoundProtocolGenerator.kt:1390 */
|
328 + | input = input.set_query_string_list(
|
329 + | /* ServerHttpBoundProtocolGenerator.kt:1396 */
|
330 + | Some(
|
331 + | /* ServerHttpBoundProtocolGenerator.kt:1405 */
|
332 + | query_string_list, /* ServerHttpBoundProtocolGenerator.kt:1396 */
|
333 + | ), /* ServerHttpBoundProtocolGenerator.kt:1390 */
|
334 + | );
|
335 + | /* ServerHttpBoundProtocolGenerator.kt:1389 */
|
336 + | }
|
337 + | /* ServerHttpBoundProtocolGenerator.kt:1389 */
|
338 + | if !query_string_set.is_empty() {
|
339 + | /* ServerHttpBoundProtocolGenerator.kt:1390 */
|
340 + | input = input.set_query_string_set(
|
341 + | /* ServerHttpBoundProtocolGenerator.kt:1396 */
|
342 + | Some(
|
343 + | /* ServerHttpBoundProtocolGenerator.kt:1397 */
|
344 + | crate::unconstrained::string_set_unconstrained::StringSetUnconstrained(
|
345 + | /* ServerHttpBoundProtocolGenerator.kt:1405 */
|
346 + | query_string_set, /* ServerHttpBoundProtocolGenerator.kt:1397 */
|
347 + | ), /* ServerHttpBoundProtocolGenerator.kt:1396 */
|
348 + | ), /* ServerHttpBoundProtocolGenerator.kt:1390 */
|
349 + | );
|
350 + | /* ServerHttpBoundProtocolGenerator.kt:1389 */
|
351 + | }
|
352 + | /* ServerHttpBoundProtocolGenerator.kt:1389 */
|
353 + | if !query_timestamp_list.is_empty() {
|
354 + | /* ServerHttpBoundProtocolGenerator.kt:1390 */
|
355 + | input = input.set_query_timestamp_list(
|
356 + | /* ServerHttpBoundProtocolGenerator.kt:1396 */
|
357 + | Some(
|
358 + | /* ServerHttpBoundProtocolGenerator.kt:1405 */
|
359 + | query_timestamp_list, /* ServerHttpBoundProtocolGenerator.kt:1396 */
|
360 + | ), /* ServerHttpBoundProtocolGenerator.kt:1390 */
|
361 + | );
|
362 + | /* ServerHttpBoundProtocolGenerator.kt:1389 */
|
363 + | }
|
364 + | /* ServerHttpBoundProtocolGenerator.kt:896 */
|
365 + | input.build()?
|
366 + | /* ServerHttpBoundProtocolGenerator.kt:424 */
|
367 + | })
|
368 + | /* ServerHttpBoundProtocolGenerator.kt:408 */
|
369 + | }
|
370 + |
|
371 + | /* RustType.kt:534 */
|
372 + | #[allow(clippy::unnecessary_wraps)]
|
373 + | /* ServerHttpBoundProtocolGenerator.kt:445 */
|
374 + | pub fn ser_all_query_string_types_http_response(
|
375 + | #[allow(unused_variables)] output: crate::output::AllQueryStringTypesOutput,
|
376 + | ) -> std::result::Result<
|
377 + | ::aws_smithy_legacy_http_server::response::Response,
|
378 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
379 + | > {
|
380 + | /* ServerHttpBoundProtocolGenerator.kt:457 */
|
381 + | Ok({
|
382 + | /* RustType.kt:534 */
|
383 + | #[allow(unused_mut)]
|
384 + | /* ServerHttpBoundProtocolGenerator.kt:547 */
|
385 + | let mut builder = ::http::Response::builder();
|
386 + | /* ServerHttpBoundProtocolGenerator.kt:633 */
|
387 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
388 + | builder,
|
389 + | ::http::header::CONTENT_TYPE,
|
390 + | "application/json",
|
391 + | );
|
392 + | /* ServerHttpBoundProtocolGenerator.kt:718 */
|
393 + | let http_status: u16 = 200;
|
394 + | builder = builder.status(http_status);
|
395 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
396 + | let payload =
|
397 + | /* HttpBoundProtocolPayloadGenerator.kt:233 */""
|
398 + | /* ServerHttpBoundProtocolGenerator.kt:597 */;
|
399 + | /* ServerHttpBoundProtocolGenerator.kt:699 */
|
400 + | let content_length = payload.len();
|
401 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
402 + | builder,
|
403 + | ::http::header::CONTENT_LENGTH,
|
404 + | content_length,
|
405 + | );
|
406 + | /* ServerHttpBoundProtocolGenerator.kt:603 */
|
407 + | let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
|
408 + | /* ServerHttpBoundProtocolGenerator.kt:611 */
|
409 + | builder.body(body)?
|
410 + | /* ServerHttpBoundProtocolGenerator.kt:457 */
|
411 + | })
|
412 + | /* ServerHttpBoundProtocolGenerator.kt:445 */
|
413 + | }
|
414 + |
|
415 + | /* RustType.kt:534 */
|
416 + | #[allow(clippy::unnecessary_wraps)]
|
417 + | /* ServerHttpBoundProtocolGenerator.kt:471 */
|
418 + | pub fn ser_all_query_string_types_http_error(
|
419 + | error: &crate::error::AllQueryStringTypesError,
|
420 + | ) -> std::result::Result<
|
421 + | ::aws_smithy_legacy_http_server::response::Response,
|
422 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
423 + | > {
|
424 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
425 + | Ok({
|
426 + | /* ServerHttpBoundProtocolGenerator.kt:492 */
|
427 + | match error {
|
428 + | /* ServerHttpBoundProtocolGenerator.kt:500 */
|
429 + | crate::error::AllQueryStringTypesError::ValidationException(output) => {
|
430 + | /* ServerHttpBoundProtocolGenerator.kt:501 */
|
431 + | let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
|
432 + | /* RustType.kt:534 */
|
433 + | #[allow(unused_mut)]
|
434 + | /* ServerHttpBoundProtocolGenerator.kt:511 */
|
435 + | let mut builder = ::http::Response::builder();
|
436 + | /* ServerHttpBoundProtocolGenerator.kt:633 */
|
437 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
438 + | builder,
|
439 + | ::http::header::CONTENT_TYPE,
|
440 + | "application/json",
|
441 + | );
|
442 + | /* ServerHttpBoundProtocolGenerator.kt:633 */
|
443 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
444 + | builder,
|
445 + | ::http::header::HeaderName::from_static("x-amzn-errortype"),
|
446 + | "ValidationException",
|
447 + | );
|
448 + | /* ServerHttpBoundProtocolGenerator.kt:699 */
|
449 + | let content_length = payload.len();
|
450 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
451 + | builder,
|
452 + | ::http::header::CONTENT_LENGTH,
|
453 + | content_length,
|
454 + | );
|
455 + | /* ServerHttpBoundProtocolGenerator.kt:528 */
|
456 + | builder
|
457 + | .status(400)
|
458 + | .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
|
459 + | /* ServerHttpBoundProtocolGenerator.kt:500 */
|
460 + | } /* ServerHttpBoundProtocolGenerator.kt:492 */
|
461 + | }
|
462 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
463 + | })
|
464 + | /* ServerHttpBoundProtocolGenerator.kt:471 */
|
465 + | }
|