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>An adjustment to the CVSS metric.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Adjustment {
    /// <p>The metric to adjust.</p>
    pub metric: ::std::option::Option<::std::string::String>,
    /// <p>The reason for the adjustment.</p>
    pub reason: ::std::option::Option<::std::string::String>,
}
impl Adjustment {
    /// <p>The metric to adjust.</p>
    pub fn metric(&self) -> ::std::option::Option<&str> {
        self.metric.as_deref()
    }
    /// <p>The reason for the adjustment.</p>
    pub fn reason(&self) -> ::std::option::Option<&str> {
        self.reason.as_deref()
    }
}
impl Adjustment {
    /// Creates a new builder-style object to manufacture [`Adjustment`](crate::types::Adjustment).
    pub fn builder() -> crate::types::builders::AdjustmentBuilder {
        crate::types::builders::AdjustmentBuilder::default()
    }
}

/// A builder for [`Adjustment`](crate::types::Adjustment).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AdjustmentBuilder {
    pub(crate) metric: ::std::option::Option<::std::string::String>,
    pub(crate) reason: ::std::option::Option<::std::string::String>,
}
impl AdjustmentBuilder {
    /// <p>The metric to adjust.</p>
    pub fn metric(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.metric = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The metric to adjust.</p>
    pub fn set_metric(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.metric = input;
        self
    }
    /// <p>The metric to adjust.</p>
    pub fn get_metric(&self) -> &::std::option::Option<::std::string::String> {
        &self.metric
    }
    /// <p>The reason for the adjustment.</p>
    pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.reason = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The reason for the adjustment.</p>
    pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.reason = input;
        self
    }
    /// <p>The reason for the adjustment.</p>
    pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
        &self.reason
    }
    /// Consumes the builder and constructs a [`Adjustment`](crate::types::Adjustment).
    pub fn build(self) -> crate::types::Adjustment {
        crate::types::Adjustment {
            metric: self.metric,
            reason: self.reason,
        }
    }
}