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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SetAlarmStateInput {
/// <p>The name of the alarm.</p>
pub alarm_name: ::std::option::Option<::std::string::String>,
/// <p>The value of the state.</p>
pub state_value: ::std::option::Option<crate::types::StateValue>,
/// <p>The reason that this alarm is set to this specific state, in text format.</p>
pub state_reason: ::std::option::Option<::std::string::String>,
/// <p>The reason that this alarm is set to this specific state, in JSON format.</p>
/// <p>For SNS or EC2 alarm actions, this is just informational. But for EC2 Auto Scaling or application Auto Scaling alarm actions, the Auto Scaling policy uses the information in this field to take the correct action.</p>
pub state_reason_data: ::std::option::Option<::std::string::String>,
}
impl SetAlarmStateInput {
/// <p>The name of the alarm.</p>
pub fn alarm_name(&self) -> ::std::option::Option<&str> {
self.alarm_name.as_deref()
}
/// <p>The value of the state.</p>
pub fn state_value(&self) -> ::std::option::Option<&crate::types::StateValue> {
self.state_value.as_ref()
}
/// <p>The reason that this alarm is set to this specific state, in text format.</p>
pub fn state_reason(&self) -> ::std::option::Option<&str> {
self.state_reason.as_deref()
}
/// <p>The reason that this alarm is set to this specific state, in JSON format.</p>
/// <p>For SNS or EC2 alarm actions, this is just informational. But for EC2 Auto Scaling or application Auto Scaling alarm actions, the Auto Scaling policy uses the information in this field to take the correct action.</p>
pub fn state_reason_data(&self) -> ::std::option::Option<&str> {
self.state_reason_data.as_deref()
}
}
impl SetAlarmStateInput {
/// Creates a new builder-style object to manufacture [`SetAlarmStateInput`](crate::operation::set_alarm_state::SetAlarmStateInput).
pub fn builder() -> crate::operation::set_alarm_state::builders::SetAlarmStateInputBuilder {
crate::operation::set_alarm_state::builders::SetAlarmStateInputBuilder::default()
}
}
/// A builder for [`SetAlarmStateInput`](crate::operation::set_alarm_state::SetAlarmStateInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SetAlarmStateInputBuilder {
pub(crate) alarm_name: ::std::option::Option<::std::string::String>,
pub(crate) state_value: ::std::option::Option<crate::types::StateValue>,
pub(crate) state_reason: ::std::option::Option<::std::string::String>,
pub(crate) state_reason_data: ::std::option::Option<::std::string::String>,
}
impl SetAlarmStateInputBuilder {
/// <p>The name of the alarm.</p>
/// This field is required.
pub fn alarm_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.alarm_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the alarm.</p>
pub fn set_alarm_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.alarm_name = input;
self
}
/// <p>The name of the alarm.</p>
pub fn get_alarm_name(&self) -> &::std::option::Option<::std::string::String> {
&self.alarm_name
}
/// <p>The value of the state.</p>
/// This field is required.
pub fn state_value(mut self, input: crate::types::StateValue) -> Self {
self.state_value = ::std::option::Option::Some(input);
self
}
/// <p>The value of the state.</p>
pub fn set_state_value(mut self, input: ::std::option::Option<crate::types::StateValue>) -> Self {
self.state_value = input;
self
}
/// <p>The value of the state.</p>
pub fn get_state_value(&self) -> &::std::option::Option<crate::types::StateValue> {
&self.state_value
}
/// <p>The reason that this alarm is set to this specific state, in text format.</p>
/// This field is required.
pub fn state_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.state_reason = ::std::option::Option::Some(input.into());
self
}
/// <p>The reason that this alarm is set to this specific state, in text format.</p>
pub fn set_state_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.state_reason = input;
self
}
/// <p>The reason that this alarm is set to this specific state, in text format.</p>
pub fn get_state_reason(&self) -> &::std::option::Option<::std::string::String> {
&self.state_reason
}
/// <p>The reason that this alarm is set to this specific state, in JSON format.</p>
/// <p>For SNS or EC2 alarm actions, this is just informational. But for EC2 Auto Scaling or application Auto Scaling alarm actions, the Auto Scaling policy uses the information in this field to take the correct action.</p>
pub fn state_reason_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.state_reason_data = ::std::option::Option::Some(input.into());
self
}
/// <p>The reason that this alarm is set to this specific state, in JSON format.</p>
/// <p>For SNS or EC2 alarm actions, this is just informational. But for EC2 Auto Scaling or application Auto Scaling alarm actions, the Auto Scaling policy uses the information in this field to take the correct action.</p>
pub fn set_state_reason_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.state_reason_data = input;
self
}
/// <p>The reason that this alarm is set to this specific state, in JSON format.</p>
/// <p>For SNS or EC2 alarm actions, this is just informational. But for EC2 Auto Scaling or application Auto Scaling alarm actions, the Auto Scaling policy uses the information in this field to take the correct action.</p>
pub fn get_state_reason_data(&self) -> &::std::option::Option<::std::string::String> {
&self.state_reason_data
}
/// Consumes the builder and constructs a [`SetAlarmStateInput`](crate::operation::set_alarm_state::SetAlarmStateInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::set_alarm_state::SetAlarmStateInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::set_alarm_state::SetAlarmStateInput {
alarm_name: self.alarm_name,
state_value: self.state_value,
state_reason: self.state_reason,
state_reason_data: self.state_reason_data,
})
}
}