windmill-api 1.544.2

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Windmill API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.544.2
 * Contact: contact@windmill.dev
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct MqttTrigger {
    #[serde(rename = "mqtt_resource_path")]
    pub mqtt_resource_path: String,
    #[serde(rename = "subscribe_topics")]
    pub subscribe_topics: Vec<models::MqttSubscribeTopic>,
    #[serde(rename = "v3_config", skip_serializing_if = "Option::is_none")]
    pub v3_config: Option<Box<models::MqttV3Config>>,
    #[serde(rename = "v5_config", skip_serializing_if = "Option::is_none")]
    pub v5_config: Option<Box<models::MqttV5Config>>,
    #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")]
    pub client_id: Option<String>,
    #[serde(rename = "client_version", skip_serializing_if = "Option::is_none")]
    pub client_version: Option<models::MqttClientVersion>,
    #[serde(rename = "server_id", skip_serializing_if = "Option::is_none")]
    pub server_id: Option<String>,
    #[serde(rename = "last_server_ping", skip_serializing_if = "Option::is_none")]
    pub last_server_ping: Option<String>,
    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
    #[serde(rename = "enabled")]
    pub enabled: bool,
    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
    pub error_handler_path: Option<String>,
    /// The arguments to pass to the script or flow
    #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
    pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
    pub retry: Option<Box<models::Retry>>,
    #[serde(rename = "path")]
    pub path: String,
    #[serde(rename = "script_path")]
    pub script_path: String,
    #[serde(rename = "email")]
    pub email: String,
    #[serde(rename = "extra_perms")]
    pub extra_perms: std::collections::HashMap<String, bool>,
    #[serde(rename = "workspace_id")]
    pub workspace_id: String,
    #[serde(rename = "edited_by")]
    pub edited_by: String,
    #[serde(rename = "edited_at")]
    pub edited_at: String,
    #[serde(rename = "is_flow")]
    pub is_flow: bool,
}

impl MqttTrigger {
    pub fn new(mqtt_resource_path: String, subscribe_topics: Vec<models::MqttSubscribeTopic>, enabled: bool, path: String, script_path: String, email: String, extra_perms: std::collections::HashMap<String, bool>, workspace_id: String, edited_by: String, edited_at: String, is_flow: bool) -> MqttTrigger {
        MqttTrigger {
            mqtt_resource_path,
            subscribe_topics,
            v3_config: None,
            v5_config: None,
            client_id: None,
            client_version: None,
            server_id: None,
            last_server_ping: None,
            error: None,
            enabled,
            error_handler_path: None,
            error_handler_args: None,
            retry: None,
            path,
            script_path,
            email,
            extra_perms,
            workspace_id,
            edited_by,
            edited_at,
            is_flow,
        }
    }
}