Skip to main content

windmill_api/models/
script_module.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.662.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ScriptModule : An additional module file associated with a script
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ScriptModule {
17    /// The source code content of this module
18    #[serde(rename = "content")]
19    pub content: String,
20    #[serde(rename = "language")]
21    pub language: models::ScriptLang,
22    /// Lock file content for this module's dependencies
23    #[serde(rename = "lock", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub lock: Option<Option<String>>,
25}
26
27impl ScriptModule {
28    /// An additional module file associated with a script
29    pub fn new(content: String, language: models::ScriptLang) -> ScriptModule {
30        ScriptModule {
31            content,
32            language,
33            lock: None,
34        }
35    }
36}
37