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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Provides details about one of the following actions that affects or that was taken on a resource:</p>
/// <ul>
/// <li>
/// <p>A remote IP address issued an Amazon Web Services API call</p></li>
/// <li>
/// <p>A DNS request was received</p></li>
/// <li>
/// <p>A remote IP address attempted to connect to an EC2 instance</p></li>
/// <li>
/// <p>A remote IP address attempted a port probe on an EC2 instance</p></li>
/// </ul>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Action {
/// <p>The type of action that was detected. The possible action types are:</p>
/// <ul>
/// <li>
/// <p><code>NETWORK_CONNECTION</code></p></li>
/// <li>
/// <p><code>AWS_API_CALL</code></p></li>
/// <li>
/// <p><code>DNS_REQUEST</code></p></li>
/// <li>
/// <p><code>PORT_PROBE</code></p></li>
/// </ul>
pub action_type: ::std::option::Option<::std::string::String>,
/// <p>Included if <code>ActionType</code> is <code>NETWORK_CONNECTION</code>. Provides details about the network connection that was detected.</p>
pub network_connection_action: ::std::option::Option<crate::types::NetworkConnectionAction>,
/// <p>Included if <code>ActionType</code> is <code>AWS_API_CALL</code>. Provides details about the API call that was detected.</p>
pub aws_api_call_action: ::std::option::Option<crate::types::AwsApiCallAction>,
/// <p>Included if <code>ActionType</code> is <code>DNS_REQUEST</code>. Provides details about the DNS request that was detected.</p>
pub dns_request_action: ::std::option::Option<crate::types::DnsRequestAction>,
/// <p>Included if <code>ActionType</code> is <code>PORT_PROBE</code>. Provides details about the port probe that was detected.</p>
pub port_probe_action: ::std::option::Option<crate::types::PortProbeAction>,
}
impl Action {
/// <p>The type of action that was detected. The possible action types are:</p>
/// <ul>
/// <li>
/// <p><code>NETWORK_CONNECTION</code></p></li>
/// <li>
/// <p><code>AWS_API_CALL</code></p></li>
/// <li>
/// <p><code>DNS_REQUEST</code></p></li>
/// <li>
/// <p><code>PORT_PROBE</code></p></li>
/// </ul>
pub fn action_type(&self) -> ::std::option::Option<&str> {
self.action_type.as_deref()
}
/// <p>Included if <code>ActionType</code> is <code>NETWORK_CONNECTION</code>. Provides details about the network connection that was detected.</p>
pub fn network_connection_action(&self) -> ::std::option::Option<&crate::types::NetworkConnectionAction> {
self.network_connection_action.as_ref()
}
/// <p>Included if <code>ActionType</code> is <code>AWS_API_CALL</code>. Provides details about the API call that was detected.</p>
pub fn aws_api_call_action(&self) -> ::std::option::Option<&crate::types::AwsApiCallAction> {
self.aws_api_call_action.as_ref()
}
/// <p>Included if <code>ActionType</code> is <code>DNS_REQUEST</code>. Provides details about the DNS request that was detected.</p>
pub fn dns_request_action(&self) -> ::std::option::Option<&crate::types::DnsRequestAction> {
self.dns_request_action.as_ref()
}
/// <p>Included if <code>ActionType</code> is <code>PORT_PROBE</code>. Provides details about the port probe that was detected.</p>
pub fn port_probe_action(&self) -> ::std::option::Option<&crate::types::PortProbeAction> {
self.port_probe_action.as_ref()
}
}
impl Action {
/// Creates a new builder-style object to manufacture [`Action`](crate::types::Action).
pub fn builder() -> crate::types::builders::ActionBuilder {
crate::types::builders::ActionBuilder::default()
}
}
/// A builder for [`Action`](crate::types::Action).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ActionBuilder {
pub(crate) action_type: ::std::option::Option<::std::string::String>,
pub(crate) network_connection_action: ::std::option::Option<crate::types::NetworkConnectionAction>,
pub(crate) aws_api_call_action: ::std::option::Option<crate::types::AwsApiCallAction>,
pub(crate) dns_request_action: ::std::option::Option<crate::types::DnsRequestAction>,
pub(crate) port_probe_action: ::std::option::Option<crate::types::PortProbeAction>,
}
impl ActionBuilder {
/// <p>The type of action that was detected. The possible action types are:</p>
/// <ul>
/// <li>
/// <p><code>NETWORK_CONNECTION</code></p></li>
/// <li>
/// <p><code>AWS_API_CALL</code></p></li>
/// <li>
/// <p><code>DNS_REQUEST</code></p></li>
/// <li>
/// <p><code>PORT_PROBE</code></p></li>
/// </ul>
pub fn action_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.action_type = ::std::option::Option::Some(input.into());
self
}
/// <p>The type of action that was detected. The possible action types are:</p>
/// <ul>
/// <li>
/// <p><code>NETWORK_CONNECTION</code></p></li>
/// <li>
/// <p><code>AWS_API_CALL</code></p></li>
/// <li>
/// <p><code>DNS_REQUEST</code></p></li>
/// <li>
/// <p><code>PORT_PROBE</code></p></li>
/// </ul>
pub fn set_action_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.action_type = input;
self
}
/// <p>The type of action that was detected. The possible action types are:</p>
/// <ul>
/// <li>
/// <p><code>NETWORK_CONNECTION</code></p></li>
/// <li>
/// <p><code>AWS_API_CALL</code></p></li>
/// <li>
/// <p><code>DNS_REQUEST</code></p></li>
/// <li>
/// <p><code>PORT_PROBE</code></p></li>
/// </ul>
pub fn get_action_type(&self) -> &::std::option::Option<::std::string::String> {
&self.action_type
}
/// <p>Included if <code>ActionType</code> is <code>NETWORK_CONNECTION</code>. Provides details about the network connection that was detected.</p>
pub fn network_connection_action(mut self, input: crate::types::NetworkConnectionAction) -> Self {
self.network_connection_action = ::std::option::Option::Some(input);
self
}
/// <p>Included if <code>ActionType</code> is <code>NETWORK_CONNECTION</code>. Provides details about the network connection that was detected.</p>
pub fn set_network_connection_action(mut self, input: ::std::option::Option<crate::types::NetworkConnectionAction>) -> Self {
self.network_connection_action = input;
self
}
/// <p>Included if <code>ActionType</code> is <code>NETWORK_CONNECTION</code>. Provides details about the network connection that was detected.</p>
pub fn get_network_connection_action(&self) -> &::std::option::Option<crate::types::NetworkConnectionAction> {
&self.network_connection_action
}
/// <p>Included if <code>ActionType</code> is <code>AWS_API_CALL</code>. Provides details about the API call that was detected.</p>
pub fn aws_api_call_action(mut self, input: crate::types::AwsApiCallAction) -> Self {
self.aws_api_call_action = ::std::option::Option::Some(input);
self
}
/// <p>Included if <code>ActionType</code> is <code>AWS_API_CALL</code>. Provides details about the API call that was detected.</p>
pub fn set_aws_api_call_action(mut self, input: ::std::option::Option<crate::types::AwsApiCallAction>) -> Self {
self.aws_api_call_action = input;
self
}
/// <p>Included if <code>ActionType</code> is <code>AWS_API_CALL</code>. Provides details about the API call that was detected.</p>
pub fn get_aws_api_call_action(&self) -> &::std::option::Option<crate::types::AwsApiCallAction> {
&self.aws_api_call_action
}
/// <p>Included if <code>ActionType</code> is <code>DNS_REQUEST</code>. Provides details about the DNS request that was detected.</p>
pub fn dns_request_action(mut self, input: crate::types::DnsRequestAction) -> Self {
self.dns_request_action = ::std::option::Option::Some(input);
self
}
/// <p>Included if <code>ActionType</code> is <code>DNS_REQUEST</code>. Provides details about the DNS request that was detected.</p>
pub fn set_dns_request_action(mut self, input: ::std::option::Option<crate::types::DnsRequestAction>) -> Self {
self.dns_request_action = input;
self
}
/// <p>Included if <code>ActionType</code> is <code>DNS_REQUEST</code>. Provides details about the DNS request that was detected.</p>
pub fn get_dns_request_action(&self) -> &::std::option::Option<crate::types::DnsRequestAction> {
&self.dns_request_action
}
/// <p>Included if <code>ActionType</code> is <code>PORT_PROBE</code>. Provides details about the port probe that was detected.</p>
pub fn port_probe_action(mut self, input: crate::types::PortProbeAction) -> Self {
self.port_probe_action = ::std::option::Option::Some(input);
self
}
/// <p>Included if <code>ActionType</code> is <code>PORT_PROBE</code>. Provides details about the port probe that was detected.</p>
pub fn set_port_probe_action(mut self, input: ::std::option::Option<crate::types::PortProbeAction>) -> Self {
self.port_probe_action = input;
self
}
/// <p>Included if <code>ActionType</code> is <code>PORT_PROBE</code>. Provides details about the port probe that was detected.</p>
pub fn get_port_probe_action(&self) -> &::std::option::Option<crate::types::PortProbeAction> {
&self.port_probe_action
}
/// Consumes the builder and constructs a [`Action`](crate::types::Action).
pub fn build(self) -> crate::types::Action {
crate::types::Action {
action_type: self.action_type,
network_connection_action: self.network_connection_action,
aws_api_call_action: self.aws_api_call_action,
dns_request_action: self.dns_request_action,
port_probe_action: self.port_probe_action,
}
}
}