#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Expression {
pub attribute_condition: ::std::option::Option<crate::types::AttributeCondition>,
pub and_expression: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>,
pub or_expression: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>,
pub not_attribute_condition: ::std::option::Option<crate::types::AttributeCondition>,
}
impl Expression {
pub fn attribute_condition(&self) -> ::std::option::Option<&crate::types::AttributeCondition> {
self.attribute_condition.as_ref()
}
pub fn and_expression(&self) -> &[crate::types::Expression] {
self.and_expression.as_deref().unwrap_or_default()
}
pub fn or_expression(&self) -> &[crate::types::Expression] {
self.or_expression.as_deref().unwrap_or_default()
}
pub fn not_attribute_condition(&self) -> ::std::option::Option<&crate::types::AttributeCondition> {
self.not_attribute_condition.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) attribute_condition: ::std::option::Option<crate::types::AttributeCondition>,
pub(crate) and_expression: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>,
pub(crate) or_expression: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>,
pub(crate) not_attribute_condition: ::std::option::Option<crate::types::AttributeCondition>,
}
impl ExpressionBuilder {
pub fn attribute_condition(mut self, input: crate::types::AttributeCondition) -> Self {
self.attribute_condition = ::std::option::Option::Some(input);
self
}
pub fn set_attribute_condition(mut self, input: ::std::option::Option<crate::types::AttributeCondition>) -> Self {
self.attribute_condition = input;
self
}
pub fn get_attribute_condition(&self) -> &::std::option::Option<crate::types::AttributeCondition> {
&self.attribute_condition
}
pub fn and_expression(mut self, input: crate::types::Expression) -> Self {
let mut v = self.and_expression.unwrap_or_default();
v.push(input);
self.and_expression = ::std::option::Option::Some(v);
self
}
pub fn set_and_expression(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>) -> Self {
self.and_expression = input;
self
}
pub fn get_and_expression(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Expression>> {
&self.and_expression
}
pub fn or_expression(mut self, input: crate::types::Expression) -> Self {
let mut v = self.or_expression.unwrap_or_default();
v.push(input);
self.or_expression = ::std::option::Option::Some(v);
self
}
pub fn set_or_expression(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>) -> Self {
self.or_expression = input;
self
}
pub fn get_or_expression(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Expression>> {
&self.or_expression
}
pub fn not_attribute_condition(mut self, input: crate::types::AttributeCondition) -> Self {
self.not_attribute_condition = ::std::option::Option::Some(input);
self
}
pub fn set_not_attribute_condition(mut self, input: ::std::option::Option<crate::types::AttributeCondition>) -> Self {
self.not_attribute_condition = input;
self
}
pub fn get_not_attribute_condition(&self) -> &::std::option::Option<crate::types::AttributeCondition> {
&self.not_attribute_condition
}
pub fn build(self) -> crate::types::Expression {
crate::types::Expression {
attribute_condition: self.attribute_condition,
and_expression: self.and_expression,
or_expression: self.or_expression,
not_attribute_condition: self.not_attribute_condition,
}
}
}