aws_sdk_securityhub/types/_aws_api_call_action.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Provided if <code>ActionType</code> is <code>AWS_API_CALL</code>. It provides details about the API call that was detected.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AwsApiCallAction {
7 /// <p>The name of the API method that was issued.</p>
8 /// <p>Length Constraints: 128.</p>
9 pub api: ::std::option::Option<::std::string::String>,
10 /// <p>The name of the Amazon Web Services service that the API method belongs to.</p>
11 /// <p>Length Constraints: 128.</p>
12 pub service_name: ::std::option::Option<::std::string::String>,
13 /// <p>Indicates whether the API call originated from a remote IP address (<code>remoteip</code>) or from a DNS domain (<code>domain</code>).</p>
14 pub caller_type: ::std::option::Option<::std::string::String>,
15 /// <p>Provided if <code>CallerType</code> is <code>remoteip</code>. Provides information about the remote IP address that the API call originated from.</p>
16 pub remote_ip_details: ::std::option::Option<crate::types::ActionRemoteIpDetails>,
17 /// <p>Provided if <code>CallerType</code> is <code>domain</code>. Provides information about the DNS domain that the API call originated from.</p>
18 pub domain_details: ::std::option::Option<crate::types::AwsApiCallActionDomainDetails>,
19 /// <p>Identifies the resources that were affected by the API call.</p>
20 pub affected_resources: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
21 /// <p>A timestamp that indicates when the API call was first observed.</p>
22 /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
23 pub first_seen: ::std::option::Option<::std::string::String>,
24 /// <p>A timestamp that indicates when the API call was most recently observed.</p>
25 /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
26 pub last_seen: ::std::option::Option<::std::string::String>,
27}
28impl AwsApiCallAction {
29 /// <p>The name of the API method that was issued.</p>
30 /// <p>Length Constraints: 128.</p>
31 pub fn api(&self) -> ::std::option::Option<&str> {
32 self.api.as_deref()
33 }
34 /// <p>The name of the Amazon Web Services service that the API method belongs to.</p>
35 /// <p>Length Constraints: 128.</p>
36 pub fn service_name(&self) -> ::std::option::Option<&str> {
37 self.service_name.as_deref()
38 }
39 /// <p>Indicates whether the API call originated from a remote IP address (<code>remoteip</code>) or from a DNS domain (<code>domain</code>).</p>
40 pub fn caller_type(&self) -> ::std::option::Option<&str> {
41 self.caller_type.as_deref()
42 }
43 /// <p>Provided if <code>CallerType</code> is <code>remoteip</code>. Provides information about the remote IP address that the API call originated from.</p>
44 pub fn remote_ip_details(&self) -> ::std::option::Option<&crate::types::ActionRemoteIpDetails> {
45 self.remote_ip_details.as_ref()
46 }
47 /// <p>Provided if <code>CallerType</code> is <code>domain</code>. Provides information about the DNS domain that the API call originated from.</p>
48 pub fn domain_details(&self) -> ::std::option::Option<&crate::types::AwsApiCallActionDomainDetails> {
49 self.domain_details.as_ref()
50 }
51 /// <p>Identifies the resources that were affected by the API call.</p>
52 pub fn affected_resources(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
53 self.affected_resources.as_ref()
54 }
55 /// <p>A timestamp that indicates when the API call was first observed.</p>
56 /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
57 pub fn first_seen(&self) -> ::std::option::Option<&str> {
58 self.first_seen.as_deref()
59 }
60 /// <p>A timestamp that indicates when the API call was most recently observed.</p>
61 /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
62 pub fn last_seen(&self) -> ::std::option::Option<&str> {
63 self.last_seen.as_deref()
64 }
65}
66impl AwsApiCallAction {
67 /// Creates a new builder-style object to manufacture [`AwsApiCallAction`](crate::types::AwsApiCallAction).
68 pub fn builder() -> crate::types::builders::AwsApiCallActionBuilder {
69 crate::types::builders::AwsApiCallActionBuilder::default()
70 }
71}
72
73/// A builder for [`AwsApiCallAction`](crate::types::AwsApiCallAction).
74#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
75#[non_exhaustive]
76pub struct AwsApiCallActionBuilder {
77 pub(crate) api: ::std::option::Option<::std::string::String>,
78 pub(crate) service_name: ::std::option::Option<::std::string::String>,
79 pub(crate) caller_type: ::std::option::Option<::std::string::String>,
80 pub(crate) remote_ip_details: ::std::option::Option<crate::types::ActionRemoteIpDetails>,
81 pub(crate) domain_details: ::std::option::Option<crate::types::AwsApiCallActionDomainDetails>,
82 pub(crate) affected_resources: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
83 pub(crate) first_seen: ::std::option::Option<::std::string::String>,
84 pub(crate) last_seen: ::std::option::Option<::std::string::String>,
85}
86impl AwsApiCallActionBuilder {
87 /// <p>The name of the API method that was issued.</p>
88 /// <p>Length Constraints: 128.</p>
89 pub fn api(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90 self.api = ::std::option::Option::Some(input.into());
91 self
92 }
93 /// <p>The name of the API method that was issued.</p>
94 /// <p>Length Constraints: 128.</p>
95 pub fn set_api(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96 self.api = input;
97 self
98 }
99 /// <p>The name of the API method that was issued.</p>
100 /// <p>Length Constraints: 128.</p>
101 pub fn get_api(&self) -> &::std::option::Option<::std::string::String> {
102 &self.api
103 }
104 /// <p>The name of the Amazon Web Services service that the API method belongs to.</p>
105 /// <p>Length Constraints: 128.</p>
106 pub fn service_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107 self.service_name = ::std::option::Option::Some(input.into());
108 self
109 }
110 /// <p>The name of the Amazon Web Services service that the API method belongs to.</p>
111 /// <p>Length Constraints: 128.</p>
112 pub fn set_service_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113 self.service_name = input;
114 self
115 }
116 /// <p>The name of the Amazon Web Services service that the API method belongs to.</p>
117 /// <p>Length Constraints: 128.</p>
118 pub fn get_service_name(&self) -> &::std::option::Option<::std::string::String> {
119 &self.service_name
120 }
121 /// <p>Indicates whether the API call originated from a remote IP address (<code>remoteip</code>) or from a DNS domain (<code>domain</code>).</p>
122 pub fn caller_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123 self.caller_type = ::std::option::Option::Some(input.into());
124 self
125 }
126 /// <p>Indicates whether the API call originated from a remote IP address (<code>remoteip</code>) or from a DNS domain (<code>domain</code>).</p>
127 pub fn set_caller_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128 self.caller_type = input;
129 self
130 }
131 /// <p>Indicates whether the API call originated from a remote IP address (<code>remoteip</code>) or from a DNS domain (<code>domain</code>).</p>
132 pub fn get_caller_type(&self) -> &::std::option::Option<::std::string::String> {
133 &self.caller_type
134 }
135 /// <p>Provided if <code>CallerType</code> is <code>remoteip</code>. Provides information about the remote IP address that the API call originated from.</p>
136 pub fn remote_ip_details(mut self, input: crate::types::ActionRemoteIpDetails) -> Self {
137 self.remote_ip_details = ::std::option::Option::Some(input);
138 self
139 }
140 /// <p>Provided if <code>CallerType</code> is <code>remoteip</code>. Provides information about the remote IP address that the API call originated from.</p>
141 pub fn set_remote_ip_details(mut self, input: ::std::option::Option<crate::types::ActionRemoteIpDetails>) -> Self {
142 self.remote_ip_details = input;
143 self
144 }
145 /// <p>Provided if <code>CallerType</code> is <code>remoteip</code>. Provides information about the remote IP address that the API call originated from.</p>
146 pub fn get_remote_ip_details(&self) -> &::std::option::Option<crate::types::ActionRemoteIpDetails> {
147 &self.remote_ip_details
148 }
149 /// <p>Provided if <code>CallerType</code> is <code>domain</code>. Provides information about the DNS domain that the API call originated from.</p>
150 pub fn domain_details(mut self, input: crate::types::AwsApiCallActionDomainDetails) -> Self {
151 self.domain_details = ::std::option::Option::Some(input);
152 self
153 }
154 /// <p>Provided if <code>CallerType</code> is <code>domain</code>. Provides information about the DNS domain that the API call originated from.</p>
155 pub fn set_domain_details(mut self, input: ::std::option::Option<crate::types::AwsApiCallActionDomainDetails>) -> Self {
156 self.domain_details = input;
157 self
158 }
159 /// <p>Provided if <code>CallerType</code> is <code>domain</code>. Provides information about the DNS domain that the API call originated from.</p>
160 pub fn get_domain_details(&self) -> &::std::option::Option<crate::types::AwsApiCallActionDomainDetails> {
161 &self.domain_details
162 }
163 /// Adds a key-value pair to `affected_resources`.
164 ///
165 /// To override the contents of this collection use [`set_affected_resources`](Self::set_affected_resources).
166 ///
167 /// <p>Identifies the resources that were affected by the API call.</p>
168 pub fn affected_resources(
169 mut self,
170 k: impl ::std::convert::Into<::std::string::String>,
171 v: impl ::std::convert::Into<::std::string::String>,
172 ) -> Self {
173 let mut hash_map = self.affected_resources.unwrap_or_default();
174 hash_map.insert(k.into(), v.into());
175 self.affected_resources = ::std::option::Option::Some(hash_map);
176 self
177 }
178 /// <p>Identifies the resources that were affected by the API call.</p>
179 pub fn set_affected_resources(
180 mut self,
181 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
182 ) -> Self {
183 self.affected_resources = input;
184 self
185 }
186 /// <p>Identifies the resources that were affected by the API call.</p>
187 pub fn get_affected_resources(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
188 &self.affected_resources
189 }
190 /// <p>A timestamp that indicates when the API call was first observed.</p>
191 /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
192 pub fn first_seen(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193 self.first_seen = ::std::option::Option::Some(input.into());
194 self
195 }
196 /// <p>A timestamp that indicates when the API call was first observed.</p>
197 /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
198 pub fn set_first_seen(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
199 self.first_seen = input;
200 self
201 }
202 /// <p>A timestamp that indicates when the API call was first observed.</p>
203 /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
204 pub fn get_first_seen(&self) -> &::std::option::Option<::std::string::String> {
205 &self.first_seen
206 }
207 /// <p>A timestamp that indicates when the API call was most recently observed.</p>
208 /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
209 pub fn last_seen(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
210 self.last_seen = ::std::option::Option::Some(input.into());
211 self
212 }
213 /// <p>A timestamp that indicates when the API call was most recently observed.</p>
214 /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
215 pub fn set_last_seen(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216 self.last_seen = input;
217 self
218 }
219 /// <p>A timestamp that indicates when the API call was most recently observed.</p>
220 /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
221 pub fn get_last_seen(&self) -> &::std::option::Option<::std::string::String> {
222 &self.last_seen
223 }
224 /// Consumes the builder and constructs a [`AwsApiCallAction`](crate::types::AwsApiCallAction).
225 pub fn build(self) -> crate::types::AwsApiCallAction {
226 crate::types::AwsApiCallAction {
227 api: self.api,
228 service_name: self.service_name,
229 caller_type: self.caller_type,
230 remote_ip_details: self.remote_ip_details,
231 domain_details: self.domain_details,
232 affected_resources: self.affected_resources,
233 first_seen: self.first_seen,
234 last_seen: self.last_seen,
235 }
236 }
237}