windmill_api/models/
retry_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.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/// RetryIf : Conditional retry based on error or result
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct RetryIf {
17    /// JavaScript expression that returns true to retry. Has access to 'result' and 'error' variables
18    #[serde(rename = "expr")]
19    pub expr: String,
20}
21
22impl RetryIf {
23    /// Conditional retry based on error or result
24    pub fn new(expr: String) -> RetryIf {
25        RetryIf {
26            expr,
27        }
28    }
29}
30