windmill_api/models/branch_one.rs
1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.592.1
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// BranchOne : Conditional branching where only the first matching branch executes. Branches are evaluated in order, and the first one with a true expression runs. If no branches match, the default branch executes
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct BranchOne {
17 /// Array of branches to evaluate in order. The first branch with expr evaluating to true executes
18 #[serde(rename = "branches")]
19 pub branches: Vec<models::BranchOneBranchesInner>,
20 /// Steps to execute if no branch expressions match
21 #[serde(rename = "default")]
22 pub default: Vec<models::FlowModule>,
23 #[serde(rename = "type")]
24 pub r#type: Type,
25}
26
27impl BranchOne {
28 /// Conditional branching where only the first matching branch executes. Branches are evaluated in order, and the first one with a true expression runs. If no branches match, the default branch executes
29 pub fn new(branches: Vec<models::BranchOneBranchesInner>, default: Vec<models::FlowModule>, r#type: Type) -> BranchOne {
30 BranchOne {
31 branches,
32 default,
33 r#type,
34 }
35 }
36}
37///
38#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
39pub enum Type {
40 #[serde(rename = "branchone")]
41 Branchone,
42}
43
44impl Default for Type {
45 fn default() -> Type {
46 Self::Branchone
47 }
48}
49