Skip to main content

windmill_api/models/
edit_flow.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.824.1
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 EditFlow {
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    /// Authorization identity to run as: u/{username}, g/{group}, or a bare email when the username is itself email-shaped. Supply this or on_behalf_of_email; when only the address is given it is resolved to the account it names, and an address naming nobody is rejected. A pair that disagrees is rejected.
30    #[serde(rename = "on_behalf_of", skip_serializing_if = "Option::is_none")]
31    pub on_behalf_of: Option<String>,
32    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
33    pub path: Option<String>,
34    #[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
35    pub tag: Option<String>,
36    #[serde(rename = "ws_error_handler_muted", skip_serializing_if = "Option::is_none")]
37    pub ws_error_handler_muted: Option<bool>,
38    #[serde(rename = "priority", skip_serializing_if = "Option::is_none")]
39    pub priority: Option<i32>,
40    #[serde(rename = "dedicated_worker", skip_serializing_if = "Option::is_none")]
41    pub dedicated_worker: Option<bool>,
42    #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")]
43    pub timeout: Option<f64>,
44    #[serde(rename = "visible_to_runner_only", skip_serializing_if = "Option::is_none")]
45    pub visible_to_runner_only: Option<bool>,
46    /// When true and the caller is a member of the 'wm_deployers' group, preserves the original on_behalf_of_email / on_behalf_of pair instead of overwriting it with the caller's own identity.
47    #[serde(rename = "preserve_on_behalf_of", skip_serializing_if = "Option::is_none")]
48    pub preserve_on_behalf_of: Option<bool>,
49    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
50    pub labels: Option<Vec<String>>,
51    /// Scopes the token of every job of this runnable is restricted to (domain:action[:resource], e.g. oidc:write). Jobs it starts, flow steps and AI agent tools inherit the restriction. Unset, the job token carries the full permissions of the identity the job runs as; an empty list leaves it no API access beyond its own job. Omitting the field keeps the deployed value; null clears it.
52    #[serde(rename = "job_token_scopes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
53    pub job_token_scopes: Option<Option<Vec<String>>>,
54}
55
56impl EditFlow {
57    pub fn new(summary: String, value: models::FlowValue) -> EditFlow {
58        EditFlow {
59            summary,
60            description: None,
61            value: Box::new(value),
62            schema: None,
63            on_behalf_of_email: None,
64            on_behalf_of: None,
65            path: None,
66            tag: None,
67            ws_error_handler_muted: None,
68            priority: None,
69            dedicated_worker: None,
70            timeout: None,
71            visible_to_runner_only: None,
72            preserve_on_behalf_of: None,
73            labels: None,
74            job_token_scopes: None,
75        }
76    }
77}
78