Skip to main content

windmill_api/models/
invite_user_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.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 InviteUserRequest {
16    #[serde(rename = "email")]
17    pub email: String,
18    #[serde(rename = "is_admin")]
19    pub is_admin: bool,
20    /// Legacy role selector, true for the `operator` role.
21    #[serde(rename = "operator", skip_serializing_if = "Option::is_none")]
22    pub operator: Option<bool>,
23    /// The workspace role to give, one of the workspace's roles. Wins over `operator`.
24    #[serde(rename = "role", skip_serializing_if = "Option::is_none")]
25    pub role: Option<String>,
26    #[serde(rename = "parent_workspace_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
27    pub parent_workspace_id: Option<Option<String>>,
28}
29
30impl InviteUserRequest {
31    pub fn new(email: String, is_admin: bool) -> InviteUserRequest {
32        InviteUserRequest {
33            email,
34            is_admin,
35            operator: None,
36            role: None,
37            parent_workspace_id: None,
38        }
39    }
40}
41