windmill_api/models/
edit_postgres_trigger.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct EditPostgresTrigger {
16 #[serde(rename = "replication_slot_name")]
17 pub replication_slot_name: String,
18 #[serde(rename = "publication_name")]
19 pub publication_name: String,
20 #[serde(rename = "path")]
21 pub path: String,
22 #[serde(rename = "script_path")]
23 pub script_path: String,
24 #[serde(rename = "is_flow")]
25 pub is_flow: bool,
26 #[serde(rename = "enabled")]
27 pub enabled: bool,
28 #[serde(rename = "postgres_resource_path")]
29 pub postgres_resource_path: String,
30 #[serde(rename = "publication", skip_serializing_if = "Option::is_none")]
31 pub publication: Option<Box<models::PublicationData>>,
32 #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
33 pub error_handler_path: Option<String>,
34 #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
35 pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
36 #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
37 pub retry: Option<Box<models::Retry>>,
38}
39
40impl EditPostgresTrigger {
41 pub fn new(replication_slot_name: String, publication_name: String, path: String, script_path: String, is_flow: bool, enabled: bool, postgres_resource_path: String) -> EditPostgresTrigger {
42 EditPostgresTrigger {
43 replication_slot_name,
44 publication_name,
45 path,
46 script_path,
47 is_flow,
48 enabled,
49 postgres_resource_path,
50 publication: None,
51 error_handler_path: None,
52 error_handler_args: None,
53 retry: None,
54 }
55 }
56}
57