1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /* RustType.kt:534 */
|
3 + | #[allow(clippy::unnecessary_wraps)]
|
4 + | /* ServerHttpBoundProtocolGenerator.kt:408 */
|
5 + | pub async fn de_input_and_output_with_headers_http_request<B>(
|
6 + | #[allow(unused_variables)] request: ::http::Request<B>,
|
7 + | ) -> std::result::Result<
|
8 + | crate::input::InputAndOutputWithHeadersInput,
|
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 + | /* ServerHttpBoundProtocolGenerator.kt:424 */
|
18 + | Ok({
|
19 + | /* RustType.kt:534 */
|
20 + | #[allow(unused_mut)]
|
21 + | /* ServerHttpBoundProtocolGenerator.kt:759 */
|
22 + | let mut input = crate::input::input_and_output_with_headers_input::Builder::default();
|
23 + | /* RustType.kt:534 */
|
24 + | #[allow(unused_variables)]
|
25 + | /* ServerHttpBoundProtocolGenerator.kt:764 */
|
26 + | let ::aws_smithy_runtime_api::http::RequestParts {
|
27 + | uri, headers, body, ..
|
28 + | } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
|
29 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
30 + | if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_boolean_list_header(&headers)? {
|
31 + | input = input.set_header_boolean_list(Some(value))
|
32 + | }
|
33 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
34 + | if let Some(value) =
|
35 + | crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_byte_header(
|
36 + | &headers,
|
37 + | )?
|
38 + | {
|
39 + | input = input.set_header_byte(Some(value))
|
40 + | }
|
41 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
42 + | if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_double_header(&headers)? {
|
43 + | input = input.set_header_double(Some(value))
|
44 + | }
|
45 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
46 + | if let Some(value) =
|
47 + | crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_enum_header(
|
48 + | &headers,
|
49 + | )?
|
50 + | {
|
51 + | input = input.set_header_enum(Some(value))
|
52 + | }
|
53 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
54 + | if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_enum_list_header(&headers)? {
|
55 + | input = input.set_header_enum_list(Some(value))
|
56 + | }
|
57 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
58 + | if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_false_bool_header(&headers)? {
|
59 + | input = input.set_header_false_bool(Some(value))
|
60 + | }
|
61 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
62 + | if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_float_header(&headers)? {
|
63 + | input = input.set_header_float(Some(value))
|
64 + | }
|
65 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
66 + | if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_integer_header(&headers)? {
|
67 + | input = input.set_header_integer(Some(value))
|
68 + | }
|
69 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
70 + | if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_integer_enum_header(&headers)? {
|
71 + | input = input.set_header_integer_enum(Some(value))
|
72 + | }
|
73 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
74 + | if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_integer_enum_list_header(&headers)? {
|
75 + | input = input.set_header_integer_enum_list(Some(value))
|
76 + | }
|
77 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
78 + | if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_integer_list_header(&headers)? {
|
79 + | input = input.set_header_integer_list(Some(value))
|
80 + | }
|
81 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
82 + | if let Some(value) =
|
83 + | crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_long_header(
|
84 + | &headers,
|
85 + | )?
|
86 + | {
|
87 + | input = input.set_header_long(Some(value))
|
88 + | }
|
89 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
90 + | if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_short_header(&headers)? {
|
91 + | input = input.set_header_short(Some(value))
|
92 + | }
|
93 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
94 + | if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_string_header(&headers)? {
|
95 + | input = input.set_header_string(Some(value))
|
96 + | }
|
97 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
98 + | if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_string_list_header(&headers)? {
|
99 + | input = input.set_header_string_list(Some(value))
|
100 + | }
|
101 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
102 + | if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_string_set_header(&headers)? {
|
103 + | input = input.set_header_string_set(Some(value))
|
104 + | }
|
105 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
106 + | if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_timestamp_list_header(&headers)? {
|
107 + | input = input.set_header_timestamp_list(Some(value))
|
108 + | }
|
109 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
110 + | if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_true_bool_header(&headers)? {
|
111 + | input = input.set_header_true_bool(Some(value))
|
112 + | }
|
113 + | /* ServerHttpBoundProtocolGenerator.kt:896 */
|
114 + | input.build()?
|
115 + | /* ServerHttpBoundProtocolGenerator.kt:424 */
|
116 + | })
|
117 + | /* ServerHttpBoundProtocolGenerator.kt:408 */
|
118 + | }
|
119 + |
|
120 + | /* RustType.kt:534 */
|
121 + | #[allow(clippy::unnecessary_wraps)]
|
122 + | /* ServerHttpBoundProtocolGenerator.kt:445 */
|
123 + | pub fn ser_input_and_output_with_headers_http_response(
|
124 + | #[allow(unused_variables)] output: crate::output::InputAndOutputWithHeadersOutput,
|
125 + | ) -> std::result::Result<
|
126 + | ::aws_smithy_legacy_http_server::response::Response,
|
127 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
128 + | > {
|
129 + | /* ServerHttpBoundProtocolGenerator.kt:457 */
|
130 + | Ok({
|
131 + | /* RustType.kt:534 */
|
132 + | #[allow(unused_mut)]
|
133 + | /* ServerHttpBoundProtocolGenerator.kt:547 */
|
134 + | let mut builder = ::http::Response::builder();
|
135 + | /* ServerHttpBoundProtocolGenerator.kt:665 */
|
136 + | builder = crate::protocol_serde::shape_input_and_output_with_headers::ser_input_and_output_with_headers_headers(&output, builder)?;
|
137 + | /* ServerHttpBoundProtocolGenerator.kt:633 */
|
138 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
139 + | builder,
|
140 + | ::http::header::CONTENT_TYPE,
|
141 + | "application/json",
|
142 + | );
|
143 + | /* ServerHttpBoundProtocolGenerator.kt:718 */
|
144 + | let http_status: u16 = 200;
|
145 + | builder = builder.status(http_status);
|
146 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
147 + | let payload =
|
148 + | /* HttpBoundProtocolPayloadGenerator.kt:235 */crate::protocol_serde::shape_input_and_output_with_headers_output::ser_input_and_output_with_headers_output_output_output(&output)?
|
149 + | /* ServerHttpBoundProtocolGenerator.kt:597 */;
|
150 + | /* ServerHttpBoundProtocolGenerator.kt:699 */
|
151 + | let content_length = payload.len();
|
152 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
153 + | builder,
|
154 + | ::http::header::CONTENT_LENGTH,
|
155 + | content_length,
|
156 + | );
|
157 + | /* ServerHttpBoundProtocolGenerator.kt:603 */
|
158 + | let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
|
159 + | /* ServerHttpBoundProtocolGenerator.kt:611 */
|
160 + | builder.body(body)?
|
161 + | /* ServerHttpBoundProtocolGenerator.kt:457 */
|
162 + | })
|
163 + | /* ServerHttpBoundProtocolGenerator.kt:445 */
|
164 + | }
|
165 + |
|
166 + | /* RustType.kt:534 */
|
167 + | #[allow(clippy::unnecessary_wraps)]
|
168 + | /* ServerHttpBoundProtocolGenerator.kt:471 */
|
169 + | pub fn ser_input_and_output_with_headers_http_error(
|
170 + | error: &crate::error::InputAndOutputWithHeadersError,
|
171 + | ) -> std::result::Result<
|
172 + | ::aws_smithy_legacy_http_server::response::Response,
|
173 + | ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
174 + | > {
|
175 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
176 + | Ok({
|
177 + | /* ServerHttpBoundProtocolGenerator.kt:492 */
|
178 + | match error {
|
179 + | /* ServerHttpBoundProtocolGenerator.kt:500 */
|
180 + | crate::error::InputAndOutputWithHeadersError::ValidationException(output) => {
|
181 + | /* ServerHttpBoundProtocolGenerator.kt:501 */
|
182 + | let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
|
183 + | /* RustType.kt:534 */
|
184 + | #[allow(unused_mut)]
|
185 + | /* ServerHttpBoundProtocolGenerator.kt:511 */
|
186 + | let mut builder = ::http::Response::builder();
|
187 + | /* ServerHttpBoundProtocolGenerator.kt:633 */
|
188 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
189 + | builder,
|
190 + | ::http::header::CONTENT_TYPE,
|
191 + | "application/json",
|
192 + | );
|
193 + | /* ServerHttpBoundProtocolGenerator.kt:633 */
|
194 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
195 + | builder,
|
196 + | ::http::header::HeaderName::from_static("x-amzn-errortype"),
|
197 + | "ValidationException",
|
198 + | );
|
199 + | /* ServerHttpBoundProtocolGenerator.kt:699 */
|
200 + | let content_length = payload.len();
|
201 + | builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
|
202 + | builder,
|
203 + | ::http::header::CONTENT_LENGTH,
|
204 + | content_length,
|
205 + | );
|
206 + | /* ServerHttpBoundProtocolGenerator.kt:528 */
|
207 + | builder
|
208 + | .status(400)
|
209 + | .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
|
210 + | /* ServerHttpBoundProtocolGenerator.kt:500 */
|
211 + | } /* ServerHttpBoundProtocolGenerator.kt:492 */
|
212 + | }
|
213 + | /* ServerHttpBoundProtocolGenerator.kt:476 */
|
214 + | })
|
215 + | /* ServerHttpBoundProtocolGenerator.kt:471 */
|
216 + | }
|
217 + |
|
218 + | /* HttpBindingGenerator.kt:565 */
|
219 + | pub fn ser_input_and_output_with_headers_headers(
|
220 + | input: &crate::output::InputAndOutputWithHeadersOutput,
|
221 + | mut builder: ::http::response::Builder,
|
222 + | ) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
|
223 + | {
|
224 + | /* HttpBindingGenerator.kt:615 */
|
225 + | if let ::std::option::Option::Some(inner_1) = &input.header_string {
|
226 + | /* HttpBindingGenerator.kt:727 */
|
227 + | let formatted_2 = inner_1.as_str();
|
228 + | /* HttpBindingGenerator.kt:728 */
|
229 + | if !formatted_2.is_empty() {
|
230 + | /* HttpBindingGenerator.kt:729 */
|
231 + | let header_value = formatted_2;
|
232 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
233 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
234 + | "header_string",
|
235 + | format!(
|
236 + | "`{}` cannot be used as a header value: {}",
|
237 + | &header_value, err
|
238 + | ),
|
239 + | )
|
240 + | })?;
|
241 + | builder = builder.header("X-String", header_value);
|
242 + | /* HttpBindingGenerator.kt:728 */
|
243 + | }
|
244 + | /* HttpBindingGenerator.kt:615 */
|
245 + | }
|
246 + | /* HttpBindingGenerator.kt:615 */
|
247 + | if let ::std::option::Option::Some(inner_3) = &input.header_byte {
|
248 + | /* HttpBindingGenerator.kt:713 */
|
249 + | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_3);
|
250 + | /* HttpBindingGenerator.kt:727 */
|
251 + | let formatted_4 = encoder.encode();
|
252 + | /* HttpBindingGenerator.kt:728 */
|
253 + | if !formatted_4.is_empty() {
|
254 + | /* HttpBindingGenerator.kt:729 */
|
255 + | let header_value = formatted_4;
|
256 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
257 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
258 + | "header_byte",
|
259 + | format!(
|
260 + | "`{}` cannot be used as a header value: {}",
|
261 + | &header_value, err
|
262 + | ),
|
263 + | )
|
264 + | })?;
|
265 + | builder = builder.header("X-Byte", header_value);
|
266 + | /* HttpBindingGenerator.kt:728 */
|
267 + | }
|
268 + | /* HttpBindingGenerator.kt:615 */
|
269 + | }
|
270 + | /* HttpBindingGenerator.kt:615 */
|
271 + | if let ::std::option::Option::Some(inner_5) = &input.header_short {
|
272 + | /* HttpBindingGenerator.kt:713 */
|
273 + | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_5);
|
274 + | /* HttpBindingGenerator.kt:727 */
|
275 + | let formatted_6 = encoder.encode();
|
276 + | /* HttpBindingGenerator.kt:728 */
|
277 + | if !formatted_6.is_empty() {
|
278 + | /* HttpBindingGenerator.kt:729 */
|
279 + | let header_value = formatted_6;
|
280 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
281 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
282 + | "header_short",
|
283 + | format!(
|
284 + | "`{}` cannot be used as a header value: {}",
|
285 + | &header_value, err
|
286 + | ),
|
287 + | )
|
288 + | })?;
|
289 + | builder = builder.header("X-Short", header_value);
|
290 + | /* HttpBindingGenerator.kt:728 */
|
291 + | }
|
292 + | /* HttpBindingGenerator.kt:615 */
|
293 + | }
|
294 + | /* HttpBindingGenerator.kt:615 */
|
295 + | if let ::std::option::Option::Some(inner_7) = &input.header_integer {
|
296 + | /* HttpBindingGenerator.kt:713 */
|
297 + | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_7);
|
298 + | /* HttpBindingGenerator.kt:727 */
|
299 + | let formatted_8 = encoder.encode();
|
300 + | /* HttpBindingGenerator.kt:728 */
|
301 + | if !formatted_8.is_empty() {
|
302 + | /* HttpBindingGenerator.kt:729 */
|
303 + | let header_value = formatted_8;
|
304 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
305 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
306 + | "header_integer",
|
307 + | format!(
|
308 + | "`{}` cannot be used as a header value: {}",
|
309 + | &header_value, err
|
310 + | ),
|
311 + | )
|
312 + | })?;
|
313 + | builder = builder.header("X-Integer", header_value);
|
314 + | /* HttpBindingGenerator.kt:728 */
|
315 + | }
|
316 + | /* HttpBindingGenerator.kt:615 */
|
317 + | }
|
318 + | /* HttpBindingGenerator.kt:615 */
|
319 + | if let ::std::option::Option::Some(inner_9) = &input.header_long {
|
320 + | /* HttpBindingGenerator.kt:713 */
|
321 + | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_9);
|
322 + | /* HttpBindingGenerator.kt:727 */
|
323 + | let formatted_10 = encoder.encode();
|
324 + | /* HttpBindingGenerator.kt:728 */
|
325 + | if !formatted_10.is_empty() {
|
326 + | /* HttpBindingGenerator.kt:729 */
|
327 + | let header_value = formatted_10;
|
328 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
329 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
330 + | "header_long",
|
331 + | format!(
|
332 + | "`{}` cannot be used as a header value: {}",
|
333 + | &header_value, err
|
334 + | ),
|
335 + | )
|
336 + | })?;
|
337 + | builder = builder.header("X-Long", header_value);
|
338 + | /* HttpBindingGenerator.kt:728 */
|
339 + | }
|
340 + | /* HttpBindingGenerator.kt:615 */
|
341 + | }
|
342 + | /* HttpBindingGenerator.kt:615 */
|
343 + | if let ::std::option::Option::Some(inner_11) = &input.header_float {
|
344 + | /* HttpBindingGenerator.kt:713 */
|
345 + | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_11);
|
346 + | /* HttpBindingGenerator.kt:727 */
|
347 + | let formatted_12 = encoder.encode();
|
348 + | /* HttpBindingGenerator.kt:728 */
|
349 + | if !formatted_12.is_empty() {
|
350 + | /* HttpBindingGenerator.kt:729 */
|
351 + | let header_value = formatted_12;
|
352 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
353 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
354 + | "header_float",
|
355 + | format!(
|
356 + | "`{}` cannot be used as a header value: {}",
|
357 + | &header_value, err
|
358 + | ),
|
359 + | )
|
360 + | })?;
|
361 + | builder = builder.header("X-Float", header_value);
|
362 + | /* HttpBindingGenerator.kt:728 */
|
363 + | }
|
364 + | /* HttpBindingGenerator.kt:615 */
|
365 + | }
|
366 + | /* HttpBindingGenerator.kt:615 */
|
367 + | if let ::std::option::Option::Some(inner_13) = &input.header_double {
|
368 + | /* HttpBindingGenerator.kt:713 */
|
369 + | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_13);
|
370 + | /* HttpBindingGenerator.kt:727 */
|
371 + | let formatted_14 = encoder.encode();
|
372 + | /* HttpBindingGenerator.kt:728 */
|
373 + | if !formatted_14.is_empty() {
|
374 + | /* HttpBindingGenerator.kt:729 */
|
375 + | let header_value = formatted_14;
|
376 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
377 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
378 + | "header_double",
|
379 + | format!(
|
380 + | "`{}` cannot be used as a header value: {}",
|
381 + | &header_value, err
|
382 + | ),
|
383 + | )
|
384 + | })?;
|
385 + | builder = builder.header("X-Double", header_value);
|
386 + | /* HttpBindingGenerator.kt:728 */
|
387 + | }
|
388 + | /* HttpBindingGenerator.kt:615 */
|
389 + | }
|
390 + | /* HttpBindingGenerator.kt:615 */
|
391 + | if let ::std::option::Option::Some(inner_15) = &input.header_true_bool {
|
392 + | /* HttpBindingGenerator.kt:713 */
|
393 + | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_15);
|
394 + | /* HttpBindingGenerator.kt:727 */
|
395 + | let formatted_16 = encoder.encode();
|
396 + | /* HttpBindingGenerator.kt:728 */
|
397 + | if !formatted_16.is_empty() {
|
398 + | /* HttpBindingGenerator.kt:729 */
|
399 + | let header_value = formatted_16;
|
400 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
401 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
402 + | "header_true_bool",
|
403 + | format!(
|
404 + | "`{}` cannot be used as a header value: {}",
|
405 + | &header_value, err
|
406 + | ),
|
407 + | )
|
408 + | })?;
|
409 + | builder = builder.header("X-Boolean1", header_value);
|
410 + | /* HttpBindingGenerator.kt:728 */
|
411 + | }
|
412 + | /* HttpBindingGenerator.kt:615 */
|
413 + | }
|
414 + | /* HttpBindingGenerator.kt:615 */
|
415 + | if let ::std::option::Option::Some(inner_17) = &input.header_false_bool {
|
416 + | /* HttpBindingGenerator.kt:713 */
|
417 + | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_17);
|
418 + | /* HttpBindingGenerator.kt:727 */
|
419 + | let formatted_18 = encoder.encode();
|
420 + | /* HttpBindingGenerator.kt:728 */
|
421 + | if !formatted_18.is_empty() {
|
422 + | /* HttpBindingGenerator.kt:729 */
|
423 + | let header_value = formatted_18;
|
424 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
425 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
426 + | "header_false_bool",
|
427 + | format!(
|
428 + | "`{}` cannot be used as a header value: {}",
|
429 + | &header_value, err
|
430 + | ),
|
431 + | )
|
432 + | })?;
|
433 + | builder = builder.header("X-Boolean2", header_value);
|
434 + | /* HttpBindingGenerator.kt:728 */
|
435 + | }
|
436 + | /* HttpBindingGenerator.kt:615 */
|
437 + | }
|
438 + | /* HttpBindingGenerator.kt:615 */
|
439 + | if let ::std::option::Option::Some(inner_19) = &input.header_string_list {
|
440 + | /* HttpBindingGenerator.kt:669 */
|
441 + | for inner_20 in inner_19 {
|
442 + | /* HttpBindingGenerator.kt:727 */
|
443 + | let formatted_21 =
|
444 + | ::aws_smithy_legacy_http::header::quote_header_value(inner_20.as_str());
|
445 + | /* HttpBindingGenerator.kt:728 */
|
446 + | if !formatted_21.is_empty() {
|
447 + | /* HttpBindingGenerator.kt:729 */
|
448 + | let header_value = formatted_21;
|
449 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
450 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
451 + | "header_string_list",
|
452 + | format!(
|
453 + | "`{}` cannot be used as a header value: {}",
|
454 + | &header_value, err
|
455 + | ),
|
456 + | )
|
457 + | })?;
|
458 + | builder = builder.header("X-StringList", header_value);
|
459 + | /* HttpBindingGenerator.kt:728 */
|
460 + | }
|
461 + | /* HttpBindingGenerator.kt:669 */
|
462 + | }
|
463 + | /* HttpBindingGenerator.kt:615 */
|
464 + | }
|
465 + | /* HttpBindingGenerator.kt:615 */
|
466 + | if let ::std::option::Option::Some(inner_22) = &input.header_string_set {
|
467 + | /* HttpBindingGenerator.kt:669 */
|
468 + | for inner_23 in &inner_22.0 {
|
469 + | /* HttpBindingGenerator.kt:727 */
|
470 + | let formatted_24 =
|
471 + | ::aws_smithy_legacy_http::header::quote_header_value(inner_23.as_str());
|
472 + | /* HttpBindingGenerator.kt:728 */
|
473 + | if !formatted_24.is_empty() {
|
474 + | /* HttpBindingGenerator.kt:729 */
|
475 + | let header_value = formatted_24;
|
476 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
477 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
478 + | "header_string_set",
|
479 + | format!(
|
480 + | "`{}` cannot be used as a header value: {}",
|
481 + | &header_value, err
|
482 + | ),
|
483 + | )
|
484 + | })?;
|
485 + | builder = builder.header("X-StringSet", header_value);
|
486 + | /* HttpBindingGenerator.kt:728 */
|
487 + | }
|
488 + | /* HttpBindingGenerator.kt:669 */
|
489 + | }
|
490 + | /* HttpBindingGenerator.kt:615 */
|
491 + | }
|
492 + | /* HttpBindingGenerator.kt:615 */
|
493 + | if let ::std::option::Option::Some(inner_25) = &input.header_integer_list {
|
494 + | /* HttpBindingGenerator.kt:669 */
|
495 + | for inner_26 in inner_25 {
|
496 + | /* HttpBindingGenerator.kt:713 */
|
497 + | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_26);
|
498 + | /* HttpBindingGenerator.kt:727 */
|
499 + | let formatted_27 = encoder.encode();
|
500 + | /* HttpBindingGenerator.kt:728 */
|
501 + | if !formatted_27.is_empty() {
|
502 + | /* HttpBindingGenerator.kt:729 */
|
503 + | let header_value = formatted_27;
|
504 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
505 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
506 + | "header_integer_list",
|
507 + | format!(
|
508 + | "`{}` cannot be used as a header value: {}",
|
509 + | &header_value, err
|
510 + | ),
|
511 + | )
|
512 + | })?;
|
513 + | builder = builder.header("X-IntegerList", header_value);
|
514 + | /* HttpBindingGenerator.kt:728 */
|
515 + | }
|
516 + | /* HttpBindingGenerator.kt:669 */
|
517 + | }
|
518 + | /* HttpBindingGenerator.kt:615 */
|
519 + | }
|
520 + | /* HttpBindingGenerator.kt:615 */
|
521 + | if let ::std::option::Option::Some(inner_28) = &input.header_boolean_list {
|
522 + | /* HttpBindingGenerator.kt:669 */
|
523 + | for inner_29 in inner_28 {
|
524 + | /* HttpBindingGenerator.kt:713 */
|
525 + | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_29);
|
526 + | /* HttpBindingGenerator.kt:727 */
|
527 + | let formatted_30 = encoder.encode();
|
528 + | /* HttpBindingGenerator.kt:728 */
|
529 + | if !formatted_30.is_empty() {
|
530 + | /* HttpBindingGenerator.kt:729 */
|
531 + | let header_value = formatted_30;
|
532 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
533 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
534 + | "header_boolean_list",
|
535 + | format!(
|
536 + | "`{}` cannot be used as a header value: {}",
|
537 + | &header_value, err
|
538 + | ),
|
539 + | )
|
540 + | })?;
|
541 + | builder = builder.header("X-BooleanList", header_value);
|
542 + | /* HttpBindingGenerator.kt:728 */
|
543 + | }
|
544 + | /* HttpBindingGenerator.kt:669 */
|
545 + | }
|
546 + | /* HttpBindingGenerator.kt:615 */
|
547 + | }
|
548 + | /* HttpBindingGenerator.kt:615 */
|
549 + | if let ::std::option::Option::Some(inner_31) = &input.header_timestamp_list {
|
550 + | /* HttpBindingGenerator.kt:669 */
|
551 + | for inner_32 in inner_31 {
|
552 + | /* HttpBindingGenerator.kt:727 */
|
553 + | let formatted_33 = inner_32.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
|
554 + | /* HttpBindingGenerator.kt:728 */
|
555 + | if !formatted_33.is_empty() {
|
556 + | /* HttpBindingGenerator.kt:729 */
|
557 + | let header_value = formatted_33;
|
558 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
559 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
560 + | "header_timestamp_list",
|
561 + | format!(
|
562 + | "`{}` cannot be used as a header value: {}",
|
563 + | &header_value, err
|
564 + | ),
|
565 + | )
|
566 + | })?;
|
567 + | builder = builder.header("X-TimestampList", header_value);
|
568 + | /* HttpBindingGenerator.kt:728 */
|
569 + | }
|
570 + | /* HttpBindingGenerator.kt:669 */
|
571 + | }
|
572 + | /* HttpBindingGenerator.kt:615 */
|
573 + | }
|
574 + | /* HttpBindingGenerator.kt:615 */
|
575 + | if let ::std::option::Option::Some(inner_34) = &input.header_enum {
|
576 + | /* HttpBindingGenerator.kt:727 */
|
577 + | let formatted_35 = inner_34.as_str();
|
578 + | /* HttpBindingGenerator.kt:728 */
|
579 + | if !formatted_35.is_empty() {
|
580 + | /* HttpBindingGenerator.kt:729 */
|
581 + | let header_value = formatted_35;
|
582 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
583 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
584 + | "header_enum",
|
585 + | format!(
|
586 + | "`{}` cannot be used as a header value: {}",
|
587 + | &header_value, err
|
588 + | ),
|
589 + | )
|
590 + | })?;
|
591 + | builder = builder.header("X-Enum", header_value);
|
592 + | /* HttpBindingGenerator.kt:728 */
|
593 + | }
|
594 + | /* HttpBindingGenerator.kt:615 */
|
595 + | }
|
596 + | /* HttpBindingGenerator.kt:615 */
|
597 + | if let ::std::option::Option::Some(inner_36) = &input.header_enum_list {
|
598 + | /* HttpBindingGenerator.kt:669 */
|
599 + | for inner_37 in inner_36 {
|
600 + | /* HttpBindingGenerator.kt:727 */
|
601 + | let formatted_38 =
|
602 + | ::aws_smithy_legacy_http::header::quote_header_value(inner_37.as_str());
|
603 + | /* HttpBindingGenerator.kt:728 */
|
604 + | if !formatted_38.is_empty() {
|
605 + | /* HttpBindingGenerator.kt:729 */
|
606 + | let header_value = formatted_38;
|
607 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
608 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
609 + | "header_enum_list",
|
610 + | format!(
|
611 + | "`{}` cannot be used as a header value: {}",
|
612 + | &header_value, err
|
613 + | ),
|
614 + | )
|
615 + | })?;
|
616 + | builder = builder.header("X-EnumList", header_value);
|
617 + | /* HttpBindingGenerator.kt:728 */
|
618 + | }
|
619 + | /* HttpBindingGenerator.kt:669 */
|
620 + | }
|
621 + | /* HttpBindingGenerator.kt:615 */
|
622 + | }
|
623 + | /* HttpBindingGenerator.kt:615 */
|
624 + | if let ::std::option::Option::Some(inner_39) = &input.header_integer_enum {
|
625 + | /* HttpBindingGenerator.kt:713 */
|
626 + | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_39);
|
627 + | /* HttpBindingGenerator.kt:727 */
|
628 + | let formatted_40 = encoder.encode();
|
629 + | /* HttpBindingGenerator.kt:728 */
|
630 + | if !formatted_40.is_empty() {
|
631 + | /* HttpBindingGenerator.kt:729 */
|
632 + | let header_value = formatted_40;
|
633 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
634 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
635 + | "header_integer_enum",
|
636 + | format!(
|
637 + | "`{}` cannot be used as a header value: {}",
|
638 + | &header_value, err
|
639 + | ),
|
640 + | )
|
641 + | })?;
|
642 + | builder = builder.header("X-IntegerEnum", header_value);
|
643 + | /* HttpBindingGenerator.kt:728 */
|
644 + | }
|
645 + | /* HttpBindingGenerator.kt:615 */
|
646 + | }
|
647 + | /* HttpBindingGenerator.kt:615 */
|
648 + | if let ::std::option::Option::Some(inner_41) = &input.header_integer_enum_list {
|
649 + | /* HttpBindingGenerator.kt:669 */
|
650 + | for inner_42 in inner_41 {
|
651 + | /* HttpBindingGenerator.kt:713 */
|
652 + | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_42);
|
653 + | /* HttpBindingGenerator.kt:727 */
|
654 + | let formatted_43 = encoder.encode();
|
655 + | /* HttpBindingGenerator.kt:728 */
|
656 + | if !formatted_43.is_empty() {
|
657 + | /* HttpBindingGenerator.kt:729 */
|
658 + | let header_value = formatted_43;
|
659 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
660 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
661 + | "header_integer_enum_list",
|
662 + | format!(
|
663 + | "`{}` cannot be used as a header value: {}",
|
664 + | &header_value, err
|
665 + | ),
|
666 + | )
|
667 + | })?;
|
668 + | builder = builder.header("X-IntegerEnumList", header_value);
|
669 + | /* HttpBindingGenerator.kt:728 */
|
670 + | }
|
671 + | /* HttpBindingGenerator.kt:669 */
|
672 + | }
|
673 + | /* HttpBindingGenerator.kt:615 */
|
674 + | }
|
675 + | /* HttpBindingGenerator.kt:578 */
|
676 + | Ok(builder)
|
677 + | /* HttpBindingGenerator.kt:565 */
|
678 + | }
|