/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.2.0
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GlobalUserInfo {
    #[serde(rename = "email")]
    pub email: String,
    #[serde(rename = "login_type")]
    pub login_type: LoginType,
    #[serde(rename = "super_admin")]
    pub super_admin: bool,
    #[serde(rename = "devops", skip_serializing_if = "Option::is_none")]
    pub devops: Option<bool>,
    #[serde(rename = "verified")]
    pub verified: bool,
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(rename = "company", skip_serializing_if = "Option::is_none")]
    pub company: Option<String>,
    #[serde(rename = "username", skip_serializing_if = "Option::is_none")]
    pub username: Option<String>,
    #[serde(rename = "operator_only", skip_serializing_if = "Option::is_none")]
    pub operator_only: Option<bool>,
    #[serde(rename = "first_time_user")]
    pub first_time_user: bool,
    #[serde(rename = "role_source")]
    pub role_source: RoleSource,
    #[serde(rename = "disabled")]
    pub disabled: bool,
}

impl GlobalUserInfo {
    pub fn new(email: String, login_type: LoginType, super_admin: bool, verified: bool, first_time_user: bool, role_source: RoleSource, disabled: bool) -> GlobalUserInfo {
        GlobalUserInfo {
            email,
            login_type,
            super_admin,
            devops: None,
            verified,
            name: None,
            company: None,
            username: None,
            operator_only: None,
            first_time_user,
            role_source,
            disabled,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum LoginType {
    #[serde(rename = "password")]
    Password,
    #[serde(rename = "github")]
    Github,
}

impl Default for LoginType {
    fn default() -> LoginType {
        Self::Password
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum RoleSource {
    #[serde(rename = "manual")]
    Manual,
    #[serde(rename = "instance_group")]
    InstanceGroup,
}

impl Default for RoleSource {
    fn default() -> RoleSource {
        Self::Manual
    }
}

