aws-sdk-costoptimizationhub 1.13.0

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

/// <p>Details about the usage.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Usage {
    /// <p>The usage type.</p>
    pub usage_type: ::std::option::Option<::std::string::String>,
    /// <p>The usage amount.</p>
    pub usage_amount: ::std::option::Option<f64>,
    /// <p>The operation value.</p>
    pub operation: ::std::option::Option<::std::string::String>,
    /// <p>The product code.</p>
    pub product_code: ::std::option::Option<::std::string::String>,
    /// <p>The usage unit.</p>
    pub unit: ::std::option::Option<::std::string::String>,
}
impl Usage {
    /// <p>The usage type.</p>
    pub fn usage_type(&self) -> ::std::option::Option<&str> {
        self.usage_type.as_deref()
    }
    /// <p>The usage amount.</p>
    pub fn usage_amount(&self) -> ::std::option::Option<f64> {
        self.usage_amount
    }
    /// <p>The operation value.</p>
    pub fn operation(&self) -> ::std::option::Option<&str> {
        self.operation.as_deref()
    }
    /// <p>The product code.</p>
    pub fn product_code(&self) -> ::std::option::Option<&str> {
        self.product_code.as_deref()
    }
    /// <p>The usage unit.</p>
    pub fn unit(&self) -> ::std::option::Option<&str> {
        self.unit.as_deref()
    }
}
impl Usage {
    /// Creates a new builder-style object to manufacture [`Usage`](crate::types::Usage).
    pub fn builder() -> crate::types::builders::UsageBuilder {
        crate::types::builders::UsageBuilder::default()
    }
}

/// A builder for [`Usage`](crate::types::Usage).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct UsageBuilder {
    pub(crate) usage_type: ::std::option::Option<::std::string::String>,
    pub(crate) usage_amount: ::std::option::Option<f64>,
    pub(crate) operation: ::std::option::Option<::std::string::String>,
    pub(crate) product_code: ::std::option::Option<::std::string::String>,
    pub(crate) unit: ::std::option::Option<::std::string::String>,
}
impl UsageBuilder {
    /// <p>The usage type.</p>
    pub fn usage_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.usage_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The usage type.</p>
    pub fn set_usage_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.usage_type = input;
        self
    }
    /// <p>The usage type.</p>
    pub fn get_usage_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.usage_type
    }
    /// <p>The usage amount.</p>
    pub fn usage_amount(mut self, input: f64) -> Self {
        self.usage_amount = ::std::option::Option::Some(input);
        self
    }
    /// <p>The usage amount.</p>
    pub fn set_usage_amount(mut self, input: ::std::option::Option<f64>) -> Self {
        self.usage_amount = input;
        self
    }
    /// <p>The usage amount.</p>
    pub fn get_usage_amount(&self) -> &::std::option::Option<f64> {
        &self.usage_amount
    }
    /// <p>The operation value.</p>
    pub fn operation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.operation = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The operation value.</p>
    pub fn set_operation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.operation = input;
        self
    }
    /// <p>The operation value.</p>
    pub fn get_operation(&self) -> &::std::option::Option<::std::string::String> {
        &self.operation
    }
    /// <p>The product code.</p>
    pub fn product_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.product_code = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The product code.</p>
    pub fn set_product_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.product_code = input;
        self
    }
    /// <p>The product code.</p>
    pub fn get_product_code(&self) -> &::std::option::Option<::std::string::String> {
        &self.product_code
    }
    /// <p>The usage unit.</p>
    pub fn unit(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.unit = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The usage unit.</p>
    pub fn set_unit(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.unit = input;
        self
    }
    /// <p>The usage unit.</p>
    pub fn get_unit(&self) -> &::std::option::Option<::std::string::String> {
        &self.unit
    }
    /// Consumes the builder and constructs a [`Usage`](crate::types::Usage).
    pub fn build(self) -> crate::types::Usage {
        crate::types::Usage {
            usage_type: self.usage_type,
            usage_amount: self.usage_amount,
            operation: self.operation,
            product_code: self.product_code,
            unit: self.unit,
        }
    }
}