/* tslint:disable */
/* eslint-disable */
/**
 * @fastify/swagger
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 9.6.1
 * 
 *
 * 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 { TournamentData200ResponsePayloadDataUsersInner } from './TournamentData200ResponsePayloadDataUsersInner';
import {
    TournamentData200ResponsePayloadDataUsersInnerFromJSON,
    TournamentData200ResponsePayloadDataUsersInnerFromJSONTyped,
    TournamentData200ResponsePayloadDataUsersInnerToJSON,
    TournamentData200ResponsePayloadDataUsersInnerToJSONTyped,
} from './TournamentData200ResponsePayloadDataUsersInner';
import type { PongHistory200ResponsePayloadDataInner } from './PongHistory200ResponsePayloadDataInner';
import {
    PongHistory200ResponsePayloadDataInnerFromJSON,
    PongHistory200ResponsePayloadDataInnerFromJSONTyped,
    PongHistory200ResponsePayloadDataInnerToJSON,
    PongHistory200ResponsePayloadDataInnerToJSONTyped,
} from './PongHistory200ResponsePayloadDataInner';

/**
 * 
 * @export
 * @interface TournamentData200ResponsePayloadData
 */
export interface TournamentData200ResponsePayloadData {
    /**
     * 
     * @type {number}
     * @memberof TournamentData200ResponsePayloadData
     */
    playerCount: number;
    /**
     * 
     * @type {string}
     * @memberof TournamentData200ResponsePayloadData
     */
    owner: string;
    /**
     * 
     * @type {Array<TournamentData200ResponsePayloadDataUsersInner>}
     * @memberof TournamentData200ResponsePayloadData
     */
    users: Array<TournamentData200ResponsePayloadDataUsersInner>;
    /**
     * 
     * @type {Array<PongHistory200ResponsePayloadDataInner>}
     * @memberof TournamentData200ResponsePayloadData
     */
    games: Array<PongHistory200ResponsePayloadDataInner>;
    /**
     * 
     * @type {string}
     * @memberof TournamentData200ResponsePayloadData
     */
    time: string;
}

/**
 * Check if a given object implements the TournamentData200ResponsePayloadData interface.
 */
export function instanceOfTournamentData200ResponsePayloadData(value: object): value is TournamentData200ResponsePayloadData {
    if (!('playerCount' in value) || value['playerCount'] === undefined) return false;
    if (!('owner' in value) || value['owner'] === undefined) return false;
    if (!('users' in value) || value['users'] === undefined) return false;
    if (!('games' in value) || value['games'] === undefined) return false;
    if (!('time' in value) || value['time'] === undefined) return false;
    return true;
}

export function TournamentData200ResponsePayloadDataFromJSON(json: any): TournamentData200ResponsePayloadData {
    return TournamentData200ResponsePayloadDataFromJSONTyped(json, false);
}

export function TournamentData200ResponsePayloadDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): TournamentData200ResponsePayloadData {
    if (json == null) {
        return json;
    }
    return {
        
        'playerCount': json['playerCount'],
        'owner': json['owner'],
        'users': ((json['users'] as Array<any>).map(TournamentData200ResponsePayloadDataUsersInnerFromJSON)),
        'games': ((json['games'] as Array<any>).map(PongHistory200ResponsePayloadDataInnerFromJSON)),
        'time': json['time'],
    };
}

export function TournamentData200ResponsePayloadDataToJSON(json: any): TournamentData200ResponsePayloadData {
    return TournamentData200ResponsePayloadDataToJSONTyped(json, false);
}

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

    return {
        
        'playerCount': value['playerCount'],
        'owner': value['owner'],
        'users': ((value['users'] as Array<any>).map(TournamentData200ResponsePayloadDataUsersInnerToJSON)),
        'games': ((value['games'] as Array<any>).map(PongHistory200ResponsePayloadDataInnerToJSON)),
        'time': value['time'],
    };
}

