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