/*
 * 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 Game {
    #[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 = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<models::ApplicationType>,
    #[serde(rename = "organization_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub organization_id: Option<Option<String>>,
    #[serde(rename = "icon_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub icon_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 = "capsule_image_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub capsule_image_url: Option<Option<String>>,
    #[serde(rename = "library_image_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub library_image_url: Option<Option<String>>,
    #[serde(rename = "slug", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub slug: 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>>,
    #[serde(rename = "enable_servers", skip_serializing_if = "Option::is_none")]
    pub enable_servers: Option<bool>,
    #[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 = "query_port", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub query_port: Option<Option<i32>>,
    #[serde(rename = "rcon_port", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub rcon_port: Option<Option<i32>>,
    #[serde(rename = "gamedig_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub gamedig_id: Option<Option<String>>,
    #[serde(rename = "steam_app_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub steam_app_id: Option<Option<i32>>,
    #[serde(rename = "steam_server_app_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub steam_server_app_id: Option<Option<i32>>,
}

impl Game {
    pub fn new(name: Option<String>) -> Game {
        Game {
            id: None,
            name,
            description: None,
            r#type: None,
            organization_id: None,
            icon_url: None,
            banner_url: None,
            capsule_image_url: None,
            library_image_url: None,
            slug: None,
            created: None,
            updated: None,
            enable_servers: None,
            game_port: None,
            query_port: None,
            rcon_port: None,
            gamedig_id: None,
            steam_app_id: None,
            steam_server_app_id: None,
        }
    }
}

