Skip to main content

azisaba_graph/models/
update_player_by_id_request.rs

1/*
2 * Azisaba Graph API
3 *
4 * An API for connecting and sharing data across the Azisaba Network.
5 *
6 * The version of the OpenAPI document: 0.0.1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct UpdatePlayerByIdRequest {
16    /// 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.
17    #[serde(rename = "discordId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
18    pub discord_id: Option<Option<String>>,
19    /// The online status of the player.
20    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
21    pub status: Option<Status>,
22    /// The server to which the player is currently connected, or `null` if the player is offline.
23    #[serde(rename = "currentServer", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub current_server: Option<Option<String>>,
25    /// The player's biography of up to 160 characters, or `null` if it is not set.
26    #[serde(rename = "bio", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
27    pub bio: Option<Option<String>>,
28}
29
30impl UpdatePlayerByIdRequest {
31    pub fn new() -> UpdatePlayerByIdRequest {
32        UpdatePlayerByIdRequest {
33            discord_id: None,
34            status: None,
35            current_server: None,
36            bio: None,
37        }
38    }
39}
40/// The online status of the player.
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
42pub enum Status {
43    #[serde(rename = "online")]
44    Online,
45    #[serde(rename = "offline")]
46    Offline,
47}
48
49impl Default for Status {
50    fn default() -> Status {
51        Self::Online
52    }
53}
54