aws-sdk-securityhub 1.110.0

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

/// <p>The severity of the finding.</p>
/// <p>The finding provider can provide the initial severity. The finding provider can only update the severity if it hasn't been updated using <code>BatchUpdateFindings</code>.</p>
/// <p>The finding must have either <code>Label</code> or <code>Normalized</code> populated. If only one of these attributes is populated, then Security Hub CSPM automatically populates the other one. If neither attribute is populated, then the finding is invalid. <code>Label</code> is the preferred attribute.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Severity {
    /// <p>Deprecated. This attribute isn't included in findings. Instead of providing <code>Product</code>, provide <code>Original</code>.</p>
    /// <p>The native severity as defined by the Amazon Web Services service or integrated partner product that generated the finding.</p>
    pub product: ::std::option::Option<f64>,
    /// <p>The severity value of the finding. The allowed values are the following.</p>
    /// <ul>
    /// <li>
    /// <p><code>INFORMATIONAL</code> - No issue was found.</p></li>
    /// <li>
    /// <p><code>LOW</code> - The issue does not require action on its own.</p></li>
    /// <li>
    /// <p><code>MEDIUM</code> - The issue must be addressed but not urgently.</p></li>
    /// <li>
    /// <p><code>HIGH</code> - The issue must be addressed as a priority.</p></li>
    /// <li>
    /// <p><code>CRITICAL</code> - The issue must be remediated immediately to avoid it escalating.</p></li>
    /// </ul>
    /// <p>If you provide <code>Normalized</code> and don't provide <code>Label</code>, then <code>Label</code> is set automatically as follows.</p>
    /// <ul>
    /// <li>
    /// <p>0 - <code>INFORMATIONAL</code></p></li>
    /// <li>
    /// <p>1–39 - <code>LOW</code></p></li>
    /// <li>
    /// <p>40–69 - <code>MEDIUM</code></p></li>
    /// <li>
    /// <p>70–89 - <code>HIGH</code></p></li>
    /// <li>
    /// <p>90–100 - <code>CRITICAL</code></p></li>
    /// </ul>
    pub label: ::std::option::Option<crate::types::SeverityLabel>,
    /// <p>Deprecated. The normalized severity of a finding. Instead of providing <code>Normalized</code>, provide <code>Label</code>.</p>
    /// <p>The value of <code>Normalized</code> can be an integer between <code>0</code> and <code>100</code>.</p>
    /// <p>If you provide <code>Label</code> and don't provide <code>Normalized</code>, then <code>Normalized</code> is set automatically as follows.</p>
    /// <ul>
    /// <li>
    /// <p><code>INFORMATIONAL</code> - 0</p></li>
    /// <li>
    /// <p><code>LOW</code> - 1</p></li>
    /// <li>
    /// <p><code>MEDIUM</code> - 40</p></li>
    /// <li>
    /// <p><code>HIGH</code> - 70</p></li>
    /// <li>
    /// <p><code>CRITICAL</code> - 90</p></li>
    /// </ul>
    pub normalized: ::std::option::Option<i32>,
    /// <p>The native severity from the finding product that generated the finding.</p>
    /// <p>Length Constraints: Minimum length of 1. Maximum length of 64.</p>
    pub original: ::std::option::Option<::std::string::String>,
}
impl Severity {
    /// <p>Deprecated. This attribute isn't included in findings. Instead of providing <code>Product</code>, provide <code>Original</code>.</p>
    /// <p>The native severity as defined by the Amazon Web Services service or integrated partner product that generated the finding.</p>
    pub fn product(&self) -> ::std::option::Option<f64> {
        self.product
    }
    /// <p>The severity value of the finding. The allowed values are the following.</p>
    /// <ul>
    /// <li>
    /// <p><code>INFORMATIONAL</code> - No issue was found.</p></li>
    /// <li>
    /// <p><code>LOW</code> - The issue does not require action on its own.</p></li>
    /// <li>
    /// <p><code>MEDIUM</code> - The issue must be addressed but not urgently.</p></li>
    /// <li>
    /// <p><code>HIGH</code> - The issue must be addressed as a priority.</p></li>
    /// <li>
    /// <p><code>CRITICAL</code> - The issue must be remediated immediately to avoid it escalating.</p></li>
    /// </ul>
    /// <p>If you provide <code>Normalized</code> and don't provide <code>Label</code>, then <code>Label</code> is set automatically as follows.</p>
    /// <ul>
    /// <li>
    /// <p>0 - <code>INFORMATIONAL</code></p></li>
    /// <li>
    /// <p>1–39 - <code>LOW</code></p></li>
    /// <li>
    /// <p>40–69 - <code>MEDIUM</code></p></li>
    /// <li>
    /// <p>70–89 - <code>HIGH</code></p></li>
    /// <li>
    /// <p>90–100 - <code>CRITICAL</code></p></li>
    /// </ul>
    pub fn label(&self) -> ::std::option::Option<&crate::types::SeverityLabel> {
        self.label.as_ref()
    }
    /// <p>Deprecated. The normalized severity of a finding. Instead of providing <code>Normalized</code>, provide <code>Label</code>.</p>
    /// <p>The value of <code>Normalized</code> can be an integer between <code>0</code> and <code>100</code>.</p>
    /// <p>If you provide <code>Label</code> and don't provide <code>Normalized</code>, then <code>Normalized</code> is set automatically as follows.</p>
    /// <ul>
    /// <li>
    /// <p><code>INFORMATIONAL</code> - 0</p></li>
    /// <li>
    /// <p><code>LOW</code> - 1</p></li>
    /// <li>
    /// <p><code>MEDIUM</code> - 40</p></li>
    /// <li>
    /// <p><code>HIGH</code> - 70</p></li>
    /// <li>
    /// <p><code>CRITICAL</code> - 90</p></li>
    /// </ul>
    pub fn normalized(&self) -> ::std::option::Option<i32> {
        self.normalized
    }
    /// <p>The native severity from the finding product that generated the finding.</p>
    /// <p>Length Constraints: Minimum length of 1. Maximum length of 64.</p>
    pub fn original(&self) -> ::std::option::Option<&str> {
        self.original.as_deref()
    }
}
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) product: ::std::option::Option<f64>,
    pub(crate) label: ::std::option::Option<crate::types::SeverityLabel>,
    pub(crate) normalized: ::std::option::Option<i32>,
    pub(crate) original: ::std::option::Option<::std::string::String>,
}
impl SeverityBuilder {
    /// <p>Deprecated. This attribute isn't included in findings. Instead of providing <code>Product</code>, provide <code>Original</code>.</p>
    /// <p>The native severity as defined by the Amazon Web Services service or integrated partner product that generated the finding.</p>
    pub fn product(mut self, input: f64) -> Self {
        self.product = ::std::option::Option::Some(input);
        self
    }
    /// <p>Deprecated. This attribute isn't included in findings. Instead of providing <code>Product</code>, provide <code>Original</code>.</p>
    /// <p>The native severity as defined by the Amazon Web Services service or integrated partner product that generated the finding.</p>
    pub fn set_product(mut self, input: ::std::option::Option<f64>) -> Self {
        self.product = input;
        self
    }
    /// <p>Deprecated. This attribute isn't included in findings. Instead of providing <code>Product</code>, provide <code>Original</code>.</p>
    /// <p>The native severity as defined by the Amazon Web Services service or integrated partner product that generated the finding.</p>
    pub fn get_product(&self) -> &::std::option::Option<f64> {
        &self.product
    }
    /// <p>The severity value of the finding. The allowed values are the following.</p>
    /// <ul>
    /// <li>
    /// <p><code>INFORMATIONAL</code> - No issue was found.</p></li>
    /// <li>
    /// <p><code>LOW</code> - The issue does not require action on its own.</p></li>
    /// <li>
    /// <p><code>MEDIUM</code> - The issue must be addressed but not urgently.</p></li>
    /// <li>
    /// <p><code>HIGH</code> - The issue must be addressed as a priority.</p></li>
    /// <li>
    /// <p><code>CRITICAL</code> - The issue must be remediated immediately to avoid it escalating.</p></li>
    /// </ul>
    /// <p>If you provide <code>Normalized</code> and don't provide <code>Label</code>, then <code>Label</code> is set automatically as follows.</p>
    /// <ul>
    /// <li>
    /// <p>0 - <code>INFORMATIONAL</code></p></li>
    /// <li>
    /// <p>1–39 - <code>LOW</code></p></li>
    /// <li>
    /// <p>40–69 - <code>MEDIUM</code></p></li>
    /// <li>
    /// <p>70–89 - <code>HIGH</code></p></li>
    /// <li>
    /// <p>90–100 - <code>CRITICAL</code></p></li>
    /// </ul>
    pub fn label(mut self, input: crate::types::SeverityLabel) -> Self {
        self.label = ::std::option::Option::Some(input);
        self
    }
    /// <p>The severity value of the finding. The allowed values are the following.</p>
    /// <ul>
    /// <li>
    /// <p><code>INFORMATIONAL</code> - No issue was found.</p></li>
    /// <li>
    /// <p><code>LOW</code> - The issue does not require action on its own.</p></li>
    /// <li>
    /// <p><code>MEDIUM</code> - The issue must be addressed but not urgently.</p></li>
    /// <li>
    /// <p><code>HIGH</code> - The issue must be addressed as a priority.</p></li>
    /// <li>
    /// <p><code>CRITICAL</code> - The issue must be remediated immediately to avoid it escalating.</p></li>
    /// </ul>
    /// <p>If you provide <code>Normalized</code> and don't provide <code>Label</code>, then <code>Label</code> is set automatically as follows.</p>
    /// <ul>
    /// <li>
    /// <p>0 - <code>INFORMATIONAL</code></p></li>
    /// <li>
    /// <p>1–39 - <code>LOW</code></p></li>
    /// <li>
    /// <p>40–69 - <code>MEDIUM</code></p></li>
    /// <li>
    /// <p>70–89 - <code>HIGH</code></p></li>
    /// <li>
    /// <p>90–100 - <code>CRITICAL</code></p></li>
    /// </ul>
    pub fn set_label(mut self, input: ::std::option::Option<crate::types::SeverityLabel>) -> Self {
        self.label = input;
        self
    }
    /// <p>The severity value of the finding. The allowed values are the following.</p>
    /// <ul>
    /// <li>
    /// <p><code>INFORMATIONAL</code> - No issue was found.</p></li>
    /// <li>
    /// <p><code>LOW</code> - The issue does not require action on its own.</p></li>
    /// <li>
    /// <p><code>MEDIUM</code> - The issue must be addressed but not urgently.</p></li>
    /// <li>
    /// <p><code>HIGH</code> - The issue must be addressed as a priority.</p></li>
    /// <li>
    /// <p><code>CRITICAL</code> - The issue must be remediated immediately to avoid it escalating.</p></li>
    /// </ul>
    /// <p>If you provide <code>Normalized</code> and don't provide <code>Label</code>, then <code>Label</code> is set automatically as follows.</p>
    /// <ul>
    /// <li>
    /// <p>0 - <code>INFORMATIONAL</code></p></li>
    /// <li>
    /// <p>1–39 - <code>LOW</code></p></li>
    /// <li>
    /// <p>40–69 - <code>MEDIUM</code></p></li>
    /// <li>
    /// <p>70–89 - <code>HIGH</code></p></li>
    /// <li>
    /// <p>90–100 - <code>CRITICAL</code></p></li>
    /// </ul>
    pub fn get_label(&self) -> &::std::option::Option<crate::types::SeverityLabel> {
        &self.label
    }
    /// <p>Deprecated. The normalized severity of a finding. Instead of providing <code>Normalized</code>, provide <code>Label</code>.</p>
    /// <p>The value of <code>Normalized</code> can be an integer between <code>0</code> and <code>100</code>.</p>
    /// <p>If you provide <code>Label</code> and don't provide <code>Normalized</code>, then <code>Normalized</code> is set automatically as follows.</p>
    /// <ul>
    /// <li>
    /// <p><code>INFORMATIONAL</code> - 0</p></li>
    /// <li>
    /// <p><code>LOW</code> - 1</p></li>
    /// <li>
    /// <p><code>MEDIUM</code> - 40</p></li>
    /// <li>
    /// <p><code>HIGH</code> - 70</p></li>
    /// <li>
    /// <p><code>CRITICAL</code> - 90</p></li>
    /// </ul>
    pub fn normalized(mut self, input: i32) -> Self {
        self.normalized = ::std::option::Option::Some(input);
        self
    }
    /// <p>Deprecated. The normalized severity of a finding. Instead of providing <code>Normalized</code>, provide <code>Label</code>.</p>
    /// <p>The value of <code>Normalized</code> can be an integer between <code>0</code> and <code>100</code>.</p>
    /// <p>If you provide <code>Label</code> and don't provide <code>Normalized</code>, then <code>Normalized</code> is set automatically as follows.</p>
    /// <ul>
    /// <li>
    /// <p><code>INFORMATIONAL</code> - 0</p></li>
    /// <li>
    /// <p><code>LOW</code> - 1</p></li>
    /// <li>
    /// <p><code>MEDIUM</code> - 40</p></li>
    /// <li>
    /// <p><code>HIGH</code> - 70</p></li>
    /// <li>
    /// <p><code>CRITICAL</code> - 90</p></li>
    /// </ul>
    pub fn set_normalized(mut self, input: ::std::option::Option<i32>) -> Self {
        self.normalized = input;
        self
    }
    /// <p>Deprecated. The normalized severity of a finding. Instead of providing <code>Normalized</code>, provide <code>Label</code>.</p>
    /// <p>The value of <code>Normalized</code> can be an integer between <code>0</code> and <code>100</code>.</p>
    /// <p>If you provide <code>Label</code> and don't provide <code>Normalized</code>, then <code>Normalized</code> is set automatically as follows.</p>
    /// <ul>
    /// <li>
    /// <p><code>INFORMATIONAL</code> - 0</p></li>
    /// <li>
    /// <p><code>LOW</code> - 1</p></li>
    /// <li>
    /// <p><code>MEDIUM</code> - 40</p></li>
    /// <li>
    /// <p><code>HIGH</code> - 70</p></li>
    /// <li>
    /// <p><code>CRITICAL</code> - 90</p></li>
    /// </ul>
    pub fn get_normalized(&self) -> &::std::option::Option<i32> {
        &self.normalized
    }
    /// <p>The native severity from the finding product that generated the finding.</p>
    /// <p>Length Constraints: Minimum length of 1. Maximum length of 64.</p>
    pub fn original(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.original = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The native severity from the finding product that generated the finding.</p>
    /// <p>Length Constraints: Minimum length of 1. Maximum length of 64.</p>
    pub fn set_original(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.original = input;
        self
    }
    /// <p>The native severity from the finding product that generated the finding.</p>
    /// <p>Length Constraints: Minimum length of 1. Maximum length of 64.</p>
    pub fn get_original(&self) -> &::std::option::Option<::std::string::String> {
        &self.original
    }
    /// Consumes the builder and constructs a [`Severity`](crate::types::Severity).
    pub fn build(self) -> crate::types::Severity {
        crate::types::Severity {
            product: self.product,
            label: self.label,
            normalized: self.normalized,
            original: self.original,
        }
    }
}