/* 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 GameServerCluster
 */
export interface GameServerCluster {
    /**
     * 
     * @type {string}
     * @memberof GameServerCluster
     */
    id?: string;
    /**
     * 
     * @type {string}
     * @memberof GameServerCluster
     */
    name: string | null;
    /**
     * 
     * @type {string}
     * @memberof GameServerCluster
     */
    description?: string | null;
    /**
     * 
     * @type {string}
     * @memberof GameServerCluster
     */
    gameId?: string;
    /**
     * 
     * @type {string}
     * @memberof GameServerCluster
     */
    websiteUrl?: string | null;
    /**
     * 
     * @type {string}
     * @memberof GameServerCluster
     */
    bannerUrl?: string | null;
    /**
     * 
     * @type {string}
     * @memberof GameServerCluster
     */
    ownerId?: string;
    /**
     * 
     * @type {string}
     * @memberof GameServerCluster
     */
    discordServerId?: string | null;
    /**
     * 
     * @type {string}
     * @memberof GameServerCluster
     */
    youtubeVideoUrl?: string | null;
    /**
     * 
     * @type {string}
     * @memberof GameServerCluster
     */
    tags?: string | null;
    /**
     * 
     * @type {number}
     * @memberof GameServerCluster
     */
    commentCount?: number;
    /**
     * 
     * @type {number}
     * @memberof GameServerCluster
     */
    serverCount?: number;
    /**
     * 
     * @type {Date}
     * @memberof GameServerCluster
     */
    created?: Date;
    /**
     * 
     * @type {Date}
     * @memberof GameServerCluster
     */
    updated?: Date | null;
}

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

export function GameServerClusterFromJSON(json: any): GameServerCluster {
    return GameServerClusterFromJSONTyped(json, false);
}

export function GameServerClusterFromJSONTyped(json: any, ignoreDiscriminator: boolean): GameServerCluster {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'] == null ? undefined : json['id'],
        'name': json['name'],
        'description': json['description'] == null ? undefined : json['description'],
        'gameId': json['game_id'] == null ? undefined : json['game_id'],
        'websiteUrl': json['website_url'] == null ? undefined : json['website_url'],
        'bannerUrl': json['banner_url'] == null ? undefined : json['banner_url'],
        'ownerId': json['owner_id'] == null ? undefined : json['owner_id'],
        'discordServerId': json['discord_server_id'] == null ? undefined : json['discord_server_id'],
        'youtubeVideoUrl': json['youtube_video_url'] == null ? undefined : json['youtube_video_url'],
        'tags': json['tags'] == null ? undefined : json['tags'],
        'commentCount': json['comment_count'] == null ? undefined : json['comment_count'],
        'serverCount': json['server_count'] == null ? undefined : json['server_count'],
        'created': json['created'] == null ? undefined : (new Date(json['created'])),
        'updated': json['updated'] == null ? undefined : (new Date(json['updated'])),
    };
}

export function GameServerClusterToJSON(json: any): GameServerCluster {
    return GameServerClusterToJSONTyped(json, false);
}

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

    return {
        
        'id': value['id'],
        'name': value['name'],
        'description': value['description'],
        'game_id': value['gameId'],
        'website_url': value['websiteUrl'],
        'banner_url': value['bannerUrl'],
        'owner_id': value['ownerId'],
        'discord_server_id': value['discordServerId'],
        'youtube_video_url': value['youtubeVideoUrl'],
        'tags': value['tags'],
        'comment_count': value['commentCount'],
        'server_count': value['serverCount'],
        'created': value['created'] == null ? undefined : ((value['created']).toISOString()),
        'updated': value['updated'] == null ? undefined : ((value['updated'] as any).toISOString()),
    };
}

