windmill-api 1.544.2

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Windmill API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.544.2
 * Contact: contact@windmill.dev
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EditSchedule {
    /// The cron schedule to trigger the script or flow. Should include seconds.
    #[serde(rename = "schedule")]
    pub schedule: String,
    /// The timezone to use for the cron schedule
    #[serde(rename = "timezone")]
    pub timezone: String,
    /// The arguments to pass to the script or flow
    #[serde(rename = "args")]
    pub args: std::collections::HashMap<String, serde_json::Value>,
    /// The path to the script or flow to trigger on failure
    #[serde(rename = "on_failure", skip_serializing_if = "Option::is_none")]
    pub on_failure: Option<String>,
    /// The number of times to retry on failure
    #[serde(rename = "on_failure_times", skip_serializing_if = "Option::is_none")]
    pub on_failure_times: Option<f64>,
    /// Whether the schedule should only run on the exact time
    #[serde(rename = "on_failure_exact", skip_serializing_if = "Option::is_none")]
    pub on_failure_exact: Option<bool>,
    /// The arguments to pass to the script or flow
    #[serde(rename = "on_failure_extra_args", skip_serializing_if = "Option::is_none")]
    pub on_failure_extra_args: Option<std::collections::HashMap<String, serde_json::Value>>,
    /// The path to the script or flow to trigger on recovery
    #[serde(rename = "on_recovery", skip_serializing_if = "Option::is_none")]
    pub on_recovery: Option<String>,
    /// The number of times to retry on recovery
    #[serde(rename = "on_recovery_times", skip_serializing_if = "Option::is_none")]
    pub on_recovery_times: Option<f64>,
    /// The arguments to pass to the script or flow
    #[serde(rename = "on_recovery_extra_args", skip_serializing_if = "Option::is_none")]
    pub on_recovery_extra_args: Option<std::collections::HashMap<String, serde_json::Value>>,
    /// The path to the script or flow to trigger on success
    #[serde(rename = "on_success", skip_serializing_if = "Option::is_none")]
    pub on_success: Option<String>,
    /// The arguments to pass to the script or flow
    #[serde(rename = "on_success_extra_args", skip_serializing_if = "Option::is_none")]
    pub on_success_extra_args: Option<std::collections::HashMap<String, serde_json::Value>>,
    /// Whether the WebSocket error handler is muted
    #[serde(rename = "ws_error_handler_muted", skip_serializing_if = "Option::is_none")]
    pub ws_error_handler_muted: Option<bool>,
    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
    pub retry: Option<Box<models::Retry>>,
    /// Whether the schedule should not run if a flow is already running
    #[serde(rename = "no_flow_overlap", skip_serializing_if = "Option::is_none")]
    pub no_flow_overlap: Option<bool>,
    /// The summary of the schedule
    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
    pub summary: Option<String>,
    /// The description of the schedule
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// The tag of the schedule
    #[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
    pub tag: Option<String>,
    /// The date and time the schedule will be paused until
    #[serde(rename = "paused_until", skip_serializing_if = "Option::is_none")]
    pub paused_until: Option<String>,
    /// The version of the cron schedule to use (last is v2)
    #[serde(rename = "cron_version", skip_serializing_if = "Option::is_none")]
    pub cron_version: Option<String>,
}

impl EditSchedule {
    pub fn new(schedule: String, timezone: String, args: std::collections::HashMap<String, serde_json::Value>) -> EditSchedule {
        EditSchedule {
            schedule,
            timezone,
            args,
            on_failure: None,
            on_failure_times: None,
            on_failure_exact: None,
            on_failure_extra_args: None,
            on_recovery: None,
            on_recovery_times: None,
            on_recovery_extra_args: None,
            on_success: None,
            on_success_extra_args: None,
            ws_error_handler_muted: None,
            retry: None,
            no_flow_overlap: None,
            summary: None,
            description: None,
            tag: None,
            paused_until: None,
            cron_version: None,
        }
    }
}