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