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