windmill_api/models/
stop_after_if.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.598.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// StopAfterIf : Early termination condition for a module
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct StopAfterIf {
17    /// If true, following steps are skipped when this condition triggers
18    #[serde(rename = "skip_if_stopped", skip_serializing_if = "Option::is_none")]
19    pub skip_if_stopped: Option<bool>,
20    /// JavaScript expression evaluated after the module runs. Can use 'result' (step's result) or 'flow_input'. Return true to stop
21    #[serde(rename = "expr")]
22    pub expr: String,
23    /// Custom error message shown when stopping
24    #[serde(rename = "error_message", skip_serializing_if = "Option::is_none")]
25    pub error_message: Option<String>,
26}
27
28impl StopAfterIf {
29    /// Early termination condition for a module
30    pub fn new(expr: String) -> StopAfterIf {
31        StopAfterIf {
32            skip_if_stopped: None,
33            expr,
34            error_message: None,
35        }
36    }
37}
38