windmill_api/models/
gcp_trigger.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct GcpTrigger {
17 #[serde(rename = "gcp_resource_path")]
19 pub gcp_resource_path: String,
20 #[serde(rename = "topic_id")]
22 pub topic_id: String,
23 #[serde(rename = "subscription_id")]
25 pub subscription_id: String,
26 #[serde(rename = "server_id", skip_serializing_if = "Option::is_none")]
28 pub server_id: Option<String>,
29 #[serde(rename = "delivery_type")]
30 pub delivery_type: models::DeliveryType,
31 #[serde(rename = "delivery_config", skip_serializing_if = "Option::is_none")]
32 pub delivery_config: Option<Box<models::PushConfig>>,
33 #[serde(rename = "subscription_mode")]
34 pub subscription_mode: models::SubscriptionMode,
35 #[serde(rename = "last_server_ping", skip_serializing_if = "Option::is_none")]
37 pub last_server_ping: Option<String>,
38 #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
40 pub error: Option<String>,
41 #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
43 pub error_handler_path: Option<String>,
44 #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
46 pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
47 #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
48 pub retry: Option<Box<models::Retry>>,
49 #[serde(rename = "path")]
51 pub path: String,
52 #[serde(rename = "script_path")]
54 pub script_path: String,
55 #[serde(rename = "email")]
57 pub email: String,
58 #[serde(rename = "extra_perms")]
60 pub extra_perms: std::collections::HashMap<String, bool>,
61 #[serde(rename = "workspace_id")]
63 pub workspace_id: String,
64 #[serde(rename = "edited_by")]
66 pub edited_by: String,
67 #[serde(rename = "edited_at")]
69 pub edited_at: String,
70 #[serde(rename = "is_flow")]
72 pub is_flow: bool,
73 #[serde(rename = "mode")]
74 pub mode: models::TriggerMode,
75}
76
77impl GcpTrigger {
78 pub fn new(gcp_resource_path: String, topic_id: String, subscription_id: String, delivery_type: models::DeliveryType, subscription_mode: models::SubscriptionMode, 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, mode: models::TriggerMode) -> GcpTrigger {
80 GcpTrigger {
81 gcp_resource_path,
82 topic_id,
83 subscription_id,
84 server_id: None,
85 delivery_type,
86 delivery_config: None,
87 subscription_mode,
88 last_server_ping: None,
89 error: None,
90 error_handler_path: None,
91 error_handler_args: None,
92 retry: None,
93 path,
94 script_path,
95 email,
96 extra_perms,
97 workspace_id,
98 edited_by,
99 edited_at,
100 is_flow,
101 mode,
102 }
103 }
104}
105