windmill_api/models/
websocket_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.579.2
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 WebsocketTrigger {
16    #[serde(rename = "url")]
17    pub url: String,
18    #[serde(rename = "server_id", skip_serializing_if = "Option::is_none")]
19    pub server_id: Option<String>,
20    #[serde(rename = "last_server_ping", skip_serializing_if = "Option::is_none")]
21    pub last_server_ping: Option<String>,
22    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
23    pub error: Option<String>,
24    #[serde(rename = "filters")]
25    pub filters: Vec<serde_json::Value>,
26    #[serde(rename = "initial_messages", skip_serializing_if = "Option::is_none")]
27    pub initial_messages: Option<Vec<models::WebsocketTriggerInitialMessage>>,
28    /// The arguments to pass to the script or flow
29    #[serde(rename = "url_runnable_args", skip_serializing_if = "Option::is_none")]
30    pub url_runnable_args: Option<std::collections::HashMap<String, serde_json::Value>>,
31    #[serde(rename = "can_return_message")]
32    pub can_return_message: bool,
33    #[serde(rename = "can_return_error_result")]
34    pub can_return_error_result: bool,
35    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
36    pub error_handler_path: Option<String>,
37    /// The arguments to pass to the script or flow
38    #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
39    pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
40    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
41    pub retry: Option<Box<models::Retry>>,
42    #[serde(rename = "path")]
43    pub path: String,
44    #[serde(rename = "script_path")]
45    pub script_path: String,
46    #[serde(rename = "email")]
47    pub email: String,
48    #[serde(rename = "extra_perms")]
49    pub extra_perms: std::collections::HashMap<String, bool>,
50    #[serde(rename = "workspace_id")]
51    pub workspace_id: String,
52    #[serde(rename = "edited_by")]
53    pub edited_by: String,
54    #[serde(rename = "edited_at")]
55    pub edited_at: String,
56    #[serde(rename = "is_flow")]
57    pub is_flow: bool,
58    #[serde(rename = "enabled")]
59    pub enabled: bool,
60}
61
62impl WebsocketTrigger {
63    pub fn new(url: String, filters: Vec<serde_json::Value>, can_return_message: bool, can_return_error_result: 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, enabled: bool) -> WebsocketTrigger {
64        WebsocketTrigger {
65            url,
66            server_id: None,
67            last_server_ping: None,
68            error: None,
69            filters,
70            initial_messages: None,
71            url_runnable_args: None,
72            can_return_message,
73            can_return_error_result,
74            error_handler_path: None,
75            error_handler_args: None,
76            retry: None,
77            path,
78            script_path,
79            email,
80            extra_perms,
81            workspace_id,
82            edited_by,
83            edited_at,
84            is_flow,
85            enabled,
86        }
87    }
88}
89