windmill_api/models/
edit_schedule.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.554.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct EditSchedule {
16    /// The cron schedule to trigger the script or flow. Should include seconds.
17    #[serde(rename = "schedule")]
18    pub schedule: String,
19    /// The timezone to use for the cron schedule
20    #[serde(rename = "timezone")]
21    pub timezone: String,
22    /// The arguments to pass to the script or flow
23    #[serde(rename = "args")]
24    pub args: std::collections::HashMap<String, serde_json::Value>,
25    /// The path to the script or flow to trigger on failure
26    #[serde(rename = "on_failure", skip_serializing_if = "Option::is_none")]
27    pub on_failure: Option<String>,
28    /// The number of times to retry on failure
29    #[serde(rename = "on_failure_times", skip_serializing_if = "Option::is_none")]
30    pub on_failure_times: Option<f64>,
31    /// Whether the schedule should only run on the exact time
32    #[serde(rename = "on_failure_exact", skip_serializing_if = "Option::is_none")]
33    pub on_failure_exact: Option<bool>,
34    /// The arguments to pass to the script or flow
35    #[serde(rename = "on_failure_extra_args", skip_serializing_if = "Option::is_none")]
36    pub on_failure_extra_args: Option<std::collections::HashMap<String, serde_json::Value>>,
37    /// The path to the script or flow to trigger on recovery
38    #[serde(rename = "on_recovery", skip_serializing_if = "Option::is_none")]
39    pub on_recovery: Option<String>,
40    /// The number of times to retry on recovery
41    #[serde(rename = "on_recovery_times", skip_serializing_if = "Option::is_none")]
42    pub on_recovery_times: Option<f64>,
43    /// The arguments to pass to the script or flow
44    #[serde(rename = "on_recovery_extra_args", skip_serializing_if = "Option::is_none")]
45    pub on_recovery_extra_args: Option<std::collections::HashMap<String, serde_json::Value>>,
46    /// The path to the script or flow to trigger on success
47    #[serde(rename = "on_success", skip_serializing_if = "Option::is_none")]
48    pub on_success: Option<String>,
49    /// The arguments to pass to the script or flow
50    #[serde(rename = "on_success_extra_args", skip_serializing_if = "Option::is_none")]
51    pub on_success_extra_args: Option<std::collections::HashMap<String, serde_json::Value>>,
52    /// Whether the WebSocket error handler is muted
53    #[serde(rename = "ws_error_handler_muted", skip_serializing_if = "Option::is_none")]
54    pub ws_error_handler_muted: Option<bool>,
55    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
56    pub retry: Option<Box<models::Retry>>,
57    /// Whether the schedule should not run if a flow is already running
58    #[serde(rename = "no_flow_overlap", skip_serializing_if = "Option::is_none")]
59    pub no_flow_overlap: Option<bool>,
60    /// The summary of the schedule
61    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
62    pub summary: Option<String>,
63    /// The description of the schedule
64    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
65    pub description: Option<String>,
66    /// The tag of the schedule
67    #[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
68    pub tag: Option<String>,
69    /// The date and time the schedule will be paused until
70    #[serde(rename = "paused_until", skip_serializing_if = "Option::is_none")]
71    pub paused_until: Option<String>,
72    /// The version of the cron schedule to use (last is v2)
73    #[serde(rename = "cron_version", skip_serializing_if = "Option::is_none")]
74    pub cron_version: Option<String>,
75}
76
77impl EditSchedule {
78    pub fn new(schedule: String, timezone: String, args: std::collections::HashMap<String, serde_json::Value>) -> EditSchedule {
79        EditSchedule {
80            schedule,
81            timezone,
82            args,
83            on_failure: None,
84            on_failure_times: None,
85            on_failure_exact: None,
86            on_failure_extra_args: None,
87            on_recovery: None,
88            on_recovery_times: None,
89            on_recovery_extra_args: None,
90            on_success: None,
91            on_success_extra_args: None,
92            ws_error_handler_muted: None,
93            retry: None,
94            no_flow_overlap: None,
95            summary: None,
96            description: None,
97            tag: None,
98            paused_until: None,
99            cron_version: None,
100        }
101    }
102}
103