aws-sdk-budgets 1.80.0

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

/// <p>Use Expression to filter in various Budgets APIs.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Expression {
    /// <p>Return results that match either Dimension object.</p>
    pub or: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>,
    /// <p>Return results that match both Dimension objects.</p>
    pub and: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>,
    /// <p>Return results that don't match a Dimension object.</p>
    pub not: ::std::option::Option<::std::boxed::Box<crate::types::Expression>>,
    /// <p>The specific Dimension to use for Expression.</p>
    pub dimensions: ::std::option::Option<crate::types::ExpressionDimensionValues>,
    /// <p>The specific Tag to use for Expression.</p>
    pub tags: ::std::option::Option<crate::types::TagValues>,
    /// <p>The filter that's based on CostCategoryValues.</p>
    pub cost_categories: ::std::option::Option<crate::types::CostCategoryValues>,
}
impl Expression {
    /// <p>Return results that match either Dimension object.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.or.is_none()`.
    pub fn or(&self) -> &[crate::types::Expression] {
        self.or.as_deref().unwrap_or_default()
    }
    /// <p>Return results that match both Dimension objects.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.and.is_none()`.
    pub fn and(&self) -> &[crate::types::Expression] {
        self.and.as_deref().unwrap_or_default()
    }
    /// <p>Return results that don't match a Dimension object.</p>
    pub fn not(&self) -> ::std::option::Option<&crate::types::Expression> {
        self.not.as_deref()
    }
    /// <p>The specific Dimension to use for Expression.</p>
    pub fn dimensions(&self) -> ::std::option::Option<&crate::types::ExpressionDimensionValues> {
        self.dimensions.as_ref()
    }
    /// <p>The specific Tag to use for Expression.</p>
    pub fn tags(&self) -> ::std::option::Option<&crate::types::TagValues> {
        self.tags.as_ref()
    }
    /// <p>The filter that's based on CostCategoryValues.</p>
    pub fn cost_categories(&self) -> ::std::option::Option<&crate::types::CostCategoryValues> {
        self.cost_categories.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) or: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>,
    pub(crate) and: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>,
    pub(crate) not: ::std::option::Option<::std::boxed::Box<crate::types::Expression>>,
    pub(crate) dimensions: ::std::option::Option<crate::types::ExpressionDimensionValues>,
    pub(crate) tags: ::std::option::Option<crate::types::TagValues>,
    pub(crate) cost_categories: ::std::option::Option<crate::types::CostCategoryValues>,
}
impl ExpressionBuilder {
    /// Appends an item to `or`.
    ///
    /// To override the contents of this collection use [`set_or`](Self::set_or).
    ///
    /// <p>Return results that match either Dimension object.</p>
    pub fn or(mut self, input: crate::types::Expression) -> Self {
        let mut v = self.or.unwrap_or_default();
        v.push(input);
        self.or = ::std::option::Option::Some(v);
        self
    }
    /// <p>Return results that match either Dimension object.</p>
    pub fn set_or(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>) -> Self {
        self.or = input;
        self
    }
    /// <p>Return results that match either Dimension object.</p>
    pub fn get_or(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Expression>> {
        &self.or
    }
    /// Appends an item to `and`.
    ///
    /// To override the contents of this collection use [`set_and`](Self::set_and).
    ///
    /// <p>Return results that match both Dimension objects.</p>
    pub fn and(mut self, input: crate::types::Expression) -> Self {
        let mut v = self.and.unwrap_or_default();
        v.push(input);
        self.and = ::std::option::Option::Some(v);
        self
    }
    /// <p>Return results that match both Dimension objects.</p>
    pub fn set_and(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>) -> Self {
        self.and = input;
        self
    }
    /// <p>Return results that match both Dimension objects.</p>
    pub fn get_and(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Expression>> {
        &self.and
    }
    /// <p>Return results that don't match a Dimension object.</p>
    pub fn not(mut self, input: impl ::std::convert::Into<::std::boxed::Box<crate::types::Expression>>) -> Self {
        self.not = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Return results that don't match a Dimension object.</p>
    pub fn set_not(mut self, input: ::std::option::Option<::std::boxed::Box<crate::types::Expression>>) -> Self {
        self.not = input;
        self
    }
    /// <p>Return results that don't match a Dimension object.</p>
    pub fn get_not(&self) -> &::std::option::Option<::std::boxed::Box<crate::types::Expression>> {
        &self.not
    }
    /// <p>The specific Dimension to use for Expression.</p>
    pub fn dimensions(mut self, input: crate::types::ExpressionDimensionValues) -> Self {
        self.dimensions = ::std::option::Option::Some(input);
        self
    }
    /// <p>The specific Dimension to use for Expression.</p>
    pub fn set_dimensions(mut self, input: ::std::option::Option<crate::types::ExpressionDimensionValues>) -> Self {
        self.dimensions = input;
        self
    }
    /// <p>The specific Dimension to use for Expression.</p>
    pub fn get_dimensions(&self) -> &::std::option::Option<crate::types::ExpressionDimensionValues> {
        &self.dimensions
    }
    /// <p>The specific Tag to use for Expression.</p>
    pub fn tags(mut self, input: crate::types::TagValues) -> Self {
        self.tags = ::std::option::Option::Some(input);
        self
    }
    /// <p>The specific Tag to use for Expression.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<crate::types::TagValues>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The specific Tag to use for Expression.</p>
    pub fn get_tags(&self) -> &::std::option::Option<crate::types::TagValues> {
        &self.tags
    }
    /// <p>The filter that's based on CostCategoryValues.</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 CostCategoryValues.</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 CostCategoryValues.</p>
    pub fn get_cost_categories(&self) -> &::std::option::Option<crate::types::CostCategoryValues> {
        &self.cost_categories
    }
    /// Consumes the builder and constructs a [`Expression`](crate::types::Expression).
    pub fn build(self) -> crate::types::Expression {
        crate::types::Expression {
            or: self.or,
            and: self.and,
            not: self.not,
            dimensions: self.dimensions,
            tags: self.tags,
            cost_categories: self.cost_categories,
        }
    }
}