/*
 * 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 GameServerCluster {
    #[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 = "game_id", skip_serializing_if = "Option::is_none")]
    pub game_id: 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 = "owner_id", skip_serializing_if = "Option::is_none")]
    pub owner_id: Option<String>,
    #[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 = "tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Option<String>>,
    #[serde(rename = "comment_count", skip_serializing_if = "Option::is_none")]
    pub comment_count: Option<i32>,
    #[serde(rename = "server_count", skip_serializing_if = "Option::is_none")]
    pub server_count: Option<i32>,
    #[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 GameServerCluster {
    pub fn new(name: Option<String>) -> GameServerCluster {
        GameServerCluster {
            id: None,
            name,
            description: None,
            game_id: None,
            website_url: None,
            banner_url: None,
            owner_id: None,
            discord_server_id: None,
            youtube_video_url: None,
            tags: None,
            comment_count: None,
            server_count: None,
            created: None,
            updated: None,
        }
    }
}

