Skip to main content

windmill_api/models/
get_amqp_trigger_200_response.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.770.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 GetAmqpTrigger200Response {
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    #[serde(rename = "is_draft")]
75    pub is_draft: bool,
76    #[serde(rename = "draft_saved_at", skip_serializing_if = "Option::is_none")]
77    pub draft_saved_at: Option<String>,
78    #[serde(rename = "no_deployed", skip_serializing_if = "Option::is_none")]
79    pub no_deployed: Option<bool>,
80    #[serde(rename = "draft", skip_serializing_if = "Option::is_none")]
81    pub draft: Option<std::collections::HashMap<String, serde_json::Value>>,
82    /// Other workspace users (and the legacy NULL-email row, if any) with a saved draft at the same path. Populated only on the authed user's \"get by path\" responses for kinds the editor surfaces a fork banner for (script, flow, app, raw_app). Empty / omitted for kinds without that UI. 
83    #[serde(rename = "other_drafts_users", skip_serializing_if = "Option::is_none")]
84    pub other_drafts_users: Option<Vec<models::UserDraftOverlayOtherDraftsUsersInner>>,
85}
86
87impl GetAmqpTrigger200Response {
88    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, is_draft: bool) -> GetAmqpTrigger200Response {
89        GetAmqpTrigger200Response {
90            amqp_resource_path,
91            queue_name,
92            exchange: None,
93            options: None,
94            server_id: None,
95            last_server_ping: None,
96            error: None,
97            error_handler_path: None,
98            error_handler_args: None,
99            retry: None,
100            path,
101            script_path,
102            permissioned_as,
103            extra_perms,
104            workspace_id,
105            edited_by,
106            edited_at,
107            is_flow,
108            mode,
109            labels: None,
110            draft_only: None,
111            is_draft,
112            draft_saved_at: None,
113            no_deployed: None,
114            draft: None,
115            other_drafts_users: None,
116        }
117    }
118}
119