aws-sdk-macie2 1.97.0

AWS SDK for Amazon Macie 2
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Provides the numerical and qualitative representations of a finding's severity.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Severity {
    /// <p>The qualitative representation of the finding's severity, ranging from Low (least severe) to High (most severe).</p>
    pub description: ::std::option::Option<crate::types::SeverityDescription>,
    /// <p>The numerical representation of the finding's severity, ranging from 1 (least severe) to 3 (most severe).</p>
    pub score: ::std::option::Option<i64>,
}
impl Severity {
    /// <p>The qualitative representation of the finding's severity, ranging from Low (least severe) to High (most severe).</p>
    pub fn description(&self) -> ::std::option::Option<&crate::types::SeverityDescription> {
        self.description.as_ref()
    }
    /// <p>The numerical representation of the finding's severity, ranging from 1 (least severe) to 3 (most severe).</p>
    pub fn score(&self) -> ::std::option::Option<i64> {
        self.score
    }
}
impl Severity {
    /// Creates a new builder-style object to manufacture [`Severity`](crate::types::Severity).
    pub fn builder() -> crate::types::builders::SeverityBuilder {
        crate::types::builders::SeverityBuilder::default()
    }
}

/// A builder for [`Severity`](crate::types::Severity).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SeverityBuilder {
    pub(crate) description: ::std::option::Option<crate::types::SeverityDescription>,
    pub(crate) score: ::std::option::Option<i64>,
}
impl SeverityBuilder {
    /// <p>The qualitative representation of the finding's severity, ranging from Low (least severe) to High (most severe).</p>
    pub fn description(mut self, input: crate::types::SeverityDescription) -> Self {
        self.description = ::std::option::Option::Some(input);
        self
    }
    /// <p>The qualitative representation of the finding's severity, ranging from Low (least severe) to High (most severe).</p>
    pub fn set_description(mut self, input: ::std::option::Option<crate::types::SeverityDescription>) -> Self {
        self.description = input;
        self
    }
    /// <p>The qualitative representation of the finding's severity, ranging from Low (least severe) to High (most severe).</p>
    pub fn get_description(&self) -> &::std::option::Option<crate::types::SeverityDescription> {
        &self.description
    }
    /// <p>The numerical representation of the finding's severity, ranging from 1 (least severe) to 3 (most severe).</p>
    pub fn score(mut self, input: i64) -> Self {
        self.score = ::std::option::Option::Some(input);
        self
    }
    /// <p>The numerical representation of the finding's severity, ranging from 1 (least severe) to 3 (most severe).</p>
    pub fn set_score(mut self, input: ::std::option::Option<i64>) -> Self {
        self.score = input;
        self
    }
    /// <p>The numerical representation of the finding's severity, ranging from 1 (least severe) to 3 (most severe).</p>
    pub fn get_score(&self) -> &::std::option::Option<i64> {
        &self.score
    }
    /// Consumes the builder and constructs a [`Severity`](crate::types::Severity).
    pub fn build(self) -> crate::types::Severity {
        crate::types::Severity {
            description: self.description,
            score: self.score,
        }
    }
}