azisaba-graph 0.1.0-rc.2

An API for connecting and sharing data across Azisaba Network.
Documentation
/*
 * Azisaba Graph API
 *
 * An API for connecting and sharing data across Azisaba Network.
 *
 * The version of the OpenAPI document: 0.0.1
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// ApiKeyScope : A permission granted to an API key. The `players:read-details` scope grants the player access available with `players:read` and also permits access to linked Discord user IDs. 
/// A permission granted to an API key. The `players:read-details` scope grants the player access available with `players:read` and also permits access to linked Discord user IDs. 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ApiKeyScope {
    #[serde(rename = "*")]
    Star,
    #[serde(rename = "api-keys:read")]
    ApiKeysColonRead,
    #[serde(rename = "api-keys:write")]
    ApiKeysColonWrite,
    #[serde(rename = "crawls:read")]
    CrawlsColonRead,
    #[serde(rename = "crawls:write")]
    CrawlsColonWrite,
    #[serde(rename = "patch-notes:read")]
    PatchNotesColonRead,
    #[serde(rename = "patch-notes:write")]
    PatchNotesColonWrite,
    #[serde(rename = "players:read")]
    PlayersColonRead,
    #[serde(rename = "players:read-details")]
    PlayersColonReadDetails,
    #[serde(rename = "players:write")]
    PlayersColonWrite,
    #[serde(rename = "punishments:read")]
    PunishmentsColonRead,
    #[serde(rename = "punishments:write")]
    PunishmentsColonWrite,

}

impl std::fmt::Display for ApiKeyScope {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::Star => write!(f, "*"),
            Self::ApiKeysColonRead => write!(f, "api-keys:read"),
            Self::ApiKeysColonWrite => write!(f, "api-keys:write"),
            Self::CrawlsColonRead => write!(f, "crawls:read"),
            Self::CrawlsColonWrite => write!(f, "crawls:write"),
            Self::PatchNotesColonRead => write!(f, "patch-notes:read"),
            Self::PatchNotesColonWrite => write!(f, "patch-notes:write"),
            Self::PlayersColonRead => write!(f, "players:read"),
            Self::PlayersColonReadDetails => write!(f, "players:read-details"),
            Self::PlayersColonWrite => write!(f, "players:write"),
            Self::PunishmentsColonRead => write!(f, "punishments:read"),
            Self::PunishmentsColonWrite => write!(f, "punishments:write"),
        }
    }
}

impl Default for ApiKeyScope {
    fn default() -> ApiKeyScope {
        Self::Star
    }
}