Skip to main content

aws_sdk_macie2/types/
_finding.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Provides the details of a finding.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Finding {
7    /// <p>The unique identifier for the Amazon Web Services account that the finding applies to. This is typically the account that owns the affected resource.</p>
8    pub account_id: ::std::option::Option<::std::string::String>,
9    /// <p>Specifies whether the finding is archived (suppressed).</p>
10    pub archived: ::std::option::Option<bool>,
11    /// <p>The category of the finding. Possible values are: CLASSIFICATION, for a sensitive data finding; and, POLICY, for a policy finding.</p>
12    pub category: ::std::option::Option<crate::types::FindingCategory>,
13    /// <p>The details of a sensitive data finding. This value is null for a policy finding.</p>
14    pub classification_details: ::std::option::Option<crate::types::ClassificationDetails>,
15    /// <p>The total number of occurrences of the finding. For sensitive data findings, this value is always 1. All sensitive data findings are considered unique.</p>
16    pub count: ::std::option::Option<i64>,
17    /// <p>The date and time, in UTC and extended ISO 8601 format, when Amazon Macie created the finding.</p>
18    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
19    /// <p>The description of the finding.</p>
20    pub description: ::std::option::Option<::std::string::String>,
21    /// <p>The unique identifier for the finding. This is a random string that Amazon Macie generates and assigns to a finding when it creates the finding.</p>
22    pub id: ::std::option::Option<::std::string::String>,
23    /// <p>The Amazon Web Services partition that Amazon Macie created the finding in.</p>
24    pub partition: ::std::option::Option<::std::string::String>,
25    /// <p>The details of a policy finding. This value is null for a sensitive data finding.</p>
26    pub policy_details: ::std::option::Option<crate::types::PolicyDetails>,
27    /// <p>The Amazon Web Services Region that Amazon Macie created the finding in.</p>
28    pub region: ::std::option::Option<::std::string::String>,
29    /// <p>The resources that the finding applies to.</p>
30    pub resources_affected: ::std::option::Option<crate::types::ResourcesAffected>,
31    /// <p>Specifies whether the finding is a sample finding. A <i>sample finding</i> is a finding that uses example data to demonstrate what a finding might contain.</p>
32    pub sample: ::std::option::Option<bool>,
33    /// <p>The version of the schema that was used to define the data structures in the finding.</p>
34    pub schema_version: ::std::option::Option<::std::string::String>,
35    /// <p>The severity level and score for the finding.</p>
36    pub severity: ::std::option::Option<crate::types::Severity>,
37    /// <p>The brief description of the finding.</p>
38    pub title: ::std::option::Option<::std::string::String>,
39    /// <p>The type of the finding.</p>
40    pub r#type: ::std::option::Option<crate::types::FindingType>,
41    /// <p>The date and time, in UTC and extended ISO 8601 format, when Amazon Macie last updated the finding. For sensitive data findings, this value is the same as the value for the createdAt property. All sensitive data findings are considered new.</p>
42    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
43}
44impl Finding {
45    /// <p>The unique identifier for the Amazon Web Services account that the finding applies to. This is typically the account that owns the affected resource.</p>
46    pub fn account_id(&self) -> ::std::option::Option<&str> {
47        self.account_id.as_deref()
48    }
49    /// <p>Specifies whether the finding is archived (suppressed).</p>
50    pub fn archived(&self) -> ::std::option::Option<bool> {
51        self.archived
52    }
53    /// <p>The category of the finding. Possible values are: CLASSIFICATION, for a sensitive data finding; and, POLICY, for a policy finding.</p>
54    pub fn category(&self) -> ::std::option::Option<&crate::types::FindingCategory> {
55        self.category.as_ref()
56    }
57    /// <p>The details of a sensitive data finding. This value is null for a policy finding.</p>
58    pub fn classification_details(&self) -> ::std::option::Option<&crate::types::ClassificationDetails> {
59        self.classification_details.as_ref()
60    }
61    /// <p>The total number of occurrences of the finding. For sensitive data findings, this value is always 1. All sensitive data findings are considered unique.</p>
62    pub fn count(&self) -> ::std::option::Option<i64> {
63        self.count
64    }
65    /// <p>The date and time, in UTC and extended ISO 8601 format, when Amazon Macie created the finding.</p>
66    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
67        self.created_at.as_ref()
68    }
69    /// <p>The description of the finding.</p>
70    pub fn description(&self) -> ::std::option::Option<&str> {
71        self.description.as_deref()
72    }
73    /// <p>The unique identifier for the finding. This is a random string that Amazon Macie generates and assigns to a finding when it creates the finding.</p>
74    pub fn id(&self) -> ::std::option::Option<&str> {
75        self.id.as_deref()
76    }
77    /// <p>The Amazon Web Services partition that Amazon Macie created the finding in.</p>
78    pub fn partition(&self) -> ::std::option::Option<&str> {
79        self.partition.as_deref()
80    }
81    /// <p>The details of a policy finding. This value is null for a sensitive data finding.</p>
82    pub fn policy_details(&self) -> ::std::option::Option<&crate::types::PolicyDetails> {
83        self.policy_details.as_ref()
84    }
85    /// <p>The Amazon Web Services Region that Amazon Macie created the finding in.</p>
86    pub fn region(&self) -> ::std::option::Option<&str> {
87        self.region.as_deref()
88    }
89    /// <p>The resources that the finding applies to.</p>
90    pub fn resources_affected(&self) -> ::std::option::Option<&crate::types::ResourcesAffected> {
91        self.resources_affected.as_ref()
92    }
93    /// <p>Specifies whether the finding is a sample finding. A <i>sample finding</i> is a finding that uses example data to demonstrate what a finding might contain.</p>
94    pub fn sample(&self) -> ::std::option::Option<bool> {
95        self.sample
96    }
97    /// <p>The version of the schema that was used to define the data structures in the finding.</p>
98    pub fn schema_version(&self) -> ::std::option::Option<&str> {
99        self.schema_version.as_deref()
100    }
101    /// <p>The severity level and score for the finding.</p>
102    pub fn severity(&self) -> ::std::option::Option<&crate::types::Severity> {
103        self.severity.as_ref()
104    }
105    /// <p>The brief description of the finding.</p>
106    pub fn title(&self) -> ::std::option::Option<&str> {
107        self.title.as_deref()
108    }
109    /// <p>The type of the finding.</p>
110    pub fn r#type(&self) -> ::std::option::Option<&crate::types::FindingType> {
111        self.r#type.as_ref()
112    }
113    /// <p>The date and time, in UTC and extended ISO 8601 format, when Amazon Macie last updated the finding. For sensitive data findings, this value is the same as the value for the createdAt property. All sensitive data findings are considered new.</p>
114    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
115        self.updated_at.as_ref()
116    }
117}
118impl Finding {
119    /// Creates a new builder-style object to manufacture [`Finding`](crate::types::Finding).
120    pub fn builder() -> crate::types::builders::FindingBuilder {
121        crate::types::builders::FindingBuilder::default()
122    }
123}
124
125/// A builder for [`Finding`](crate::types::Finding).
126#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
127#[non_exhaustive]
128pub struct FindingBuilder {
129    pub(crate) account_id: ::std::option::Option<::std::string::String>,
130    pub(crate) archived: ::std::option::Option<bool>,
131    pub(crate) category: ::std::option::Option<crate::types::FindingCategory>,
132    pub(crate) classification_details: ::std::option::Option<crate::types::ClassificationDetails>,
133    pub(crate) count: ::std::option::Option<i64>,
134    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
135    pub(crate) description: ::std::option::Option<::std::string::String>,
136    pub(crate) id: ::std::option::Option<::std::string::String>,
137    pub(crate) partition: ::std::option::Option<::std::string::String>,
138    pub(crate) policy_details: ::std::option::Option<crate::types::PolicyDetails>,
139    pub(crate) region: ::std::option::Option<::std::string::String>,
140    pub(crate) resources_affected: ::std::option::Option<crate::types::ResourcesAffected>,
141    pub(crate) sample: ::std::option::Option<bool>,
142    pub(crate) schema_version: ::std::option::Option<::std::string::String>,
143    pub(crate) severity: ::std::option::Option<crate::types::Severity>,
144    pub(crate) title: ::std::option::Option<::std::string::String>,
145    pub(crate) r#type: ::std::option::Option<crate::types::FindingType>,
146    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
147}
148impl FindingBuilder {
149    /// <p>The unique identifier for the Amazon Web Services account that the finding applies to. This is typically the account that owns the affected resource.</p>
150    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.account_id = ::std::option::Option::Some(input.into());
152        self
153    }
154    /// <p>The unique identifier for the Amazon Web Services account that the finding applies to. This is typically the account that owns the affected resource.</p>
155    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.account_id = input;
157        self
158    }
159    /// <p>The unique identifier for the Amazon Web Services account that the finding applies to. This is typically the account that owns the affected resource.</p>
160    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
161        &self.account_id
162    }
163    /// <p>Specifies whether the finding is archived (suppressed).</p>
164    pub fn archived(mut self, input: bool) -> Self {
165        self.archived = ::std::option::Option::Some(input);
166        self
167    }
168    /// <p>Specifies whether the finding is archived (suppressed).</p>
169    pub fn set_archived(mut self, input: ::std::option::Option<bool>) -> Self {
170        self.archived = input;
171        self
172    }
173    /// <p>Specifies whether the finding is archived (suppressed).</p>
174    pub fn get_archived(&self) -> &::std::option::Option<bool> {
175        &self.archived
176    }
177    /// <p>The category of the finding. Possible values are: CLASSIFICATION, for a sensitive data finding; and, POLICY, for a policy finding.</p>
178    pub fn category(mut self, input: crate::types::FindingCategory) -> Self {
179        self.category = ::std::option::Option::Some(input);
180        self
181    }
182    /// <p>The category of the finding. Possible values are: CLASSIFICATION, for a sensitive data finding; and, POLICY, for a policy finding.</p>
183    pub fn set_category(mut self, input: ::std::option::Option<crate::types::FindingCategory>) -> Self {
184        self.category = input;
185        self
186    }
187    /// <p>The category of the finding. Possible values are: CLASSIFICATION, for a sensitive data finding; and, POLICY, for a policy finding.</p>
188    pub fn get_category(&self) -> &::std::option::Option<crate::types::FindingCategory> {
189        &self.category
190    }
191    /// <p>The details of a sensitive data finding. This value is null for a policy finding.</p>
192    pub fn classification_details(mut self, input: crate::types::ClassificationDetails) -> Self {
193        self.classification_details = ::std::option::Option::Some(input);
194        self
195    }
196    /// <p>The details of a sensitive data finding. This value is null for a policy finding.</p>
197    pub fn set_classification_details(mut self, input: ::std::option::Option<crate::types::ClassificationDetails>) -> Self {
198        self.classification_details = input;
199        self
200    }
201    /// <p>The details of a sensitive data finding. This value is null for a policy finding.</p>
202    pub fn get_classification_details(&self) -> &::std::option::Option<crate::types::ClassificationDetails> {
203        &self.classification_details
204    }
205    /// <p>The total number of occurrences of the finding. For sensitive data findings, this value is always 1. All sensitive data findings are considered unique.</p>
206    pub fn count(mut self, input: i64) -> Self {
207        self.count = ::std::option::Option::Some(input);
208        self
209    }
210    /// <p>The total number of occurrences of the finding. For sensitive data findings, this value is always 1. All sensitive data findings are considered unique.</p>
211    pub fn set_count(mut self, input: ::std::option::Option<i64>) -> Self {
212        self.count = input;
213        self
214    }
215    /// <p>The total number of occurrences of the finding. For sensitive data findings, this value is always 1. All sensitive data findings are considered unique.</p>
216    pub fn get_count(&self) -> &::std::option::Option<i64> {
217        &self.count
218    }
219    /// <p>The date and time, in UTC and extended ISO 8601 format, when Amazon Macie created the finding.</p>
220    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
221        self.created_at = ::std::option::Option::Some(input);
222        self
223    }
224    /// <p>The date and time, in UTC and extended ISO 8601 format, when Amazon Macie created the finding.</p>
225    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
226        self.created_at = input;
227        self
228    }
229    /// <p>The date and time, in UTC and extended ISO 8601 format, when Amazon Macie created the finding.</p>
230    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
231        &self.created_at
232    }
233    /// <p>The description of the finding.</p>
234    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
235        self.description = ::std::option::Option::Some(input.into());
236        self
237    }
238    /// <p>The description of the finding.</p>
239    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
240        self.description = input;
241        self
242    }
243    /// <p>The description of the finding.</p>
244    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
245        &self.description
246    }
247    /// <p>The unique identifier for the finding. This is a random string that Amazon Macie generates and assigns to a finding when it creates the finding.</p>
248    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
249        self.id = ::std::option::Option::Some(input.into());
250        self
251    }
252    /// <p>The unique identifier for the finding. This is a random string that Amazon Macie generates and assigns to a finding when it creates the finding.</p>
253    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
254        self.id = input;
255        self
256    }
257    /// <p>The unique identifier for the finding. This is a random string that Amazon Macie generates and assigns to a finding when it creates the finding.</p>
258    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
259        &self.id
260    }
261    /// <p>The Amazon Web Services partition that Amazon Macie created the finding in.</p>
262    pub fn partition(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
263        self.partition = ::std::option::Option::Some(input.into());
264        self
265    }
266    /// <p>The Amazon Web Services partition that Amazon Macie created the finding in.</p>
267    pub fn set_partition(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
268        self.partition = input;
269        self
270    }
271    /// <p>The Amazon Web Services partition that Amazon Macie created the finding in.</p>
272    pub fn get_partition(&self) -> &::std::option::Option<::std::string::String> {
273        &self.partition
274    }
275    /// <p>The details of a policy finding. This value is null for a sensitive data finding.</p>
276    pub fn policy_details(mut self, input: crate::types::PolicyDetails) -> Self {
277        self.policy_details = ::std::option::Option::Some(input);
278        self
279    }
280    /// <p>The details of a policy finding. This value is null for a sensitive data finding.</p>
281    pub fn set_policy_details(mut self, input: ::std::option::Option<crate::types::PolicyDetails>) -> Self {
282        self.policy_details = input;
283        self
284    }
285    /// <p>The details of a policy finding. This value is null for a sensitive data finding.</p>
286    pub fn get_policy_details(&self) -> &::std::option::Option<crate::types::PolicyDetails> {
287        &self.policy_details
288    }
289    /// <p>The Amazon Web Services Region that Amazon Macie created the finding in.</p>
290    pub fn region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
291        self.region = ::std::option::Option::Some(input.into());
292        self
293    }
294    /// <p>The Amazon Web Services Region that Amazon Macie created the finding in.</p>
295    pub fn set_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
296        self.region = input;
297        self
298    }
299    /// <p>The Amazon Web Services Region that Amazon Macie created the finding in.</p>
300    pub fn get_region(&self) -> &::std::option::Option<::std::string::String> {
301        &self.region
302    }
303    /// <p>The resources that the finding applies to.</p>
304    pub fn resources_affected(mut self, input: crate::types::ResourcesAffected) -> Self {
305        self.resources_affected = ::std::option::Option::Some(input);
306        self
307    }
308    /// <p>The resources that the finding applies to.</p>
309    pub fn set_resources_affected(mut self, input: ::std::option::Option<crate::types::ResourcesAffected>) -> Self {
310        self.resources_affected = input;
311        self
312    }
313    /// <p>The resources that the finding applies to.</p>
314    pub fn get_resources_affected(&self) -> &::std::option::Option<crate::types::ResourcesAffected> {
315        &self.resources_affected
316    }
317    /// <p>Specifies whether the finding is a sample finding. A <i>sample finding</i> is a finding that uses example data to demonstrate what a finding might contain.</p>
318    pub fn sample(mut self, input: bool) -> Self {
319        self.sample = ::std::option::Option::Some(input);
320        self
321    }
322    /// <p>Specifies whether the finding is a sample finding. A <i>sample finding</i> is a finding that uses example data to demonstrate what a finding might contain.</p>
323    pub fn set_sample(mut self, input: ::std::option::Option<bool>) -> Self {
324        self.sample = input;
325        self
326    }
327    /// <p>Specifies whether the finding is a sample finding. A <i>sample finding</i> is a finding that uses example data to demonstrate what a finding might contain.</p>
328    pub fn get_sample(&self) -> &::std::option::Option<bool> {
329        &self.sample
330    }
331    /// <p>The version of the schema that was used to define the data structures in the finding.</p>
332    pub fn schema_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
333        self.schema_version = ::std::option::Option::Some(input.into());
334        self
335    }
336    /// <p>The version of the schema that was used to define the data structures in the finding.</p>
337    pub fn set_schema_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
338        self.schema_version = input;
339        self
340    }
341    /// <p>The version of the schema that was used to define the data structures in the finding.</p>
342    pub fn get_schema_version(&self) -> &::std::option::Option<::std::string::String> {
343        &self.schema_version
344    }
345    /// <p>The severity level and score for the finding.</p>
346    pub fn severity(mut self, input: crate::types::Severity) -> Self {
347        self.severity = ::std::option::Option::Some(input);
348        self
349    }
350    /// <p>The severity level and score for the finding.</p>
351    pub fn set_severity(mut self, input: ::std::option::Option<crate::types::Severity>) -> Self {
352        self.severity = input;
353        self
354    }
355    /// <p>The severity level and score for the finding.</p>
356    pub fn get_severity(&self) -> &::std::option::Option<crate::types::Severity> {
357        &self.severity
358    }
359    /// <p>The brief description of the finding.</p>
360    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
361        self.title = ::std::option::Option::Some(input.into());
362        self
363    }
364    /// <p>The brief description of the finding.</p>
365    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
366        self.title = input;
367        self
368    }
369    /// <p>The brief description of the finding.</p>
370    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
371        &self.title
372    }
373    /// <p>The type of the finding.</p>
374    pub fn r#type(mut self, input: crate::types::FindingType) -> Self {
375        self.r#type = ::std::option::Option::Some(input);
376        self
377    }
378    /// <p>The type of the finding.</p>
379    pub fn set_type(mut self, input: ::std::option::Option<crate::types::FindingType>) -> Self {
380        self.r#type = input;
381        self
382    }
383    /// <p>The type of the finding.</p>
384    pub fn get_type(&self) -> &::std::option::Option<crate::types::FindingType> {
385        &self.r#type
386    }
387    /// <p>The date and time, in UTC and extended ISO 8601 format, when Amazon Macie last updated the finding. For sensitive data findings, this value is the same as the value for the createdAt property. All sensitive data findings are considered new.</p>
388    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
389        self.updated_at = ::std::option::Option::Some(input);
390        self
391    }
392    /// <p>The date and time, in UTC and extended ISO 8601 format, when Amazon Macie last updated the finding. For sensitive data findings, this value is the same as the value for the createdAt property. All sensitive data findings are considered new.</p>
393    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
394        self.updated_at = input;
395        self
396    }
397    /// <p>The date and time, in UTC and extended ISO 8601 format, when Amazon Macie last updated the finding. For sensitive data findings, this value is the same as the value for the createdAt property. All sensitive data findings are considered new.</p>
398    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
399        &self.updated_at
400    }
401    /// Consumes the builder and constructs a [`Finding`](crate::types::Finding).
402    pub fn build(self) -> crate::types::Finding {
403        crate::types::Finding {
404            account_id: self.account_id,
405            archived: self.archived,
406            category: self.category,
407            classification_details: self.classification_details,
408            count: self.count,
409            created_at: self.created_at,
410            description: self.description,
411            id: self.id,
412            partition: self.partition,
413            policy_details: self.policy_details,
414            region: self.region,
415            resources_affected: self.resources_affected,
416            sample: self.sample,
417            schema_version: self.schema_version,
418            severity: self.severity,
419            title: self.title,
420            r#type: self.r#type,
421            updated_at: self.updated_at,
422        }
423    }
424}