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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <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>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SeverityLevel {
/// <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>
pub occurrences_threshold: ::std::option::Option<i64>,
/// <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>
pub severity: ::std::option::Option<crate::types::DataIdentifierSeverity>,
}
impl SeverityLevel {
/// <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>
pub fn occurrences_threshold(&self) -> ::std::option::Option<i64> {
self.occurrences_threshold
}
/// <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>
pub fn severity(&self) -> ::std::option::Option<&crate::types::DataIdentifierSeverity> {
self.severity.as_ref()
}
}
impl SeverityLevel {
/// Creates a new builder-style object to manufacture [`SeverityLevel`](crate::types::SeverityLevel).
pub fn builder() -> crate::types::builders::SeverityLevelBuilder {
crate::types::builders::SeverityLevelBuilder::default()
}
}
/// A builder for [`SeverityLevel`](crate::types::SeverityLevel).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct SeverityLevelBuilder {
pub(crate) occurrences_threshold: ::std::option::Option<i64>,
pub(crate) severity: ::std::option::Option<crate::types::DataIdentifierSeverity>,
}
impl SeverityLevelBuilder {
/// <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>
/// This field is required.
pub fn occurrences_threshold(mut self, input: i64) -> Self {
self.occurrences_threshold = ::std::option::Option::Some(input);
self
}
/// <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>
pub fn set_occurrences_threshold(mut self, input: ::std::option::Option<i64>) -> Self {
self.occurrences_threshold = input;
self
}
/// <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>
pub fn get_occurrences_threshold(&self) -> &::std::option::Option<i64> {
&self.occurrences_threshold
}
/// <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>
/// This field is required.
pub fn severity(mut self, input: crate::types::DataIdentifierSeverity) -> Self {
self.severity = ::std::option::Option::Some(input);
self
}
/// <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>
pub fn set_severity(mut self, input: ::std::option::Option<crate::types::DataIdentifierSeverity>) -> Self {
self.severity = input;
self
}
/// <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>
pub fn get_severity(&self) -> &::std::option::Option<crate::types::DataIdentifierSeverity> {
&self.severity
}
/// Consumes the builder and constructs a [`SeverityLevel`](crate::types::SeverityLevel).
pub fn build(self) -> crate::types::SeverityLevel {
crate::types::SeverityLevel {
occurrences_threshold: self.occurrences_threshold,
severity: self.severity,
}
}
}