Skip to main content

windmill_api/models/
create_flow_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.674.2
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 CreateFlowRequest {
16    /// Short description of what this flow does
17    #[serde(rename = "summary")]
18    pub summary: String,
19    /// Detailed documentation for this flow
20    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
21    pub description: Option<String>,
22    #[serde(rename = "value")]
23    pub value: Box<models::FlowValue>,
24    /// JSON Schema for flow inputs. Use this to define input parameters, their types, defaults, and validation. For resource inputs, set type to 'object' and format to 'resource-<type>' (e.g., 'resource-stripe')
25    #[serde(rename = "schema", skip_serializing_if = "Option::is_none")]
26    pub schema: Option<serde_json::Value>,
27    #[serde(rename = "on_behalf_of_email", skip_serializing_if = "Option::is_none")]
28    pub on_behalf_of_email: Option<String>,
29    #[serde(rename = "path")]
30    pub path: String,
31    #[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
32    pub tag: Option<String>,
33    #[serde(rename = "ws_error_handler_muted", skip_serializing_if = "Option::is_none")]
34    pub ws_error_handler_muted: Option<bool>,
35    #[serde(rename = "priority", skip_serializing_if = "Option::is_none")]
36    pub priority: Option<i32>,
37    #[serde(rename = "dedicated_worker", skip_serializing_if = "Option::is_none")]
38    pub dedicated_worker: Option<bool>,
39    #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")]
40    pub timeout: Option<f64>,
41    #[serde(rename = "visible_to_runner_only", skip_serializing_if = "Option::is_none")]
42    pub visible_to_runner_only: Option<bool>,
43    /// When true and the caller is a member of the 'wm_deployers' group, preserves the original on_behalf_of_email value instead of overwriting it.
44    #[serde(rename = "preserve_on_behalf_of", skip_serializing_if = "Option::is_none")]
45    pub preserve_on_behalf_of: Option<bool>,
46    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
47    pub labels: Option<Vec<String>>,
48    #[serde(rename = "draft_only", skip_serializing_if = "Option::is_none")]
49    pub draft_only: Option<bool>,
50    #[serde(rename = "deployment_message", skip_serializing_if = "Option::is_none")]
51    pub deployment_message: Option<String>,
52}
53
54impl CreateFlowRequest {
55    pub fn new(summary: String, value: models::FlowValue, path: String) -> CreateFlowRequest {
56        CreateFlowRequest {
57            summary,
58            description: None,
59            value: Box::new(value),
60            schema: None,
61            on_behalf_of_email: None,
62            path,
63            tag: None,
64            ws_error_handler_muted: None,
65            priority: None,
66            dedicated_worker: None,
67            timeout: None,
68            visible_to_runner_only: None,
69            preserve_on_behalf_of: None,
70            labels: None,
71            draft_only: None,
72            deployment_message: None,
73        }
74    }
75}
76