aws-sdk-connect 1.167.0

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

/// <p>A tagged union to specify expression for a routing step.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Expression {
    /// <p>An object to specify the predefined attribute condition.</p>
    pub attribute_condition: ::std::option::Option<crate::types::AttributeCondition>,
    /// <p>List of routing expressions which will be AND-ed together.</p>
    pub and_expression: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>,
    /// <p>List of routing expressions which will be OR-ed together.</p>
    pub or_expression: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>,
    /// <p>An object to specify the predefined attribute condition.</p>
    pub not_attribute_condition: ::std::option::Option<crate::types::AttributeCondition>,
}
impl Expression {
    /// <p>An object to specify the predefined attribute condition.</p>
    pub fn attribute_condition(&self) -> ::std::option::Option<&crate::types::AttributeCondition> {
        self.attribute_condition.as_ref()
    }
    /// <p>List of routing expressions which will be AND-ed together.</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_expression.is_none()`.
    pub fn and_expression(&self) -> &[crate::types::Expression] {
        self.and_expression.as_deref().unwrap_or_default()
    }
    /// <p>List of routing expressions which will be OR-ed together.</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_expression.is_none()`.
    pub fn or_expression(&self) -> &[crate::types::Expression] {
        self.or_expression.as_deref().unwrap_or_default()
    }
    /// <p>An object to specify the predefined attribute condition.</p>
    pub fn not_attribute_condition(&self) -> ::std::option::Option<&crate::types::AttributeCondition> {
        self.not_attribute_condition.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) 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 {
    /// <p>An object to specify the predefined attribute condition.</p>
    pub fn attribute_condition(mut self, input: crate::types::AttributeCondition) -> Self {
        self.attribute_condition = ::std::option::Option::Some(input);
        self
    }
    /// <p>An object to specify the predefined attribute condition.</p>
    pub fn set_attribute_condition(mut self, input: ::std::option::Option<crate::types::AttributeCondition>) -> Self {
        self.attribute_condition = input;
        self
    }
    /// <p>An object to specify the predefined attribute condition.</p>
    pub fn get_attribute_condition(&self) -> &::std::option::Option<crate::types::AttributeCondition> {
        &self.attribute_condition
    }
    /// Appends an item to `and_expression`.
    ///
    /// To override the contents of this collection use [`set_and_expression`](Self::set_and_expression).
    ///
    /// <p>List of routing expressions which will be AND-ed together.</p>
    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
    }
    /// <p>List of routing expressions which will be AND-ed together.</p>
    pub fn set_and_expression(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>) -> Self {
        self.and_expression = input;
        self
    }
    /// <p>List of routing expressions which will be AND-ed together.</p>
    pub fn get_and_expression(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Expression>> {
        &self.and_expression
    }
    /// Appends an item to `or_expression`.
    ///
    /// To override the contents of this collection use [`set_or_expression`](Self::set_or_expression).
    ///
    /// <p>List of routing expressions which will be OR-ed together.</p>
    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
    }
    /// <p>List of routing expressions which will be OR-ed together.</p>
    pub fn set_or_expression(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Expression>>) -> Self {
        self.or_expression = input;
        self
    }
    /// <p>List of routing expressions which will be OR-ed together.</p>
    pub fn get_or_expression(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Expression>> {
        &self.or_expression
    }
    /// <p>An object to specify the predefined attribute condition.</p>
    pub fn not_attribute_condition(mut self, input: crate::types::AttributeCondition) -> Self {
        self.not_attribute_condition = ::std::option::Option::Some(input);
        self
    }
    /// <p>An object to specify the predefined attribute condition.</p>
    pub fn set_not_attribute_condition(mut self, input: ::std::option::Option<crate::types::AttributeCondition>) -> Self {
        self.not_attribute_condition = input;
        self
    }
    /// <p>An object to specify the predefined attribute condition.</p>
    pub fn get_not_attribute_condition(&self) -> &::std::option::Option<crate::types::AttributeCondition> {
        &self.not_attribute_condition
    }
    /// Consumes the builder and constructs a [`Expression`](crate::types::Expression).
    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,
        }
    }
}