1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | #[allow(clippy::unnecessary_wraps)]
|
3 + | pub async fn de_query_params_targeting_map_of_length_list_of_pattern_string_operation_http_request<
|
4 + | B,
|
5 + | >(
|
6 + | #[allow(unused_variables)] request: ::http::Request<B>,
|
7 + | ) -> std::result::Result<
|
8 + | crate::input::QueryParamsTargetingMapOfLengthListOfPatternStringOperationInput,
|
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 + | Ok({
|
18 + | #[allow(unused_mut)]
|
19 + | let mut input = crate::input::query_params_targeting_map_of_length_list_of_pattern_string_operation_input::Builder::default();
|
20 + | #[allow(unused_variables)]
|
21 + | let ::aws_smithy_runtime_api::http::RequestParts {
|
22 + | uri, headers, body, ..
|
23 + | } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
|
24 + | let query_string = uri.query().unwrap_or("");
|
25 + | let pairs = ::form_urlencoded::parse(query_string.as_bytes());
|
26 + | let mut query_params: crate::unconstrained::map_of_length_list_of_pattern_string_unconstrained::MapOfLengthListOfPatternStringUnconstrained =
|
27 + | crate::unconstrained::map_of_length_list_of_pattern_string_unconstrained::MapOfLengthListOfPatternStringUnconstrained(
|
28 + | ::std::collections::HashMap::new()
|
29 + | )
|
30 + | ;
|
31 + | for (k, v) in pairs {
|
32 + | let entry = query_params.0.entry(String::from(k)).or_insert_with(|| crate::unconstrained::length_list_of_pattern_string_unconstrained::LengthListOfPatternStringUnconstrained(std::vec::Vec::new()));
|
33 + | entry.0.push(String::from(v));
|
34 + | }
|
35 + | input = input.set_map_of_length_list_of_pattern_string(Some(query_params));
|
36 + | input.build()?
|
37 + | })
|
38 + | }
|
39 + |
|
40 + | #[allow(clippy::unnecessary_wraps)]
|
41 + | pub fn ser_query_params_targeting_map_of_length_list_of_pattern_string_operation_http_response(
|
42 + | #[allow(unused_variables)]
|
43 + | output: crate::output::QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput,
|
44 + | ) -> std::result::Result<
|
45 + | ::aws_smithy_legacy_http_server::response::Response,
|
46 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
47 + | > {
|
48 + | Ok({
|
49 + | #[allow(unused_mut)]
|
50 + | let mut builder = ::http::Response::builder();
|
51 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
52 + | builder,
|
53 + | ::http::header::CONTENT_TYPE,
|
54 + | "application/json",
|
55 + | );
|
56 + | let http_status: u16 = 200;
|
57 + | builder = builder.status(http_status);
|
58 + | let payload =
|
59 + | crate::protocol_serde::shape_query_params_targeting_map_of_length_list_of_pattern_string_operation_output::ser_query_params_targeting_map_of_length_list_of_pattern_string_operation_output_output_output(&output)?
|
60 + | ;
|
61 + | let content_length = payload.len();
|
62 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
63 + | builder,
|
64 + | ::http::header::CONTENT_LENGTH,
|
65 + | content_length,
|
66 + | );
|
67 + | let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
|
68 + | builder.body(body)?
|
69 + | })
|
70 + | }
|
71 + |
|
72 + | #[allow(clippy::unnecessary_wraps)]
|
73 + | pub fn ser_query_params_targeting_map_of_length_list_of_pattern_string_operation_http_error(
|
74 + | error: &crate::error::QueryParamsTargetingMapOfLengthListOfPatternStringOperationError,
|
75 + | ) -> std::result::Result<
|
76 + | ::aws_smithy_legacy_http_server::response::Response,
|
77 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
78 + | > {
|
79 + | Ok({
|
80 + | match error {
|
81 + | crate::error::QueryParamsTargetingMapOfLengthListOfPatternStringOperationError::ValidationException(output) => {
|
82 + | let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
|
83 + | #[allow(unused_mut)]
|
84 + | let mut builder = ::http::Response::builder();
|
85 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
86 + | builder,
|
87 + | ::http::header::CONTENT_TYPE,
|
88 + | "application/json",
|
89 + | );
|
90 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
91 + | builder,
|
92 + | ::http::header::HeaderName::from_static("x-amzn-errortype"),
|
93 + | "ValidationException",
|
94 + | );
|
95 + | let content_length = payload.len();
|
96 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
|
97 + | builder.status(400).body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
|
98 + | }
|
99 + | }
|
100 + | })
|
101 + | }
|