/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.2
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

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

/// PathScript : Reference to an existing script by path. Use this when calling a previously saved script instead of writing inline code
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PathScript {
    /// Map of parameter names to their values (static or JavaScript expressions). These become the script's input arguments
    #[serde(rename = "input_transforms")]
    pub input_transforms: std::collections::HashMap<String, models::InputTransform>,
    /// Path to the script in the workspace (e.g., 'f/scripts/send_email')
    #[serde(rename = "path")]
    pub path: String,
    /// Optional specific version hash of the script to use
    #[serde(rename = "hash", skip_serializing_if = "Option::is_none")]
    pub hash: Option<String>,
    #[serde(rename = "type")]
    pub r#type: Type,
    /// Override the script's default worker group tag
    #[serde(rename = "tag_override", skip_serializing_if = "Option::is_none")]
    pub tag_override: Option<String>,
    /// If true, this script is a trigger that can start the flow
    #[serde(rename = "is_trigger", skip_serializing_if = "Option::is_none")]
    pub is_trigger: Option<bool>,
}

impl PathScript {
    /// Reference to an existing script by path. Use this when calling a previously saved script instead of writing inline code
    pub fn new(input_transforms: std::collections::HashMap<String, models::InputTransform>, path: String, r#type: Type) -> PathScript {
        PathScript {
            input_transforms,
            path,
            hash: None,
            r#type,
            tag_override: None,
            is_trigger: None,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "script")]
    Script,
}

impl Default for Type {
    fn default() -> Type {
        Self::Script
    }
}

