windmill-api 1.684.1

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.684.1
 * 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 UserSource {
    /// How the user was added to the workspace
    #[serde(rename = "source")]
    pub source: Source,
    /// The domain used for auto-invite (when source is 'domain')
    #[serde(rename = "domain", skip_serializing_if = "Option::is_none")]
    pub domain: Option<String>,
    /// The instance group name (when source is 'instance_group')
    #[serde(rename = "group", skip_serializing_if = "Option::is_none")]
    pub group: Option<String>,
}

impl UserSource {
    pub fn new(source: Source) -> UserSource {
        UserSource {
            source,
            domain: None,
            group: None,
        }
    }
}
/// How the user was added to the workspace
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Source {
    #[serde(rename = "domain")]
    Domain,
    #[serde(rename = "instance_group")]
    InstanceGroup,
    #[serde(rename = "manual")]
    Manual,
}

impl Default for Source {
    fn default() -> Source {
        Self::Domain
    }
}