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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Information about a rule.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Rule {
/// <p>The name of the rule.</p>
pub name: ::std::string::String,
/// <p>A unique identifier for the rule.</p>
pub rule_id: ::std::string::String,
/// <p>The Amazon Resource Name (ARN) of the rule.</p>
pub rule_arn: ::std::string::String,
/// <p>The event source to trigger the rule.</p>
pub trigger_event_source: ::std::option::Option<crate::types::RuleTriggerEventSource>,
/// <p>The list of capability tiers associated with the rule. Used for categorizing rules by capability (for example, <code>GenerativeAI</code>).</p>
pub rule_capability_tiers: ::std::option::Option<::std::vec::Vec<crate::types::RuleCapabilityTier>>,
/// <p>The conditions of the rule.</p>
pub function: ::std::string::String,
/// <p>A list of actions to be run when the rule is triggered.</p>
pub actions: ::std::vec::Vec<crate::types::RuleAction>,
/// <p>The publish status of the rule.</p>
pub publish_status: crate::types::RulePublishStatus,
/// <p>The pre-evaluation filters for the rule, that restrict the rule to be applied to only certain resources based on the resource's attributes, such as tags assigned to a contact. The pre-evaluation filters are applied even before rule conditions are evaluated and are used to enforce tag-based-access-control while applying rules.</p>
pub pre_evaluation_filters: ::std::option::Option<crate::types::PreEvaluationFilters>,
/// <p>The timestamp for when the rule was created.</p>
pub created_time: ::aws_smithy_types::DateTime,
/// <p>The timestamp for the when the rule was last updated.</p>
pub last_updated_time: ::aws_smithy_types::DateTime,
/// <p>The Amazon Resource Name (ARN) of the user who last updated the rule.</p>
pub last_updated_by: ::std::string::String,
/// <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl Rule {
/// <p>The name of the rule.</p>
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
/// <p>A unique identifier for the rule.</p>
pub fn rule_id(&self) -> &str {
use std::ops::Deref;
self.rule_id.deref()
}
/// <p>The Amazon Resource Name (ARN) of the rule.</p>
pub fn rule_arn(&self) -> &str {
use std::ops::Deref;
self.rule_arn.deref()
}
/// <p>The event source to trigger the rule.</p>
pub fn trigger_event_source(&self) -> ::std::option::Option<&crate::types::RuleTriggerEventSource> {
self.trigger_event_source.as_ref()
}
/// <p>The list of capability tiers associated with the rule. Used for categorizing rules by capability (for example, <code>GenerativeAI</code>).</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 `.rule_capability_tiers.is_none()`.
pub fn rule_capability_tiers(&self) -> &[crate::types::RuleCapabilityTier] {
self.rule_capability_tiers.as_deref().unwrap_or_default()
}
/// <p>The conditions of the rule.</p>
pub fn function(&self) -> &str {
use std::ops::Deref;
self.function.deref()
}
/// <p>A list of actions to be run when the rule is triggered.</p>
pub fn actions(&self) -> &[crate::types::RuleAction] {
use std::ops::Deref;
self.actions.deref()
}
/// <p>The publish status of the rule.</p>
pub fn publish_status(&self) -> &crate::types::RulePublishStatus {
&self.publish_status
}
/// <p>The pre-evaluation filters for the rule, that restrict the rule to be applied to only certain resources based on the resource's attributes, such as tags assigned to a contact. The pre-evaluation filters are applied even before rule conditions are evaluated and are used to enforce tag-based-access-control while applying rules.</p>
pub fn pre_evaluation_filters(&self) -> ::std::option::Option<&crate::types::PreEvaluationFilters> {
self.pre_evaluation_filters.as_ref()
}
/// <p>The timestamp for when the rule was created.</p>
pub fn created_time(&self) -> &::aws_smithy_types::DateTime {
&self.created_time
}
/// <p>The timestamp for the when the rule was last updated.</p>
pub fn last_updated_time(&self) -> &::aws_smithy_types::DateTime {
&self.last_updated_time
}
/// <p>The Amazon Resource Name (ARN) of the user who last updated the rule.</p>
pub fn last_updated_by(&self) -> &str {
use std::ops::Deref;
self.last_updated_by.deref()
}
/// <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.tags.as_ref()
}
}
impl Rule {
/// Creates a new builder-style object to manufacture [`Rule`](crate::types::Rule).
pub fn builder() -> crate::types::builders::RuleBuilder {
crate::types::builders::RuleBuilder::default()
}
}
/// A builder for [`Rule`](crate::types::Rule).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RuleBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) rule_id: ::std::option::Option<::std::string::String>,
pub(crate) rule_arn: ::std::option::Option<::std::string::String>,
pub(crate) trigger_event_source: ::std::option::Option<crate::types::RuleTriggerEventSource>,
pub(crate) rule_capability_tiers: ::std::option::Option<::std::vec::Vec<crate::types::RuleCapabilityTier>>,
pub(crate) function: ::std::option::Option<::std::string::String>,
pub(crate) actions: ::std::option::Option<::std::vec::Vec<crate::types::RuleAction>>,
pub(crate) publish_status: ::std::option::Option<crate::types::RulePublishStatus>,
pub(crate) pre_evaluation_filters: ::std::option::Option<crate::types::PreEvaluationFilters>,
pub(crate) created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) last_updated_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) last_updated_by: ::std::option::Option<::std::string::String>,
pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl RuleBuilder {
/// <p>The name of the rule.</p>
/// This field is required.
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the rule.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the rule.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>A unique identifier for the rule.</p>
/// This field is required.
pub fn rule_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.rule_id = ::std::option::Option::Some(input.into());
self
}
/// <p>A unique identifier for the rule.</p>
pub fn set_rule_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.rule_id = input;
self
}
/// <p>A unique identifier for the rule.</p>
pub fn get_rule_id(&self) -> &::std::option::Option<::std::string::String> {
&self.rule_id
}
/// <p>The Amazon Resource Name (ARN) of the rule.</p>
/// This field is required.
pub fn rule_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.rule_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the rule.</p>
pub fn set_rule_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.rule_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the rule.</p>
pub fn get_rule_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.rule_arn
}
/// <p>The event source to trigger the rule.</p>
/// This field is required.
pub fn trigger_event_source(mut self, input: crate::types::RuleTriggerEventSource) -> Self {
self.trigger_event_source = ::std::option::Option::Some(input);
self
}
/// <p>The event source to trigger the rule.</p>
pub fn set_trigger_event_source(mut self, input: ::std::option::Option<crate::types::RuleTriggerEventSource>) -> Self {
self.trigger_event_source = input;
self
}
/// <p>The event source to trigger the rule.</p>
pub fn get_trigger_event_source(&self) -> &::std::option::Option<crate::types::RuleTriggerEventSource> {
&self.trigger_event_source
}
/// Appends an item to `rule_capability_tiers`.
///
/// To override the contents of this collection use [`set_rule_capability_tiers`](Self::set_rule_capability_tiers).
///
/// <p>The list of capability tiers associated with the rule. Used for categorizing rules by capability (for example, <code>GenerativeAI</code>).</p>
pub fn rule_capability_tiers(mut self, input: crate::types::RuleCapabilityTier) -> Self {
let mut v = self.rule_capability_tiers.unwrap_or_default();
v.push(input);
self.rule_capability_tiers = ::std::option::Option::Some(v);
self
}
/// <p>The list of capability tiers associated with the rule. Used for categorizing rules by capability (for example, <code>GenerativeAI</code>).</p>
pub fn set_rule_capability_tiers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RuleCapabilityTier>>) -> Self {
self.rule_capability_tiers = input;
self
}
/// <p>The list of capability tiers associated with the rule. Used for categorizing rules by capability (for example, <code>GenerativeAI</code>).</p>
pub fn get_rule_capability_tiers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RuleCapabilityTier>> {
&self.rule_capability_tiers
}
/// <p>The conditions of the rule.</p>
/// This field is required.
pub fn function(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.function = ::std::option::Option::Some(input.into());
self
}
/// <p>The conditions of the rule.</p>
pub fn set_function(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.function = input;
self
}
/// <p>The conditions of the rule.</p>
pub fn get_function(&self) -> &::std::option::Option<::std::string::String> {
&self.function
}
/// Appends an item to `actions`.
///
/// To override the contents of this collection use [`set_actions`](Self::set_actions).
///
/// <p>A list of actions to be run when the rule is triggered.</p>
pub fn actions(mut self, input: crate::types::RuleAction) -> Self {
let mut v = self.actions.unwrap_or_default();
v.push(input);
self.actions = ::std::option::Option::Some(v);
self
}
/// <p>A list of actions to be run when the rule is triggered.</p>
pub fn set_actions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RuleAction>>) -> Self {
self.actions = input;
self
}
/// <p>A list of actions to be run when the rule is triggered.</p>
pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RuleAction>> {
&self.actions
}
/// <p>The publish status of the rule.</p>
/// This field is required.
pub fn publish_status(mut self, input: crate::types::RulePublishStatus) -> Self {
self.publish_status = ::std::option::Option::Some(input);
self
}
/// <p>The publish status of the rule.</p>
pub fn set_publish_status(mut self, input: ::std::option::Option<crate::types::RulePublishStatus>) -> Self {
self.publish_status = input;
self
}
/// <p>The publish status of the rule.</p>
pub fn get_publish_status(&self) -> &::std::option::Option<crate::types::RulePublishStatus> {
&self.publish_status
}
/// <p>The pre-evaluation filters for the rule, that restrict the rule to be applied to only certain resources based on the resource's attributes, such as tags assigned to a contact. The pre-evaluation filters are applied even before rule conditions are evaluated and are used to enforce tag-based-access-control while applying rules.</p>
pub fn pre_evaluation_filters(mut self, input: crate::types::PreEvaluationFilters) -> Self {
self.pre_evaluation_filters = ::std::option::Option::Some(input);
self
}
/// <p>The pre-evaluation filters for the rule, that restrict the rule to be applied to only certain resources based on the resource's attributes, such as tags assigned to a contact. The pre-evaluation filters are applied even before rule conditions are evaluated and are used to enforce tag-based-access-control while applying rules.</p>
pub fn set_pre_evaluation_filters(mut self, input: ::std::option::Option<crate::types::PreEvaluationFilters>) -> Self {
self.pre_evaluation_filters = input;
self
}
/// <p>The pre-evaluation filters for the rule, that restrict the rule to be applied to only certain resources based on the resource's attributes, such as tags assigned to a contact. The pre-evaluation filters are applied even before rule conditions are evaluated and are used to enforce tag-based-access-control while applying rules.</p>
pub fn get_pre_evaluation_filters(&self) -> &::std::option::Option<crate::types::PreEvaluationFilters> {
&self.pre_evaluation_filters
}
/// <p>The timestamp for when the rule was created.</p>
/// This field is required.
pub fn created_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_time = ::std::option::Option::Some(input);
self
}
/// <p>The timestamp for when the rule was created.</p>
pub fn set_created_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_time = input;
self
}
/// <p>The timestamp for when the rule was created.</p>
pub fn get_created_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_time
}
/// <p>The timestamp for the when the rule was last updated.</p>
/// This field is required.
pub fn last_updated_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.last_updated_time = ::std::option::Option::Some(input);
self
}
/// <p>The timestamp for the when the rule was last updated.</p>
pub fn set_last_updated_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.last_updated_time = input;
self
}
/// <p>The timestamp for the when the rule was last updated.</p>
pub fn get_last_updated_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.last_updated_time
}
/// <p>The Amazon Resource Name (ARN) of the user who last updated the rule.</p>
/// This field is required.
pub fn last_updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.last_updated_by = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the user who last updated the rule.</p>
pub fn set_last_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.last_updated_by = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the user who last updated the rule.</p>
pub fn get_last_updated_by(&self) -> &::std::option::Option<::std::string::String> {
&self.last_updated_by
}
/// Adds a key-value pair to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = ::std::option::Option::Some(hash_map);
self
}
/// <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.tags = input;
self
}
/// <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.tags
}
/// Consumes the builder and constructs a [`Rule`](crate::types::Rule).
/// This method will fail if any of the following fields are not set:
/// - [`name`](crate::types::builders::RuleBuilder::name)
/// - [`rule_id`](crate::types::builders::RuleBuilder::rule_id)
/// - [`rule_arn`](crate::types::builders::RuleBuilder::rule_arn)
/// - [`function`](crate::types::builders::RuleBuilder::function)
/// - [`actions`](crate::types::builders::RuleBuilder::actions)
/// - [`publish_status`](crate::types::builders::RuleBuilder::publish_status)
/// - [`created_time`](crate::types::builders::RuleBuilder::created_time)
/// - [`last_updated_time`](crate::types::builders::RuleBuilder::last_updated_time)
/// - [`last_updated_by`](crate::types::builders::RuleBuilder::last_updated_by)
pub fn build(self) -> ::std::result::Result<crate::types::Rule, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Rule {
name: self.name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"name",
"name was not specified but it is required when building Rule",
)
})?,
rule_id: self.rule_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"rule_id",
"rule_id was not specified but it is required when building Rule",
)
})?,
rule_arn: self.rule_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"rule_arn",
"rule_arn was not specified but it is required when building Rule",
)
})?,
trigger_event_source: self.trigger_event_source,
rule_capability_tiers: self.rule_capability_tiers,
function: self.function.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"function",
"function was not specified but it is required when building Rule",
)
})?,
actions: self.actions.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"actions",
"actions was not specified but it is required when building Rule",
)
})?,
publish_status: self.publish_status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"publish_status",
"publish_status was not specified but it is required when building Rule",
)
})?,
pre_evaluation_filters: self.pre_evaluation_filters,
created_time: self.created_time.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"created_time",
"created_time was not specified but it is required when building Rule",
)
})?,
last_updated_time: self.last_updated_time.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"last_updated_time",
"last_updated_time was not specified but it is required when building Rule",
)
})?,
last_updated_by: self.last_updated_by.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"last_updated_by",
"last_updated_by was not specified but it is required when building Rule",
)
})?,
tags: self.tags,
})
}
}