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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>This structure contains the attributes that determine the goal of an SLO. This includes the time period for evaluation and the attainment threshold.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Goal {
/// <p>The time period used to evaluate the SLO. It can be either a calendar interval or rolling interval.</p>
/// <p>If you omit this parameter, a rolling interval of 7 days is used.</p>
pub interval: ::std::option::Option<crate::types::Interval>,
/// <p>The threshold that determines if the goal is being met.</p>
/// <p>If this is a period-based SLO, the attainment goal is the percentage of good periods that meet the threshold requirements to the total periods within the interval. For example, an attainment goal of 99.9% means that within your interval, you are targeting 99.9% of the periods to be in healthy state.</p>
/// <p>If this is a request-based SLO, the attainment goal is the percentage of requests that must be successful to meet the attainment goal.</p>
/// <p>If you omit this parameter, 99 is used to represent 99% as the attainment goal.</p>
pub attainment_goal: ::std::option::Option<f64>,
/// <p>The percentage of remaining budget over total budget that you want to get warnings for. If you omit this parameter, the default of 50.0 is used.</p>
pub warning_threshold: ::std::option::Option<f64>,
}
impl Goal {
/// <p>The time period used to evaluate the SLO. It can be either a calendar interval or rolling interval.</p>
/// <p>If you omit this parameter, a rolling interval of 7 days is used.</p>
pub fn interval(&self) -> ::std::option::Option<&crate::types::Interval> {
self.interval.as_ref()
}
/// <p>The threshold that determines if the goal is being met.</p>
/// <p>If this is a period-based SLO, the attainment goal is the percentage of good periods that meet the threshold requirements to the total periods within the interval. For example, an attainment goal of 99.9% means that within your interval, you are targeting 99.9% of the periods to be in healthy state.</p>
/// <p>If this is a request-based SLO, the attainment goal is the percentage of requests that must be successful to meet the attainment goal.</p>
/// <p>If you omit this parameter, 99 is used to represent 99% as the attainment goal.</p>
pub fn attainment_goal(&self) -> ::std::option::Option<f64> {
self.attainment_goal
}
/// <p>The percentage of remaining budget over total budget that you want to get warnings for. If you omit this parameter, the default of 50.0 is used.</p>
pub fn warning_threshold(&self) -> ::std::option::Option<f64> {
self.warning_threshold
}
}
impl Goal {
/// Creates a new builder-style object to manufacture [`Goal`](crate::types::Goal).
pub fn builder() -> crate::types::builders::GoalBuilder {
crate::types::builders::GoalBuilder::default()
}
}
/// A builder for [`Goal`](crate::types::Goal).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GoalBuilder {
pub(crate) interval: ::std::option::Option<crate::types::Interval>,
pub(crate) attainment_goal: ::std::option::Option<f64>,
pub(crate) warning_threshold: ::std::option::Option<f64>,
}
impl GoalBuilder {
/// <p>The time period used to evaluate the SLO. It can be either a calendar interval or rolling interval.</p>
/// <p>If you omit this parameter, a rolling interval of 7 days is used.</p>
pub fn interval(mut self, input: crate::types::Interval) -> Self {
self.interval = ::std::option::Option::Some(input);
self
}
/// <p>The time period used to evaluate the SLO. It can be either a calendar interval or rolling interval.</p>
/// <p>If you omit this parameter, a rolling interval of 7 days is used.</p>
pub fn set_interval(mut self, input: ::std::option::Option<crate::types::Interval>) -> Self {
self.interval = input;
self
}
/// <p>The time period used to evaluate the SLO. It can be either a calendar interval or rolling interval.</p>
/// <p>If you omit this parameter, a rolling interval of 7 days is used.</p>
pub fn get_interval(&self) -> &::std::option::Option<crate::types::Interval> {
&self.interval
}
/// <p>The threshold that determines if the goal is being met.</p>
/// <p>If this is a period-based SLO, the attainment goal is the percentage of good periods that meet the threshold requirements to the total periods within the interval. For example, an attainment goal of 99.9% means that within your interval, you are targeting 99.9% of the periods to be in healthy state.</p>
/// <p>If this is a request-based SLO, the attainment goal is the percentage of requests that must be successful to meet the attainment goal.</p>
/// <p>If you omit this parameter, 99 is used to represent 99% as the attainment goal.</p>
pub fn attainment_goal(mut self, input: f64) -> Self {
self.attainment_goal = ::std::option::Option::Some(input);
self
}
/// <p>The threshold that determines if the goal is being met.</p>
/// <p>If this is a period-based SLO, the attainment goal is the percentage of good periods that meet the threshold requirements to the total periods within the interval. For example, an attainment goal of 99.9% means that within your interval, you are targeting 99.9% of the periods to be in healthy state.</p>
/// <p>If this is a request-based SLO, the attainment goal is the percentage of requests that must be successful to meet the attainment goal.</p>
/// <p>If you omit this parameter, 99 is used to represent 99% as the attainment goal.</p>
pub fn set_attainment_goal(mut self, input: ::std::option::Option<f64>) -> Self {
self.attainment_goal = input;
self
}
/// <p>The threshold that determines if the goal is being met.</p>
/// <p>If this is a period-based SLO, the attainment goal is the percentage of good periods that meet the threshold requirements to the total periods within the interval. For example, an attainment goal of 99.9% means that within your interval, you are targeting 99.9% of the periods to be in healthy state.</p>
/// <p>If this is a request-based SLO, the attainment goal is the percentage of requests that must be successful to meet the attainment goal.</p>
/// <p>If you omit this parameter, 99 is used to represent 99% as the attainment goal.</p>
pub fn get_attainment_goal(&self) -> &::std::option::Option<f64> {
&self.attainment_goal
}
/// <p>The percentage of remaining budget over total budget that you want to get warnings for. If you omit this parameter, the default of 50.0 is used.</p>
pub fn warning_threshold(mut self, input: f64) -> Self {
self.warning_threshold = ::std::option::Option::Some(input);
self
}
/// <p>The percentage of remaining budget over total budget that you want to get warnings for. If you omit this parameter, the default of 50.0 is used.</p>
pub fn set_warning_threshold(mut self, input: ::std::option::Option<f64>) -> Self {
self.warning_threshold = input;
self
}
/// <p>The percentage of remaining budget over total budget that you want to get warnings for. If you omit this parameter, the default of 50.0 is used.</p>
pub fn get_warning_threshold(&self) -> &::std::option::Option<f64> {
&self.warning_threshold
}
/// Consumes the builder and constructs a [`Goal`](crate::types::Goal).
pub fn build(self) -> crate::types::Goal {
crate::types::Goal {
interval: self.interval,
attainment_goal: self.attainment_goal,
warning_threshold: self.warning_threshold,
}
}
}