Skip to main content

windmill_api/models/
get_mqtt_trigger_200_response.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 GetMqttTrigger200Response {
16    /// Path to the MQTT resource containing broker connection configuration
17    #[serde(rename = "mqtt_resource_path")]
18    pub mqtt_resource_path: String,
19    /// Array of MQTT topics to subscribe to, each with topic name and QoS level
20    #[serde(rename = "subscribe_topics")]
21    pub subscribe_topics: Vec<models::MqttSubscribeTopic>,
22    #[serde(rename = "v3_config", skip_serializing_if = "Option::is_none")]
23    pub v3_config: Option<Box<models::MqttV3Config>>,
24    #[serde(rename = "v5_config", skip_serializing_if = "Option::is_none")]
25    pub v5_config: Option<Box<models::MqttV5Config>>,
26    /// MQTT client ID for this connection
27    #[serde(rename = "client_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub client_id: Option<Option<String>>,
29    #[serde(rename = "client_version", skip_serializing_if = "Option::is_none")]
30    pub client_version: Option<models::MqttClientVersion>,
31    /// ID of the server currently handling this trigger (internal)
32    #[serde(rename = "server_id", skip_serializing_if = "Option::is_none")]
33    pub server_id: Option<String>,
34    /// Timestamp of last server heartbeat (internal)
35    #[serde(rename = "last_server_ping", skip_serializing_if = "Option::is_none")]
36    pub last_server_ping: Option<String>,
37    /// Last error message if the trigger failed
38    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
39    pub error: Option<String>,
40    /// Path to a script or flow to run when the triggered job fails
41    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
42    pub error_handler_path: Option<String>,
43    /// The arguments to pass to the script or flow
44    #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
45    pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
46    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
47    pub retry: Option<Box<models::Retry>>,
48    /// 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.
49    #[serde(rename = "path")]
50    pub path: String,
51    /// Path to the script or flow to execute when triggered
52    #[serde(rename = "script_path")]
53    pub script_path: String,
54    /// The user or group this trigger runs as (permissioned_as)
55    #[serde(rename = "permissioned_as")]
56    pub permissioned_as: String,
57    /// Additional permissions for this trigger
58    #[serde(rename = "extra_perms")]
59    pub extra_perms: std::collections::HashMap<String, bool>,
60    /// The workspace this trigger belongs to
61    #[serde(rename = "workspace_id")]
62    pub workspace_id: String,
63    /// Username of the last person who edited this trigger
64    #[serde(rename = "edited_by")]
65    pub edited_by: String,
66    /// Timestamp of the last edit
67    #[serde(rename = "edited_at")]
68    pub edited_at: String,
69    /// True if script_path points to a flow, false if it points to a script
70    #[serde(rename = "is_flow")]
71    pub is_flow: bool,
72    #[serde(rename = "mode")]
73    pub mode: models::TriggerMode,
74    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
75    pub labels: Option<Vec<String>>,
76    /// 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. 
77    #[serde(rename = "draft_only", skip_serializing_if = "Option::is_none")]
78    pub draft_only: Option<bool>,
79    #[serde(rename = "is_draft")]
80    pub is_draft: bool,
81    #[serde(rename = "draft_saved_at", skip_serializing_if = "Option::is_none")]
82    pub draft_saved_at: Option<String>,
83    #[serde(rename = "no_deployed", skip_serializing_if = "Option::is_none")]
84    pub no_deployed: Option<bool>,
85    #[serde(rename = "draft", skip_serializing_if = "Option::is_none")]
86    pub draft: Option<std::collections::HashMap<String, serde_json::Value>>,
87    /// Other workspace users (and the legacy NULL-email row, if any) with a saved draft at the same path. Populated only on the authed user's \"get by path\" responses for kinds the editor surfaces a fork banner for (script, flow, app, raw_app). Empty / omitted for kinds without that UI. 
88    #[serde(rename = "other_drafts_users", skip_serializing_if = "Option::is_none")]
89    pub other_drafts_users: Option<Vec<models::UserDraftOverlayOtherDraftsUsersInner>>,
90}
91
92impl GetMqttTrigger200Response {
93    pub fn new(mqtt_resource_path: String, subscribe_topics: Vec<models::MqttSubscribeTopic>, 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, is_draft: bool) -> GetMqttTrigger200Response {
94        GetMqttTrigger200Response {
95            mqtt_resource_path,
96            subscribe_topics,
97            v3_config: None,
98            v5_config: None,
99            client_id: None,
100            client_version: None,
101            server_id: None,
102            last_server_ping: None,
103            error: None,
104            error_handler_path: None,
105            error_handler_args: None,
106            retry: None,
107            path,
108            script_path,
109            permissioned_as,
110            extra_perms,
111            workspace_id,
112            edited_by,
113            edited_at,
114            is_flow,
115            mode,
116            labels: None,
117            draft_only: None,
118            is_draft,
119            draft_saved_at: None,
120            no_deployed: None,
121            draft: None,
122            other_drafts_users: None,
123        }
124    }
125}
126