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