use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PostgresTrigger {
#[serde(rename = "enabled")]
pub enabled: bool,
#[serde(rename = "postgres_resource_path")]
pub postgres_resource_path: String,
#[serde(rename = "publication_name")]
pub publication_name: String,
#[serde(rename = "server_id", skip_serializing_if = "Option::is_none")]
pub server_id: Option<String>,
#[serde(rename = "replication_slot_name")]
pub replication_slot_name: String,
#[serde(rename = "error", skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(rename = "last_server_ping", skip_serializing_if = "Option::is_none")]
pub last_server_ping: Option<String>,
#[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
pub error_handler_path: Option<String>,
#[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
#[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
pub retry: Option<Box<models::Retry>>,
#[serde(rename = "path")]
pub path: String,
#[serde(rename = "script_path")]
pub script_path: String,
#[serde(rename = "email")]
pub email: String,
#[serde(rename = "extra_perms")]
pub extra_perms: std::collections::HashMap<String, bool>,
#[serde(rename = "workspace_id")]
pub workspace_id: String,
#[serde(rename = "edited_by")]
pub edited_by: String,
#[serde(rename = "edited_at")]
pub edited_at: String,
#[serde(rename = "is_flow")]
pub is_flow: bool,
}
impl PostgresTrigger {
pub fn new(enabled: bool, postgres_resource_path: String, publication_name: String, replication_slot_name: String, 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) -> PostgresTrigger {
PostgresTrigger {
enabled,
postgres_resource_path,
publication_name,
server_id: None,
replication_slot_name,
error: None,
last_server_ping: None,
error_handler_path: None,
error_handler_args: None,
retry: None,
path,
script_path,
email,
extra_perms,
workspace_id,
edited_by,
edited_at,
is_flow,
}
}
}