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.626.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", skip_serializing_if = "Option::is_none")]
24    pub client_id: 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}
51
52impl EditMqttTrigger {
53    pub fn new(mqtt_resource_path: String, subscribe_topics: Vec<models::MqttSubscribeTopic>, path: String, script_path: String, is_flow: bool) -> EditMqttTrigger {
54        EditMqttTrigger {
55            mqtt_resource_path,
56            subscribe_topics,
57            client_id: None,
58            v3_config: None,
59            v5_config: None,
60            client_version: None,
61            path,
62            script_path,
63            is_flow,
64            mode: None,
65            error_handler_path: None,
66            error_handler_args: None,
67            retry: None,
68        }
69    }
70}
71