Skip to main content

windmill_api/models/
edit_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.767.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 EditAmqpTrigger {
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    /// The unique Windmill path for this trigger. Must be of the form `u/<user>/<path>` or `f/<folder>/<path>`.
27    #[serde(rename = "path")]
28    pub path: String,
29    /// Path to the script or flow to execute when a message is received
30    #[serde(rename = "script_path")]
31    pub script_path: String,
32    /// True if script_path points to a flow, false if it points to a script
33    #[serde(rename = "is_flow")]
34    pub is_flow: bool,
35    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
36    pub mode: Option<models::TriggerMode>,
37    /// Path to a script or flow to run when the triggered job fails
38    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
39    pub error_handler_path: Option<String>,
40    /// The arguments to pass to the script or flow
41    #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
42    pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
43    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
44    pub retry: Option<Box<models::Retry>>,
45    /// The user or group this trigger runs as. Used during deployment to preserve the original trigger owner.
46    #[serde(rename = "permissioned_as", skip_serializing_if = "Option::is_none")]
47    pub permissioned_as: Option<String>,
48    /// When true and the caller is a member of the 'wm_deployers' group, preserves the original permissioned_as value instead of overwriting it.
49    #[serde(rename = "preserve_permissioned_as", skip_serializing_if = "Option::is_none")]
50    pub preserve_permissioned_as: Option<bool>,
51    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
52    pub labels: Option<Vec<String>>,
53}
54
55impl EditAmqpTrigger {
56    pub fn new(amqp_resource_path: String, queue_name: String, path: String, script_path: String, is_flow: bool) -> EditAmqpTrigger {
57        EditAmqpTrigger {
58            amqp_resource_path,
59            queue_name,
60            exchange: None,
61            options: None,
62            path,
63            script_path,
64            is_flow,
65            mode: None,
66            error_handler_path: None,
67            error_handler_args: None,
68            retry: None,
69            permissioned_as: None,
70            preserve_permissioned_as: None,
71            labels: None,
72        }
73    }
74}
75