windmill_api/models/
create_draft_request.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.505.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 CreateDraftRequest {
16    #[serde(rename = "path")]
17    pub path: String,
18    #[serde(rename = "typ")]
19    pub typ: Typ,
20    #[serde(rename = "value", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub value: Option<Option<serde_json::Value>>,
22}
23
24impl CreateDraftRequest {
25    pub fn new(path: String, typ: Typ) -> CreateDraftRequest {
26        CreateDraftRequest {
27            path,
28            typ,
29            value: None,
30        }
31    }
32}
33/// 
34#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
35pub enum Typ {
36    #[serde(rename = "flow")]
37    Flow,
38    #[serde(rename = "script")]
39    Script,
40    #[serde(rename = "app")]
41    App,
42}
43
44impl Default for Typ {
45    fn default() -> Typ {
46        Self::Flow
47    }
48}
49