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