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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An Amazon Web Services resource event. Amazon Web Services resource events and metrics are analyzed by DevOps Guru to find anomalous behavior and provide recommendations to improve your operational solutions.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Event {
/// <p>A collection of Amazon Web Services resources supported by DevOps Guru. The two types of Amazon Web Services resource collections supported are Amazon Web Services CloudFormation stacks and Amazon Web Services resources that contain the same Amazon Web Services tag. DevOps Guru can be configured to analyze the Amazon Web Services resources that are defined in the stacks or that are tagged using the same tag <i>key</i>. You can specify up to 500 Amazon Web Services CloudFormation stacks.</p>
pub resource_collection: ::std::option::Option<crate::types::ResourceCollection>,
/// <p>The ID of the event.</p>
pub id: ::std::option::Option<::std::string::String>,
/// <p>A <code>Timestamp</code> that specifies the time the event occurred.</p>
pub time: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The Amazon Web Services source that emitted the event.</p>
pub event_source: ::std::option::Option<::std::string::String>,
/// <p>The name of the event.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>The source, <code>AWS_CLOUD_TRAIL</code> or <code>AWS_CODE_DEPLOY</code>, where DevOps Guru analysis found the event.</p>
pub data_source: ::std::option::Option<crate::types::EventDataSource>,
/// <p>The class of the event. The class specifies what the event is related to, such as an infrastructure change, a deployment, or a schema change.</p>
pub event_class: ::std::option::Option<crate::types::EventClass>,
/// <p>An <code>EventResource</code> object that contains information about the resource that emitted the event.</p>
pub resources: ::std::option::Option<::std::vec::Vec<crate::types::EventResource>>,
}
impl Event {
/// <p>A collection of Amazon Web Services resources supported by DevOps Guru. The two types of Amazon Web Services resource collections supported are Amazon Web Services CloudFormation stacks and Amazon Web Services resources that contain the same Amazon Web Services tag. DevOps Guru can be configured to analyze the Amazon Web Services resources that are defined in the stacks or that are tagged using the same tag <i>key</i>. You can specify up to 500 Amazon Web Services CloudFormation stacks.</p>
pub fn resource_collection(&self) -> ::std::option::Option<&crate::types::ResourceCollection> {
self.resource_collection.as_ref()
}
/// <p>The ID of the event.</p>
pub fn id(&self) -> ::std::option::Option<&str> {
self.id.as_deref()
}
/// <p>A <code>Timestamp</code> that specifies the time the event occurred.</p>
pub fn time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.time.as_ref()
}
/// <p>The Amazon Web Services source that emitted the event.</p>
pub fn event_source(&self) -> ::std::option::Option<&str> {
self.event_source.as_deref()
}
/// <p>The name of the event.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The source, <code>AWS_CLOUD_TRAIL</code> or <code>AWS_CODE_DEPLOY</code>, where DevOps Guru analysis found the event.</p>
pub fn data_source(&self) -> ::std::option::Option<&crate::types::EventDataSource> {
self.data_source.as_ref()
}
/// <p>The class of the event. The class specifies what the event is related to, such as an infrastructure change, a deployment, or a schema change.</p>
pub fn event_class(&self) -> ::std::option::Option<&crate::types::EventClass> {
self.event_class.as_ref()
}
/// <p>An <code>EventResource</code> object that contains information about the resource that emitted the event.</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 `.resources.is_none()`.
pub fn resources(&self) -> &[crate::types::EventResource] {
self.resources.as_deref().unwrap_or_default()
}
}
impl Event {
/// Creates a new builder-style object to manufacture [`Event`](crate::types::Event).
pub fn builder() -> crate::types::builders::EventBuilder {
crate::types::builders::EventBuilder::default()
}
}
/// A builder for [`Event`](crate::types::Event).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EventBuilder {
pub(crate) resource_collection: ::std::option::Option<crate::types::ResourceCollection>,
pub(crate) id: ::std::option::Option<::std::string::String>,
pub(crate) time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) event_source: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) data_source: ::std::option::Option<crate::types::EventDataSource>,
pub(crate) event_class: ::std::option::Option<crate::types::EventClass>,
pub(crate) resources: ::std::option::Option<::std::vec::Vec<crate::types::EventResource>>,
}
impl EventBuilder {
/// <p>A collection of Amazon Web Services resources supported by DevOps Guru. The two types of Amazon Web Services resource collections supported are Amazon Web Services CloudFormation stacks and Amazon Web Services resources that contain the same Amazon Web Services tag. DevOps Guru can be configured to analyze the Amazon Web Services resources that are defined in the stacks or that are tagged using the same tag <i>key</i>. You can specify up to 500 Amazon Web Services CloudFormation stacks.</p>
pub fn resource_collection(mut self, input: crate::types::ResourceCollection) -> Self {
self.resource_collection = ::std::option::Option::Some(input);
self
}
/// <p>A collection of Amazon Web Services resources supported by DevOps Guru. The two types of Amazon Web Services resource collections supported are Amazon Web Services CloudFormation stacks and Amazon Web Services resources that contain the same Amazon Web Services tag. DevOps Guru can be configured to analyze the Amazon Web Services resources that are defined in the stacks or that are tagged using the same tag <i>key</i>. You can specify up to 500 Amazon Web Services CloudFormation stacks.</p>
pub fn set_resource_collection(mut self, input: ::std::option::Option<crate::types::ResourceCollection>) -> Self {
self.resource_collection = input;
self
}
/// <p>A collection of Amazon Web Services resources supported by DevOps Guru. The two types of Amazon Web Services resource collections supported are Amazon Web Services CloudFormation stacks and Amazon Web Services resources that contain the same Amazon Web Services tag. DevOps Guru can be configured to analyze the Amazon Web Services resources that are defined in the stacks or that are tagged using the same tag <i>key</i>. You can specify up to 500 Amazon Web Services CloudFormation stacks.</p>
pub fn get_resource_collection(&self) -> &::std::option::Option<crate::types::ResourceCollection> {
&self.resource_collection
}
/// <p>The ID of the event.</p>
pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the event.</p>
pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The ID of the event.</p>
pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
&self.id
}
/// <p>A <code>Timestamp</code> that specifies the time the event occurred.</p>
pub fn time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.time = ::std::option::Option::Some(input);
self
}
/// <p>A <code>Timestamp</code> that specifies the time the event occurred.</p>
pub fn set_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.time = input;
self
}
/// <p>A <code>Timestamp</code> that specifies the time the event occurred.</p>
pub fn get_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.time
}
/// <p>The Amazon Web Services source that emitted the event.</p>
pub fn event_source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.event_source = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Web Services source that emitted the event.</p>
pub fn set_event_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.event_source = input;
self
}
/// <p>The Amazon Web Services source that emitted the event.</p>
pub fn get_event_source(&self) -> &::std::option::Option<::std::string::String> {
&self.event_source
}
/// <p>The name of the event.</p>
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 event.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the event.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>The source, <code>AWS_CLOUD_TRAIL</code> or <code>AWS_CODE_DEPLOY</code>, where DevOps Guru analysis found the event.</p>
pub fn data_source(mut self, input: crate::types::EventDataSource) -> Self {
self.data_source = ::std::option::Option::Some(input);
self
}
/// <p>The source, <code>AWS_CLOUD_TRAIL</code> or <code>AWS_CODE_DEPLOY</code>, where DevOps Guru analysis found the event.</p>
pub fn set_data_source(mut self, input: ::std::option::Option<crate::types::EventDataSource>) -> Self {
self.data_source = input;
self
}
/// <p>The source, <code>AWS_CLOUD_TRAIL</code> or <code>AWS_CODE_DEPLOY</code>, where DevOps Guru analysis found the event.</p>
pub fn get_data_source(&self) -> &::std::option::Option<crate::types::EventDataSource> {
&self.data_source
}
/// <p>The class of the event. The class specifies what the event is related to, such as an infrastructure change, a deployment, or a schema change.</p>
pub fn event_class(mut self, input: crate::types::EventClass) -> Self {
self.event_class = ::std::option::Option::Some(input);
self
}
/// <p>The class of the event. The class specifies what the event is related to, such as an infrastructure change, a deployment, or a schema change.</p>
pub fn set_event_class(mut self, input: ::std::option::Option<crate::types::EventClass>) -> Self {
self.event_class = input;
self
}
/// <p>The class of the event. The class specifies what the event is related to, such as an infrastructure change, a deployment, or a schema change.</p>
pub fn get_event_class(&self) -> &::std::option::Option<crate::types::EventClass> {
&self.event_class
}
/// Appends an item to `resources`.
///
/// To override the contents of this collection use [`set_resources`](Self::set_resources).
///
/// <p>An <code>EventResource</code> object that contains information about the resource that emitted the event.</p>
pub fn resources(mut self, input: crate::types::EventResource) -> Self {
let mut v = self.resources.unwrap_or_default();
v.push(input);
self.resources = ::std::option::Option::Some(v);
self
}
/// <p>An <code>EventResource</code> object that contains information about the resource that emitted the event.</p>
pub fn set_resources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EventResource>>) -> Self {
self.resources = input;
self
}
/// <p>An <code>EventResource</code> object that contains information about the resource that emitted the event.</p>
pub fn get_resources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EventResource>> {
&self.resources
}
/// Consumes the builder and constructs a [`Event`](crate::types::Event).
pub fn build(self) -> crate::types::Event {
crate::types::Event {
resource_collection: self.resource_collection,
id: self.id,
time: self.time,
event_source: self.event_source,
name: self.name,
data_source: self.data_source,
event_class: self.event_class,
resources: self.resources,
}
}
}