289 289 | /// <p>Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html">Service Connect</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
|
290 290 | pub fn service_connect_defaults(&self) -> ::std::option::Option<&crate::types::ClusterServiceConnectDefaults> {
|
291 291 | self.service_connect_defaults.as_ref()
|
292 292 | }
|
293 293 | }
|
294 294 | static CLUSTER_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
|
295 295 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ecs#Cluster", "com.amazonaws.ecs", "Cluster");
|
296 296 | static CLUSTER_MEMBER_CLUSTER_ARN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
297 297 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ecs#Cluster$clusterArn", "com.amazonaws.ecs", "Cluster"),
|
298 298 | ::aws_smithy_schema::ShapeType::String,
|
299 - | "cluster_arn",
|
299 + | "clusterArn",
|
300 300 | 0,
|
301 301 | );
|
302 302 | static CLUSTER_MEMBER_CLUSTER_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
303 303 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ecs#Cluster$clusterName", "com.amazonaws.ecs", "Cluster"),
|
304 304 | ::aws_smithy_schema::ShapeType::String,
|
305 - | "cluster_name",
|
305 + | "clusterName",
|
306 306 | 1,
|
307 307 | );
|
308 308 | static CLUSTER_MEMBER_CONFIGURATION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
309 309 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ecs#Cluster$configuration", "com.amazonaws.ecs", "Cluster"),
|
310 310 | ::aws_smithy_schema::ShapeType::Structure,
|
311 311 | "configuration",
|
312 312 | 2,
|
313 313 | );
|
314 314 | static CLUSTER_MEMBER_STATUS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
315 315 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ecs#Cluster$status", "com.amazonaws.ecs", "Cluster"),
|
316 316 | ::aws_smithy_schema::ShapeType::String,
|
317 317 | "status",
|
318 318 | 3,
|
319 319 | );
|
320 320 | static CLUSTER_MEMBER_REGISTERED_CONTAINER_INSTANCES_COUNT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
321 321 | ::aws_smithy_schema::ShapeId::from_static(
|
322 322 | "com.amazonaws.ecs#Cluster$registeredContainerInstancesCount",
|
323 323 | "com.amazonaws.ecs",
|
324 324 | "Cluster",
|
325 325 | ),
|
326 326 | ::aws_smithy_schema::ShapeType::Integer,
|
327 - | "registered_container_instances_count",
|
327 + | "registeredContainerInstancesCount",
|
328 328 | 4,
|
329 329 | );
|
330 330 | static CLUSTER_MEMBER_RUNNING_TASKS_COUNT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
331 331 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ecs#Cluster$runningTasksCount", "com.amazonaws.ecs", "Cluster"),
|
332 332 | ::aws_smithy_schema::ShapeType::Integer,
|
333 - | "running_tasks_count",
|
333 + | "runningTasksCount",
|
334 334 | 5,
|
335 335 | );
|
336 336 | static CLUSTER_MEMBER_PENDING_TASKS_COUNT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
337 337 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ecs#Cluster$pendingTasksCount", "com.amazonaws.ecs", "Cluster"),
|
338 338 | ::aws_smithy_schema::ShapeType::Integer,
|
339 - | "pending_tasks_count",
|
339 + | "pendingTasksCount",
|
340 340 | 6,
|
341 341 | );
|
342 342 | static CLUSTER_MEMBER_ACTIVE_SERVICES_COUNT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
343 343 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ecs#Cluster$activeServicesCount", "com.amazonaws.ecs", "Cluster"),
|
344 344 | ::aws_smithy_schema::ShapeType::Integer,
|
345 - | "active_services_count",
|
345 + | "activeServicesCount",
|
346 346 | 7,
|
347 347 | );
|
348 348 | static CLUSTER_MEMBER_STATISTICS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
349 349 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ecs#Cluster$statistics", "com.amazonaws.ecs", "Cluster"),
|
350 350 | ::aws_smithy_schema::ShapeType::List,
|
351 351 | "statistics",
|
352 352 | 8,
|
353 353 | );
|
354 354 | static CLUSTER_MEMBER_TAGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
355 355 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ecs#Cluster$tags", "com.amazonaws.ecs", "Cluster"),
|
356 356 | ::aws_smithy_schema::ShapeType::List,
|
357 357 | "tags",
|
358 358 | 9,
|
359 359 | );
|
360 360 | static CLUSTER_MEMBER_SETTINGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
361 361 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ecs#Cluster$settings", "com.amazonaws.ecs", "Cluster"),
|
362 362 | ::aws_smithy_schema::ShapeType::List,
|
363 363 | "settings",
|
364 364 | 10,
|
365 365 | );
|
366 366 | static CLUSTER_MEMBER_CAPACITY_PROVIDERS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
367 367 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ecs#Cluster$capacityProviders", "com.amazonaws.ecs", "Cluster"),
|
368 368 | ::aws_smithy_schema::ShapeType::List,
|
369 - | "capacity_providers",
|
369 + | "capacityProviders",
|
370 370 | 11,
|
371 371 | );
|
372 372 | static CLUSTER_MEMBER_DEFAULT_CAPACITY_PROVIDER_STRATEGY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
373 373 | ::aws_smithy_schema::ShapeId::from_static(
|
374 374 | "com.amazonaws.ecs#Cluster$defaultCapacityProviderStrategy",
|
375 375 | "com.amazonaws.ecs",
|
376 376 | "Cluster",
|
377 377 | ),
|
378 378 | ::aws_smithy_schema::ShapeType::List,
|
379 - | "default_capacity_provider_strategy",
|
379 + | "defaultCapacityProviderStrategy",
|
380 380 | 12,
|
381 381 | );
|
382 382 | static CLUSTER_MEMBER_ATTACHMENTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
383 383 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ecs#Cluster$attachments", "com.amazonaws.ecs", "Cluster"),
|
384 384 | ::aws_smithy_schema::ShapeType::List,
|
385 385 | "attachments",
|
386 386 | 13,
|
387 387 | );
|
388 388 | static CLUSTER_MEMBER_ATTACHMENTS_STATUS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
389 389 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ecs#Cluster$attachmentsStatus", "com.amazonaws.ecs", "Cluster"),
|
390 390 | ::aws_smithy_schema::ShapeType::String,
|
391 - | "attachments_status",
|
391 + | "attachmentsStatus",
|
392 392 | 14,
|
393 393 | );
|
394 394 | static CLUSTER_MEMBER_SERVICE_CONNECT_DEFAULTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
395 395 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ecs#Cluster$serviceConnectDefaults", "com.amazonaws.ecs", "Cluster"),
|
396 396 | ::aws_smithy_schema::ShapeType::Structure,
|
397 - | "service_connect_defaults",
|
397 + | "serviceConnectDefaults",
|
398 398 | 15,
|
399 399 | );
|
400 400 | static CLUSTER_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
401 401 | CLUSTER_SCHEMA_ID,
|
402 402 | ::aws_smithy_schema::ShapeType::Structure,
|
403 403 | &[
|
404 404 | &CLUSTER_MEMBER_CLUSTER_ARN,
|
405 405 | &CLUSTER_MEMBER_CLUSTER_NAME,
|
406 406 | &CLUSTER_MEMBER_CONFIGURATION,
|
407 407 | &CLUSTER_MEMBER_STATUS,
|
521 521 | ser.write_string(&CLUSTER_MEMBER_ATTACHMENTS_STATUS, val)?;
|
522 522 | }
|
523 523 | if let Some(ref val) = self.service_connect_defaults {
|
524 524 | ser.write_struct(&CLUSTER_MEMBER_SERVICE_CONNECT_DEFAULTS, val)?;
|
525 525 | }
|
526 526 | Ok(())
|
527 527 | }
|
528 528 | }
|
529 529 | impl Cluster {
|
530 530 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
531 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
532 - | deserializer: &mut D,
|
531 + | pub fn deserialize(
|
532 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
533 533 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
534 534 | #[allow(unused_variables, unused_mut)]
|
535 535 | let mut builder = Self::builder();
|
536 536 | #[allow(
|
537 537 | unused_variables,
|
538 538 | unreachable_code,
|
539 539 | clippy::single_match,
|
540 540 | clippy::match_single_binding,
|
541 541 | clippy::diverging_sub_expression
|
542 542 | )]
|
543 - | deserializer.read_struct(&CLUSTER_SCHEMA, (), |_, member, deser| {
|
543 + | deserializer.read_struct(&CLUSTER_SCHEMA, &mut |member, deser| {
|
544 544 | match member.member_index() {
|
545 545 | Some(0) => {
|
546 546 | builder.cluster_arn = Some(deser.read_string(member)?);
|
547 547 | }
|
548 548 | Some(1) => {
|
549 549 | builder.cluster_name = Some(deser.read_string(member)?);
|
550 550 | }
|
551 551 | Some(2) => {
|
552 552 | builder.configuration = Some(crate::types::ClusterConfiguration::deserialize(deser)?);
|
553 553 | }
|
554 554 | Some(3) => {
|
555 555 | builder.status = Some(deser.read_string(member)?);
|
556 556 | }
|
557 557 | Some(4) => {
|
558 558 | builder.registered_container_instances_count = Some(deser.read_integer(member)?);
|
559 559 | }
|
560 560 | Some(5) => {
|
561 561 | builder.running_tasks_count = Some(deser.read_integer(member)?);
|
562 562 | }
|
563 563 | Some(6) => {
|
564 564 | builder.pending_tasks_count = Some(deser.read_integer(member)?);
|
565 565 | }
|
566 566 | Some(7) => {
|
567 567 | builder.active_services_count = Some(deser.read_integer(member)?);
|
568 568 | }
|
569 569 | Some(8) => {
|
570 570 | builder.statistics = Some({
|
571 - | let container = if let Some(cap) = deser.container_size() {
|
572 - | Vec::with_capacity(cap)
|
573 - | } else {
|
574 - | Vec::new()
|
575 - | };
|
576 - | deser.read_list(member, container, |mut list, deser| {
|
577 - | list.push(crate::types::KeyValuePair::deserialize(deser)?);
|
578 - | Ok(list)
|
579 - | })?
|
571 + | let mut container = Vec::new();
|
572 + | deser.read_list(member, &mut |deser| {
|
573 + | container.push(crate::types::KeyValuePair::deserialize(deser)?);
|
574 + | Ok(())
|
575 + | })?;
|
576 + | container
|
580 577 | });
|
581 578 | }
|
582 579 | Some(9) => {
|
583 580 | builder.tags = Some({
|
584 - | let container = if let Some(cap) = deser.container_size() {
|
585 - | Vec::with_capacity(cap)
|
586 - | } else {
|
587 - | Vec::new()
|
588 - | };
|
589 - | deser.read_list(member, container, |mut list, deser| {
|
590 - | list.push(crate::types::Tag::deserialize(deser)?);
|
591 - | Ok(list)
|
592 - | })?
|
581 + | let mut container = Vec::new();
|
582 + | deser.read_list(member, &mut |deser| {
|
583 + | container.push(crate::types::Tag::deserialize(deser)?);
|
584 + | Ok(())
|
585 + | })?;
|
586 + | container
|
593 587 | });
|
594 588 | }
|
595 589 | Some(10) => {
|
596 590 | builder.settings = Some({
|
597 - | let container = if let Some(cap) = deser.container_size() {
|
598 - | Vec::with_capacity(cap)
|
599 - | } else {
|
600 - | Vec::new()
|
601 - | };
|
602 - | deser.read_list(member, container, |mut list, deser| {
|
603 - | list.push(crate::types::ClusterSetting::deserialize(deser)?);
|
604 - | Ok(list)
|
605 - | })?
|
591 + | let mut container = Vec::new();
|
592 + | deser.read_list(member, &mut |deser| {
|
593 + | container.push(crate::types::ClusterSetting::deserialize(deser)?);
|
594 + | Ok(())
|
595 + | })?;
|
596 + | container
|
606 597 | });
|
607 598 | }
|
608 599 | Some(11) => {
|
609 - | builder.capacity_providers = 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_string(member)?);
|
617 - | Ok(list)
|
618 - | })?
|
619 - | });
|
600 + | builder.capacity_providers = Some(deser.read_string_list(member)?);
|
620 601 | }
|
621 602 | Some(12) => {
|
622 603 | builder.default_capacity_provider_strategy = Some({
|
623 - | let container = if let Some(cap) = deser.container_size() {
|
624 - | Vec::with_capacity(cap)
|
625 - | } else {
|
626 - | Vec::new()
|
627 - | };
|
628 - | deser.read_list(member, container, |mut list, deser| {
|
629 - | list.push(crate::types::CapacityProviderStrategyItem::deserialize(deser)?);
|
630 - | Ok(list)
|
631 - | })?
|
604 + | let mut container = Vec::new();
|
605 + | deser.read_list(member, &mut |deser| {
|
606 + | container.push(crate::types::CapacityProviderStrategyItem::deserialize(deser)?);
|
607 + | Ok(())
|
608 + | })?;
|
609 + | container
|
632 610 | });
|
633 611 | }
|
634 612 | Some(13) => {
|
635 613 | builder.attachments = Some({
|
636 - | let container = if let Some(cap) = deser.container_size() {
|
637 - | Vec::with_capacity(cap)
|
638 - | } else {
|
639 - | Vec::new()
|
640 - | };
|
641 - | deser.read_list(member, container, |mut list, deser| {
|
642 - | list.push(crate::types::Attachment::deserialize(deser)?);
|
643 - | Ok(list)
|
644 - | })?
|
614 + | let mut container = Vec::new();
|
615 + | deser.read_list(member, &mut |deser| {
|
616 + | container.push(crate::types::Attachment::deserialize(deser)?);
|
617 + | Ok(())
|
618 + | })?;
|
619 + | container
|
645 620 | });
|
646 621 | }
|
647 622 | Some(14) => {
|
648 623 | builder.attachments_status = Some(deser.read_string(member)?);
|
649 624 | }
|
650 625 | Some(15) => {
|
651 626 | builder.service_connect_defaults = Some(crate::types::ClusterServiceConnectDefaults::deserialize(deser)?);
|
652 627 | }
|
653 628 | _ => {}
|
654 629 | }
|
655 630 | Ok(())
|
656 631 | })?;
|
657 632 | Ok(builder.build())
|
658 633 | }
|
659 634 | }
|
635 + | impl Cluster {
|
636 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
637 + | pub fn deserialize_with_response(
|
638 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
639 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
640 + | _status: u16,
|
641 + | _body: &[u8],
|
642 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
643 + | Self::deserialize(deserializer)
|
644 + | }
|
645 + | }
|
660 646 | impl Cluster {
|
661 647 | /// Creates a new builder-style object to manufacture [`Cluster`](crate::types::Cluster).
|
662 648 | pub fn builder() -> crate::types::builders::ClusterBuilder {
|
663 649 | crate::types::builders::ClusterBuilder::default()
|
664 650 | }
|
665 651 | }
|
666 652 |
|
667 653 | /// A builder for [`Cluster`](crate::types::Cluster).
|
668 654 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
669 655 | #[non_exhaustive]
|
670 656 | pub struct ClusterBuilder {
|
671 657 | pub(crate) cluster_arn: ::std::option::Option<::std::string::String>,
|
672 658 | pub(crate) cluster_name: ::std::option::Option<::std::string::String>,
|
673 659 | pub(crate) configuration: ::std::option::Option<crate::types::ClusterConfiguration>,
|
674 660 | pub(crate) status: ::std::option::Option<::std::string::String>,
|
675 661 | pub(crate) registered_container_instances_count: ::std::option::Option<i32>,
|
676 662 | pub(crate) running_tasks_count: ::std::option::Option<i32>,
|
677 663 | pub(crate) pending_tasks_count: ::std::option::Option<i32>,
|
678 664 | pub(crate) active_services_count: ::std::option::Option<i32>,
|
679 665 | pub(crate) statistics: ::std::option::Option<::std::vec::Vec<crate::types::KeyValuePair>>,
|
680 666 | pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
|
681 667 | pub(crate) settings: ::std::option::Option<::std::vec::Vec<crate::types::ClusterSetting>>,
|
682 668 | pub(crate) capacity_providers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
683 669 | pub(crate) default_capacity_provider_strategy: ::std::option::Option<::std::vec::Vec<crate::types::CapacityProviderStrategyItem>>,
|
684 670 | pub(crate) attachments: ::std::option::Option<::std::vec::Vec<crate::types::Attachment>>,
|
685 671 | pub(crate) attachments_status: ::std::option::Option<::std::string::String>,
|
686 672 | pub(crate) service_connect_defaults: ::std::option::Option<crate::types::ClusterServiceConnectDefaults>,
|
687 673 | }
|
688 674 | impl ClusterBuilder {
|
689 675 | /// <p>The Amazon Resource Name (ARN) that identifies the cluster. For more information about the ARN format, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids">Amazon Resource Name (ARN)</a> in the <i>Amazon ECS Developer Guide</i>.</p>
|