Skip to main content

windmill_api/models/
edit_kafka_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.652.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 EditKafkaTrigger {
16    /// Path to the Kafka resource containing connection configuration
17    #[serde(rename = "kafka_resource_path")]
18    pub kafka_resource_path: String,
19    /// Kafka consumer group ID for this trigger
20    #[serde(rename = "group_id")]
21    pub group_id: String,
22    /// Array of Kafka topic names to subscribe to
23    #[serde(rename = "topics")]
24    pub topics: Vec<String>,
25    #[serde(rename = "filters")]
26    pub filters: Vec<models::NewWebsocketTriggerFiltersInner>,
27    /// The unique path identifier for this trigger
28    #[serde(rename = "path")]
29    pub path: String,
30    /// Path to the script or flow to execute when a message is received
31    #[serde(rename = "script_path")]
32    pub script_path: String,
33    /// True if script_path points to a flow, false if it points to a script
34    #[serde(rename = "is_flow")]
35    pub is_flow: bool,
36    /// Path to a script or flow to run when the triggered job fails
37    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
38    pub error_handler_path: Option<String>,
39    /// The arguments to pass to the script or flow
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    /// Email of the user who triggered jobs run as. Used during deployment to preserve the original trigger owner.
45    #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
46    pub email: Option<String>,
47    /// When true and the caller is a member of the 'wm_deployers' group, preserves the original email value instead of overwriting it.
48    #[serde(rename = "preserve_email", skip_serializing_if = "Option::is_none")]
49    pub preserve_email: Option<bool>,
50}
51
52impl EditKafkaTrigger {
53    pub fn new(kafka_resource_path: String, group_id: String, topics: Vec<String>, filters: Vec<models::NewWebsocketTriggerFiltersInner>, path: String, script_path: String, is_flow: bool) -> EditKafkaTrigger {
54        EditKafkaTrigger {
55            kafka_resource_path,
56            group_id,
57            topics,
58            filters,
59            path,
60            script_path,
61            is_flow,
62            error_handler_path: None,
63            error_handler_args: None,
64            retry: None,
65            email: None,
66            preserve_email: None,
67        }
68    }
69}
70