Skip to main content

windmill_api/models/
amqp_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.765.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 AmqpTrigger {
16    /// Path to the AMQP resource containing broker connection configuration
17    #[serde(rename = "amqp_resource_path")]
18    pub amqp_resource_path: String,
19    /// Name of the queue to consume messages from
20    #[serde(rename = "queue_name")]
21    pub queue_name: String,
22    #[serde(rename = "exchange", skip_serializing_if = "Option::is_none")]
23    pub exchange: Option<Box<models::AmqpExchange>>,
24    #[serde(rename = "options", skip_serializing_if = "Option::is_none")]
25    pub options: Option<Box<models::AmqpOptions>>,
26    /// ID of the server currently handling this trigger (internal)
27    #[serde(rename = "server_id", skip_serializing_if = "Option::is_none")]
28    pub server_id: Option<String>,
29    /// Timestamp of last server heartbeat (internal)
30    #[serde(rename = "last_server_ping", skip_serializing_if = "Option::is_none")]
31    pub last_server_ping: Option<String>,
32    /// Last error message if the trigger failed
33    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
34    pub error: Option<String>,
35    /// Path to a script or flow to run when the triggered job fails
36    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
37    pub error_handler_path: Option<String>,
38    /// The arguments to pass to the script or flow
39    #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
40    pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
41    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
42    pub retry: Option<Box<models::Retry>>,
43    /// The unique Windmill path for this trigger. Must be of the form `u/<user>/<path>` or `f/<folder>/<path>`. This is the trigger object path, not the HTTP route path.
44    #[serde(rename = "path")]
45    pub path: String,
46    /// Path to the script or flow to execute when triggered
47    #[serde(rename = "script_path")]
48    pub script_path: String,
49    /// The user or group this trigger runs as (permissioned_as)
50    #[serde(rename = "permissioned_as")]
51    pub permissioned_as: String,
52    /// Additional permissions for this trigger
53    #[serde(rename = "extra_perms")]
54    pub extra_perms: std::collections::HashMap<String, bool>,
55    /// The workspace this trigger belongs to
56    #[serde(rename = "workspace_id")]
57    pub workspace_id: String,
58    /// Username of the last person who edited this trigger
59    #[serde(rename = "edited_by")]
60    pub edited_by: String,
61    /// Timestamp of the last edit
62    #[serde(rename = "edited_at")]
63    pub edited_at: String,
64    /// True if script_path points to a flow, false if it points to a script
65    #[serde(rename = "is_flow")]
66    pub is_flow: bool,
67    #[serde(rename = "mode")]
68    pub mode: models::TriggerMode,
69    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
70    pub labels: Option<Vec<String>>,
71    /// True when this row is a per-user draft with no deployed trigger at the same path. Set by list endpoints when `include_draft_only=true` synthesizes the row from the draft. Frontend renders a \"Draft\" badge. 
72    #[serde(rename = "draft_only", skip_serializing_if = "Option::is_none")]
73    pub draft_only: Option<bool>,
74    /// True when the authed user has a per-user draft at this path (over a deployed row or a synthesized draft-only row). Frontend appends a `*` to the displayed name. 
75    #[serde(rename = "is_draft", skip_serializing_if = "Option::is_none")]
76    pub is_draft: Option<bool>,
77}
78
79impl AmqpTrigger {
80    pub fn new(amqp_resource_path: String, queue_name: String, path: String, script_path: String, permissioned_as: String, extra_perms: std::collections::HashMap<String, bool>, workspace_id: String, edited_by: String, edited_at: String, is_flow: bool, mode: models::TriggerMode) -> AmqpTrigger {
81        AmqpTrigger {
82            amqp_resource_path,
83            queue_name,
84            exchange: None,
85            options: None,
86            server_id: None,
87            last_server_ping: None,
88            error: None,
89            error_handler_path: None,
90            error_handler_args: None,
91            retry: None,
92            path,
93            script_path,
94            permissioned_as,
95            extra_perms,
96            workspace_id,
97            edited_by,
98            edited_at,
99            is_flow,
100            mode,
101            labels: None,
102            draft_only: None,
103            is_draft: None,
104        }
105    }
106}
107