aws-sdk-ecs 1.126.0

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

/// <p>A floating-point percentage of the desired number of tasks to place and keep running in the task set.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Scale {
    /// <p>The value, specified as a percent total of a service's <code>desiredCount</code>, to scale the task set. Accepted values are numbers between 0 and 100.</p>
    pub value: f64,
    /// <p>The unit of measure for the scale value.</p>
    pub unit: ::std::option::Option<crate::types::ScaleUnit>,
}
impl Scale {
    /// <p>The value, specified as a percent total of a service's <code>desiredCount</code>, to scale the task set. Accepted values are numbers between 0 and 100.</p>
    pub fn value(&self) -> f64 {
        self.value
    }
    /// <p>The unit of measure for the scale value.</p>
    pub fn unit(&self) -> ::std::option::Option<&crate::types::ScaleUnit> {
        self.unit.as_ref()
    }
}
impl Scale {
    /// Creates a new builder-style object to manufacture [`Scale`](crate::types::Scale).
    pub fn builder() -> crate::types::builders::ScaleBuilder {
        crate::types::builders::ScaleBuilder::default()
    }
}

/// A builder for [`Scale`](crate::types::Scale).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ScaleBuilder {
    pub(crate) value: ::std::option::Option<f64>,
    pub(crate) unit: ::std::option::Option<crate::types::ScaleUnit>,
}
impl ScaleBuilder {
    /// <p>The value, specified as a percent total of a service's <code>desiredCount</code>, to scale the task set. Accepted values are numbers between 0 and 100.</p>
    pub fn value(mut self, input: f64) -> Self {
        self.value = ::std::option::Option::Some(input);
        self
    }
    /// <p>The value, specified as a percent total of a service's <code>desiredCount</code>, to scale the task set. Accepted values are numbers between 0 and 100.</p>
    pub fn set_value(mut self, input: ::std::option::Option<f64>) -> Self {
        self.value = input;
        self
    }
    /// <p>The value, specified as a percent total of a service's <code>desiredCount</code>, to scale the task set. Accepted values are numbers between 0 and 100.</p>
    pub fn get_value(&self) -> &::std::option::Option<f64> {
        &self.value
    }
    /// <p>The unit of measure for the scale value.</p>
    pub fn unit(mut self, input: crate::types::ScaleUnit) -> Self {
        self.unit = ::std::option::Option::Some(input);
        self
    }
    /// <p>The unit of measure for the scale value.</p>
    pub fn set_unit(mut self, input: ::std::option::Option<crate::types::ScaleUnit>) -> Self {
        self.unit = input;
        self
    }
    /// <p>The unit of measure for the scale value.</p>
    pub fn get_unit(&self) -> &::std::option::Option<crate::types::ScaleUnit> {
        &self.unit
    }
    /// Consumes the builder and constructs a [`Scale`](crate::types::Scale).
    pub fn build(self) -> crate::types::Scale {
        crate::types::Scale {
            value: self.value.unwrap_or_default(),
            unit: self.unit,
        }
    }
}