azisaba-graph 0.1.0-rc.16

An API for connecting and sharing data across the Azisaba Network.
Documentation
/*
 * Azisaba Graph API
 *
 * An API for connecting and sharing data across the 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 UpdatePlayerByIdRequest {
    /// The Discord user ID linked to the player, or `null` if no Discord account is linked or the API key lacks the `players:read-details` scope.
    #[serde(rename = "discordId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub discord_id: Option<Option<String>>,
    /// The online status of the player.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    /// The server to which the player is currently connected, or `null` if the player is offline.
    #[serde(rename = "currentServer", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub current_server: Option<Option<String>>,
    /// The player's biography of up to 160 characters, or `null` if it is not set.
    #[serde(rename = "bio", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub bio: Option<Option<String>>,
}

impl UpdatePlayerByIdRequest {
    pub fn new() -> UpdatePlayerByIdRequest {
        UpdatePlayerByIdRequest {
            discord_id: None,
            status: None,
            current_server: None,
            bio: None,
        }
    }
}
/// The online status of the player.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "online")]
    Online,
    #[serde(rename = "offline")]
    Offline,
}

impl Default for Status {
    fn default() -> Status {
        Self::Online
    }
}