windmill_api/models/
path_script.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.592.1
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// PathScript : Reference to an existing script by path. Use this when calling a previously saved script instead of writing inline code
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PathScript {
17    /// Map of parameter names to their values (static or JavaScript expressions). These become the script's input arguments
18    #[serde(rename = "input_transforms")]
19    pub input_transforms: std::collections::HashMap<String, models::InputTransform>,
20    /// Path to the script in the workspace (e.g., 'f/scripts/send_email')
21    #[serde(rename = "path")]
22    pub path: String,
23    /// Optional specific version hash of the script to use
24    #[serde(rename = "hash", skip_serializing_if = "Option::is_none")]
25    pub hash: Option<String>,
26    #[serde(rename = "type")]
27    pub r#type: Type,
28    /// Override the script's default worker group tag
29    #[serde(rename = "tag_override", skip_serializing_if = "Option::is_none")]
30    pub tag_override: Option<String>,
31    /// If true, this script is a trigger that can start the flow
32    #[serde(rename = "is_trigger", skip_serializing_if = "Option::is_none")]
33    pub is_trigger: Option<bool>,
34}
35
36impl PathScript {
37    /// Reference to an existing script by path. Use this when calling a previously saved script instead of writing inline code
38    pub fn new(input_transforms: std::collections::HashMap<String, models::InputTransform>, path: String, r#type: Type) -> PathScript {
39        PathScript {
40            input_transforms,
41            path,
42            hash: None,
43            r#type,
44            tag_override: None,
45            is_trigger: None,
46        }
47    }
48}
49/// 
50#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
51pub enum Type {
52    #[serde(rename = "script")]
53    Script,
54}
55
56impl Default for Type {
57    fn default() -> Type {
58        Self::Script
59    }
60}
61