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