225 225 | "com.amazonaws.ec2.synthetic",
|
226 226 | "CreateCapacityReservationInput",
|
227 227 | );
|
228 228 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_CLIENT_TOKEN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
229 229 | ::aws_smithy_schema::ShapeId::from_static(
|
230 230 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$ClientToken",
|
231 231 | "com.amazonaws.ec2.synthetic",
|
232 232 | "CreateCapacityReservationInput",
|
233 233 | ),
|
234 234 | ::aws_smithy_schema::ShapeType::String,
|
235 - | "client_token",
|
235 + | "ClientToken",
|
236 236 | 0,
|
237 237 | );
|
238 238 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_INSTANCE_TYPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
239 239 | ::aws_smithy_schema::ShapeId::from_static(
|
240 240 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$InstanceType",
|
241 241 | "com.amazonaws.ec2.synthetic",
|
242 242 | "CreateCapacityReservationInput",
|
243 243 | ),
|
244 244 | ::aws_smithy_schema::ShapeType::String,
|
245 - | "instance_type",
|
245 + | "InstanceType",
|
246 246 | 1,
|
247 247 | );
|
248 248 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_INSTANCE_PLATFORM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
249 249 | ::aws_smithy_schema::ShapeId::from_static(
|
250 250 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$InstancePlatform",
|
251 251 | "com.amazonaws.ec2.synthetic",
|
252 252 | "CreateCapacityReservationInput",
|
253 253 | ),
|
254 254 | ::aws_smithy_schema::ShapeType::String,
|
255 - | "instance_platform",
|
255 + | "InstancePlatform",
|
256 256 | 2,
|
257 257 | );
|
258 258 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_AVAILABILITY_ZONE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
259 259 | ::aws_smithy_schema::ShapeId::from_static(
|
260 260 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$AvailabilityZone",
|
261 261 | "com.amazonaws.ec2.synthetic",
|
262 262 | "CreateCapacityReservationInput",
|
263 263 | ),
|
264 264 | ::aws_smithy_schema::ShapeType::String,
|
265 - | "availability_zone",
|
265 + | "AvailabilityZone",
|
266 266 | 3,
|
267 267 | );
|
268 268 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_AVAILABILITY_ZONE_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
269 269 | ::aws_smithy_schema::ShapeId::from_static(
|
270 270 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$AvailabilityZoneId",
|
271 271 | "com.amazonaws.ec2.synthetic",
|
272 272 | "CreateCapacityReservationInput",
|
273 273 | ),
|
274 274 | ::aws_smithy_schema::ShapeType::String,
|
275 - | "availability_zone_id",
|
275 + | "AvailabilityZoneId",
|
276 276 | 4,
|
277 277 | );
|
278 278 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_TENANCY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
279 279 | ::aws_smithy_schema::ShapeId::from_static(
|
280 280 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$Tenancy",
|
281 281 | "com.amazonaws.ec2.synthetic",
|
282 282 | "CreateCapacityReservationInput",
|
283 283 | ),
|
284 284 | ::aws_smithy_schema::ShapeType::String,
|
285 - | "tenancy",
|
285 + | "Tenancy",
|
286 286 | 5,
|
287 287 | );
|
288 288 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_INSTANCE_COUNT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
289 289 | ::aws_smithy_schema::ShapeId::from_static(
|
290 290 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$InstanceCount",
|
291 291 | "com.amazonaws.ec2.synthetic",
|
292 292 | "CreateCapacityReservationInput",
|
293 293 | ),
|
294 294 | ::aws_smithy_schema::ShapeType::Integer,
|
295 - | "instance_count",
|
295 + | "InstanceCount",
|
296 296 | 6,
|
297 297 | );
|
298 298 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_EBS_OPTIMIZED: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
299 299 | ::aws_smithy_schema::ShapeId::from_static(
|
300 300 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$EbsOptimized",
|
301 301 | "com.amazonaws.ec2.synthetic",
|
302 302 | "CreateCapacityReservationInput",
|
303 303 | ),
|
304 304 | ::aws_smithy_schema::ShapeType::Boolean,
|
305 - | "ebs_optimized",
|
305 + | "EbsOptimized",
|
306 306 | 7,
|
307 307 | );
|
308 308 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_EPHEMERAL_STORAGE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
309 309 | ::aws_smithy_schema::ShapeId::from_static(
|
310 310 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$EphemeralStorage",
|
311 311 | "com.amazonaws.ec2.synthetic",
|
312 312 | "CreateCapacityReservationInput",
|
313 313 | ),
|
314 314 | ::aws_smithy_schema::ShapeType::Boolean,
|
315 - | "ephemeral_storage",
|
315 + | "EphemeralStorage",
|
316 316 | 8,
|
317 317 | );
|
318 318 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_END_DATE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
319 319 | ::aws_smithy_schema::ShapeId::from_static(
|
320 320 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$EndDate",
|
321 321 | "com.amazonaws.ec2.synthetic",
|
322 322 | "CreateCapacityReservationInput",
|
323 323 | ),
|
324 324 | ::aws_smithy_schema::ShapeType::Timestamp,
|
325 - | "end_date",
|
325 + | "EndDate",
|
326 326 | 9,
|
327 327 | );
|
328 328 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_END_DATE_TYPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
329 329 | ::aws_smithy_schema::ShapeId::from_static(
|
330 330 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$EndDateType",
|
331 331 | "com.amazonaws.ec2.synthetic",
|
332 332 | "CreateCapacityReservationInput",
|
333 333 | ),
|
334 334 | ::aws_smithy_schema::ShapeType::String,
|
335 - | "end_date_type",
|
335 + | "EndDateType",
|
336 336 | 10,
|
337 337 | );
|
338 338 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_INSTANCE_MATCH_CRITERIA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
339 339 | ::aws_smithy_schema::ShapeId::from_static(
|
340 340 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$InstanceMatchCriteria",
|
341 341 | "com.amazonaws.ec2.synthetic",
|
342 342 | "CreateCapacityReservationInput",
|
343 343 | ),
|
344 344 | ::aws_smithy_schema::ShapeType::String,
|
345 - | "instance_match_criteria",
|
345 + | "InstanceMatchCriteria",
|
346 346 | 11,
|
347 347 | );
|
348 348 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_TAG_SPECIFICATIONS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
349 349 | ::aws_smithy_schema::ShapeId::from_static(
|
350 350 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$TagSpecifications",
|
351 351 | "com.amazonaws.ec2.synthetic",
|
352 352 | "CreateCapacityReservationInput",
|
353 353 | ),
|
354 354 | ::aws_smithy_schema::ShapeType::List,
|
355 - | "tag_specifications",
|
355 + | "TagSpecifications",
|
356 356 | 12,
|
357 357 | );
|
358 358 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_DRY_RUN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
359 359 | ::aws_smithy_schema::ShapeId::from_static(
|
360 360 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$DryRun",
|
361 361 | "com.amazonaws.ec2.synthetic",
|
362 362 | "CreateCapacityReservationInput",
|
363 363 | ),
|
364 364 | ::aws_smithy_schema::ShapeType::Boolean,
|
365 - | "dry_run",
|
365 + | "DryRun",
|
366 366 | 13,
|
367 367 | );
|
368 368 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_OUTPOST_ARN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
369 369 | ::aws_smithy_schema::ShapeId::from_static(
|
370 370 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$OutpostArn",
|
371 371 | "com.amazonaws.ec2.synthetic",
|
372 372 | "CreateCapacityReservationInput",
|
373 373 | ),
|
374 374 | ::aws_smithy_schema::ShapeType::String,
|
375 - | "outpost_arn",
|
375 + | "OutpostArn",
|
376 376 | 14,
|
377 377 | );
|
378 378 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_PLACEMENT_GROUP_ARN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
379 379 | ::aws_smithy_schema::ShapeId::from_static(
|
380 380 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$PlacementGroupArn",
|
381 381 | "com.amazonaws.ec2.synthetic",
|
382 382 | "CreateCapacityReservationInput",
|
383 383 | ),
|
384 384 | ::aws_smithy_schema::ShapeType::String,
|
385 - | "placement_group_arn",
|
385 + | "PlacementGroupArn",
|
386 386 | 15,
|
387 387 | );
|
388 388 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_START_DATE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
389 389 | ::aws_smithy_schema::ShapeId::from_static(
|
390 390 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$StartDate",
|
391 391 | "com.amazonaws.ec2.synthetic",
|
392 392 | "CreateCapacityReservationInput",
|
393 393 | ),
|
394 394 | ::aws_smithy_schema::ShapeType::Timestamp,
|
395 - | "start_date",
|
395 + | "StartDate",
|
396 396 | 16,
|
397 397 | );
|
398 398 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_COMMITMENT_DURATION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
399 399 | ::aws_smithy_schema::ShapeId::from_static(
|
400 400 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$CommitmentDuration",
|
401 401 | "com.amazonaws.ec2.synthetic",
|
402 402 | "CreateCapacityReservationInput",
|
403 403 | ),
|
404 404 | ::aws_smithy_schema::ShapeType::Long,
|
405 - | "commitment_duration",
|
405 + | "CommitmentDuration",
|
406 406 | 17,
|
407 407 | );
|
408 408 | static CREATECAPACITYRESERVATIONINPUT_MEMBER_DELIVERY_PREFERENCE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
409 409 | ::aws_smithy_schema::ShapeId::from_static(
|
410 410 | "com.amazonaws.ec2.synthetic#CreateCapacityReservationInput$DeliveryPreference",
|
411 411 | "com.amazonaws.ec2.synthetic",
|
412 412 | "CreateCapacityReservationInput",
|
413 413 | ),
|
414 414 | ::aws_smithy_schema::ShapeType::String,
|
415 - | "delivery_preference",
|
415 + | "DeliveryPreference",
|
416 416 | 18,
|
417 417 | );
|
418 418 | static CREATECAPACITYRESERVATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
419 419 | CREATECAPACITYRESERVATIONINPUT_SCHEMA_ID,
|
420 420 | ::aws_smithy_schema::ShapeType::Structure,
|
421 421 | &[
|
422 422 | &CREATECAPACITYRESERVATIONINPUT_MEMBER_CLIENT_TOKEN,
|
423 423 | &CREATECAPACITYRESERVATIONINPUT_MEMBER_INSTANCE_TYPE,
|
424 424 | &CREATECAPACITYRESERVATIONINPUT_MEMBER_INSTANCE_PLATFORM,
|
425 425 | &CREATECAPACITYRESERVATIONINPUT_MEMBER_AVAILABILITY_ZONE,
|
513 513 | ser.write_long(&CREATECAPACITYRESERVATIONINPUT_MEMBER_COMMITMENT_DURATION, *val)?;
|
514 514 | }
|
515 515 | if let Some(ref val) = self.delivery_preference {
|
516 516 | ser.write_string(&CREATECAPACITYRESERVATIONINPUT_MEMBER_DELIVERY_PREFERENCE, val.as_str())?;
|
517 517 | }
|
518 518 | Ok(())
|
519 519 | }
|
520 520 | }
|
521 521 | impl CreateCapacityReservationInput {
|
522 522 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
523 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
524 - | deserializer: &mut D,
|
523 + | pub fn deserialize(
|
524 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
525 525 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
526 526 | #[allow(unused_variables, unused_mut)]
|
527 527 | let mut builder = Self::builder();
|
528 528 | #[allow(
|
529 529 | unused_variables,
|
530 530 | unreachable_code,
|
531 531 | clippy::single_match,
|
532 532 | clippy::match_single_binding,
|
533 533 | clippy::diverging_sub_expression
|
534 534 | )]
|
535 - | deserializer.read_struct(&CREATECAPACITYRESERVATIONINPUT_SCHEMA, (), |_, member, deser| {
|
535 + | deserializer.read_struct(&CREATECAPACITYRESERVATIONINPUT_SCHEMA, &mut |member, deser| {
|
536 536 | match member.member_index() {
|
537 537 | Some(0) => {
|
538 538 | builder.client_token = Some(deser.read_string(member)?);
|
539 539 | }
|
540 540 | Some(1) => {
|
541 541 | builder.instance_type = Some(deser.read_string(member)?);
|
542 542 | }
|
543 543 | Some(2) => {
|
544 544 | builder.instance_platform = Some(crate::types::CapacityReservationInstancePlatform::from(
|
545 545 | deser.read_string(member)?.as_str(),
|
546 546 | ));
|
547 547 | }
|
548 548 | Some(3) => {
|
549 549 | builder.availability_zone = Some(deser.read_string(member)?);
|
550 550 | }
|
551 551 | Some(4) => {
|
552 552 | builder.availability_zone_id = Some(deser.read_string(member)?);
|
553 553 | }
|
554 554 | Some(5) => {
|
555 555 | builder.tenancy = Some(crate::types::CapacityReservationTenancy::from(deser.read_string(member)?.as_str()));
|
556 556 | }
|
557 557 | Some(6) => {
|
558 558 | builder.instance_count = Some(deser.read_integer(member)?);
|
559 559 | }
|
560 560 | Some(7) => {
|
561 561 | builder.ebs_optimized = Some(deser.read_boolean(member)?);
|
562 562 | }
|
563 563 | Some(8) => {
|
564 564 | builder.ephemeral_storage = Some(deser.read_boolean(member)?);
|
565 565 | }
|
566 566 | Some(9) => {
|
567 567 | builder.end_date = Some(deser.read_timestamp(member)?);
|
568 568 | }
|
569 569 | Some(10) => {
|
570 570 | builder.end_date_type = Some(crate::types::EndDateType::from(deser.read_string(member)?.as_str()));
|
571 571 | }
|
572 572 | Some(11) => {
|
573 573 | builder.instance_match_criteria = Some(crate::types::InstanceMatchCriteria::from(deser.read_string(member)?.as_str()));
|
574 574 | }
|
575 575 | Some(12) => {
|
576 576 | builder.tag_specifications = Some({
|
577 - | let container = if let Some(cap) = deser.container_size() {
|
578 - | Vec::with_capacity(cap)
|
579 - | } else {
|
580 - | Vec::new()
|
581 - | };
|
582 - | deser.read_list(member, container, |mut list, deser| {
|
583 - | list.push(crate::types::TagSpecification::deserialize(deser)?);
|
584 - | Ok(list)
|
585 - | })?
|
577 + | let mut container = Vec::new();
|
578 + | deser.read_list(member, &mut |deser| {
|
579 + | container.push(crate::types::TagSpecification::deserialize(deser)?);
|
580 + | Ok(())
|
581 + | })?;
|
582 + | container
|
586 583 | });
|
587 584 | }
|
588 585 | Some(13) => {
|
589 586 | builder.dry_run = Some(deser.read_boolean(member)?);
|
590 587 | }
|
591 588 | Some(14) => {
|
592 589 | builder.outpost_arn = Some(deser.read_string(member)?);
|
593 590 | }
|
594 591 | Some(15) => {
|
595 592 | builder.placement_group_arn = Some(deser.read_string(member)?);
|
596 593 | }
|
597 594 | Some(16) => {
|
598 595 | builder.start_date = Some(deser.read_timestamp(member)?);
|
599 596 | }
|
600 597 | Some(17) => {
|
601 598 | builder.commitment_duration = Some(deser.read_long(member)?);
|
602 599 | }
|
603 600 | Some(18) => {
|
604 601 | builder.delivery_preference = Some(crate::types::CapacityReservationDeliveryPreference::from(
|
605 602 | deser.read_string(member)?.as_str(),
|
606 603 | ));
|
607 604 | }
|
608 605 | _ => {}
|
609 606 | }
|
610 607 | Ok(())
|
611 608 | })?;
|
609 + | builder.instance_type = builder.instance_type.or(Some(String::new()));
|
610 + | builder.instance_count = builder.instance_count.or(Some(0i32));
|
612 611 | builder
|
613 612 | .build()
|
614 613 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
615 614 | }
|
616 615 | }
|
616 + | impl CreateCapacityReservationInput {
|
617 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
618 + | pub fn deserialize_with_response(
|
619 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
620 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
621 + | _status: u16,
|
622 + | _body: &[u8],
|
623 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
624 + | Self::deserialize(deserializer)
|
625 + | }
|
626 + | }
|
617 627 | impl CreateCapacityReservationInput {
|
618 628 | /// Creates a new builder-style object to manufacture [`CreateCapacityReservationInput`](crate::operation::create_capacity_reservation::CreateCapacityReservationInput).
|
619 629 | pub fn builder() -> crate::operation::create_capacity_reservation::builders::CreateCapacityReservationInputBuilder {
|
620 630 | crate::operation::create_capacity_reservation::builders::CreateCapacityReservationInputBuilder::default()
|
621 631 | }
|
622 632 | }
|
623 633 |
|
624 634 | /// A builder for [`CreateCapacityReservationInput`](crate::operation::create_capacity_reservation::CreateCapacityReservationInput).
|
625 635 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
626 636 | #[non_exhaustive]
|