Skip to main content

windmill_api/models/
trigger_extra_property.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.727.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 TriggerExtraProperty {
16    /// The unique Windmill path for this trigger. Must be of the form `u/<user>/<path>` or `f/<folder>/<path>`. This is the trigger object path, not the HTTP route path.
17    #[serde(rename = "path")]
18    pub path: String,
19    /// Path to the script or flow to execute when triggered
20    #[serde(rename = "script_path")]
21    pub script_path: String,
22    /// The user or group this trigger runs as (permissioned_as)
23    #[serde(rename = "permissioned_as")]
24    pub permissioned_as: String,
25    /// Additional permissions for this trigger
26    #[serde(rename = "extra_perms")]
27    pub extra_perms: std::collections::HashMap<String, bool>,
28    /// The workspace this trigger belongs to
29    #[serde(rename = "workspace_id")]
30    pub workspace_id: String,
31    /// Username of the last person who edited this trigger
32    #[serde(rename = "edited_by")]
33    pub edited_by: String,
34    /// Timestamp of the last edit
35    #[serde(rename = "edited_at")]
36    pub edited_at: String,
37    /// True if script_path points to a flow, false if it points to a script
38    #[serde(rename = "is_flow")]
39    pub is_flow: bool,
40    #[serde(rename = "mode")]
41    pub mode: models::TriggerMode,
42    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
43    pub labels: Option<Vec<String>>,
44    /// True when this row is a per-user draft with no deployed trigger at the same path. Set by list endpoints when `include_draft_only=true` synthesizes the row from the draft. Frontend renders a \"Draft\" badge. 
45    #[serde(rename = "draft_only", skip_serializing_if = "Option::is_none")]
46    pub draft_only: Option<bool>,
47    /// True when the authed user has a per-user draft at this path (over a deployed row or a synthesized draft-only row). Frontend appends a `*` to the displayed name. 
48    #[serde(rename = "is_draft", skip_serializing_if = "Option::is_none")]
49    pub is_draft: Option<bool>,
50}
51
52impl TriggerExtraProperty {
53    pub fn new(path: String, script_path: String, permissioned_as: String, extra_perms: std::collections::HashMap<String, bool>, workspace_id: String, edited_by: String, edited_at: String, is_flow: bool, mode: models::TriggerMode) -> TriggerExtraProperty {
54        TriggerExtraProperty {
55            path,
56            script_path,
57            permissioned_as,
58            extra_perms,
59            workspace_id,
60            edited_by,
61            edited_at,
62            is_flow,
63            mode,
64            labels: None,
65            draft_only: None,
66            is_draft: None,
67        }
68    }
69}
70