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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Describes a utilization metric of an Lambda function.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct LambdaFunctionUtilizationMetric {
    /// <p>The name of the utilization metric.</p>
    /// <p>The following utilization metrics are available:</p>
    /// <ul>
    /// <li>
    /// <p><code>Duration</code> - The amount of time that your function code spends processing an event.</p></li>
    /// <li>
    /// <p><code>Memory</code> - The amount of memory used per invocation.</p></li>
    /// </ul>
    pub name: ::std::option::Option<crate::types::LambdaFunctionMetricName>,
    /// <p>The statistic of the utilization metric.</p>
    /// <p>The Compute Optimizer API, Command Line Interface (CLI), and SDKs return utilization metrics using only the <code>Maximum</code> statistic, which is the highest value observed during the specified period.</p>
    /// <p>The Compute Optimizer console displays graphs for some utilization metrics using the <code>Average</code> statistic, which is the value of <code>Sum</code> / <code>SampleCount</code> during the specified period. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/viewing-recommendations.html">Viewing resource recommendations</a> in the <i>Compute Optimizer User Guide</i>. You can also get averaged utilization metric data for your resources using Amazon CloudWatch. For more information, see the <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html">Amazon CloudWatch User Guide</a>.</p>
    pub statistic: ::std::option::Option<crate::types::LambdaFunctionMetricStatistic>,
    /// <p>The value of the utilization metric.</p>
    pub value: f64,
}
impl LambdaFunctionUtilizationMetric {
    /// <p>The name of the utilization metric.</p>
    /// <p>The following utilization metrics are available:</p>
    /// <ul>
    /// <li>
    /// <p><code>Duration</code> - The amount of time that your function code spends processing an event.</p></li>
    /// <li>
    /// <p><code>Memory</code> - The amount of memory used per invocation.</p></li>
    /// </ul>
    pub fn name(&self) -> ::std::option::Option<&crate::types::LambdaFunctionMetricName> {
        self.name.as_ref()
    }
    /// <p>The statistic of the utilization metric.</p>
    /// <p>The Compute Optimizer API, Command Line Interface (CLI), and SDKs return utilization metrics using only the <code>Maximum</code> statistic, which is the highest value observed during the specified period.</p>
    /// <p>The Compute Optimizer console displays graphs for some utilization metrics using the <code>Average</code> statistic, which is the value of <code>Sum</code> / <code>SampleCount</code> during the specified period. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/viewing-recommendations.html">Viewing resource recommendations</a> in the <i>Compute Optimizer User Guide</i>. You can also get averaged utilization metric data for your resources using Amazon CloudWatch. For more information, see the <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html">Amazon CloudWatch User Guide</a>.</p>
    pub fn statistic(&self) -> ::std::option::Option<&crate::types::LambdaFunctionMetricStatistic> {
        self.statistic.as_ref()
    }
    /// <p>The value of the utilization metric.</p>
    pub fn value(&self) -> f64 {
        self.value
    }
}
impl LambdaFunctionUtilizationMetric {
    /// Creates a new builder-style object to manufacture [`LambdaFunctionUtilizationMetric`](crate::types::LambdaFunctionUtilizationMetric).
    pub fn builder() -> crate::types::builders::LambdaFunctionUtilizationMetricBuilder {
        crate::types::builders::LambdaFunctionUtilizationMetricBuilder::default()
    }
}

