Skip to main content

windmill_api/models/
edit_mqtt_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.662.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 EditMqttTrigger {
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    /// MQTT client ID for this connection
23    #[serde(rename = "client_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub client_id: Option<Option<String>>,
25    #[serde(rename = "v3_config", skip_serializing_if = "Option::is_none")]
26    pub v3_config: Option<Box<models::MqttV3Config>>,
27    #[serde(rename = "v5_config", skip_serializing_if = "Option::is_none")]
28    pub v5_config: Option<Box<models::MqttV5Config>>,
29    #[serde(rename = "client_version", skip_serializing_if = "Option::is_none")]
30    pub client_version: Option<models::MqttClientVersion>,
31    /// The unique path identifier for this trigger
32    #[serde(rename = "path")]
33    pub path: String,
34    /// Path to the script or flow to execute when a message is received
35    #[serde(rename = "script_path")]
36    pub script_path: 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", skip_serializing_if = "Option::is_none")]
41    pub mode: Option<models::TriggerMode>,
42    /// Path to a script or flow to run when the triggered job fails
43    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
44    pub error_handler_path: Option<String>,
45    /// The arguments to pass to the script or flow
46    #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
47    pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
48    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
49    pub retry: Option<Box<models::Retry>>,
50    /// The user or group this trigger runs as. Used during deployment to preserve the original trigger owner.
51    #[serde(rename = "permissioned_as", skip_serializing_if = "Option::is_none")]
52    pub permissioned_as: Option<String>,
53    /// When true and the caller is a member of the 'wm_deployers' group, preserves the original permissioned_as value instead of overwriting it.
54    #[serde(rename = "preserve_permissioned_as", skip_serializing_if = "Option::is_none")]
55    pub preserve_permissioned_as: Option<bool>,
56}
57
58impl EditMqttTrigger {
59    pub fn new(mqtt_resource_path: String, subscribe_topics: Vec<models::MqttSubscribeTopic>, path: String, script_path: String, is_flow: bool) -> EditMqttTrigger {
60        EditMqttTrigger {
61            mqtt_resource_path,
62            subscribe_topics,
63            client_id: None,
64            v3_config: None,
65            v5_config: None,
66            client_version: None,
67            path,
68            script_path,
69            is_flow,
70            mode: None,
71            error_handler_path: None,
72            error_handler_args: None,
73            retry: None,
74            permissioned_as: None,
75            preserve_permissioned_as: None,
76        }
77    }
78}
79