Skip to main content

aws_sdk_ecs/types/
_container_instance_health_status.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>An object representing the health status of the container instance.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ContainerInstanceHealthStatus {
7    /// <p>The overall health status of the container instance. This is an aggregate status of all container instance health checks.</p>
8    pub overall_status: ::std::option::Option<crate::types::InstanceHealthCheckState>,
9    /// <p>An array of objects representing the details of the container instance health status.</p>
10    pub details: ::std::option::Option<::std::vec::Vec<crate::types::InstanceHealthCheckResult>>,
11}
12impl ContainerInstanceHealthStatus {
13    /// <p>The overall health status of the container instance. This is an aggregate status of all container instance health checks.</p>
14    pub fn overall_status(&self) -> ::std::option::Option<&crate::types::InstanceHealthCheckState> {
15        self.overall_status.as_ref()
16    }
17    /// <p>An array of objects representing the details of the container instance health status.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.details.is_none()`.
20    pub fn details(&self) -> &[crate::types::InstanceHealthCheckResult] {
21        self.details.as_deref().unwrap_or_default()
22    }
23}
24impl ContainerInstanceHealthStatus {
25    /// Creates a new builder-style object to manufacture [`ContainerInstanceHealthStatus`](crate::types::ContainerInstanceHealthStatus).
26    pub fn builder() -> crate::types::builders::ContainerInstanceHealthStatusBuilder {
27        crate::types::builders::ContainerInstanceHealthStatusBuilder::default()
28    }
29}
30
31/// A builder for [`ContainerInstanceHealthStatus`](crate::types::ContainerInstanceHealthStatus).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct ContainerInstanceHealthStatusBuilder {
35    pub(crate) overall_status: ::std::option::Option<crate::types::InstanceHealthCheckState>,
36    pub(crate) details: ::std::option::Option<::std::vec::Vec<crate::types::InstanceHealthCheckResult>>,
37}
38impl ContainerInstanceHealthStatusBuilder {
39    /// <p>The overall health status of the container instance. This is an aggregate status of all container instance health checks.</p>
40    pub fn overall_status(mut self, input: crate::types::InstanceHealthCheckState) -> Self {
41        self.overall_status = ::std::option::Option::Some(input);
42        self
43    }
44    /// <p>The overall health status of the container instance. This is an aggregate status of all container instance health checks.</p>
45    pub fn set_overall_status(mut self, input: ::std::option::Option<crate::types::InstanceHealthCheckState>) -> Self {
46        self.overall_status = input;
47        self
48    }
49    /// <p>The overall health status of the container instance. This is an aggregate status of all container instance health checks.</p>
50    pub fn get_overall_status(&self) -> &::std::option::Option<crate::types::InstanceHealthCheckState> {
51        &self.overall_status
52    }
53    /// Appends an item to `details`.
54    ///
55    /// To override the contents of this collection use [`set_details`](Self::set_details).
56    ///
57    /// <p>An array of objects representing the details of the container instance health status.</p>
58    pub fn details(mut self, input: crate::types::InstanceHealthCheckResult) -> Self {
59        let mut v = self.details.unwrap_or_default();
60        v.push(input);
61        self.details = ::std::option::Option::Some(v);
62        self
63    }
64    /// <p>An array of objects representing the details of the container instance health status.</p>
65    pub fn set_details(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceHealthCheckResult>>) -> Self {
66        self.details = input;
67        self
68    }
69    /// <p>An array of objects representing the details of the container instance health status.</p>
70    pub fn get_details(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceHealthCheckResult>> {
71        &self.details
72    }
73    /// Consumes the builder and constructs a [`ContainerInstanceHealthStatus`](crate::types::ContainerInstanceHealthStatus).
74    pub fn build(self) -> crate::types::ContainerInstanceHealthStatus {
75        crate::types::ContainerInstanceHealthStatus {
76            overall_status: self.overall_status,
77            details: self.details,
78        }
79    }
80}