windmill_api/models/
gcp_trigger_data.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 GcpTriggerData {
16    #[serde(rename = "gcp_resource_path")]
17    pub gcp_resource_path: String,
18    #[serde(rename = "subscription_mode")]
19    pub subscription_mode: models::SubscriptionMode,
20    #[serde(rename = "topic_id")]
21    pub topic_id: String,
22    #[serde(rename = "subscription_id", skip_serializing_if = "Option::is_none")]
23    pub subscription_id: Option<String>,
24    #[serde(rename = "base_endpoint", skip_serializing_if = "Option::is_none")]
25    pub base_endpoint: Option<String>,
26    #[serde(rename = "delivery_type", skip_serializing_if = "Option::is_none")]
27    pub delivery_type: Option<models::DeliveryType>,
28    #[serde(rename = "delivery_config", skip_serializing_if = "Option::is_none")]
29    pub delivery_config: Option<Box<models::PushConfig>>,
30    #[serde(rename = "path")]
31    pub path: String,
32    #[serde(rename = "script_path")]
33    pub script_path: String,
34    #[serde(rename = "is_flow")]
35    pub is_flow: bool,
36    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
37    pub enabled: Option<bool>,
38    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
39    pub error_handler_path: Option<String>,
40    #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
41    pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
42    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
43    pub retry: Option<Box<models::Retry>>,
44}
45
46impl GcpTriggerData {
47    pub fn new(gcp_resource_path: String, subscription_mode: models::SubscriptionMode, topic_id: String, path: String, script_path: String, is_flow: bool) -> GcpTriggerData {
48        GcpTriggerData {
49            gcp_resource_path,
50            subscription_mode,
51            topic_id,
52            subscription_id: None,
53            base_endpoint: None,
54            delivery_type: None,
55            delivery_config: None,
56            path,
57            script_path,
58            is_flow,
59            enabled: None,
60            error_handler_path: None,
61            error_handler_args: None,
62            retry: None,
63        }
64    }
65}
66