windmill-api 1.683.1

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Windmill API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.683.1
 * Contact: contact@windmill.dev
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct NewEmailTrigger {
    #[serde(rename = "path")]
    pub path: String,
    #[serde(rename = "script_path")]
    pub script_path: String,
    #[serde(rename = "local_part")]
    pub local_part: String,
    #[serde(rename = "workspaced_local_part", skip_serializing_if = "Option::is_none")]
    pub workspaced_local_part: Option<bool>,
    #[serde(rename = "is_flow")]
    pub is_flow: bool,
    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
    pub error_handler_path: Option<String>,
    /// The arguments to pass to the script or flow
    #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
    pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
    pub retry: Option<Box<models::Retry>>,
    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
    pub mode: Option<models::TriggerMode>,
    /// The user or group this trigger runs as. Used during deployment to preserve the original trigger owner.
    #[serde(rename = "permissioned_as", skip_serializing_if = "Option::is_none")]
    pub permissioned_as: Option<String>,
    /// When true and the caller is a member of the 'wm_deployers' group, preserves the original permissioned_as value instead of overwriting it.
    #[serde(rename = "preserve_permissioned_as", skip_serializing_if = "Option::is_none")]
    pub preserve_permissioned_as: Option<bool>,
    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
    pub labels: Option<Vec<String>>,
}

impl NewEmailTrigger {
    pub fn new(path: String, script_path: String, local_part: String, is_flow: bool) -> NewEmailTrigger {
        NewEmailTrigger {
            path,
            script_path,
            local_part,
            workspaced_local_part: None,
            is_flow,
            error_handler_path: None,
            error_handler_args: None,
            retry: None,
            mode: None,
            permissioned_as: None,
            preserve_permissioned_as: None,
            labels: None,
        }
    }
}