aws_sdk_macie2/types/_severity_level.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Specifies a severity level for findings that a custom data identifier produces. A severity level determines which severity is assigned to the findings, based on the number of occurrences of text that match the custom data identifier's detection criteria.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SeverityLevel {
7 /// <p>The minimum number of occurrences of text that must match the custom data identifier's detection criteria in order to produce a finding with the specified severity (severity).</p>
8 pub occurrences_threshold: ::std::option::Option<i64>,
9 /// <p>The severity to assign to a finding: if the number of occurrences is greater than or equal to the specified threshold (occurrencesThreshold); and, if applicable, the number of occurrences is less than the threshold for the next consecutive severity level for the custom data identifier, moving from LOW to HIGH.</p>
10 pub severity: ::std::option::Option<crate::types::DataIdentifierSeverity>,
11}
12impl SeverityLevel {
13 /// <p>The minimum number of occurrences of text that must match the custom data identifier's detection criteria in order to produce a finding with the specified severity (severity).</p>
14 pub fn occurrences_threshold(&self) -> ::std::option::Option<i64> {
15 self.occurrences_threshold
16 }
17 /// <p>The severity to assign to a finding: if the number of occurrences is greater than or equal to the specified threshold (occurrencesThreshold); and, if applicable, the number of occurrences is less than the threshold for the next consecutive severity level for the custom data identifier, moving from LOW to HIGH.</p>
18 pub fn severity(&self) -> ::std::option::Option<&crate::types::DataIdentifierSeverity> {
19 self.severity.as_ref()
20 }
21}
22impl SeverityLevel {
23 /// Creates a new builder-style object to manufacture [`SeverityLevel`](crate::types::SeverityLevel).
24 pub fn builder() -> crate::types::builders::SeverityLevelBuilder {
25 crate::types::builders::SeverityLevelBuilder::default()
26 }
27}
28
29/// A builder for [`SeverityLevel`](crate::types::SeverityLevel).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct SeverityLevelBuilder {
33 pub(crate) occurrences_threshold: ::std::option::Option<i64>,
34 pub(crate) severity: ::std::option::Option<crate::types::DataIdentifierSeverity>,
35}
36impl SeverityLevelBuilder {
37 /// <p>The minimum number of occurrences of text that must match the custom data identifier's detection criteria in order to produce a finding with the specified severity (severity).</p>
38 /// This field is required.
39 pub fn occurrences_threshold(mut self, input: i64) -> Self {
40 self.occurrences_threshold = ::std::option::Option::Some(input);
41 self
42 }
43 /// <p>The minimum number of occurrences of text that must match the custom data identifier's detection criteria in order to produce a finding with the specified severity (severity).</p>
44 pub fn set_occurrences_threshold(mut self, input: ::std::option::Option<i64>) -> Self {
45 self.occurrences_threshold = input;
46 self
47 }
48 /// <p>The minimum number of occurrences of text that must match the custom data identifier's detection criteria in order to produce a finding with the specified severity (severity).</p>
49 pub fn get_occurrences_threshold(&self) -> &::std::option::Option<i64> {
50 &self.occurrences_threshold
51 }
52 /// <p>The severity to assign to a finding: if the number of occurrences is greater than or equal to the specified threshold (occurrencesThreshold); and, if applicable, the number of occurrences is less than the threshold for the next consecutive severity level for the custom data identifier, moving from LOW to HIGH.</p>
53 /// This field is required.
54 pub fn severity(mut self, input: crate::types::DataIdentifierSeverity) -> Self {
55 self.severity = ::std::option::Option::Some(input);
56 self
57 }
58 /// <p>The severity to assign to a finding: if the number of occurrences is greater than or equal to the specified threshold (occurrencesThreshold); and, if applicable, the number of occurrences is less than the threshold for the next consecutive severity level for the custom data identifier, moving from LOW to HIGH.</p>
59 pub fn set_severity(mut self, input: ::std::option::Option<crate::types::DataIdentifierSeverity>) -> Self {
60 self.severity = input;
61 self
62 }
63 /// <p>The severity to assign to a finding: if the number of occurrences is greater than or equal to the specified threshold (occurrencesThreshold); and, if applicable, the number of occurrences is less than the threshold for the next consecutive severity level for the custom data identifier, moving from LOW to HIGH.</p>
64 pub fn get_severity(&self) -> &::std::option::Option<crate::types::DataIdentifierSeverity> {
65 &self.severity
66 }
67 /// Consumes the builder and constructs a [`SeverityLevel`](crate::types::SeverityLevel).
68 pub fn build(self) -> crate::types::SeverityLevel {
69 crate::types::SeverityLevel {
70 occurrences_threshold: self.occurrences_threshold,
71 severity: self.severity,
72 }
73 }
74}