Skip to main content

windmill_api/models/
workspace_invite.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.846.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 WorkspaceInvite {
16    #[serde(rename = "workspace_id")]
17    pub workspace_id: String,
18    #[serde(rename = "email")]
19    pub email: String,
20    #[serde(rename = "is_admin")]
21    pub is_admin: bool,
22    #[serde(rename = "operator")]
23    pub operator: bool,
24    /// The workspace role the invite grants.
25    #[serde(rename = "role")]
26    pub role: String,
27    #[serde(rename = "parent_workspace_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub parent_workspace_id: Option<Option<String>>,
29}
30
31impl WorkspaceInvite {
32    pub fn new(workspace_id: String, email: String, is_admin: bool, operator: bool, role: String) -> WorkspaceInvite {
33        WorkspaceInvite {
34            workspace_id,
35            email,
36            is_admin,
37            operator,
38            role,
39            parent_workspace_id: None,
40        }
41    }
42}
43