/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.8
 * 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 InstanceGroup {
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
    pub summary: Option<String>,
    #[serde(rename = "emails", skip_serializing_if = "Option::is_none")]
    pub emails: Option<Vec<String>>,
    #[serde(rename = "instance_role", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub instance_role: Option<Option<InstanceRole>>,
}

impl InstanceGroup {
    pub fn new(name: String) -> InstanceGroup {
        InstanceGroup {
            name,
            summary: None,
            emails: None,
            instance_role: None,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum InstanceRole {
    #[serde(rename = "superadmin")]
    Superadmin,
    #[serde(rename = "devops")]
    Devops,
}

impl Default for InstanceRole {
    fn default() -> InstanceRole {
        Self::Superadmin
    }
}

