/* 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 ProfileGame
 */
export interface ProfileGame {
    /**
     * 
     * @type {string}
     * @memberof ProfileGame
     */
    id?: string;
    /**
     * 
     * @type {string}
     * @memberof ProfileGame
     */
    name?: string | null;
    /**
     * 
     * @type {string}
     * @memberof ProfileGame
     */
    capsuleImageUrl?: string | null;
    /**
     * 
     * @type {string}
     * @memberof ProfileGame
     */
    libraryImageUrl?: string | null;
    /**
     * 
     * @type {string}
     * @memberof ProfileGame
     */
    slug?: string | null;
    /**
     * 
     * @type {number}
     * @memberof ProfileGame
     */
    timeUsed?: number;
    /**
     * 
     * @type {number}
     * @memberof ProfileGame
     */
    unlockedAchievements?: number;
    /**
     * 
     * @type {number}
     * @memberof ProfileGame
     */
    totalAchievements?: number;
    /**
     * 
     * @type {any}
     * @memberof ProfileGame
     */
    stats?: any | null;
    /**
     * 
     * @type {Date}
     * @memberof ProfileGame
     */
    acquired?: Date;
    /**
     * 
     * @type {Date}
     * @memberof ProfileGame
     */
    lastUsed?: Date | null;
}

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

export function ProfileGameFromJSON(json: any): ProfileGame {
    return ProfileGameFromJSONTyped(json, false);
}

export function ProfileGameFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProfileGame {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'] == null ? undefined : json['id'],
        'name': json['name'] == null ? undefined : json['name'],
        'capsuleImageUrl': json['capsule_image_url'] == null ? undefined : json['capsule_image_url'],
        'libraryImageUrl': json['library_image_url'] == null ? undefined : json['library_image_url'],
        'slug': json['slug'] == null ? undefined : json['slug'],
        'timeUsed': json['time_used'] == null ? undefined : json['time_used'],
        'unlockedAchievements': json['unlocked_achievements'] == null ? undefined : json['unlocked_achievements'],
        'totalAchievements': json['total_achievements'] == null ? undefined : json['total_achievements'],
        'stats': json['stats'] == null ? undefined : json['stats'],
        'acquired': json['acquired'] == null ? undefined : (new Date(json['acquired'])),
        'lastUsed': json['last_used'] == null ? undefined : (new Date(json['last_used'])),
    };
}

export function ProfileGameToJSON(json: any): ProfileGame {
    return ProfileGameToJSONTyped(json, false);
}

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

    return {
        
        'id': value['id'],
        'name': value['name'],
        'capsule_image_url': value['capsuleImageUrl'],
        'library_image_url': value['libraryImageUrl'],
        'slug': value['slug'],
        'time_used': value['timeUsed'],
        'unlocked_achievements': value['unlockedAchievements'],
        'total_achievements': value['totalAchievements'],
        'stats': value['stats'],
        'acquired': value['acquired'] == null ? undefined : ((value['acquired']).toISOString()),
        'last_used': value['lastUsed'] == null ? undefined : ((value['lastUsed'] as any).toISOString()),
    };
}

