1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>CPU utilization and load average metrics for an Amazon EC2 instance.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SystemStatus {
    /// <p>CPU utilization metrics for the instance.</p>
    pub cpu_utilization: ::std::option::Option<crate::types::CpuUtilization>,
    /// <p>Load average in the last 1-minute, 5-minute, and 15-minute periods. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-metrics.html#health-enhanced-metrics-os">Operating System Metrics</a>.</p>
    pub load_average: ::std::option::Option<::std::vec::Vec<f64>>,
}
impl SystemStatus {
    /// <p>CPU utilization metrics for the instance.</p>
    pub fn cpu_utilization(&self) -> ::std::option::Option<&crate::types::CpuUtilization> {
        self.cpu_utilization.as_ref()
    }
    /// <p>Load average in the last 1-minute, 5-minute, and 15-minute periods. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-metrics.html#health-enhanced-metrics-os">Operating System Metrics</a>.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.load_average.is_none()`.
    pub fn load_average(&self) -> &[f64] {
        self.load_average.as_deref().unwrap_or_default()
    }
}
impl SystemStatus {
    /// Creates a new builder-style object to manufacture [`SystemStatus`](crate::types::SystemStatus).
    pub fn builder() -> crate::types::builders::SystemStatusBuilder {
        crate::types::builders::SystemStatusBuilder::default()
    }
}

/// A builder for [`SystemStatus`](crate::types::SystemStatus).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct SystemStatusBuilder {
    pub(crate) cpu_utilization: ::std::option::Option<crate::types::CpuUtilization>,
    pub(crate) load_average: ::std::option::Option<::std::vec::Vec<f64>>,
}
impl SystemStatusBuilder {
    /// <p>CPU utilization metrics for the instance.</p>
    pub fn cpu_utilization(mut self, input: crate::types::CpuUtilization) -> Self {
        self.cpu_utilization = ::std::option::Option::Some(input);
        self
    }
    /// <p>CPU utilization metrics for the instance.</p>
    pub fn set_cpu_utilization(mut self, input: ::std::option::Option<crate::types::CpuUtilization>) -> Self {
        self.cpu_utilization = input;
        self
    }
    /// <p>CPU utilization metrics for the instance.</p>
    pub fn get_cpu_utilization(&self) -> &::std::option::Option<crate::types::CpuUtilization> {
        &self.cpu_utilization
    }
    /// Appends an item to `load_average`.
    ///
    /// To override the contents of this collection use [`set_load_average`](Self::set_load_average).
    ///
    /// <p>Load average in the last 1-minute, 5-minute, and 15-minute periods. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-metrics.html#health-enhanced-metrics-os">Operating System Metrics</a>.</p>
    pub fn load_average(mut self, input: f64) -> Self {
        let mut v = self.load_average.unwrap_or_default();
        v.push(input);
        self.load_average = ::std::option::Option::Some(v);
        self
    }
    /// <p>Load average in the last 1-minute, 5-minute, and 15-minute periods. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-metrics.html#health-enhanced-metrics-os">Operating System Metrics</a>.</p>
    pub fn set_load_average(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
        self.load_average = input;
        self
    }
    /// <p>Load average in the last 1-minute, 5-minute, and 15-minute periods. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-metrics.html#health-enhanced-metrics-os">Operating System Metrics</a>.</p>
    pub fn get_load_average(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
        &self.load_average
    }
    /// Consumes the builder and constructs a [`SystemStatus`](crate::types::SystemStatus).
    pub fn build(self) -> crate::types::SystemStatus {
        crate::types::SystemStatus {
            cpu_utilization: self.cpu_utilization,
            load_average: self.load_average,
        }
    }
}