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_omits_serializing_empty_lists_http_request<B>(
|
4 6 | #[allow(unused_variables)] request: ::http::Request<B>,
|
5 7 | ) -> std::result::Result<
|
6 8 | crate::input::OmitsSerializingEmptyListsInput,
|
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)]
|
21 + | /* ServerHttpBoundProtocolGenerator.kt:723 */
|
17 22 | let mut input =
|
18 23 | crate::input::omits_serializing_empty_lists_input_internal::Builder::default();
|
24 + | /* RustType.kt:516 */
|
19 25 | #[allow(unused_variables)]
|
26 + | /* ServerHttpBoundProtocolGenerator.kt:728 */
|
20 27 | let ::aws_smithy_runtime_api::http::RequestParts {
|
21 28 | uri, headers, body, ..
|
22 29 | } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
|
30 + | /* ServerHttpBoundProtocolGenerator.kt:1073 */
|
23 31 | let query_string = uri.query().unwrap_or("");
|
24 32 | let pairs = ::form_urlencoded::parse(query_string.as_bytes());
|
33 + | /* ServerHttpBoundProtocolGenerator.kt:1102 */
|
25 34 | let mut query_boolean_list = Vec::new();
|
35 + | /* ServerHttpBoundProtocolGenerator.kt:1102 */
|
26 36 | let mut query_double_list = Vec::new();
|
37 + | /* ServerHttpBoundProtocolGenerator.kt:1102 */
|
27 38 | let mut query_enum_list = Vec::new();
|
39 + | /* ServerHttpBoundProtocolGenerator.kt:1102 */
|
28 40 | let mut query_integer_enum_list = Vec::new();
|
41 + | /* ServerHttpBoundProtocolGenerator.kt:1102 */
|
29 42 | let mut query_integer_list = Vec::new();
|
43 + | /* ServerHttpBoundProtocolGenerator.kt:1102 */
|
30 44 | let mut query_string_list = Vec::new();
|
45 + | /* ServerHttpBoundProtocolGenerator.kt:1102 */
|
31 46 | let mut query_timestamp_list = Vec::new();
|
47 + | /* ServerHttpBoundProtocolGenerator.kt:1105 */
|
32 48 | for (k, v) in pairs {
|
49 + | /* ServerHttpBoundProtocolGenerator.kt:1122 */
|
33 50 | if k == "BooleanList" {
|
51 + | /* ServerHttpBoundProtocolGenerator.kt:1159 */
|
34 52 | let v = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(&v)?;
|
53 + | /* ServerHttpBoundProtocolGenerator.kt:1168 */
|
35 54 | query_boolean_list.push(v);
|
36 - | } else if k == "DoubleList" {
|
55 + | /* ServerHttpBoundProtocolGenerator.kt:1122 */
|
56 + | }
|
57 + | /* ServerHttpBoundProtocolGenerator.kt:1122 */
|
58 + | else if k == "DoubleList" {
|
59 + | /* ServerHttpBoundProtocolGenerator.kt:1159 */
|
37 60 | let v = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(&v)?;
|
61 + | /* ServerHttpBoundProtocolGenerator.kt:1168 */
|
38 62 | query_double_list.push(v);
|
39 - | } else if k == "EnumList" {
|
63 + | /* ServerHttpBoundProtocolGenerator.kt:1122 */
|
64 + | }
|
65 + | /* ServerHttpBoundProtocolGenerator.kt:1122 */
|
66 + | else if k == "EnumList" {
|
67 + | /* ServerHttpBoundProtocolGenerator.kt:1134 */
|
40 68 | let v = v.into_owned();
|
69 + | /* ServerHttpBoundProtocolGenerator.kt:1168 */
|
41 70 | query_enum_list.push(v);
|
42 - | } else if k == "IntegerEnumList" {
|
71 + | /* ServerHttpBoundProtocolGenerator.kt:1122 */
|
72 + | }
|
73 + | /* ServerHttpBoundProtocolGenerator.kt:1122 */
|
74 + | else if k == "IntegerEnumList" {
|
75 + | /* ServerHttpBoundProtocolGenerator.kt:1159 */
|
43 76 | let v = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(&v)?;
|
77 + | /* ServerHttpBoundProtocolGenerator.kt:1168 */
|
44 78 | query_integer_enum_list.push(v);
|
45 - | } else if k == "IntegerList" {
|
79 + | /* ServerHttpBoundProtocolGenerator.kt:1122 */
|
80 + | }
|
81 + | /* ServerHttpBoundProtocolGenerator.kt:1122 */
|
82 + | else if k == "IntegerList" {
|
83 + | /* ServerHttpBoundProtocolGenerator.kt:1159 */
|
46 84 | let v = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(&v)?;
|
85 + | /* ServerHttpBoundProtocolGenerator.kt:1168 */
|
47 86 | query_integer_list.push(v);
|
48 - | } else if k == "StringList" {
|
87 + | /* ServerHttpBoundProtocolGenerator.kt:1122 */
|
88 + | }
|
89 + | /* ServerHttpBoundProtocolGenerator.kt:1122 */
|
90 + | else if k == "StringList" {
|
91 + | /* ServerHttpBoundProtocolGenerator.kt:1134 */
|
49 92 | let v = v.into_owned();
|
93 + | /* ServerHttpBoundProtocolGenerator.kt:1168 */
|
50 94 | query_string_list.push(v);
|
51 - | } else if k == "TimestampList" {
|
52 - | let v = ::aws_smithy_types::DateTime::from_str(
|
53 - | &v,
|
54 - | ::aws_smithy_types::date_time::Format::DateTime,
|
55 - | )?
|
56 - | .into();
|
95 + | /* ServerHttpBoundProtocolGenerator.kt:1122 */
|
96 + | }
|
97 + | /* ServerHttpBoundProtocolGenerator.kt:1122 */
|
98 + | else if k == "TimestampList" {
|
99 + | /* ServerHttpBoundProtocolGenerator.kt:1146 */
|
100 + | let v = ::aws_smithy_types::DateTime::from_str(&v, ::aws_smithy_types::date_time::Format::DateTime)?
|
101 + | /* PythonServerProtocolLoader.kt:68 */.into()
|
102 + | /* ServerHttpBoundProtocolGenerator.kt:1156 */;
|
103 + | /* ServerHttpBoundProtocolGenerator.kt:1168 */
|
57 104 | query_timestamp_list.push(v);
|
105 + | /* ServerHttpBoundProtocolGenerator.kt:1122 */
|
58 106 | }
|
107 + | /* ServerHttpBoundProtocolGenerator.kt:1105 */
|
59 108 | }
|
109 + | /* ServerHttpBoundProtocolGenerator.kt:1228 */
|
60 110 | if !query_boolean_list.is_empty() {
|
61 - | input = input.set_query_boolean_list(Some(query_boolean_list));
|
111 + | /* ServerHttpBoundProtocolGenerator.kt:1229 */
|
112 + | input = input.set_query_boolean_list(
|
113 + | /* ServerHttpBoundProtocolGenerator.kt:1235 */
|
114 + | Some(
|
115 + | /* ServerHttpBoundProtocolGenerator.kt:1244 */
|
116 + | query_boolean_list, /* ServerHttpBoundProtocolGenerator.kt:1235 */
|
117 + | ), /* ServerHttpBoundProtocolGenerator.kt:1229 */
|
118 + | );
|
119 + | /* ServerHttpBoundProtocolGenerator.kt:1228 */
|
62 120 | }
|
121 + | /* ServerHttpBoundProtocolGenerator.kt:1228 */
|
63 122 | if !query_double_list.is_empty() {
|
64 - | input = input.set_query_double_list(Some(query_double_list));
|
123 + | /* ServerHttpBoundProtocolGenerator.kt:1229 */
|
124 + | input = input.set_query_double_list(
|
125 + | /* ServerHttpBoundProtocolGenerator.kt:1235 */
|
126 + | Some(
|
127 + | /* ServerHttpBoundProtocolGenerator.kt:1244 */
|
128 + | query_double_list, /* ServerHttpBoundProtocolGenerator.kt:1235 */
|
129 + | ), /* ServerHttpBoundProtocolGenerator.kt:1229 */
|
130 + | );
|
131 + | /* ServerHttpBoundProtocolGenerator.kt:1228 */
|
65 132 | }
|
133 + | /* ServerHttpBoundProtocolGenerator.kt:1228 */
|
66 134 | if !query_enum_list.is_empty() {
|
67 - | input = input.set_query_enum_list(Some(
|
135 + | /* ServerHttpBoundProtocolGenerator.kt:1229 */
|
136 + | input = input.set_query_enum_list(
|
137 + | /* ServerHttpBoundProtocolGenerator.kt:1235 */
|
138 + | Some(
|
139 + | /* ServerHttpBoundProtocolGenerator.kt:1236 */
|
68 140 | crate::unconstrained::foo_enum_list_unconstrained::FooEnumListUnconstrained(
|
69 - | query_enum_list,
|
70 - | ),
|
71 - | ));
|
141 + | /* ServerHttpBoundProtocolGenerator.kt:1244 */
|
142 + | query_enum_list, /* ServerHttpBoundProtocolGenerator.kt:1236 */
|
143 + | ), /* ServerHttpBoundProtocolGenerator.kt:1235 */
|
144 + | ), /* ServerHttpBoundProtocolGenerator.kt:1229 */
|
145 + | );
|
146 + | /* ServerHttpBoundProtocolGenerator.kt:1228 */
|
72 147 | }
|
148 + | /* ServerHttpBoundProtocolGenerator.kt:1228 */
|
73 149 | if !query_integer_enum_list.is_empty() {
|
74 - | input = input.set_query_integer_enum_list(Some(query_integer_enum_list));
|
150 + | /* ServerHttpBoundProtocolGenerator.kt:1229 */
|
151 + | input = input.set_query_integer_enum_list(
|
152 + | /* ServerHttpBoundProtocolGenerator.kt:1235 */
|
153 + | Some(
|
154 + | /* ServerHttpBoundProtocolGenerator.kt:1244 */
|
155 + | query_integer_enum_list, /* ServerHttpBoundProtocolGenerator.kt:1235 */
|
156 + | ), /* ServerHttpBoundProtocolGenerator.kt:1229 */
|
157 + | );
|
158 + | /* ServerHttpBoundProtocolGenerator.kt:1228 */
|
75 159 | }
|
160 + | /* ServerHttpBoundProtocolGenerator.kt:1228 */
|
76 161 | if !query_integer_list.is_empty() {
|
77 - | input = input.set_query_integer_list(Some(query_integer_list));
|
162 + | /* ServerHttpBoundProtocolGenerator.kt:1229 */
|
163 + | input = input.set_query_integer_list(
|
164 + | /* ServerHttpBoundProtocolGenerator.kt:1235 */
|
165 + | Some(
|
166 + | /* ServerHttpBoundProtocolGenerator.kt:1244 */
|
167 + | query_integer_list, /* ServerHttpBoundProtocolGenerator.kt:1235 */
|
168 + | ), /* ServerHttpBoundProtocolGenerator.kt:1229 */
|
169 + | );
|
170 + | /* ServerHttpBoundProtocolGenerator.kt:1228 */
|
78 171 | }
|
172 + | /* ServerHttpBoundProtocolGenerator.kt:1228 */
|
79 173 | if !query_string_list.is_empty() {
|
80 - | input = input.set_query_string_list(Some(query_string_list));
|
174 + | /* ServerHttpBoundProtocolGenerator.kt:1229 */
|
175 + | input = input.set_query_string_list(
|
176 + | /* ServerHttpBoundProtocolGenerator.kt:1235 */
|
177 + | Some(
|
178 + | /* ServerHttpBoundProtocolGenerator.kt:1244 */
|
179 + | query_string_list, /* ServerHttpBoundProtocolGenerator.kt:1235 */
|
180 + | ), /* ServerHttpBoundProtocolGenerator.kt:1229 */
|
181 + | );
|
182 + | /* ServerHttpBoundProtocolGenerator.kt:1228 */
|
81 183 | }
|
184 + | /* ServerHttpBoundProtocolGenerator.kt:1228 */
|
82 185 | if !query_timestamp_list.is_empty() {
|
83 - | input = input.set_query_timestamp_list(Some(query_timestamp_list));
|
186 + | /* ServerHttpBoundProtocolGenerator.kt:1229 */
|
187 + | input = input.set_query_timestamp_list(
|
188 + | /* ServerHttpBoundProtocolGenerator.kt:1235 */
|
189 + | Some(
|
190 + | /* ServerHttpBoundProtocolGenerator.kt:1244 */
|
191 + | query_timestamp_list, /* ServerHttpBoundProtocolGenerator.kt:1235 */
|
192 + | ), /* ServerHttpBoundProtocolGenerator.kt:1229 */
|
193 + | );
|
194 + | /* ServerHttpBoundProtocolGenerator.kt:1228 */
|
84 195 | }
|
196 + | /* ServerHttpBoundProtocolGenerator.kt:834 */
|
85 197 | input.build()?
|
198 + | /* ServerHttpBoundProtocolGenerator.kt:399 */
|
86 199 | })
|
200 + | /* ServerHttpBoundProtocolGenerator.kt:383 */
|
87 201 | }
|
88 202 |
|
203 + | /* RustType.kt:516 */
|
89 204 | #[allow(clippy::unnecessary_wraps)]
|
205 + | /* ServerHttpBoundProtocolGenerator.kt:421 */
|
90 206 | pub fn ser_omits_serializing_empty_lists_http_response(
|
91 207 | #[allow(unused_variables)] output: crate::output::OmitsSerializingEmptyListsOutput,
|
92 208 | ) -> std::result::Result<
|
93 209 | ::aws_smithy_http_server::response::Response,
|
94 210 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
95 211 | > {
|
212 + | /* ServerHttpBoundProtocolGenerator.kt:433 */
|
96 213 | Ok({
|
214 + | /* RustType.kt:516 */
|
97 215 | #[allow(unused_mut)]
|
216 + | /* ServerHttpBoundProtocolGenerator.kt:523 */
|
98 217 | let mut builder = ::http::Response::builder();
|
218 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
99 219 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
100 220 | builder,
|
101 221 | ::http::header::CONTENT_TYPE,
|
102 222 | "application/json",
|
103 223 | );
|
224 + | /* ServerHttpBoundProtocolGenerator.kt:682 */
|
104 225 | let http_status: u16 = 200;
|
105 226 | builder = builder.status(http_status);
|
106 - | let payload = "";
|
227 + | /* ServerHttpBoundProtocolGenerator.kt:561 */
|
228 + | let payload =
|
229 + | /* HttpBoundProtocolPayloadGenerator.kt:235 */""
|
230 + | /* ServerHttpBoundProtocolGenerator.kt:561 */;
|
231 + | /* ServerHttpBoundProtocolGenerator.kt:663 */
|
107 232 | let content_length = payload.len();
|
108 233 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
109 234 | builder,
|
110 235 | ::http::header::CONTENT_LENGTH,
|
111 236 | content_length,
|
112 237 | );
|
238 + | /* ServerHttpBoundProtocolGenerator.kt:567 */
|
113 239 | let body = ::aws_smithy_http_server::body::to_boxed(payload);
|
240 + | /* ServerHttpBoundProtocolGenerator.kt:575 */
|
114 241 | builder.body(body)?
|
242 + | /* ServerHttpBoundProtocolGenerator.kt:433 */
|
115 243 | })
|
244 + | /* ServerHttpBoundProtocolGenerator.kt:421 */
|
116 245 | }
|
117 246 |
|
247 + | /* RustType.kt:516 */
|
118 248 | #[allow(clippy::unnecessary_wraps)]
|
249 + | /* ServerHttpBoundProtocolGenerator.kt:447 */
|
119 250 | pub fn ser_omits_serializing_empty_lists_http_error(
|
120 251 | error: &crate::error::OmitsSerializingEmptyListsError,
|
121 252 | ) -> std::result::Result<
|
122 253 | ::aws_smithy_http_server::response::Response,
|
123 254 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
124 255 | > {
|
256 + | /* ServerHttpBoundProtocolGenerator.kt:452 */
|
125 257 | Ok({
|
258 + | /* ServerHttpBoundProtocolGenerator.kt:468 */
|
126 259 | match error {
|
260 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
127 261 | crate::error::OmitsSerializingEmptyListsError::ValidationException(output) => {
|
262 + | /* ServerHttpBoundProtocolGenerator.kt:477 */
|
128 263 | let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
|
264 + | /* RustType.kt:516 */
|
129 265 | #[allow(unused_mut)]
|
266 + | /* ServerHttpBoundProtocolGenerator.kt:487 */
|
130 267 | let mut builder = ::http::Response::builder();
|
268 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
131 269 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
132 270 | builder,
|
133 271 | ::http::header::CONTENT_TYPE,
|
134 272 | "application/json",
|
135 273 | );
|
274 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
136 275 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
137 276 | builder,
|
138 277 | ::http::header::HeaderName::from_static("x-amzn-errortype"),
|
139 278 | "ValidationException",
|
140 279 | );
|
280 + | /* ServerHttpBoundProtocolGenerator.kt:663 */
|
141 281 | let content_length = payload.len();
|
142 282 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
143 283 | builder,
|
144 284 | ::http::header::CONTENT_LENGTH,
|
145 285 | content_length,
|
146 286 | );
|
287 + | /* ServerHttpBoundProtocolGenerator.kt:504 */
|
147 288 | builder
|
148 289 | .status(400)
|
149 290 | .body(::aws_smithy_http_server::body::to_boxed(payload))?
|
291 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
150 292 | }
|
293 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
151 294 | crate::error::OmitsSerializingEmptyListsError::InternalServerError(output) => {
|
295 + | /* ServerHttpBoundProtocolGenerator.kt:477 */
|
152 296 | let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
|
297 + | /* RustType.kt:516 */
|
153 298 | #[allow(unused_mut)]
|
299 + | /* ServerHttpBoundProtocolGenerator.kt:487 */
|
154 300 | let mut builder = ::http::Response::builder();
|
301 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
155 302 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
156 303 | builder,
|
157 304 | ::http::header::CONTENT_TYPE,
|
158 305 | "application/json",
|
159 306 | );
|
307 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
160 308 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
161 309 | builder,
|
162 310 | ::http::header::HeaderName::from_static("x-amzn-errortype"),
|
163 311 | "InternalServerError",
|
164 312 | );
|
313 + | /* ServerHttpBoundProtocolGenerator.kt:663 */
|
165 314 | let content_length = payload.len();
|
166 315 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
167 316 | builder,
|
168 317 | ::http::header::CONTENT_LENGTH,
|
169 318 | content_length,
|
170 319 | );
|
320 + | /* ServerHttpBoundProtocolGenerator.kt:504 */
|
171 321 | builder
|
172 322 | .status(500)
|
173 323 | .body(::aws_smithy_http_server::body::to_boxed(payload))?
|
324 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
325 + | } /* ServerHttpBoundProtocolGenerator.kt:468 */
|
174 326 | }
|
175 - | }
|
327 + | /* ServerHttpBoundProtocolGenerator.kt:452 */
|
176 328 | })
|
329 + | /* ServerHttpBoundProtocolGenerator.kt:447 */
|
177 330 | }
|