/// A builder for [`LambdaFunctionUtilizationMetric`](crate::types::LambdaFunctionUtilizationMetric).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct LambdaFunctionUtilizationMetricBuilder {
    pub(crate) name: ::std::option::Option<crate::types::LambdaFunctionMetricName>,
    pub(crate) statistic: ::std::option::Option<crate::types::LambdaFunctionMetricStatistic>,
    pub(crate) value: ::std::option::Option<f64>,
}
impl LambdaFunctionUtilizationMetricBuilder {
    /// <p>The name of the utilization metric.</p>
    /// <p>The following utilization metrics are available:</p>
    /// <ul>
    /// <li>
    /// <p><code>Duration</code> - The amount of time that your function code spends processing an event.</p></li>
    /// <li>
    /// <p><code>Memory</code> - The amount of memory used per invocation.</p></li>
    /// </ul>
    pub fn name(mut self, input: crate::types::LambdaFunctionMetricName) -> Self {
        self.name = ::std::option::Option::Some(input);
        self
    }
    /// <p>The name of the utilization metric.</p>
    /// <p>The following utilization metrics are available:</p>
    /// <ul>
    /// <li>
    /// <p><code>Duration</code> - The amount of time that your function code spends processing an event.</p></li>
    /// <li>
    /// <p><code>Memory</code> - The amount of memory used per invocation.</p></li>
    /// </ul>
    pub fn set_name(mut self, input: ::std::option::Option<crate::types::LambdaFunctionMetricName>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the utilization metric.</p>
    /// <p>The following utilization metrics are available:</p>
    /// <ul>
    /// <li>
    /// <p><code>Duration</code> - The amount of time that your function code spends processing an event.</p></li>
    /// <li>
    /// <p><code>Memory</code> - The amount of memory used per invocation.</p></li>
    /// </ul>
    pub fn get_name(&self) -> &::std::option::Option<crate::types::LambdaFunctionMetricName> {
        &self.name
    }
    /// <p>The statistic of the utilization metric.</p>
    /// <p>The Compute Optimizer API, Command Line Interface (CLI), and SDKs return utilization metrics using only the <code>Maximum</code> statistic, which is the highest value observed during the specified period.</p>
    /// <p>The Compute Optimizer console displays graphs for some utilization metrics using the <code>Average</code> statistic, which is the value of <code>Sum</code> / <code>SampleCount</code> during the specified period. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/viewing-recommendations.html">Viewing resource recommendations</a> in the <i>Compute Optimizer User Guide</i>. You can also get averaged utilization metric data for your resources using Amazon CloudWatch. For more information, see the <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html">Amazon CloudWatch User Guide</a>.</p>
    pub fn statistic(mut self, input: crate::types::LambdaFunctionMetricStatistic) -> Self {
        self.statistic = ::std::option::Option::Some(input);
        self
    }
    /// <p>The statistic of the utilization metric.</p>
    /// <p>The Compute Optimizer API, Command Line Interface (CLI), and SDKs return utilization metrics using only the <code>Maximum</code> statistic, which is the highest value observed during the specified period.</p>
    /// <p>The Compute Optimizer console displays graphs for some utilization metrics using the <code>Average</code> statistic, which is the value of <code>Sum</code> / <code>SampleCount</code> during the specified period. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/viewing-recommendations.html">Viewing resource recommendations</a> in the <i>Compute Optimizer User Guide</i>. You can also get averaged utilization metric data for your resources using Amazon CloudWatch. For more information, see the <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html">Amazon CloudWatch User Guide</a>.</p>
    pub fn set_statistic(mut self, input: ::std::option::Option<crate::types::LambdaFunctionMetricStatistic>) -> Self {
        self.statistic = input;
        self
    }
    /// <p>The statistic of the utilization metric.</p>
    /// <p>The Compute Optimizer API, Command Line Interface (CLI), and SDKs return utilization metrics using only the <code>Maximum</code> statistic, which is the highest value observed during the specified period.</p>
    /// <p>The Compute Optimizer console displays graphs for some utilization metrics using the <code>Average</code> statistic, which is the value of <code>Sum</code> / <code>SampleCount</code> during the specified period. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/viewing-recommendations.html">Viewing resource recommendations</a> in the <i>Compute Optimizer User Guide</i>. You can also get averaged utilization metric data for your resources using Amazon CloudWatch. For more information, see the <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html">Amazon CloudWatch User Guide</a>.</p>
    pub fn get_statistic(&self) -> &::std::option::Option<crate::types::LambdaFunctionMetricStatistic> {
        &self.statistic
    }
    /// <p>The value of the utilization metric.</p>
    pub fn value(mut self, input: f64) -> Self {
        self.value = ::std::option::Option::Some(input);
        self
    }
    /// <p>The value of the utilization metric.</p>
    pub fn set_value(mut self, input: ::std::option::Option<f64>) -> Self {
        self.value = input;
        self
    }
    /// <p>The value of the utilization metric.</p>
    pub fn get_value(&self) -> &::std::option::Option<f64> {
        &self.value
    }
    /// Consumes the builder and constructs a [`LambdaFunctionUtilizationMetric`](crate::types::LambdaFunctionUtilizationMetric).
    pub fn build(self) -> crate::types::LambdaFunctionUtilizationMetric {
        crate::types::LambdaFunctionUtilizationMetric {
            name: self.name,
            statistic: self.statistic,
            value: self.value.unwrap_or_default(),
        }
    }
}