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_query_params_targeting_map_of_set_of_length_string_operation_http_request<B>(
|
4 6 | #[allow(unused_variables)] request: ::http::Request<B>,
|
5 7 | ) -> std::result::Result<
|
6 8 | crate::input::QueryParamsTargetingMapOfSetOfLengthStringOperationInput,
|
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::query_params_targeting_map_of_set_of_length_string_operation_input_internal::Builder::default();
|
21 + | /* ServerHttpBoundProtocolGenerator.kt:723 */let mut input = crate::input::query_params_targeting_map_of_set_of_length_string_operation_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:1073 */
|
22 29 | let query_string = uri.query().unwrap_or("");
|
23 30 | let pairs = ::form_urlencoded::parse(query_string.as_bytes());
|
31 + | /* ServerHttpBoundProtocolGenerator.kt:1088 */
|
24 32 | let mut query_params: crate::unconstrained::map_of_set_of_length_string_unconstrained::MapOfSetOfLengthStringUnconstrained =
|
25 - | crate::unconstrained::map_of_set_of_length_string_unconstrained::MapOfSetOfLengthStringUnconstrained(
|
26 - | ::std::collections::HashMap::new()
|
27 - | )
|
28 - | ;
|
33 + | /* ServerHttpBoundProtocolGenerator.kt:1089 */crate::unconstrained::map_of_set_of_length_string_unconstrained::MapOfSetOfLengthStringUnconstrained(
|
34 + | /* ServerHttpBoundProtocolGenerator.kt:1090 */::std::collections::HashMap::new()
|
35 + | /* ServerHttpBoundProtocolGenerator.kt:1089 */)
|
36 + | /* ServerHttpBoundProtocolGenerator.kt:1088 */;
|
37 + | /* ServerHttpBoundProtocolGenerator.kt:1105 */
|
29 38 | for (k, v) in pairs {
|
39 + | /* ServerHttpBoundProtocolGenerator.kt:1187 */
|
30 40 | let entry = query_params.0.entry(String::from(k)).or_insert_with(|| crate::unconstrained::set_of_length_string_unconstrained::SetOfLengthStringUnconstrained(std::vec::Vec::new()));
|
31 41 | entry.0.push(String::from(v));
|
42 + | /* ServerHttpBoundProtocolGenerator.kt:1105 */
|
32 43 | }
|
33 - | input = input.set_map_of_set_of_length_string(Some(query_params));
|
44 + | /* ServerHttpBoundProtocolGenerator.kt:1213 */
|
45 + | input = input.set_map_of_set_of_length_string(
|
46 + | /* ServerHttpBoundProtocolGenerator.kt:1214 */
|
47 + | Some(
|
48 + | /* ServerHttpBoundProtocolGenerator.kt:1215 */
|
49 + | query_params, /* ServerHttpBoundProtocolGenerator.kt:1214 */
|
50 + | ), /* ServerHttpBoundProtocolGenerator.kt:1213 */
|
51 + | );
|
52 + | /* ServerHttpBoundProtocolGenerator.kt:834 */
|
34 53 | input.build()?
|
54 + | /* ServerHttpBoundProtocolGenerator.kt:399 */
|
35 55 | })
|
56 + | /* ServerHttpBoundProtocolGenerator.kt:383 */
|
36 57 | }
|
37 58 |
|
59 + | /* RustType.kt:516 */
|
38 60 | #[allow(clippy::unnecessary_wraps)]
|
61 + | /* ServerHttpBoundProtocolGenerator.kt:421 */
|
39 62 | pub fn ser_query_params_targeting_map_of_set_of_length_string_operation_http_response(
|
40 63 | #[allow(unused_variables)]
|
41 64 | output: crate::output::QueryParamsTargetingMapOfSetOfLengthStringOperationOutput,
|
42 65 | ) -> std::result::Result<
|
43 66 | ::aws_smithy_http_server::response::Response,
|
44 67 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
45 68 | > {
|
69 + | /* ServerHttpBoundProtocolGenerator.kt:433 */
|
46 70 | Ok({
|
71 + | /* RustType.kt:516 */
|
47 72 | #[allow(unused_mut)]
|
73 + | /* ServerHttpBoundProtocolGenerator.kt:523 */
|
48 74 | let mut builder = ::http::Response::builder();
|
75 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
49 76 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
50 77 | builder,
|
51 78 | ::http::header::CONTENT_TYPE,
|
52 79 | "application/json",
|
53 80 | );
|
81 + | /* ServerHttpBoundProtocolGenerator.kt:682 */
|
54 82 | let http_status: u16 = 200;
|
55 83 | builder = builder.status(http_status);
|
84 + | /* ServerHttpBoundProtocolGenerator.kt:561 */
|
56 85 | let payload =
|
57 - | crate::protocol_serde::shape_query_params_targeting_map_of_set_of_length_string_operation_output::ser_query_params_targeting_map_of_set_of_length_string_operation_output_output_output(&output)?
|
58 - | ;
|
86 + | /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_query_params_targeting_map_of_set_of_length_string_operation_output::ser_query_params_targeting_map_of_set_of_length_string_operation_output_output_output(&output)?
|
87 + | /* ServerHttpBoundProtocolGenerator.kt:561 */;
|
88 + | /* ServerHttpBoundProtocolGenerator.kt:663 */
|
59 89 | let content_length = payload.len();
|
60 90 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
61 91 | builder,
|
62 92 | ::http::header::CONTENT_LENGTH,
|
63 93 | content_length,
|
64 94 | );
|
95 + | /* ServerHttpBoundProtocolGenerator.kt:567 */
|
65 96 | let body = ::aws_smithy_http_server::body::to_boxed(payload);
|
97 + | /* ServerHttpBoundProtocolGenerator.kt:575 */
|
66 98 | builder.body(body)?
|
99 + | /* ServerHttpBoundProtocolGenerator.kt:433 */
|
67 100 | })
|
101 + | /* ServerHttpBoundProtocolGenerator.kt:421 */
|
68 102 | }
|
69 103 |
|
104 + | /* RustType.kt:516 */
|
70 105 | #[allow(clippy::unnecessary_wraps)]
|
106 + | /* ServerHttpBoundProtocolGenerator.kt:447 */
|
71 107 | pub fn ser_query_params_targeting_map_of_set_of_length_string_operation_http_error(
|
72 108 | error: &crate::error::QueryParamsTargetingMapOfSetOfLengthStringOperationError,
|
73 109 | ) -> std::result::Result<
|
74 110 | ::aws_smithy_http_server::response::Response,
|
75 111 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
76 112 | > {
|
113 + | /* ServerHttpBoundProtocolGenerator.kt:452 */
|
77 114 | Ok({
|
115 + | /* ServerHttpBoundProtocolGenerator.kt:468 */
|
78 116 | match error {
|
79 - | crate::error::QueryParamsTargetingMapOfSetOfLengthStringOperationError::ValidationException(output) => {
|
80 - | let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
|
81 - | #[allow(unused_mut)]
|
82 - | let mut builder = ::http::Response::builder();
|
83 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
117 + | /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfSetOfLengthStringOperationError::ValidationException(output) => {
|
118 + | /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
|
119 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
120 + | /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
|
121 + | /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
84 122 | builder,
|
85 123 | ::http::header::CONTENT_TYPE,
|
86 124 | "application/json",
|
87 125 | );
|
88 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
126 + | /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
89 127 | builder,
|
90 128 | ::http::header::HeaderName::from_static("x-amzn-errortype"),
|
91 129 | "ValidationException",
|
92 130 | );
|
93 - | let content_length = payload.len();
|
131 + | /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
|
94 132 | builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
|
95 - | builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
|
96 - | }
|
97 - | crate::error::QueryParamsTargetingMapOfSetOfLengthStringOperationError::InternalServerError(output) => {
|
98 - | let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
|
99 - | #[allow(unused_mut)]
|
100 - | let mut builder = ::http::Response::builder();
|
101 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
133 + | /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
|
134 + | /* ServerHttpBoundProtocolGenerator.kt:476 */}
|
135 + | /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfSetOfLengthStringOperationError::InternalServerError(output) => {
|
136 + | /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
|
137 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
138 + | /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
|
139 + | /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
102 140 | builder,
|
103 141 | ::http::header::CONTENT_TYPE,
|
104 142 | "application/json",
|
105 143 | );
|
106 - | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
144 + | /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
107 145 | builder,
|
108 146 | ::http::header::HeaderName::from_static("x-amzn-errortype"),
|
109 147 | "InternalServerError",
|
110 148 | );
|
111 - | let content_length = payload.len();
|
149 + | /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
|
112 150 | builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
|
113 - | builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
|
114 - | }
|
115 - | }
|
151 + | /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
|
152 + | /* ServerHttpBoundProtocolGenerator.kt:476 */}
|
153 + | /* ServerHttpBoundProtocolGenerator.kt:468 */}
|
154 + | /* ServerHttpBoundProtocolGenerator.kt:452 */
|
116 155 | })
|
156 + | /* ServerHttpBoundProtocolGenerator.kt:447 */
|
117 157 | }
|