aws-sdk-deadline 1.64.0

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

/// <p>The minimum, maximum, average, and sum.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Stats {
    /// <p>The minimum of the usage statistics.</p>
    pub min: ::std::option::Option<f64>,
    /// <p>The maximum among the usage statistics.</p>
    pub max: ::std::option::Option<f64>,
    /// <p>The average of the usage statistics.</p>
    pub avg: ::std::option::Option<f64>,
    /// <p>The sum of the usage statistics.</p>
    pub sum: ::std::option::Option<f64>,
}
impl Stats {
    /// <p>The minimum of the usage statistics.</p>
    pub fn min(&self) -> ::std::option::Option<f64> {
        self.min
    }
    /// <p>The maximum among the usage statistics.</p>
    pub fn max(&self) -> ::std::option::Option<f64> {
        self.max
    }
    /// <p>The average of the usage statistics.</p>
    pub fn avg(&self) -> ::std::option::Option<f64> {
        self.avg
    }
    /// <p>The sum of the usage statistics.</p>
    pub fn sum(&self) -> ::std::option::Option<f64> {
        self.sum
    }
}
impl Stats {
    /// Creates a new builder-style object to manufacture [`Stats`](crate::types::Stats).
    pub fn builder() -> crate::types::builders::StatsBuilder {
        crate::types::builders::StatsBuilder::default()
    }
}

/// A builder for [`Stats`](crate::types::Stats).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StatsBuilder {
    pub(crate) min: ::std::option::Option<f64>,
    pub(crate) max: ::std::option::Option<f64>,
    pub(crate) avg: ::std::option::Option<f64>,
    pub(crate) sum: ::std::option::Option<f64>,
}
impl StatsBuilder {
    /// <p>The minimum of the usage statistics.</p>
    pub fn min(mut self, input: f64) -> Self {
        self.min = ::std::option::Option::Some(input);
        self
    }
    /// <p>The minimum of the usage statistics.</p>
    pub fn set_min(mut self, input: ::std::option::Option<f64>) -> Self {
        self.min = input;
        self
    }
    /// <p>The minimum of the usage statistics.</p>
    pub fn get_min(&self) -> &::std::option::Option<f64> {
        &self.min
    }
    /// <p>The maximum among the usage statistics.</p>
    pub fn max(mut self, input: f64) -> Self {
        self.max = ::std::option::Option::Some(input);
        self
    }
    /// <p>The maximum among the usage statistics.</p>
    pub fn set_max(mut self, input: ::std::option::Option<f64>) -> Self {
        self.max = input;
        self
    }
    /// <p>The maximum among the usage statistics.</p>
    pub fn get_max(&self) -> &::std::option::Option<f64> {
        &self.max
    }
    /// <p>The average of the usage statistics.</p>
    pub fn avg(mut self, input: f64) -> Self {
        self.avg = ::std::option::Option::Some(input);
        self
    }
    /// <p>The average of the usage statistics.</p>
    pub fn set_avg(mut self, input: ::std::option::Option<f64>) -> Self {
        self.avg = input;
        self
    }
    /// <p>The average of the usage statistics.</p>
    pub fn get_avg(&self) -> &::std::option::Option<f64> {
        &self.avg
    }
    /// <p>The sum of the usage statistics.</p>
    pub fn sum(mut self, input: f64) -> Self {
        self.sum = ::std::option::Option::Some(input);
        self
    }
    /// <p>The sum of the usage statistics.</p>
    pub fn set_sum(mut self, input: ::std::option::Option<f64>) -> Self {
        self.sum = input;
        self
    }
    /// <p>The sum of the usage statistics.</p>
    pub fn get_sum(&self) -> &::std::option::Option<f64> {
        &self.sum
    }
    /// Consumes the builder and constructs a [`Stats`](crate::types::Stats).
    pub fn build(self) -> crate::types::Stats {
        crate::types::Stats {
            min: self.min,
            max: self.max,
            avg: self.avg,
            sum: self.sum,
        }
    }
}