windmill-api 1.683.0

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Windmill API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.683.0
 * Contact: contact@windmill.dev
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateFlowRequest {
    /// Short description of what this flow does
    #[serde(rename = "summary")]
    pub summary: String,
    /// Detailed documentation for this flow
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "value")]
    pub value: Box<models::FlowValue>,
    /// 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')
    #[serde(rename = "schema", skip_serializing_if = "Option::is_none")]
    pub schema: Option<serde_json::Value>,
    #[serde(rename = "on_behalf_of_email", skip_serializing_if = "Option::is_none")]
    pub on_behalf_of_email: Option<String>,
    #[serde(rename = "path")]
    pub path: String,
    #[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
    pub tag: Option<String>,
    #[serde(rename = "ws_error_handler_muted", skip_serializing_if = "Option::is_none")]
    pub ws_error_handler_muted: Option<bool>,
    #[serde(rename = "priority", skip_serializing_if = "Option::is_none")]
    pub priority: Option<i32>,
    #[serde(rename = "dedicated_worker", skip_serializing_if = "Option::is_none")]
    pub dedicated_worker: Option<bool>,
    #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")]
    pub timeout: Option<f64>,
    #[serde(rename = "visible_to_runner_only", skip_serializing_if = "Option::is_none")]
    pub visible_to_runner_only: Option<bool>,
    /// 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.
    #[serde(rename = "preserve_on_behalf_of", skip_serializing_if = "Option::is_none")]
    pub preserve_on_behalf_of: Option<bool>,
    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
    pub labels: Option<Vec<String>>,
    #[serde(rename = "draft_only", skip_serializing_if = "Option::is_none")]
    pub draft_only: Option<bool>,
    #[serde(rename = "deployment_message", skip_serializing_if = "Option::is_none")]
    pub deployment_message: Option<String>,
}

impl CreateFlowRequest {
    pub fn new(summary: String, value: models::FlowValue, path: String) -> CreateFlowRequest {
        CreateFlowRequest {
            summary,
            description: None,
            value: Box::new(value),
            schema: None,
            on_behalf_of_email: None,
            path,
            tag: None,
            ws_error_handler_muted: None,
            priority: None,
            dedicated_worker: None,
            timeout: None,
            visible_to_runner_only: None,
            preserve_on_behalf_of: None,
            labels: None,
            draft_only: None,
            deployment_message: None,
        }
    }
}