/* 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';
import type { GameServerStatus } from './GameServerStatus';
import {
    GameServerStatusFromJSON,
    GameServerStatusFromJSONTyped,
    GameServerStatusToJSON,
    GameServerStatusToJSONTyped,
} from './GameServerStatus';

/**
 * 
 * @export
 * @interface GameServerQuery
 */
export interface GameServerQuery {
    /**
     * 
     * @type {string}
     * @memberof GameServerQuery
     */
    id?: string;
    /**
     * 
     * @type {string}
     * @memberof GameServerQuery
     */
    serverId?: string;
    /**
     * 
     * @type {GameServerStatus}
     * @memberof GameServerQuery
     */
    status?: GameServerStatus;
    /**
     * 
     * @type {number}
     * @memberof GameServerQuery
     */
    ping?: number;
    /**
     * 
     * @type {number}
     * @memberof GameServerQuery
     */
    currentPlayers?: number;
    /**
     * 
     * @type {number}
     * @memberof GameServerQuery
     */
    maxPlayers?: number;
    /**
     * 
     * @type {string}
     * @memberof GameServerQuery
     */
    motd?: string | null;
    /**
     * 
     * @type {Date}
     * @memberof GameServerQuery
     */
    created?: Date;
}



/**
 * Check if a given object implements the GameServerQuery interface.
 */
export function instanceOfGameServerQuery(value: object): value is GameServerQuery {
    return true;
}

export function GameServerQueryFromJSON(json: any): GameServerQuery {
    return GameServerQueryFromJSONTyped(json, false);
}

export function GameServerQueryFromJSONTyped(json: any, ignoreDiscriminator: boolean): GameServerQuery {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'] == null ? undefined : json['id'],
        'serverId': json['server_id'] == null ? undefined : json['server_id'],
        'status': json['status'] == null ? undefined : GameServerStatusFromJSON(json['status']),
        'ping': json['ping'] == null ? undefined : json['ping'],
        'currentPlayers': json['current_players'] == null ? undefined : json['current_players'],
        'maxPlayers': json['max_players'] == null ? undefined : json['max_players'],
        'motd': json['motd'] == null ? undefined : json['motd'],
        'created': json['created'] == null ? undefined : (new Date(json['created'])),
    };
}

export function GameServerQueryToJSON(json: any): GameServerQuery {
    return GameServerQueryToJSONTyped(json, false);
}

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

    return {
        
        'id': value['id'],
        'server_id': value['serverId'],
        'status': GameServerStatusToJSON(value['status']),
        'ping': value['ping'],
        'current_players': value['currentPlayers'],
        'max_players': value['maxPlayers'],
        'motd': value['motd'],
        'created': value['created'] == null ? undefined : ((value['created']).toISOString()),
    };
}

