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.545.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 = "auto_acknowledge_msg", skip_serializing_if = "Option::is_none")]
39    pub auto_acknowledge_msg: Option<bool>,
40    /// Time in seconds within which the message must be acknowledged. If not provided, defaults to the subscription's acknowledgment deadline (600 seconds).
41    #[serde(rename = "ack_deadline", skip_serializing_if = "Option::is_none")]
42    pub ack_deadline: Option<i32>,
43    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
44    pub error_handler_path: Option<String>,
45    /// The arguments to pass to the script or flow
46    #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
47    pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
48    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
49    pub retry: Option<Box<models::Retry>>,
50}
51
52impl GcpTriggerData {
53    pub fn new(gcp_resource_path: String, subscription_mode: models::SubscriptionMode, topic_id: String, path: String, script_path: String, is_flow: bool) -> GcpTriggerData {
54        GcpTriggerData {
55            gcp_resource_path,
56            subscription_mode,
57            topic_id,
58            subscription_id: None,
59            base_endpoint: None,
60            delivery_type: None,
61            delivery_config: None,
62            path,
63            script_path,
64            is_flow,
65            enabled: None,
66            auto_acknowledge_msg: None,
67            ack_deadline: None,
68            error_handler_path: None,
69            error_handler_args: None,
70            retry: None,
71        }
72    }
73}
74