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