#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Expression {
pub or: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>,
pub and: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>,
pub not: ::std::option::Option<::std::boxed::Box<crate::types::Expression>>,
pub dimensions: ::std::option::Option<crate::types::ExpressionDimensionValues>,
pub tags: ::std::option::Option<crate::types::TagValues>,
pub cost_categories: ::std::option::Option<crate::types::CostCategoryValues>,
}
impl Expression {
pub fn or(&self) -> &[crate::types::Expression] {
self.or.as_deref().unwrap_or_default()
}
pub fn and(&self) -> &[crate::types::Expression] {
self.and.as_deref().unwrap_or_default()
}
pub fn not(&self) -> ::std::option::Option<&crate::types::Expression> {
self.not.as_deref()
}
pub fn dimensions(&self) -> ::std::option::Option<&crate::types::ExpressionDimensionValues> {
self.dimensions.as_ref()
}
pub fn tags(&self) -> ::std::option::Option<&crate::types::TagValues> {
self.tags.as_ref()
}
pub fn cost_categories(&self) -> ::std::option::Option<&crate::types::CostCategoryValues> {
self.cost_categories.as_ref()
}
}
impl Expression {
pub fn builder() -> crate::types::builders::ExpressionBuilder {
crate::types::builders::ExpressionBuilder::default()
}
}
#[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 {
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
}
pub fn set_or(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>) -> Self {
self.or = input;
self
}
pub fn get_or(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Expression>> {
&self.or
}
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
}
pub fn set_and(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>) -> Self {
self.and = input;
self
}
pub fn get_and(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Expression>> {
&self.and
}
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
}
pub fn set_not(mut self, input: ::std::option::Option<::std::boxed::Box<crate::types::Expression>>) -> Self {
self.not = input;
self
}
pub fn get_not(&self) -> &::std::option::Option<::std::boxed::Box<crate::types::Expression>> {
&self.not
}
pub fn dimensions(mut self, input: crate::types::ExpressionDimensionValues) -> Self {
self.dimensions = ::std::option::Option::Some(input);
self
}
pub fn set_dimensions(mut self, input: ::std::option::Option<crate::types::ExpressionDimensionValues>) -> Self {
self.dimensions = input;
self
}
pub fn get_dimensions(&self) -> &::std::option::Option<crate::types::ExpressionDimensionValues> {
&self.dimensions
}
pub fn tags(mut self, input: crate::types::TagValues) -> Self {
self.tags = ::std::option::Option::Some(input);
self
}
pub fn set_tags(mut self, input: ::std::option::Option<crate::types::TagValues>) -> Self {
self.tags = input;
self
}
pub fn get_tags(&self) -> &::std::option::Option<crate::types::TagValues> {
&self.tags
}
pub fn cost_categories(mut self, input: crate::types::CostCategoryValues) -> Self {
self.cost_categories = ::std::option::Option::Some(input);
self
}
pub fn set_cost_categories(mut self, input: ::std::option::Option<crate::types::CostCategoryValues>) -> Self {
self.cost_categories = input;
self
}
pub fn get_cost_categories(&self) -> &::std::option::Option<crate::types::CostCategoryValues> {
&self.cost_categories
}
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,
}
}
}