#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Transition {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "description")]
pub description: String,
#[serde(rename = "from")]
pub from: Vec<String>,
#[serde(rename = "to")]
pub to: String,
#[serde(rename = "type")]
pub _type: Type,
#[serde(rename = "screen", skip_serializing_if = "Option::is_none")]
pub screen: Option<crate::models::TransitionScreenDetails>,
#[serde(rename = "rules", skip_serializing_if = "Option::is_none")]
pub rules: Option<crate::models::WorkflowRules>,
#[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
pub properties: Option<::std::collections::HashMap<String, serde_json::Value>>,
}
impl Transition {
pub fn new(id: String, name: String, description: String, from: Vec<String>, to: String, _type: Type) -> Transition {
Transition {
id,
name,
description,
from,
to,
_type,
screen: None,
rules: None,
properties: None,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "global")]
Global,
#[serde(rename = "initial")]
Initial,
#[serde(rename = "directed")]
Directed,
}
impl Default for Type {
fn default() -> Type {
Self::Global
}
}