/*
 * Tapis Applications API
 *
 * The Tapis Applications API provides for management of Tapis applications including permissions.
 *
 * The version of the OpenAPI document: 25Q4.0
 * Contact: cicsupport@tacc.utexas.edu
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(
    Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum OperationTypeEnum {
    #[serde(rename = "CREATE")]
    #[default]
    Create,
    #[serde(rename = "READ")]
    Read,
    #[serde(rename = "MODIFY")]
    Modify,
    #[serde(rename = "EXECUTE")]
    Execute,
    #[serde(rename = "DELETE")]
    Delete,
    #[serde(rename = "UNDELETE")]
    Undelete,
    #[serde(rename = "HARD_DELETE")]
    HardDelete,
    #[serde(rename = "CHANGE_OWNER")]
    ChangeOwner,
    #[serde(rename = "ENABLE")]
    Enable,
    #[serde(rename = "DISABLE")]
    Disable,
    #[serde(rename = "LOCK")]
    Lock,
    #[serde(rename = "UNLOCK")]
    Unlock,
    #[serde(rename = "GET_PERMS")]
    GetPerms,
    #[serde(rename = "GRANT_PERMS")]
    GrantPerms,
    #[serde(rename = "REVOKE_PERMS")]
    RevokePerms,
}

impl std::fmt::Display for OperationTypeEnum {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::Create => write!(f, "CREATE"),
            Self::Read => write!(f, "READ"),
            Self::Modify => write!(f, "MODIFY"),
            Self::Execute => write!(f, "EXECUTE"),
            Self::Delete => write!(f, "DELETE"),
            Self::Undelete => write!(f, "UNDELETE"),
            Self::HardDelete => write!(f, "HARD_DELETE"),
            Self::ChangeOwner => write!(f, "CHANGE_OWNER"),
            Self::Enable => write!(f, "ENABLE"),
            Self::Disable => write!(f, "DISABLE"),
            Self::Lock => write!(f, "LOCK"),
            Self::Unlock => write!(f, "UNLOCK"),
            Self::GetPerms => write!(f, "GET_PERMS"),
            Self::GrantPerms => write!(f, "GRANT_PERMS"),
            Self::RevokePerms => write!(f, "REVOKE_PERMS"),
        }
    }
}
