Skip to main content

windmill_api/models/
native_trigger_data.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.664.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// NativeTriggerData : Data for creating or updating a native trigger
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct NativeTriggerData {
17    /// The path to the script or flow that will be triggered
18    #[serde(rename = "script_path")]
19    pub script_path: String,
20    /// Whether the trigger targets a flow (true) or a script (false)
21    #[serde(rename = "is_flow")]
22    pub is_flow: bool,
23    /// Service-specific configuration (e.g., event types, filters)
24    #[serde(rename = "service_config")]
25    pub service_config: std::collections::HashMap<String, serde_json::Value>,
26    /// Short summary to be displayed when listed
27    #[serde(rename = "summary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub summary: Option<Option<String>>,
29}
30
31impl NativeTriggerData {
32    /// Data for creating or updating a native trigger
33    pub fn new(script_path: String, is_flow: bool, service_config: std::collections::HashMap<String, serde_json::Value>) -> NativeTriggerData {
34        NativeTriggerData {
35            script_path,
36            is_flow,
37            service_config,
38            summary: None,
39        }
40    }
41}
42