Skip to main content

windmill_api/models/
edit_postgres_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.626.0
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 EditPostgresTrigger {
16    /// Name of the PostgreSQL logical replication slot to use
17    #[serde(rename = "replication_slot_name")]
18    pub replication_slot_name: String,
19    /// Name of the PostgreSQL publication to subscribe to for change data capture
20    #[serde(rename = "publication_name")]
21    pub publication_name: String,
22    /// The unique path identifier for this trigger
23    #[serde(rename = "path")]
24    pub path: String,
25    /// Path to the script or flow to execute when database changes are detected
26    #[serde(rename = "script_path")]
27    pub script_path: String,
28    /// True if script_path points to a flow, false if it points to a script
29    #[serde(rename = "is_flow")]
30    pub is_flow: bool,
31    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
32    pub mode: Option<models::TriggerMode>,
33    /// Path to the PostgreSQL resource containing connection configuration
34    #[serde(rename = "postgres_resource_path")]
35    pub postgres_resource_path: String,
36    #[serde(rename = "publication", skip_serializing_if = "Option::is_none")]
37    pub publication: Option<Box<models::PublicationData>>,
38    /// Path to a script or flow to run when the triggered job fails
39    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
40    pub error_handler_path: Option<String>,
41    /// The arguments to pass to the script or flow
42    #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
43    pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
44    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
45    pub retry: Option<Box<models::Retry>>,
46}
47
48impl EditPostgresTrigger {
49    pub fn new(replication_slot_name: String, publication_name: String, path: String, script_path: String, is_flow: bool, postgres_resource_path: String) -> EditPostgresTrigger {
50        EditPostgresTrigger {
51            replication_slot_name,
52            publication_name,
53            path,
54            script_path,
55            is_flow,
56            mode: None,
57            postgres_resource_path,
58            publication: None,
59            error_handler_path: None,
60            error_handler_args: None,
61            retry: None,
62        }
63    }
64}
65