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
// 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 GetEventRuleOutput {
/// <p>The ARN of the resource.</p>
pub arn: ::std::string::String,
/// <p>The ARN of a <code>NotificationConfiguration</code>.</p>
pub notification_configuration_arn: ::std::string::String,
/// <p>The date when the <code>EventRule</code> was created.</p>
pub creation_time: ::aws_smithy_types::DateTime,
/// <p>The matched event source.</p>
/// <p>Must match one of the valid EventBridge sources. Only Amazon Web Services service sourced events are supported. For example, <code>aws.ec2</code> and <code>aws.cloudwatch</code>. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level">Event delivery from Amazon Web Services services</a> in the <i>Amazon EventBridge User Guide</i>.</p>
pub source: ::std::string::String,
/// <p>The event type to match.</p>
/// <p>Must match one of the valid Amazon EventBridge event types. For example, EC2 Instance State-change Notification and Amazon CloudWatch Alarm State Change. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level">Event delivery from Amazon Web Services services</a> in the <i>Amazon EventBridge User Guide</i>.</p>
pub event_type: ::std::string::String,
/// <p>An additional event pattern used to further filter the events this <code>EventRule</code> receives.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html">Amazon EventBridge event patterns</a> in the <i>Amazon EventBridge User Guide.</i></p>
pub event_pattern: ::std::string::String,
/// <p>A list of Amazon Web Services Regions that send events to this <code>EventRule</code>.</p>
pub regions: ::std::vec::Vec<::std::string::String>,
/// <p>A list of managed rules from EventBridge that are associated with this <code>EventRule</code>.</p><note>
/// <p>These are created by User Notifications within your account so this <code>EventRule</code> functions.</p>
/// </note>
pub managed_rules: ::std::vec::Vec<::std::string::String>,
/// <p>A list of an <code>EventRule</code>'s status by Region. Regions are mapped to <code>EventRuleStatusSummary</code>.</p>
pub status_summary_by_region: ::std::collections::HashMap<::std::string::String, crate::types::EventRuleStatusSummary>,
_request_id: Option<String>,
}
impl GetEventRuleOutput {
/// <p>The ARN of the resource.</p>
pub fn arn(&self) -> &str {
use std::ops::Deref;
self.arn.deref()
}
/// <p>The ARN of a <code>NotificationConfiguration</code>.</p>
pub fn notification_configuration_arn(&self) -> &str {
use std::ops::Deref;
self.notification_configuration_arn.deref()
}
/// <p>The date when the <code>EventRule</code> was created.</p>
pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
&self.creation_time
}
/// <p>The matched event source.</p>
/// <p>Must match one of the valid EventBridge sources. Only Amazon Web Services service sourced events are supported. For example, <code>aws.ec2</code> and <code>aws.cloudwatch</code>. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level">Event delivery from Amazon Web Services services</a> in the <i>Amazon EventBridge User Guide</i>.</p>
pub fn source(&self) -> &str {
use std::ops::Deref;
self.source.deref()
}
/// <p>The event type to match.</p>
/// <p>Must match one of the valid Amazon EventBridge event types. For example, EC2 Instance State-change Notification and Amazon CloudWatch Alarm State Change. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level">Event delivery from Amazon Web Services services</a> in the <i>Amazon EventBridge User Guide</i>.</p>
pub fn event_type(&self) -> &str {
use std::ops::Deref;
self.event_type.deref()
}
/// <p>An additional event pattern used to further filter the events this <code>EventRule</code> receives.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html">Amazon EventBridge event patterns</a> in the <i>Amazon EventBridge User Guide.</i></p>
pub fn event_pattern(&self) -> &str {
use std::ops::Deref;
self.event_pattern.deref()
}
/// <p>A list of Amazon Web Services Regions that send events to this <code>EventRule</code>.</p>
pub fn regions(&self) -> &[::std::string::String] {
use std::ops::Deref;
self.regions.deref()
}
/// <p>A list of managed rules from EventBridge that are associated with this <code>EventRule</code>.</p><note>
/// <p>These are created by User Notifications within your account so this <code>EventRule</code> functions.</p>
/// </note>
pub fn managed_rules(&self) -> &[::std::string::String] {
use std::ops::Deref;
self.managed_rules.deref()
}
/// <p>A list of an <code>EventRule</code>'s status by Region. Regions are mapped to <code>EventRuleStatusSummary</code>.</p>
pub fn status_summary_by_region(&self) -> &::std::collections::HashMap<::std::string::String, crate::types::EventRuleStatusSummary> {
&self.status_summary_by_region
}
}
impl ::aws_types::request_id::RequestId for GetEventRuleOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetEventRuleOutput {
/// Creates a new builder-style object to manufacture [`GetEventRuleOutput`](crate::operation::get_event_rule::GetEventRuleOutput).
pub fn builder() -> crate::operation::get_event_rule::builders::GetEventRuleOutputBuilder {
crate::operation::get_event_rule::builders::GetEventRuleOutputBuilder::default()
}
}
/// A builder for [`GetEventRuleOutput`](crate::operation::get_event_rule::GetEventRuleOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetEventRuleOutputBuilder {
pub(crate) arn: ::std::option::Option<::std::string::String>,
pub(crate) notification_configuration_arn: ::std::option::Option<::std::string::String>,
pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) source: ::std::option::Option<::std::string::String>,
pub(crate) event_type: ::std::option::Option<::std::string::String>,
pub(crate) event_pattern: ::std::option::Option<::std::string::String>,
pub(crate) regions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) managed_rules: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) status_summary_by_region:
::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::EventRuleStatusSummary>>,
_request_id: Option<String>,
}
impl GetEventRuleOutputBuilder {
/// <p>The ARN of the resource.</p>
/// This field is required.
pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The ARN of the resource.</p>
pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.arn = input;
self
}
/// <p>The ARN of the resource.</p>
pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.arn
}
/// <p>The ARN of a <code>NotificationConfiguration</code>.</p>
/// This field is required.
pub fn notification_configuration_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.notification_configuration_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The ARN of a <code>NotificationConfiguration</code>.</p>
pub fn set_notification_configuration_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.notification_configuration_arn = input;
self
}
/// <p>The ARN of a <code>NotificationConfiguration</code>.</p>
pub fn get_notification_configuration_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.notification_configuration_arn
}
/// <p>The date when the <code>EventRule</code> was created.</p>
/// This field is required.
pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.creation_time = ::std::option::Option::Some(input);
self
}
/// <p>The date when the <code>EventRule</code> was created.</p>
pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.creation_time = input;
self
}
/// <p>The date when the <code>EventRule</code> was created.</p>
pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.creation_time
}
/// <p>The matched event source.</p>
/// <p>Must match one of the valid EventBridge sources. Only Amazon Web Services service sourced events are supported. For example, <code>aws.ec2</code> and <code>aws.cloudwatch</code>. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level">Event delivery from Amazon Web Services services</a> in the <i>Amazon EventBridge User Guide</i>.</p>
/// This field is required.
pub fn source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.source = ::std::option::Option::Some(input.into());
self
}
/// <p>The matched event source.</p>
/// <p>Must match one of the valid EventBridge sources. Only Amazon Web Services service sourced events are supported. For example, <code>aws.ec2</code> and <code>aws.cloudwatch</code>. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level">Event delivery from Amazon Web Services services</a> in the <i>Amazon EventBridge User Guide</i>.</p>
pub fn set_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.source = input;
self
}
/// <p>The matched event source.</p>
/// <p>Must match one of the valid EventBridge sources. Only Amazon Web Services service sourced events are supported. For example, <code>aws.ec2</code> and <code>aws.cloudwatch</code>. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level">Event delivery from Amazon Web Services services</a> in the <i>Amazon EventBridge User Guide</i>.</p>
pub fn get_source(&self) -> &::std::option::Option<::std::string::String> {
&self.source
}
/// <p>The event type to match.</p>
/// <p>Must match one of the valid Amazon EventBridge event types. For example, EC2 Instance State-change Notification and Amazon CloudWatch Alarm State Change. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level">Event delivery from Amazon Web Services services</a> in the <i>Amazon EventBridge User Guide</i>.</p>
/// This field is required.
pub fn event_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.event_type = ::std::option::Option::Some(input.into());
self
}
/// <p>The event type to match.</p>
/// <p>Must match one of the valid Amazon EventBridge event types. For example, EC2 Instance State-change Notification and Amazon CloudWatch Alarm State Change. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level">Event delivery from Amazon Web Services services</a> in the <i>Amazon EventBridge User Guide</i>.</p>
pub fn set_event_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.event_type = input;
self
}
/// <p>The event type to match.</p>
/// <p>Must match one of the valid Amazon EventBridge event types. For example, EC2 Instance State-change Notification and Amazon CloudWatch Alarm State Change. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level">Event delivery from Amazon Web Services services</a> in the <i>Amazon EventBridge User Guide</i>.</p>
pub fn get_event_type(&self) -> &::std::option::Option<::std::string::String> {
&self.event_type
}
/// <p>An additional event pattern used to further filter the events this <code>EventRule</code> receives.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html">Amazon EventBridge event patterns</a> in the <i>Amazon EventBridge User Guide.</i></p>
/// This field is required.
pub fn event_pattern(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.event_pattern = ::std::option::Option::Some(input.into());
self
}
/// <p>An additional event pattern used to further filter the events this <code>EventRule</code> receives.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html">Amazon EventBridge event patterns</a> in the <i>Amazon EventBridge User Guide.</i></p>
pub fn set_event_pattern(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.event_pattern = input;
self
}
/// <p>An additional event pattern used to further filter the events this <code>EventRule</code> receives.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html">Amazon EventBridge event patterns</a> in the <i>Amazon EventBridge User Guide.</i></p>
pub fn get_event_pattern(&self) -> &::std::option::Option<::std::string::String> {
&self.event_pattern
}
/// Appends an item to `regions`.
///
/// To override the contents of this collection use [`set_regions`](Self::set_regions).
///
/// <p>A list of Amazon Web Services Regions that send events to this <code>EventRule</code>.</p>
pub fn regions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.regions.unwrap_or_default();
v.push(input.into());
self.regions = ::std::option::Option::Some(v);
self
}
/// <p>A list of Amazon Web Services Regions that send events to this <code>EventRule</code>.</p>
pub fn set_regions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.regions = input;
self
}
/// <p>A list of Amazon Web Services Regions that send events to this <code>EventRule</code>.</p>
pub fn get_regions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.regions
}
/// Appends an item to `managed_rules`.
///
/// To override the contents of this collection use [`set_managed_rules`](Self::set_managed_rules).
///
/// <p>A list of managed rules from EventBridge that are associated with this <code>EventRule</code>.</p><note>
/// <p>These are created by User Notifications within your account so this <code>EventRule</code> functions.</p>
/// </note>
pub fn managed_rules(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.managed_rules.unwrap_or_default();
v.push(input.into());
self.managed_rules = ::std::option::Option::Some(v);
self
}
/// <p>A list of managed rules from EventBridge that are associated with this <code>EventRule</code>.</p><note>
/// <p>These are created by User Notifications within your account so this <code>EventRule</code> functions.</p>
/// </note>
pub fn set_managed_rules(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.managed_rules = input;
self
}
/// <p>A list of managed rules from EventBridge that are associated with this <code>EventRule</code>.</p><note>
/// <p>These are created by User Notifications within your account so this <code>EventRule</code> functions.</p>
/// </note>
pub fn get_managed_rules(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.managed_rules
}
/// Adds a key-value pair to `status_summary_by_region`.
///
/// To override the contents of this collection use [`set_status_summary_by_region`](Self::set_status_summary_by_region).
///
/// <p>A list of an <code>EventRule</code>'s status by Region. Regions are mapped to <code>EventRuleStatusSummary</code>.</p>
pub fn status_summary_by_region(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::EventRuleStatusSummary) -> Self {
let mut hash_map = self.status_summary_by_region.unwrap_or_default();
hash_map.insert(k.into(), v);
self.status_summary_by_region = ::std::option::Option::Some(hash_map);
self
}
/// <p>A list of an <code>EventRule</code>'s status by Region. Regions are mapped to <code>EventRuleStatusSummary</code>.</p>
pub fn set_status_summary_by_region(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::EventRuleStatusSummary>>,
) -> Self {
self.status_summary_by_region = input;
self
}
/// <p>A list of an <code>EventRule</code>'s status by Region. Regions are mapped to <code>EventRuleStatusSummary</code>.</p>
pub fn get_status_summary_by_region(
&self,
) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::EventRuleStatusSummary>> {
&self.status_summary_by_region
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`GetEventRuleOutput`](crate::operation::get_event_rule::GetEventRuleOutput).
/// This method will fail if any of the following fields are not set:
/// - [`arn`](crate::operation::get_event_rule::builders::GetEventRuleOutputBuilder::arn)
/// - [`notification_configuration_arn`](crate::operation::get_event_rule::builders::GetEventRuleOutputBuilder::notification_configuration_arn)
/// - [`creation_time`](crate::operation::get_event_rule::builders::GetEventRuleOutputBuilder::creation_time)
/// - [`source`](crate::operation::get_event_rule::builders::GetEventRuleOutputBuilder::source)
/// - [`event_type`](crate::operation::get_event_rule::builders::GetEventRuleOutputBuilder::event_type)
/// - [`event_pattern`](crate::operation::get_event_rule::builders::GetEventRuleOutputBuilder::event_pattern)
/// - [`regions`](crate::operation::get_event_rule::builders::GetEventRuleOutputBuilder::regions)
/// - [`managed_rules`](crate::operation::get_event_rule::builders::GetEventRuleOutputBuilder::managed_rules)
/// - [`status_summary_by_region`](crate::operation::get_event_rule::builders::GetEventRuleOutputBuilder::status_summary_by_region)
pub fn build(
self,
) -> ::std::result::Result<crate::operation::get_event_rule::GetEventRuleOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_event_rule::GetEventRuleOutput {
arn: self.arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"arn",
"arn was not specified but it is required when building GetEventRuleOutput",
)
})?,
notification_configuration_arn: self.notification_configuration_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"notification_configuration_arn",
"notification_configuration_arn was not specified but it is required when building GetEventRuleOutput",
)
})?,
creation_time: self.creation_time.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"creation_time",
"creation_time was not specified but it is required when building GetEventRuleOutput",
)
})?,
source: self.source.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"source",
"source was not specified but it is required when building GetEventRuleOutput",
)
})?,
event_type: self.event_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"event_type",
"event_type was not specified but it is required when building GetEventRuleOutput",
)
})?,
event_pattern: self.event_pattern.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"event_pattern",
"event_pattern was not specified but it is required when building GetEventRuleOutput",
)
})?,
regions: self.regions.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"regions",
"regions was not specified but it is required when building GetEventRuleOutput",
)
})?,
managed_rules: self.managed_rules.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"managed_rules",
"managed_rules was not specified but it is required when building GetEventRuleOutput",
)
})?,
status_summary_by_region: self.status_summary_by_region.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"status_summary_by_region",
"status_summary_by_region was not specified but it is required when building GetEventRuleOutput",
)
})?,
_request_id: self._request_id,
})
}
}