133 133 | "aws.protocoltests.restjson.synthetic",
|
134 134 | "InputAndOutputWithHeadersInput",
|
135 135 | );
|
136 136 | static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
137 137 | ::aws_smithy_schema::ShapeId::from_static(
|
138 138 | "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerString",
|
139 139 | "aws.protocoltests.restjson.synthetic",
|
140 140 | "InputAndOutputWithHeadersInput",
|
141 141 | ),
|
142 142 | ::aws_smithy_schema::ShapeType::String,
|
143 - | "header_string",
|
143 + | "headerString",
|
144 144 | 0,
|
145 145 | )
|
146 146 | .with_http_header("X-String");
|
147 147 | static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_BYTE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
148 148 | ::aws_smithy_schema::ShapeId::from_static(
|
149 149 | "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerByte",
|
150 150 | "aws.protocoltests.restjson.synthetic",
|
151 151 | "InputAndOutputWithHeadersInput",
|
152 152 | ),
|
153 153 | ::aws_smithy_schema::ShapeType::Byte,
|
154 - | "header_byte",
|
154 + | "headerByte",
|
155 155 | 1,
|
156 156 | )
|
157 157 | .with_http_header("X-Byte");
|
158 158 | static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_SHORT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
159 159 | ::aws_smithy_schema::ShapeId::from_static(
|
160 160 | "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerShort",
|
161 161 | "aws.protocoltests.restjson.synthetic",
|
162 162 | "InputAndOutputWithHeadersInput",
|
163 163 | ),
|
164 164 | ::aws_smithy_schema::ShapeType::Short,
|
165 - | "header_short",
|
165 + | "headerShort",
|
166 166 | 2,
|
167 167 | )
|
168 168 | .with_http_header("X-Short");
|
169 169 | static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_INTEGER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
170 170 | ::aws_smithy_schema::ShapeId::from_static(
|
171 171 | "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerInteger",
|
172 172 | "aws.protocoltests.restjson.synthetic",
|
173 173 | "InputAndOutputWithHeadersInput",
|
174 174 | ),
|
175 175 | ::aws_smithy_schema::ShapeType::Integer,
|
176 - | "header_integer",
|
176 + | "headerInteger",
|
177 177 | 3,
|
178 178 | )
|
179 179 | .with_http_header("X-Integer");
|
180 180 | static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_LONG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
181 181 | ::aws_smithy_schema::ShapeId::from_static(
|
182 182 | "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerLong",
|
183 183 | "aws.protocoltests.restjson.synthetic",
|
184 184 | "InputAndOutputWithHeadersInput",
|
185 185 | ),
|
186 186 | ::aws_smithy_schema::ShapeType::Long,
|
187 - | "header_long",
|
187 + | "headerLong",
|
188 188 | 4,
|
189 189 | )
|
190 190 | .with_http_header("X-Long");
|
191 191 | static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_FLOAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
192 192 | ::aws_smithy_schema::ShapeId::from_static(
|
193 193 | "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerFloat",
|
194 194 | "aws.protocoltests.restjson.synthetic",
|
195 195 | "InputAndOutputWithHeadersInput",
|
196 196 | ),
|
197 197 | ::aws_smithy_schema::ShapeType::Float,
|
198 - | "header_float",
|
198 + | "headerFloat",
|
199 199 | 5,
|
200 200 | )
|
201 201 | .with_http_header("X-Float");
|
202 202 | static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_DOUBLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
203 203 | ::aws_smithy_schema::ShapeId::from_static(
|
204 204 | "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerDouble",
|
205 205 | "aws.protocoltests.restjson.synthetic",
|
206 206 | "InputAndOutputWithHeadersInput",
|
207 207 | ),
|
208 208 | ::aws_smithy_schema::ShapeType::Double,
|
209 - | "header_double",
|
209 + | "headerDouble",
|
210 210 | 6,
|
211 211 | )
|
212 212 | .with_http_header("X-Double");
|
213 213 | static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_TRUE_BOOL: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
214 214 | ::aws_smithy_schema::ShapeId::from_static(
|
215 215 | "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerTrueBool",
|
216 216 | "aws.protocoltests.restjson.synthetic",
|
217 217 | "InputAndOutputWithHeadersInput",
|
218 218 | ),
|
219 219 | ::aws_smithy_schema::ShapeType::Boolean,
|
220 - | "header_true_bool",
|
220 + | "headerTrueBool",
|
221 221 | 7,
|
222 222 | )
|
223 223 | .with_http_header("X-Boolean1");
|
224 224 | static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_FALSE_BOOL: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
225 225 | ::aws_smithy_schema::ShapeId::from_static(
|
226 226 | "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerFalseBool",
|
227 227 | "aws.protocoltests.restjson.synthetic",
|
228 228 | "InputAndOutputWithHeadersInput",
|
229 229 | ),
|
230 230 | ::aws_smithy_schema::ShapeType::Boolean,
|
231 - | "header_false_bool",
|
231 + | "headerFalseBool",
|
232 232 | 8,
|
233 233 | )
|
234 234 | .with_http_header("X-Boolean2");
|
235 235 | static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_STRING_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
236 236 | ::aws_smithy_schema::ShapeId::from_static(
|
237 237 | "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerStringList",
|
238 238 | "aws.protocoltests.restjson.synthetic",
|
239 239 | "InputAndOutputWithHeadersInput",
|
240 240 | ),
|
241 241 | ::aws_smithy_schema::ShapeType::List,
|
242 - | "header_string_list",
|
242 + | "headerStringList",
|
243 243 | 9,
|
244 244 | )
|
245 245 | .with_http_header("X-StringList");
|
246 246 | static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_STRING_SET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
247 247 | ::aws_smithy_schema::ShapeId::from_static(
|
248 248 | "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerStringSet",
|
249 249 | "aws.protocoltests.restjson.synthetic",
|
250 250 | "InputAndOutputWithHeadersInput",
|
251 251 | ),
|
252 252 | ::aws_smithy_schema::ShapeType::List,
|
253 - | "header_string_set",
|
253 + | "headerStringSet",
|
254 254 | 10,
|
255 255 | )
|
256 256 | .with_http_header("X-StringSet");
|
257 257 | static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_INTEGER_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
258 258 | ::aws_smithy_schema::ShapeId::from_static(
|
259 259 | "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerIntegerList",
|
260 260 | "aws.protocoltests.restjson.synthetic",
|
261 261 | "InputAndOutputWithHeadersInput",
|
262 262 | ),
|
263 263 | ::aws_smithy_schema::ShapeType::List,
|
264 - | "header_integer_list",
|
264 + | "headerIntegerList",
|
265 265 | 11,
|
266 266 | )
|
267 267 | .with_http_header("X-IntegerList");
|
268 268 | static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_BOOLEAN_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
269 269 | ::aws_smithy_schema::ShapeId::from_static(
|
270 270 | "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerBooleanList",
|
271 271 | "aws.protocoltests.restjson.synthetic",
|
272 272 | "InputAndOutputWithHeadersInput",
|
273 273 | ),
|
274 274 | ::aws_smithy_schema::ShapeType::List,
|
275 - | "header_boolean_list",
|
275 + | "headerBooleanList",
|
276 276 | 12,
|
277 277 | )
|
278 278 | .with_http_header("X-BooleanList");
|
279 279 | static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_TIMESTAMP_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
280 280 | ::aws_smithy_schema::ShapeId::from_static(
|
281 281 | "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerTimestampList",
|
282 282 | "aws.protocoltests.restjson.synthetic",
|
283 283 | "InputAndOutputWithHeadersInput",
|
284 284 | ),
|
285 285 | ::aws_smithy_schema::ShapeType::List,
|
286 - | "header_timestamp_list",
|
286 + | "headerTimestampList",
|
287 287 | 13,
|
288 288 | )
|
289 289 | .with_http_header("X-TimestampList");
|
290 290 | static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
291 291 | ::aws_smithy_schema::ShapeId::from_static(
|
292 292 | "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerEnum",
|
293 293 | "aws.protocoltests.restjson.synthetic",
|
294 294 | "InputAndOutputWithHeadersInput",
|
295 295 | ),
|
296 296 | ::aws_smithy_schema::ShapeType::String,
|
297 - | "header_enum",
|
297 + | "headerEnum",
|
298 298 | 14,
|
299 299 | )
|
300 300 | .with_http_header("X-Enum");
|
301 301 | static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
302 302 | ::aws_smithy_schema::ShapeId::from_static(
|
303 303 | "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerEnumList",
|
304 304 | "aws.protocoltests.restjson.synthetic",
|
305 305 | "InputAndOutputWithHeadersInput",
|
306 306 | ),
|
307 307 | ::aws_smithy_schema::ShapeType::List,
|
308 - | "header_enum_list",
|
308 + | "headerEnumList",
|
309 309 | 15,
|
310 310 | )
|
311 311 | .with_http_header("X-EnumList");
|
312 312 | static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_INTEGER_ENUM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
313 313 | ::aws_smithy_schema::ShapeId::from_static(
|
314 314 | "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerIntegerEnum",
|
315 315 | "aws.protocoltests.restjson.synthetic",
|
316 316 | "InputAndOutputWithHeadersInput",
|
317 317 | ),
|
318 318 | ::aws_smithy_schema::ShapeType::Integer,
|
319 - | "header_integer_enum",
|
319 + | "headerIntegerEnum",
|
320 320 | 16,
|
321 321 | )
|
322 322 | .with_http_header("X-IntegerEnum");
|
323 323 | static INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_INTEGER_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
324 324 | ::aws_smithy_schema::ShapeId::from_static(
|
325 325 | "aws.protocoltests.restjson.synthetic#InputAndOutputWithHeadersInput$headerIntegerEnumList",
|
326 326 | "aws.protocoltests.restjson.synthetic",
|
327 327 | "InputAndOutputWithHeadersInput",
|
328 328 | ),
|
329 329 | ::aws_smithy_schema::ShapeType::List,
|
330 - | "header_integer_enum_list",
|
330 + | "headerIntegerEnumList",
|
331 331 | 17,
|
332 332 | )
|
333 333 | .with_http_header("X-IntegerEnumList");
|
334 334 | static INPUTANDOUTPUTWITHHEADERSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
335 335 | INPUTANDOUTPUTWITHHEADERSINPUT_SCHEMA_ID,
|
336 336 | ::aws_smithy_schema::ShapeType::Structure,
|
337 337 | &[
|
338 338 | &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_STRING,
|
339 339 | &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_BYTE,
|
340 340 | &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_SHORT,
|
341 341 | &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_INTEGER,
|
342 342 | &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_LONG,
|
343 343 | &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_FLOAT,
|
344 344 | &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_DOUBLE,
|
345 345 | &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_TRUE_BOOL,
|
346 346 | &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_FALSE_BOOL,
|
347 347 | &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_STRING_LIST,
|
348 348 | &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_STRING_SET,
|
349 349 | &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_INTEGER_LIST,
|
350 350 | &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_BOOLEAN_LIST,
|
351 351 | &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_TIMESTAMP_LIST,
|
352 352 | &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_ENUM,
|
353 353 | &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_ENUM_LIST,
|
354 354 | &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_INTEGER_ENUM,
|
355 355 | &INPUTANDOUTPUTWITHHEADERSINPUT_MEMBER_HEADER_INTEGER_ENUM_LIST,
|
356 356 | ],
|
357 - | );
|
357 + | )
|
358 + | .with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/InputAndOutputWithHeaders", None));
|
358 359 | impl InputAndOutputWithHeadersInput {
|
359 360 | /// The schema for this shape.
|
360 361 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &INPUTANDOUTPUTWITHHEADERSINPUT_SCHEMA;
|
361 362 | }
|
362 363 | impl ::aws_smithy_schema::serde::SerializableStruct for InputAndOutputWithHeadersInput {
|
363 364 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
364 365 | fn serialize_members(
|
365 366 | &self,
|
366 367 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
367 368 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
473 474 | }
|
474 475 | Ok(())
|
475 476 | },
|
476 477 | )?;
|
477 478 | }
|
478 479 | Ok(())
|
479 480 | }
|
480 481 | }
|
481 482 | impl InputAndOutputWithHeadersInput {
|
482 483 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
483 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
484 - | deserializer: &mut D,
|
484 + | pub fn deserialize(
|
485 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
485 486 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
486 487 | #[allow(unused_variables, unused_mut)]
|
487 488 | let mut builder = Self::builder();
|
488 489 | #[allow(
|
489 490 | unused_variables,
|
490 491 | unreachable_code,
|
491 492 | clippy::single_match,
|
492 493 | clippy::match_single_binding,
|
493 494 | clippy::diverging_sub_expression
|
494 495 | )]
|
495 - | deserializer.read_struct(&INPUTANDOUTPUTWITHHEADERSINPUT_SCHEMA, (), |_, member, deser| {
|
496 + | deserializer.read_struct(&INPUTANDOUTPUTWITHHEADERSINPUT_SCHEMA, &mut |member, deser| {
|
496 497 | match member.member_index() {
|
497 498 | Some(0) => {
|
498 499 | builder.header_string = Some(deser.read_string(member)?);
|
499 500 | }
|
500 501 | Some(1) => {
|
501 502 | builder.header_byte = Some(deser.read_byte(member)?);
|
502 503 | }
|
503 504 | Some(2) => {
|
504 505 | builder.header_short = Some(deser.read_short(member)?);
|
505 506 | }
|
506 507 | Some(3) => {
|
507 508 | builder.header_integer = Some(deser.read_integer(member)?);
|
508 509 | }
|
509 510 | Some(4) => {
|
510 511 | builder.header_long = Some(deser.read_long(member)?);
|
511 512 | }
|
512 513 | Some(5) => {
|
513 514 | builder.header_float = Some(deser.read_float(member)?);
|
514 515 | }
|
515 516 | Some(6) => {
|
516 517 | builder.header_double = Some(deser.read_double(member)?);
|
517 518 | }
|
518 519 | Some(7) => {
|
519 520 | builder.header_true_bool = Some(deser.read_boolean(member)?);
|
520 521 | }
|
521 522 | Some(8) => {
|
522 523 | builder.header_false_bool = Some(deser.read_boolean(member)?);
|
523 524 | }
|
524 525 | Some(9) => {
|
525 - | builder.header_string_list = Some({
|
526 - | let container = if let Some(cap) = deser.container_size() {
|
527 - | Vec::with_capacity(cap)
|
528 - | } else {
|
529 - | Vec::new()
|
530 - | };
|
531 - | deser.read_list(member, container, |mut list, deser| {
|
532 - | list.push(deser.read_string(member)?);
|
533 - | Ok(list)
|
534 - | })?
|
535 - | });
|
526 + | builder.header_string_list = Some(deser.read_string_list(member)?);
|
536 527 | }
|
537 528 | Some(10) => {
|
538 - | builder.header_string_set = Some({
|
539 - | let container = if let Some(cap) = deser.container_size() {
|
540 - | Vec::with_capacity(cap)
|
541 - | } else {
|
542 - | Vec::new()
|
543 - | };
|
544 - | deser.read_list(member, container, |mut list, deser| {
|
545 - | list.push(deser.read_string(member)?);
|
546 - | Ok(list)
|
547 - | })?
|
548 - | });
|
529 + | builder.header_string_set = Some(deser.read_string_list(member)?);
|
549 530 | }
|
550 531 | Some(11) => {
|
551 - | builder.header_integer_list = Some({
|
552 - | let container = if let Some(cap) = deser.container_size() {
|
553 - | Vec::with_capacity(cap)
|
554 - | } else {
|
555 - | Vec::new()
|
556 - | };
|
557 - | deser.read_list(member, container, |mut list, deser| {
|
558 - | list.push(deser.read_integer(member)?);
|
559 - | Ok(list)
|
560 - | })?
|
561 - | });
|
532 + | builder.header_integer_list = Some(deser.read_integer_list(member)?);
|
562 533 | }
|
563 534 | Some(12) => {
|
564 535 | builder.header_boolean_list = Some({
|
565 - | let container = if let Some(cap) = deser.container_size() {
|
566 - | Vec::with_capacity(cap)
|
567 - | } else {
|
568 - | Vec::new()
|
569 - | };
|
570 - | deser.read_list(member, container, |mut list, deser| {
|
571 - | list.push(deser.read_boolean(member)?);
|
572 - | Ok(list)
|
573 - | })?
|
536 + | let mut container = Vec::new();
|
537 + | deser.read_list(member, &mut |deser| {
|
538 + | container.push(deser.read_boolean(member)?);
|
539 + | Ok(())
|
540 + | })?;
|
541 + | container
|
574 542 | });
|
575 543 | }
|
576 544 | Some(13) => {
|
577 545 | builder.header_timestamp_list = Some({
|
578 - | let container = if let Some(cap) = deser.container_size() {
|
579 - | Vec::with_capacity(cap)
|
580 - | } else {
|
581 - | Vec::new()
|
582 - | };
|
583 - | deser.read_list(member, container, |mut list, deser| {
|
584 - | list.push(deser.read_timestamp(member)?);
|
585 - | Ok(list)
|
586 - | })?
|
546 + | let mut container = Vec::new();
|
547 + | deser.read_list(member, &mut |deser| {
|
548 + | container.push(deser.read_timestamp(member)?);
|
549 + | Ok(())
|
550 + | })?;
|
551 + | container
|
587 552 | });
|
588 553 | }
|
589 554 | Some(14) => {
|
590 555 | builder.header_enum = Some(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
|
591 556 | }
|
592 557 | Some(15) => {
|
593 558 | builder.header_enum_list = Some({
|
594 - | let container = if let Some(cap) = deser.container_size() {
|
595 - | Vec::with_capacity(cap)
|
596 - | } else {
|
597 - | Vec::new()
|
598 - | };
|
599 - | deser.read_list(member, container, |mut list, deser| {
|
600 - | list.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
|
601 - | Ok(list)
|
602 - | })?
|
559 + | let mut container = Vec::new();
|
560 + | deser.read_list(member, &mut |deser| {
|
561 + | container.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
|
562 + | Ok(())
|
563 + | })?;
|
564 + | container
|
603 565 | });
|
604 566 | }
|
605 567 | Some(16) => {
|
606 568 | builder.header_integer_enum = Some(deser.read_integer(member)?);
|
607 569 | }
|
608 570 | Some(17) => {
|
609 - | builder.header_integer_enum_list = Some({
|
610 - | let container = if let Some(cap) = deser.container_size() {
|
611 - | Vec::with_capacity(cap)
|
612 - | } else {
|
613 - | Vec::new()
|
614 - | };
|
615 - | deser.read_list(member, container, |mut list, deser| {
|
616 - | list.push(deser.read_integer(member)?);
|
617 - | Ok(list)
|
618 - | })?
|
619 - | });
|
571 + | builder.header_integer_enum_list = Some(deser.read_integer_list(member)?);
|
620 572 | }
|
621 573 | _ => {}
|
622 574 | }
|
623 575 | Ok(())
|
624 576 | })?;
|
625 577 | builder
|
626 578 | .build()
|
627 579 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
628 580 | }
|
629 581 | }
|
582 + | impl InputAndOutputWithHeadersInput {
|
583 + | /// Deserializes this structure from a body deserializer and HTTP response headers.
|
584 + | /// Header-bound members are read directly from headers, avoiding runtime
|
585 + | /// member iteration overhead. Body members are read via the deserializer.
|
586 + | pub fn deserialize_with_response(
|
587 + | _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
588 + | headers: &::aws_smithy_runtime_api::http::Headers,
|
589 + | _status: u16,
|
590 + | _body: &[u8],
|
591 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
592 + | #[allow(unused_variables, unused_mut)]
|
593 + | let mut builder = Self::builder();
|
594 + | if let Some(val) = headers.get("X-String") {
|
595 + | builder.header_string = Some(val.to_string());
|
596 + | }
|
597 + | if let Some(val) = headers.get("X-Byte") {
|
598 + | builder.header_byte = val.parse::<i8>().ok();
|
599 + | }
|
600 + | if let Some(val) = headers.get("X-Short") {
|
601 + | builder.header_short = val.parse::<i16>().ok();
|
602 + | }
|
603 + | if let Some(val) = headers.get("X-Integer") {
|
604 + | builder.header_integer = val.parse::<i32>().ok();
|
605 + | }
|
606 + | if let Some(val) = headers.get("X-Long") {
|
607 + | builder.header_long = val.parse::<i64>().ok();
|
608 + | }
|
609 + | if let Some(val) = headers.get("X-Float") {
|
610 + | builder.header_float = val.parse::<f32>().ok();
|
611 + | }
|
612 + | if let Some(val) = headers.get("X-Double") {
|
613 + | builder.header_double = val.parse::<f64>().ok();
|
614 + | }
|
615 + | if let Some(val) = headers.get("X-Boolean1") {
|
616 + | builder.header_true_bool = val.parse::<bool>().ok();
|
617 + | }
|
618 + | if let Some(val) = headers.get("X-Boolean2") {
|
619 + | builder.header_false_bool = val.parse::<bool>().ok();
|
620 + | }
|
621 + | if let Some(val) = headers.get("X-StringList") {
|
622 + | builder.header_string_list = {
|
623 + | let mut items = Vec::new();
|
624 + | let mut chars = val.chars().peekable();
|
625 + | while chars.peek().is_some() {
|
626 + | // Skip whitespace
|
627 + | while chars.peek() == Some(&' ') {
|
628 + | chars.next();
|
629 + | }
|
630 + | if chars.peek() == Some(&'"') {
|
631 + | chars.next(); // skip opening quote
|
632 + | let mut s = String::new();
|
633 + | while let Some(&c) = chars.peek() {
|
634 + | if c == '\\' {
|
635 + | chars.next();
|
636 + | if let Some(escaped) = chars.next() {
|
637 + | s.push(escaped);
|
638 + | }
|
639 + | } else if c == '"' {
|
640 + | chars.next();
|
641 + | break;
|
642 + | } else {
|
643 + | s.push(c);
|
644 + | chars.next();
|
645 + | }
|
646 + | }
|
647 + | items.push(s);
|
648 + | } else {
|
649 + | let s: String = chars.by_ref().take_while(|&c| c != ',').collect();
|
650 + | let trimmed = s.trim();
|
651 + | if !trimmed.is_empty() {
|
652 + | items.push(trimmed.to_string());
|
653 + | }
|
654 + | }
|
655 + | // Skip comma separator
|
656 + | while chars.peek() == Some(&',') || chars.peek() == Some(&' ') {
|
657 + | chars.next();
|
658 + | }
|
659 + | }
|
660 + | Some(items)
|
661 + | };
|
662 + | }
|
663 + | if let Some(val) = headers.get("X-StringSet") {
|
664 + | builder.header_string_set = {
|
665 + | let mut items = Vec::new();
|
666 + | let mut chars = val.chars().peekable();
|
667 + | while chars.peek().is_some() {
|
668 + | // Skip whitespace
|
669 + | while chars.peek() == Some(&' ') {
|
670 + | chars.next();
|
671 + | }
|
672 + | if chars.peek() == Some(&'"') {
|
673 + | chars.next(); // skip opening quote
|
674 + | let mut s = String::new();
|
675 + | while let Some(&c) = chars.peek() {
|
676 + | if c == '\\' {
|
677 + | chars.next();
|
678 + | if let Some(escaped) = chars.next() {
|
679 + | s.push(escaped);
|
680 + | }
|
681 + | } else if c == '"' {
|
682 + | chars.next();
|
683 + | break;
|
684 + | } else {
|
685 + | s.push(c);
|
686 + | chars.next();
|
687 + | }
|
688 + | }
|
689 + | items.push(s);
|
690 + | } else {
|
691 + | let s: String = chars.by_ref().take_while(|&c| c != ',').collect();
|
692 + | let trimmed = s.trim();
|
693 + | if !trimmed.is_empty() {
|
694 + | items.push(trimmed.to_string());
|
695 + | }
|
696 + | }
|
697 + | // Skip comma separator
|
698 + | while chars.peek() == Some(&',') || chars.peek() == Some(&' ') {
|
699 + | chars.next();
|
700 + | }
|
701 + | }
|
702 + | Some(items)
|
703 + | };
|
704 + | }
|
705 + | if let Some(val) = headers.get("X-IntegerList") {
|
706 + | builder.header_integer_list = Some(val.split(',').filter_map(|s| s.trim().parse::<i32>().ok()).collect());
|
707 + | }
|
708 + | if let Some(val) = headers.get("X-BooleanList") {
|
709 + | builder.header_boolean_list = Some(val.split(',').filter_map(|s| s.trim().parse::<bool>().ok()).collect());
|
710 + | }
|
711 + | if let Some(val) = headers.get("X-TimestampList") {
|
712 + | builder.header_timestamp_list = {
|
713 + | let mut timestamps = Vec::new();
|
714 + | let re_split: Vec<&str> = val.split(", ").collect();
|
715 + | let mut i = 0;
|
716 + | while i < re_split.len() {
|
717 + | if i + 1 < re_split.len() {
|
718 + | let combined = format!("{}, {}", re_split[i], re_split[i + 1]);
|
719 + | if let Ok(ts) = ::aws_smithy_types::DateTime::from_str(&combined, ::aws_smithy_types::date_time::Format::HttpDate) {
|
720 + | timestamps.push(ts);
|
721 + | i += 2;
|
722 + | continue;
|
723 + | }
|
724 + | }
|
725 + | if let Ok(ts) = ::aws_smithy_types::DateTime::from_str(re_split[i].trim(), ::aws_smithy_types::date_time::Format::HttpDate) {
|
726 + | timestamps.push(ts);
|
727 + | }
|
728 + | i += 1;
|
729 + | }
|
730 + | Some(timestamps)
|
731 + | };
|
732 + | }
|
733 + | if let Some(val) = headers.get("X-Enum") {
|
734 + | builder.header_enum = Some(crate::types::FooEnum::from(val));
|
735 + | }
|
736 + | if let Some(val) = headers.get("X-EnumList") {
|
737 + | builder.header_enum_list = Some(val.split(',').map(|s| crate::types::FooEnum::from(s.trim())).collect());
|
738 + | }
|
739 + | if let Some(val) = headers.get("X-IntegerEnum") {
|
740 + | builder.header_integer_enum = val.parse::<i32>().ok();
|
741 + | }
|
742 + | if let Some(val) = headers.get("X-IntegerEnumList") {
|
743 + | builder.header_integer_enum_list = Some(val.split(',').filter_map(|s| s.trim().parse::<i32>().ok()).collect());
|
744 + | }
|
745 + | builder
|
746 + | .build()
|
747 + | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
748 + | }
|
749 + | }
|
630 750 | impl InputAndOutputWithHeadersInput {
|
631 751 | /// Creates a new builder-style object to manufacture [`InputAndOutputWithHeadersInput`](crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersInput).
|
632 752 | pub fn builder() -> crate::operation::input_and_output_with_headers::builders::InputAndOutputWithHeadersInputBuilder {
|
633 753 | crate::operation::input_and_output_with_headers::builders::InputAndOutputWithHeadersInputBuilder::default()
|
634 754 | }
|
635 755 | }
|
636 756 |
|
637 757 | /// A builder for [`InputAndOutputWithHeadersInput`](crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersInput).
|
638 758 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
639 759 | #[non_exhaustive]
|