/* tslint:disable */
/* eslint-disable */
/**
 * Tribufu API
 * API to access Tribufu services.
 *
 * The version of the OpenAPI document: 1.3.0
 * Contact: contact@tribufu.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { mapValues } from '../runtime';
/**
 * 
 * @export
 * @interface GameServer
 */
export interface GameServer {
    /**
     * 
     * @type {string}
     * @memberof GameServer
     */
    id?: string;
    /**
     * 
     * @type {string}
     * @memberof GameServer
     */
    name: string | null;
    /**
     * 
     * @type {string}
     * @memberof GameServer
     */
    description?: string | null;
    /**
     * 
     * @type {string}
     * @memberof GameServer
     */
    ownerId?: string | null;
    /**
     * 
     * @type {string}
     * @memberof GameServer
     */
    address: string | null;
    /**
     * 
     * @type {number}
     * @memberof GameServer
     */
    queryPort: number;
    /**
     * 
     * @type {number}
     * @memberof GameServer
     */
    gamePort?: number | null;
    /**
     * 
     * @type {string}
     * @memberof GameServer
     */
    map?: string | null;
    /**
     * 
     * @type {string}
     * @memberof GameServer
     */
    version?: string | null;
    /**
     * 
     * @type {string}
     * @memberof GameServer
     */
    gameId?: string;
    /**
     * 
     * @type {string}
     * @memberof GameServer
     */
    gameIconUrl?: string | null;
    /**
     * 
     * @type {string}
     * @memberof GameServer
     */
    clusterId?: string | null;
    /**
     * 
     * @type {string}
     * @memberof GameServer
     */
    websiteUrl?: string | null;
    /**
     * 
     * @type {string}
     * @memberof GameServer
     */
    bannerUrl?: string | null;
    /**
     * 
     * @type {number}
     * @memberof GameServer
     */
    uptime?: number;
    /**
     * 
     * @type {string}
     * @memberof GameServer
     */
    country?: string | null;
    /**
     * 
     * @type {boolean}
     * @memberof GameServer
     */
    steam?: boolean;
    /**
     * 
     * @type {string}
     * @memberof GameServer
     */
    discordServerId?: string | null;
    /**
     * 
     * @type {string}
     * @memberof GameServer
     */
    youtubeVideoUrl?: string | null;
    /**
     * 
     * @type {Date}
     * @memberof GameServer
     */
    created?: Date;
    /**
     * 
     * @type {Date}
     * @memberof GameServer
     */
    updated?: Date | null;
}

/**
 * Check if a given object implements the GameServer interface.
 */
export function instanceOfGameServer(value: object): value is GameServer {
    if (!('name' in value) || value['name'] === undefined) return false;
    if (!('address' in value) || value['address'] === undefined) return false;
    if (!('queryPort' in value) || value['queryPort'] === undefined) return false;
    return true;
}

export function GameServerFromJSON(json: any): GameServer {
    return GameServerFromJSONTyped(json, false);
}

export function GameServerFromJSONTyped(json: any, ignoreDiscriminator: boolean): GameServer {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'] == null ? undefined : json['id'],
        'name': json['name'],
        'description': json['description'] == null ? undefined : json['description'],
        'ownerId': json['owner_id'] == null ? undefined : json['owner_id'],
        'address': json['address'],
        'queryPort': json['query_port'],
        'gamePort': json['game_port'] == null ? undefined : json['game_port'],
        'map': json['map'] == null ? undefined : json['map'],
        'version': json['version'] == null ? undefined : json['version'],
        'gameId': json['game_id'] == null ? undefined : json['game_id'],
        'gameIconUrl': json['game_icon_url'] == null ? undefined : json['game_icon_url'],
        'clusterId': json['cluster_id'] == null ? undefined : json['cluster_id'],
        'websiteUrl': json['website_url'] == null ? undefined : json['website_url'],
        'bannerUrl': json['banner_url'] == null ? undefined : json['banner_url'],
        'uptime': json['uptime'] == null ? undefined : json['uptime'],
        'country': json['country'] == null ? undefined : json['country'],
        'steam': json['steam'] == null ? undefined : json['steam'],
        'discordServerId': json['discord_server_id'] == null ? undefined : json['discord_server_id'],
        'youtubeVideoUrl': json['youtube_video_url'] == null ? undefined : json['youtube_video_url'],
        'created': json['created'] == null ? undefined : (new Date(json['created'])),
        'updated': json['updated'] == null ? undefined : (new Date(json['updated'])),
    };
}

export function GameServerToJSON(json: any): GameServer {
    return GameServerToJSONTyped(json, false);
}

export function GameServerToJSONTyped(value?: GameServer | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'id': value['id'],
        'name': value['name'],
        'description': value['description'],
        'owner_id': value['ownerId'],
        'address': value['address'],
        'query_port': value['queryPort'],
        'game_port': value['gamePort'],
        'map': value['map'],
        'version': value['version'],
        'game_id': value['gameId'],
        'game_icon_url': value['gameIconUrl'],
        'cluster_id': value['clusterId'],
        'website_url': value['websiteUrl'],
        'banner_url': value['bannerUrl'],
        'uptime': value['uptime'],
        'country': value['country'],
        'steam': value['steam'],
        'discord_server_id': value['discordServerId'],
        'youtube_video_url': value['youtubeVideoUrl'],
        'created': value['created'] == null ? undefined : ((value['created']).toISOString()),
        'updated': value['updated'] == null ? undefined : ((value['updated'] as any).toISOString()),
    };
}

