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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UpdateApiKeyRequest {
    /// The human-readable name of the API key.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// The scopes granted to the API key.
    #[serde(rename = "scopes", skip_serializing_if = "Option::is_none")]
    pub scopes: Option<std::collections::HashSet<Scopes>>,
    /// The date and time at which the API key expires, or `null` if it does not expire.
    #[serde(rename = "expiresAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub expires_at: Option<Option<chrono::DateTime<chrono::FixedOffset>>>,
    /// The player linked to this API key, or `null` if the key is not linked to a player.
    #[serde(rename = "playerId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub player_id: Option<Option<uuid::Uuid>>,
}

impl UpdateApiKeyRequest {
    pub fn new() -> UpdateApiKeyRequest {
        UpdateApiKeyRequest {
            name: None,
            scopes: None,
            expires_at: None,
            player_id: None,
        }
    }
}
/// The scopes granted to the API key.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Scopes {
    #[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 Default for Scopes {
    fn default() -> Scopes {
        Self::Star
    }
}