use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WorkflowCompoundCondition {
#[serde(rename = "operator")]
pub operator: Operator,
#[serde(rename = "conditions")]
pub conditions: Vec<models::WorkflowConditionBean>,
#[serde(rename = "nodeType")]
pub node_type: String,
}
impl WorkflowCompoundCondition {
pub fn new(operator: Operator, conditions: Vec<models::WorkflowConditionBean>, node_type: String) -> WorkflowCompoundCondition {
WorkflowCompoundCondition {
operator,
conditions,
node_type,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Operator {
#[serde(rename = "AND")]
And,
#[serde(rename = "OR")]
Or,
}
impl Default for Operator {
fn default() -> Operator {
Self::And
}
}