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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
// 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 UpdateAlertInput {
/// The unique ID of the space.
pub space_id: ::std::option::Option<::std::string::String>,
/// The alert to update.
pub alert_id: ::std::option::Option<::std::string::String>,
/// The ID of the access profile associated with the alert.
pub profile_id: ::std::option::Option<::std::string::String>,
/// A new display name for the alert. Omit to leave the name unchanged (apply-if-present / PATCH). Same constraints as CreateAlert.name; the name is not the alert's identity, so a rename never changes the alertId.
pub name: ::std::option::Option<::std::string::String>,
/// A new description of the alert. Omit to leave unchanged.
pub description: ::std::option::Option<::std::string::String>,
/// The rule that defines how the alert is evaluated. Omit to leave unchanged. Each sub-block is replaced whole when present: {@code query}, {@code condition}, {@code evaluation} and {@code noData} are applied only when supplied, and within a supplied block an omitted optional member is cleared to unset (null/absent) rather than preserved from the stored alert or defaulted. See {@link AlertCondition} and {@link AlertEvaluation}.
pub rule: ::std::option::Option<crate::types::Rule>,
/// Whether actions (notifications) are enabled for this alert. Omitted = leave existing value unchanged.
pub notifications_enabled: ::std::option::Option<bool>,
/// Replaces the entire notification rule list when present; full-replace, not merge. Omitted = leave existing rules unchanged. An empty list clears all rules (the alert keeps evaluating; only notifications stop).
pub notification_rules: ::std::option::Option<::std::vec::Vec<crate::types::NotificationRule>>,
}
impl UpdateAlertInput {
/// The unique ID of the space.
pub fn space_id(&self) -> ::std::option::Option<&str> {
self.space_id.as_deref()
}
/// The alert to update.
pub fn alert_id(&self) -> ::std::option::Option<&str> {
self.alert_id.as_deref()
}
/// The ID of the access profile associated with the alert.
pub fn profile_id(&self) -> ::std::option::Option<&str> {
self.profile_id.as_deref()
}
/// A new display name for the alert. Omit to leave the name unchanged (apply-if-present / PATCH). Same constraints as CreateAlert.name; the name is not the alert's identity, so a rename never changes the alertId.
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// A new description of the alert. Omit to leave unchanged.
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
/// The rule that defines how the alert is evaluated. Omit to leave unchanged. Each sub-block is replaced whole when present: {@code query}, {@code condition}, {@code evaluation} and {@code noData} are applied only when supplied, and within a supplied block an omitted optional member is cleared to unset (null/absent) rather than preserved from the stored alert or defaulted. See {@link AlertCondition} and {@link AlertEvaluation}.
pub fn rule(&self) -> ::std::option::Option<&crate::types::Rule> {
self.rule.as_ref()
}
/// Whether actions (notifications) are enabled for this alert. Omitted = leave existing value unchanged.
pub fn notifications_enabled(&self) -> ::std::option::Option<bool> {
self.notifications_enabled
}
/// Replaces the entire notification rule list when present; full-replace, not merge. Omitted = leave existing rules unchanged. An empty list clears all rules (the alert keeps evaluating; only notifications stop).
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.notification_rules.is_none()`.
pub fn notification_rules(&self) -> &[crate::types::NotificationRule] {
self.notification_rules.as_deref().unwrap_or_default()
}
}
impl UpdateAlertInput {
/// Creates a new builder-style object to manufacture [`UpdateAlertInput`](crate::operation::update_alert::UpdateAlertInput).
pub fn builder() -> crate::operation::update_alert::builders::UpdateAlertInputBuilder {
crate::operation::update_alert::builders::UpdateAlertInputBuilder::default()
}
}
/// A builder for [`UpdateAlertInput`](crate::operation::update_alert::UpdateAlertInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateAlertInputBuilder {
pub(crate) space_id: ::std::option::Option<::std::string::String>,
pub(crate) alert_id: ::std::option::Option<::std::string::String>,
pub(crate) profile_id: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) rule: ::std::option::Option<crate::types::Rule>,
pub(crate) notifications_enabled: ::std::option::Option<bool>,
pub(crate) notification_rules: ::std::option::Option<::std::vec::Vec<crate::types::NotificationRule>>,
}
impl UpdateAlertInputBuilder {
/// The unique ID of the space.
/// This field is required.
pub fn space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.space_id = ::std::option::Option::Some(input.into());
self
}
/// The unique ID of the space.
pub fn set_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.space_id = input;
self
}
/// The unique ID of the space.
pub fn get_space_id(&self) -> &::std::option::Option<::std::string::String> {
&self.space_id
}
/// The alert to update.
/// This field is required.
pub fn alert_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.alert_id = ::std::option::Option::Some(input.into());
self
}
/// The alert to update.
pub fn set_alert_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.alert_id = input;
self
}
/// The alert to update.
pub fn get_alert_id(&self) -> &::std::option::Option<::std::string::String> {
&self.alert_id
}
/// The ID of the access profile associated with the alert.
pub fn profile_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.profile_id = ::std::option::Option::Some(input.into());
self
}
/// The ID of the access profile associated with the alert.
pub fn set_profile_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.profile_id = input;
self
}
/// The ID of the access profile associated with the alert.
pub fn get_profile_id(&self) -> &::std::option::Option<::std::string::String> {
&self.profile_id
}
/// A new display name for the alert. Omit to leave the name unchanged (apply-if-present / PATCH). Same constraints as CreateAlert.name; the name is not the alert's identity, so a rename never changes the alertId.
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// A new display name for the alert. Omit to leave the name unchanged (apply-if-present / PATCH). Same constraints as CreateAlert.name; the name is not the alert's identity, so a rename never changes the alertId.
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// A new display name for the alert. Omit to leave the name unchanged (apply-if-present / PATCH). Same constraints as CreateAlert.name; the name is not the alert's identity, so a rename never changes the alertId.
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// A new description of the alert. Omit to leave unchanged.
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
/// A new description of the alert. Omit to leave unchanged.
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
/// A new description of the alert. Omit to leave unchanged.
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
/// The rule that defines how the alert is evaluated. Omit to leave unchanged. Each sub-block is replaced whole when present: {@code query}, {@code condition}, {@code evaluation} and {@code noData} are applied only when supplied, and within a supplied block an omitted optional member is cleared to unset (null/absent) rather than preserved from the stored alert or defaulted. See {@link AlertCondition} and {@link AlertEvaluation}.
pub fn rule(mut self, input: crate::types::Rule) -> Self {
self.rule = ::std::option::Option::Some(input);
self
}
/// The rule that defines how the alert is evaluated. Omit to leave unchanged. Each sub-block is replaced whole when present: {@code query}, {@code condition}, {@code evaluation} and {@code noData} are applied only when supplied, and within a supplied block an omitted optional member is cleared to unset (null/absent) rather than preserved from the stored alert or defaulted. See {@link AlertCondition} and {@link AlertEvaluation}.
pub fn set_rule(mut self, input: ::std::option::Option<crate::types::Rule>) -> Self {
self.rule = input;
self
}
/// The rule that defines how the alert is evaluated. Omit to leave unchanged. Each sub-block is replaced whole when present: {@code query}, {@code condition}, {@code evaluation} and {@code noData} are applied only when supplied, and within a supplied block an omitted optional member is cleared to unset (null/absent) rather than preserved from the stored alert or defaulted. See {@link AlertCondition} and {@link AlertEvaluation}.
pub fn get_rule(&self) -> &::std::option::Option<crate::types::Rule> {
&self.rule
}
/// Whether actions (notifications) are enabled for this alert. Omitted = leave existing value unchanged.
pub fn notifications_enabled(mut self, input: bool) -> Self {
self.notifications_enabled = ::std::option::Option::Some(input);
self
}
/// Whether actions (notifications) are enabled for this alert. Omitted = leave existing value unchanged.
pub fn set_notifications_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
self.notifications_enabled = input;
self
}
/// Whether actions (notifications) are enabled for this alert. Omitted = leave existing value unchanged.
pub fn get_notifications_enabled(&self) -> &::std::option::Option<bool> {
&self.notifications_enabled
}
/// Appends an item to `notification_rules`.
///
/// To override the contents of this collection use [`set_notification_rules`](Self::set_notification_rules).
///
/// Replaces the entire notification rule list when present; full-replace, not merge. Omitted = leave existing rules unchanged. An empty list clears all rules (the alert keeps evaluating; only notifications stop).
pub fn notification_rules(mut self, input: crate::types::NotificationRule) -> Self {
let mut v = self.notification_rules.unwrap_or_default();
v.push(input);
self.notification_rules = ::std::option::Option::Some(v);
self
}
/// Replaces the entire notification rule list when present; full-replace, not merge. Omitted = leave existing rules unchanged. An empty list clears all rules (the alert keeps evaluating; only notifications stop).
pub fn set_notification_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::NotificationRule>>) -> Self {
self.notification_rules = input;
self
}
/// Replaces the entire notification rule list when present; full-replace, not merge. Omitted = leave existing rules unchanged. An empty list clears all rules (the alert keeps evaluating; only notifications stop).
pub fn get_notification_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::NotificationRule>> {
&self.notification_rules
}
/// Consumes the builder and constructs a [`UpdateAlertInput`](crate::operation::update_alert::UpdateAlertInput).
pub fn build(self) -> ::std::result::Result<crate::operation::update_alert::UpdateAlertInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::update_alert::UpdateAlertInput {
space_id: self.space_id,
alert_id: self.alert_id,
profile_id: self.profile_id,
name: self.name,
description: self.description,
rule: self.rule,
notifications_enabled: self.notifications_enabled,
notification_rules: self.notification_rules,
})
}
}