windmill-api 1.792.0

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.792.0
 * 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 TriggerHistoryEntry {
    #[serde(rename = "id")]
    pub id: i64,
    /// 'schedule' or a trigger type (http, kafka, ...)
    #[serde(rename = "trigger_kind")]
    pub trigger_kind: String,
    #[serde(rename = "path")]
    pub path: String,
    #[serde(rename = "operation")]
    pub operation: Operation,
    /// The kind of client the change came from. `worker` means the server disabled the trigger on its own after a failure.
    #[serde(rename = "source")]
    pub source: Source,
    /// Unset when the server acted on its own.
    #[serde(rename = "username", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub username: Option<Option<String>>,
    #[serde(rename = "created_at")]
    pub created_at: String,
    /// {field: {old, new}} for the fields that actually changed. Unset for a delete.
    #[serde(rename = "changes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub changes: Option<Option<std::collections::HashMap<String, serde_json::Value>>>,
}

impl TriggerHistoryEntry {
    pub fn new(id: i64, trigger_kind: String, path: String, operation: Operation, source: Source, created_at: String) -> TriggerHistoryEntry {
        TriggerHistoryEntry {
            id,
            trigger_kind,
            path,
            operation,
            source,
            username: None,
            created_at,
            changes: None,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Operation {
    #[serde(rename = "create")]
    Create,
    #[serde(rename = "update")]
    Update,
    #[serde(rename = "delete")]
    Delete,
    #[serde(rename = "enable")]
    Enable,
    #[serde(rename = "disable")]
    Disable,
    #[serde(rename = "suspend")]
    Suspend,
}

impl Default for Operation {
    fn default() -> Operation {
        Self::Create
    }
}
/// The kind of client the change came from. `worker` means the server disabled the trigger on its own after a failure.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Source {
    #[serde(rename = "ui")]
    Ui,
    #[serde(rename = "cli")]
    Cli,
    #[serde(rename = "api")]
    Api,
    #[serde(rename = "worker")]
    Worker,
}

impl Default for Source {
    fn default() -> Source {
        Self::Ui
    }
}