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.626.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}
45
46impl EditKafkaTrigger {
47    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 {
48        EditKafkaTrigger {
49            kafka_resource_path,
50            group_id,
51            topics,
52            filters,
53            path,
54            script_path,
55            is_flow,
56            error_handler_path: None,
57            error_handler_args: None,
58            retry: None,
59        }
60    }
61}
62