aws-sdk-applicationsignals 1.89.0

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

/// <p>This structure contains the attributes that determine the goal of an SLO. This includes the time period for evaluation and the attainment threshold.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Goal {
    /// <p>The time period used to evaluate the SLO. It can be either a calendar interval or rolling interval.</p>
    /// <p>If you omit this parameter, a rolling interval of 7 days is used.</p>
    pub interval: ::std::option::Option<crate::types::Interval>,
    /// <p>The threshold that determines if the goal is being met.</p>
    /// <p>If this is a period-based SLO, the attainment goal is the percentage of good periods that meet the threshold requirements to the total periods within the interval. For example, an attainment goal of 99.9% means that within your interval, you are targeting 99.9% of the periods to be in healthy state.</p>
    /// <p>If this is a request-based SLO, the attainment goal is the percentage of requests that must be successful to meet the attainment goal.</p>
    /// <p>If you omit this parameter, 99 is used to represent 99% as the attainment goal.</p>
    pub attainment_goal: ::std::option::Option<f64>,
    /// <p>The percentage of remaining budget over total budget that you want to get warnings for. If you omit this parameter, the default of 50.0 is used.</p>
    pub warning_threshold: ::std::option::Option<f64>,
}
impl Goal {
    /// <p>The time period used to evaluate the SLO. It can be either a calendar interval or rolling interval.</p>
    /// <p>If you omit this parameter, a rolling interval of 7 days is used.</p>
    pub fn interval(&self) -> ::std::option::Option<&crate::types::Interval> {
        self.interval.as_ref()
    }
    /// <p>The threshold that determines if the goal is being met.</p>
    /// <p>If this is a period-based SLO, the attainment goal is the percentage of good periods that meet the threshold requirements to the total periods within the interval. For example, an attainment goal of 99.9% means that within your interval, you are targeting 99.9% of the periods to be in healthy state.</p>
    /// <p>If this is a request-based SLO, the attainment goal is the percentage of requests that must be successful to meet the attainment goal.</p>
    /// <p>If you omit this parameter, 99 is used to represent 99% as the attainment goal.</p>
    pub fn attainment_goal(&self) -> ::std::option::Option<f64> {
        self.attainment_goal
    }
    /// <p>The percentage of remaining budget over total budget that you want to get warnings for. If you omit this parameter, the default of 50.0 is used.</p>
    pub fn warning_threshold(&self) -> ::std::option::Option<f64> {
        self.warning_threshold
    }
}
impl Goal {
    /// Creates a new builder-style object to manufacture [`Goal`](crate::types::Goal).
    pub fn builder() -> crate::types::builders::GoalBuilder {
        crate::types::builders::GoalBuilder::default()
    }
}

/// A builder for [`Goal`](crate::types::Goal).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GoalBuilder {
    pub(crate) interval: ::std::option::Option<crate::types::Interval>,
    pub(crate) attainment_goal: ::std::option::Option<f64>,
    pub(crate) warning_threshold: ::std::option::Option<f64>,
}
impl GoalBuilder {
    /// <p>The time period used to evaluate the SLO. It can be either a calendar interval or rolling interval.</p>
    /// <p>If you omit this parameter, a rolling interval of 7 days is used.</p>
    pub fn interval(mut self, input: crate::types::Interval) -> Self {
        self.interval = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time period used to evaluate the SLO. It can be either a calendar interval or rolling interval.</p>
    /// <p>If you omit this parameter, a rolling interval of 7 days is used.</p>
    pub fn set_interval(mut self, input: ::std::option::Option<crate::types::Interval>) -> Self {
        self.interval = input;
        self
    }
    /// <p>The time period used to evaluate the SLO. It can be either a calendar interval or rolling interval.</p>
    /// <p>If you omit this parameter, a rolling interval of 7 days is used.</p>
    pub fn get_interval(&self) -> &::std::option::Option<crate::types::Interval> {
        &self.interval
    }
    /// <p>The threshold that determines if the goal is being met.</p>
    /// <p>If this is a period-based SLO, the attainment goal is the percentage of good periods that meet the threshold requirements to the total periods within the interval. For example, an attainment goal of 99.9% means that within your interval, you are targeting 99.9% of the periods to be in healthy state.</p>
    /// <p>If this is a request-based SLO, the attainment goal is the percentage of requests that must be successful to meet the attainment goal.</p>
    /// <p>If you omit this parameter, 99 is used to represent 99% as the attainment goal.</p>
    pub fn attainment_goal(mut self, input: f64) -> Self {
        self.attainment_goal = ::std::option::Option::Some(input);
        self
    }
    /// <p>The threshold that determines if the goal is being met.</p>
    /// <p>If this is a period-based SLO, the attainment goal is the percentage of good periods that meet the threshold requirements to the total periods within the interval. For example, an attainment goal of 99.9% means that within your interval, you are targeting 99.9% of the periods to be in healthy state.</p>
    /// <p>If this is a request-based SLO, the attainment goal is the percentage of requests that must be successful to meet the attainment goal.</p>
    /// <p>If you omit this parameter, 99 is used to represent 99% as the attainment goal.</p>
    pub fn set_attainment_goal(mut self, input: ::std::option::Option<f64>) -> Self {
        self.attainment_goal = input;
        self
    }
    /// <p>The threshold that determines if the goal is being met.</p>
    /// <p>If this is a period-based SLO, the attainment goal is the percentage of good periods that meet the threshold requirements to the total periods within the interval. For example, an attainment goal of 99.9% means that within your interval, you are targeting 99.9% of the periods to be in healthy state.</p>
    /// <p>If this is a request-based SLO, the attainment goal is the percentage of requests that must be successful to meet the attainment goal.</p>
    /// <p>If you omit this parameter, 99 is used to represent 99% as the attainment goal.</p>
    pub fn get_attainment_goal(&self) -> &::std::option::Option<f64> {
        &self.attainment_goal
    }
    /// <p>The percentage of remaining budget over total budget that you want to get warnings for. If you omit this parameter, the default of 50.0 is used.</p>
    pub fn warning_threshold(mut self, input: f64) -> Self {
        self.warning_threshold = ::std::option::Option::Some(input);
        self
    }
    /// <p>The percentage of remaining budget over total budget that you want to get warnings for. If you omit this parameter, the default of 50.0 is used.</p>
    pub fn set_warning_threshold(mut self, input: ::std::option::Option<f64>) -> Self {
        self.warning_threshold = input;
        self
    }
    /// <p>The percentage of remaining budget over total budget that you want to get warnings for. If you omit this parameter, the default of 50.0 is used.</p>
    pub fn get_warning_threshold(&self) -> &::std::option::Option<f64> {
        &self.warning_threshold
    }
    /// Consumes the builder and constructs a [`Goal`](crate::types::Goal).
    pub fn build(self) -> crate::types::Goal {
        crate::types::Goal {
            interval: self.interval,
            attainment_goal: self.attainment_goal,
            warning_threshold: self.warning_threshold,
        }
    }
}