windmill_api/models/
new_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.505.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 NewPostgresTrigger {
16    #[serde(rename = "replication_slot_name", skip_serializing_if = "Option::is_none")]
17    pub replication_slot_name: Option<String>,
18    #[serde(rename = "publication_name", skip_serializing_if = "Option::is_none")]
19    pub publication_name: Option<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 NewPostgresTrigger {
41    pub fn new(path: String, script_path: String, is_flow: bool, enabled: bool, postgres_resource_path: String) -> NewPostgresTrigger {
42        NewPostgresTrigger {
43            replication_slot_name: None,
44            publication_name: None,
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