Skip to main content

windmill_api/models/
azure_trigger.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.725.1
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// AzureTrigger : An Azure Event Grid trigger that executes a script or flow when events arrive.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct AzureTrigger {
17    #[serde(rename = "azure_resource_path")]
18    pub azure_resource_path: String,
19    #[serde(rename = "azure_mode")]
20    pub azure_mode: models::AzureMode,
21    /// ARM resource ID of the topic (basic) or namespace (namespace modes).
22    #[serde(rename = "scope_resource_id")]
23    pub scope_resource_id: String,
24    /// Topic name within the namespace (namespace modes only).
25    #[serde(rename = "topic_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub topic_name: Option<Option<String>>,
27    #[serde(rename = "subscription_name")]
28    pub subscription_name: String,
29    #[serde(rename = "event_type_filters", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub event_type_filters: Option<Option<Vec<String>>>,
31    #[serde(rename = "server_id", skip_serializing_if = "Option::is_none")]
32    pub server_id: Option<String>,
33    #[serde(rename = "last_server_ping", skip_serializing_if = "Option::is_none")]
34    pub last_server_ping: Option<String>,
35    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
36    pub error: Option<String>,
37    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
38    pub error_handler_path: Option<String>,
39    /// The arguments to pass to the script or flow
40    #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
41    pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
42    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
43    pub retry: Option<Box<models::Retry>>,
44    /// 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.
45    #[serde(rename = "path")]
46    pub path: String,
47    /// Path to the script or flow to execute when triggered
48    #[serde(rename = "script_path")]
49    pub script_path: String,
50    /// The user or group this trigger runs as (permissioned_as)
51    #[serde(rename = "permissioned_as")]
52    pub permissioned_as: String,
53    /// Additional permissions for this trigger
54    #[serde(rename = "extra_perms")]
55    pub extra_perms: std::collections::HashMap<String, bool>,
56    /// The workspace this trigger belongs to
57    #[serde(rename = "workspace_id")]
58    pub workspace_id: String,
59    /// Username of the last person who edited this trigger
60    #[serde(rename = "edited_by")]
61    pub edited_by: String,
62    /// Timestamp of the last edit
63    #[serde(rename = "edited_at")]
64    pub edited_at: String,
65    /// True if script_path points to a flow, false if it points to a script
66    #[serde(rename = "is_flow")]
67    pub is_flow: bool,
68    #[serde(rename = "mode")]
69    pub mode: models::TriggerMode,
70    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
71    pub labels: Option<Vec<String>>,
72    /// 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. 
73    #[serde(rename = "draft_only", skip_serializing_if = "Option::is_none")]
74    pub draft_only: Option<bool>,
75    /// 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. 
76    #[serde(rename = "is_draft", skip_serializing_if = "Option::is_none")]
77    pub is_draft: Option<bool>,
78}
79
80impl AzureTrigger {
81    /// An Azure Event Grid trigger that executes a script or flow when events arrive.
82    pub fn new(azure_resource_path: String, azure_mode: models::AzureMode, scope_resource_id: String, subscription_name: String, 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) -> AzureTrigger {
83        AzureTrigger {
84            azure_resource_path,
85            azure_mode,
86            scope_resource_id,
87            topic_name: None,
88            subscription_name,
89            event_type_filters: None,
90            server_id: None,
91            last_server_ping: None,
92            error: None,
93            error_handler_path: None,
94            error_handler_args: None,
95            retry: None,
96            path,
97            script_path,
98            permissioned_as,
99            extra_perms,
100            workspace_id,
101            edited_by,
102            edited_at,
103            is_flow,
104            mode,
105            labels: None,
106            draft_only: None,
107            is_draft: None,
108        }
109    }
110}
111