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

/// ListCrawls200ResponseItemsInner : The result of a single crawl of a Minecraft server.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ListCrawls200ResponseItemsInner {
    /// The unique identifier of the crawl.
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    /// The hostname or IP address of the crawled Minecraft server.
    #[serde(rename = "address")]
    pub address: String,
    /// The port of the crawled Minecraft server.
    #[serde(rename = "port")]
    pub port: u16,
    /// The server ping in milliseconds.
    #[serde(rename = "ping")]
    pub ping: u32,
    /// The Minecraft version name reported by the server.
    #[serde(rename = "version")]
    pub version: String,
    /// The Minecraft protocol version reported by the server.
    #[serde(rename = "protocolVersion")]
    pub protocol_version: i32,
    /// The maximum number of players reported by the server.
    #[serde(rename = "maxPlayers")]
    pub max_players: u32,
    /// The number of players currently connected to the server.
    #[serde(rename = "onlinePlayers")]
    pub online_players: u32,
    /// The server description reported by the server.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// The server favicon as a Base64-encoded PNG data URL, or `null` if no favicon was provided.
    #[serde(rename = "favicon", deserialize_with = "Option::deserialize")]
    pub favicon: Option<String>,
    /// The date and time at which the server was crawled.
    #[serde(rename = "crawledAt")]
    pub crawled_at: chrono::DateTime<chrono::FixedOffset>,
}

impl ListCrawls200ResponseItemsInner {
    /// The result of a single crawl of a Minecraft server.
    pub fn new(id: uuid::Uuid, address: String, port: u16, ping: u32, version: String, protocol_version: i32, max_players: u32, online_players: u32, favicon: Option<String>, crawled_at: chrono::DateTime<chrono::FixedOffset>) -> ListCrawls200ResponseItemsInner {
        ListCrawls200ResponseItemsInner {
            id,
            address,
            port,
            ping,
            version,
            protocol_version,
            max_players,
            online_players,
            description: None,
            favicon,
            crawled_at,
        }
    }
}