Skip to main content

windmill_api/models/
email_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 EmailTrigger {
16    #[serde(rename = "local_part")]
17    pub local_part: String,
18    #[serde(rename = "workspaced_local_part", skip_serializing_if = "Option::is_none")]
19    pub workspaced_local_part: Option<bool>,
20    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
21    pub error_handler_path: Option<String>,
22    /// The arguments to pass to the script or flow
23    #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
24    pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
25    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
26    pub retry: Option<Box<models::Retry>>,
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 triggered
31    #[serde(rename = "script_path")]
32    pub script_path: String,
33    /// Email of the user who owns this trigger, used for permissioned_as
34    #[serde(rename = "email")]
35    pub email: String,
36    /// Additional permissions for this trigger
37    #[serde(rename = "extra_perms")]
38    pub extra_perms: std::collections::HashMap<String, bool>,
39    /// The workspace this trigger belongs to
40    #[serde(rename = "workspace_id")]
41    pub workspace_id: String,
42    /// Username of the last person who edited this trigger
43    #[serde(rename = "edited_by")]
44    pub edited_by: String,
45    /// Timestamp of the last edit
46    #[serde(rename = "edited_at")]
47    pub edited_at: String,
48    /// True if script_path points to a flow, false if it points to a script
49    #[serde(rename = "is_flow")]
50    pub is_flow: bool,
51    #[serde(rename = "mode")]
52    pub mode: models::TriggerMode,
53}
54
55impl EmailTrigger {
56    pub fn new(local_part: String, path: String, script_path: String, email: String, extra_perms: std::collections::HashMap<String, bool>, workspace_id: String, edited_by: String, edited_at: String, is_flow: bool, mode: models::TriggerMode) -> EmailTrigger {
57        EmailTrigger {
58            local_part,
59            workspaced_local_part: None,
60            error_handler_path: None,
61            error_handler_args: None,
62            retry: None,
63            path,
64            script_path,
65            email,
66            extra_perms,
67            workspace_id,
68            edited_by,
69            edited_at,
70            is_flow,
71            mode,
72        }
73    }
74}
75