aws-sdk-billing 1.53.0

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

/// <p>See <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_billing_Expression.html">Expression</a>. Billing view only supports <code>LINKED_ACCOUNT</code>, <code>Tags</code>, and <code>CostCategories</code>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Expression {
    /// <p>The specific <code>Dimension</code> to use for <code>Expression</code>.</p>
    pub dimensions: ::std::option::Option<crate::types::DimensionValues>,
    /// <p>The specific <code>Tag</code> to use for <code>Expression</code>.</p>
    pub tags: ::std::option::Option<crate::types::TagValues>,
    /// <p>The filter that's based on <code>CostCategory</code> values.</p>
    pub cost_categories: ::std::option::Option<crate::types::CostCategoryValues>,
    /// <p>Specifies a time range filter for the billing view data.</p>
    pub time_range: ::std::option::Option<crate::types::TimeRange>,
}
impl Expression {
    /// <p>The specific <code>Dimension</code> to use for <code>Expression</code>.</p>
    pub fn dimensions(&self) -> ::std::option::Option<&crate::types::DimensionValues> {
        self.dimensions.as_ref()
    }
    /// <p>The specific <code>Tag</code> to use for <code>Expression</code>.</p>
    pub fn tags(&self) -> ::std::option::Option<&crate::types::TagValues> {
        self.tags.as_ref()
    }
    /// <p>The filter that's based on <code>CostCategory</code> values.</p>
    pub fn cost_categories(&self) -> ::std::option::Option<&crate::types::CostCategoryValues> {
        self.cost_categories.as_ref()
    }
    /// <p>Specifies a time range filter for the billing view data.</p>
    pub fn time_range(&self) -> ::std::option::Option<&crate::types::TimeRange> {
        self.time_range.as_ref()
    }
}
impl Expression {
    /// Creates a new builder-style object to manufacture [`Expression`](crate::types::Expression).
    pub fn builder() -> crate::types::builders::ExpressionBuilder {
        crate::types::builders::ExpressionBuilder::default()
    }
}

/// A builder for [`Expression`](crate::types::Expression).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ExpressionBuilder {
    pub(crate) dimensions: ::std::option::Option<crate::types::DimensionValues>,
    pub(crate) tags: ::std::option::Option<crate::types::TagValues>,
    pub(crate) cost_categories: ::std::option::Option<crate::types::CostCategoryValues>,
    pub(crate) time_range: ::std::option::Option<crate::types::TimeRange>,
}
impl ExpressionBuilder {
    /// <p>The specific <code>Dimension</code> to use for <code>Expression</code>.</p>
    pub fn dimensions(mut self, input: crate::types::DimensionValues) -> Self {
        self.dimensions = ::std::option::Option::Some(input);
        self
    }
    /// <p>The specific <code>Dimension</code> to use for <code>Expression</code>.</p>
    pub fn set_dimensions(mut self, input: ::std::option::Option<crate::types::DimensionValues>) -> Self {
        self.dimensions = input;
        self
    }
    /// <p>The specific <code>Dimension</code> to use for <code>Expression</code>.</p>
    pub fn get_dimensions(&self) -> &::std::option::Option<crate::types::DimensionValues> {
        &self.dimensions
    }
    /// <p>The specific <code>Tag</code> to use for <code>Expression</code>.</p>
    pub fn tags(mut self, input: crate::types::TagValues) -> Self {
        self.tags = ::std::option::Option::Some(input);
        self
    }
    /// <p>The specific <code>Tag</code> to use for <code>Expression</code>.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<crate::types::TagValues>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The specific <code>Tag</code> to use for <code>Expression</code>.</p>
    pub fn get_tags(&self) -> &::std::option::Option<crate::types::TagValues> {
        &self.tags
    }
    /// <p>The filter that's based on <code>CostCategory</code> values.</p>
    pub fn cost_categories(mut self, input: crate::types::CostCategoryValues) -> Self {
        self.cost_categories = ::std::option::Option::Some(input);
        self
    }
    /// <p>The filter that's based on <code>CostCategory</code> values.</p>
    pub fn set_cost_categories(mut self, input: ::std::option::Option<crate::types::CostCategoryValues>) -> Self {
        self.cost_categories = input;
        self
    }
    /// <p>The filter that's based on <code>CostCategory</code> values.</p>
    pub fn get_cost_categories(&self) -> &::std::option::Option<crate::types::CostCategoryValues> {
        &self.cost_categories
    }
    /// <p>Specifies a time range filter for the billing view data.</p>
    pub fn time_range(mut self, input: crate::types::TimeRange) -> Self {
        self.time_range = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies a time range filter for the billing view data.</p>
    pub fn set_time_range(mut self, input: ::std::option::Option<crate::types::TimeRange>) -> Self {
        self.time_range = input;
        self
    }
    /// <p>Specifies a time range filter for the billing view data.</p>
    pub fn get_time_range(&self) -> &::std::option::Option<crate::types::TimeRange> {
        &self.time_range
    }
    /// Consumes the builder and constructs a [`Expression`](crate::types::Expression).
    pub fn build(self) -> crate::types::Expression {
        crate::types::Expression {
            dimensions: self.dimensions,
            tags: self.tags,
            cost_categories: self.cost_categories,
            time_range: self.time_range,
        }
    }
}