Skip to main content

windmill_api/models/
create_workspace_fork.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.841.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 CreateWorkspaceFork {
16    #[serde(rename = "id")]
17    pub id: String,
18    #[serde(rename = "name")]
19    pub name: String,
20    #[serde(rename = "color", skip_serializing_if = "Option::is_none")]
21    pub color: Option<String>,
22    #[serde(rename = "forked_datatables", skip_serializing_if = "Option::is_none")]
23    pub forked_datatables: Option<Vec<models::CreateWorkspaceForkForkedDatatablesInner>>,
24    /// Lake names the fork SHARES with the parent (reads and writes the parent's lake directly). Every lake not listed gets the default isolated fork namespace with read-defer to the parent.
25    #[serde(rename = "shared_ducklakes", skip_serializing_if = "Option::is_none")]
26    pub shared_ducklakes: Option<Vec<String>>,
27    /// Workspace storages the fork SHARES with the parent (`_default_` for the primary one): it reads and writes the parent's objects directly. Every storage not listed is isolated: the fork writes under its own prefix and reads through to the parent's objects.
28    #[serde(rename = "shared_storages", skip_serializing_if = "Option::is_none")]
29    pub shared_storages: Option<Vec<String>>,
30    /// Create the fork as a persistent dev workspace (id not required to carry the wm-fork- prefix; at most one per parent)
31    #[serde(rename = "is_dev_workspace", skip_serializing_if = "Option::is_none")]
32    pub is_dev_workspace: Option<bool>,
33    /// When creating a dev workspace, lock the parent (prod) against direct deployment
34    #[serde(rename = "lock_prod_deploy", skip_serializing_if = "Option::is_none")]
35    pub lock_prod_deploy: Option<bool>,
36    /// When creating a dev workspace, prevent forking the parent (prod)
37    #[serde(rename = "lock_prod_forking", skip_serializing_if = "Option::is_none")]
38    pub lock_prod_forking: Option<bool>,
39    /// Copy the parent's members (users + group memberships) into the fork so the team can work in it
40    #[serde(rename = "copy_members", skip_serializing_if = "Option::is_none")]
41    pub copy_members: Option<bool>,
42    /// Environment label for the dev workspace: its badge text and the branch it deploys to. Ignored for non-dev forks. Omitted defaults to 'dev'
43    #[serde(rename = "dev_workspace_label", skip_serializing_if = "Option::is_none")]
44    pub dev_workspace_label: Option<DevWorkspaceLabel>,
45}
46
47impl CreateWorkspaceFork {
48    pub fn new(id: String, name: String) -> CreateWorkspaceFork {
49        CreateWorkspaceFork {
50            id,
51            name,
52            color: None,
53            forked_datatables: None,
54            shared_ducklakes: None,
55            shared_storages: None,
56            is_dev_workspace: None,
57            lock_prod_deploy: None,
58            lock_prod_forking: None,
59            copy_members: None,
60            dev_workspace_label: None,
61        }
62    }
63}
64/// Environment label for the dev workspace: its badge text and the branch it deploys to. Ignored for non-dev forks. Omitted defaults to 'dev'
65#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
66pub enum DevWorkspaceLabel {
67    #[serde(rename = "dev")]
68    Dev,
69    #[serde(rename = "qa")]
70    Qa,
71    #[serde(rename = "test")]
72    Test,
73    #[serde(rename = "uat")]
74    Uat,
75    #[serde(rename = "staging")]
76    Staging,
77    #[serde(rename = "demo")]
78    Demo,
79    #[serde(rename = "sandbox")]
80    Sandbox,
81    #[serde(rename = "preprod")]
82    Preprod,
83}
84
85impl Default for DevWorkspaceLabel {
86    fn default() -> DevWorkspaceLabel {
87        Self::Dev
88    }
89}
90