/*
 * Tribufu API
 *
 * API to access Tribufu services.
 *
 * The version of the OpenAPI document: 1.3.0
 * Contact: contact@tribufu.com
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GameServer {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "name", deserialize_with = "Option::deserialize")]
    pub name: Option<String>,
    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub description: Option<Option<String>>,
    #[serde(rename = "owner_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub owner_id: Option<Option<String>>,
    #[serde(rename = "address", deserialize_with = "Option::deserialize")]
    pub address: Option<String>,
    #[serde(rename = "query_port")]
    pub query_port: i32,
    #[serde(rename = "game_port", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub game_port: Option<Option<i32>>,
    #[serde(rename = "map", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub map: Option<Option<String>>,
    #[serde(rename = "version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub version: Option<Option<String>>,
    #[serde(rename = "game_id", skip_serializing_if = "Option::is_none")]
    pub game_id: Option<String>,
    #[serde(rename = "game_icon_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub game_icon_url: Option<Option<String>>,
    #[serde(rename = "cluster_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub cluster_id: Option<Option<String>>,
    #[serde(rename = "website_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub website_url: Option<Option<String>>,
    #[serde(rename = "banner_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub banner_url: Option<Option<String>>,
    #[serde(rename = "uptime", skip_serializing_if = "Option::is_none")]
    pub uptime: Option<f64>,
    #[serde(rename = "country", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub country: Option<Option<String>>,
    #[serde(rename = "steam", skip_serializing_if = "Option::is_none")]
    pub steam: Option<bool>,
    #[serde(rename = "discord_server_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub discord_server_id: Option<Option<String>>,
    #[serde(rename = "youtube_video_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub youtube_video_url: Option<Option<String>>,
    #[serde(rename = "created", skip_serializing_if = "Option::is_none")]
    pub created: Option<String>,
    #[serde(rename = "updated", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub updated: Option<Option<String>>,
}

impl GameServer {
    pub fn new(name: Option<String>, address: Option<String>, query_port: i32) -> GameServer {
        GameServer {
            id: None,
            name,
            description: None,
            owner_id: None,
            address,
            query_port,
            game_port: None,
            map: None,
            version: None,
            game_id: None,
            game_icon_url: None,
            cluster_id: None,
            website_url: None,
            banner_url: None,
            uptime: None,
            country: None,
            steam: None,
            discord_server_id: None,
            youtube_video_url: None,
            created: None,
            updated: None,
        }
    }
}

