/* tslint:disable */
/* eslint-disable */
/**
 * Commander Spellbook API
 * API for Commander Spellbook, the combo database engine for Magic: The Gathering
 *
 * The version of the OpenAPI document: 5.4.10
 * 
 *
 * 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.js';
import type { LayoutRotationEnum } from './LayoutRotationEnum.js';
import {
    LayoutRotationEnumFromJSON,
    LayoutRotationEnumFromJSONTyped,
    LayoutRotationEnumToJSON,
    LayoutRotationEnumToJSONTyped,
} from './LayoutRotationEnum.js';

/**
 * 
 * @export
 * @interface Card
 */
export interface Card {
    /**
     * 
     * @type {number}
     * @memberof Card
     */
    readonly id: number;
    /**
     * 
     * @type {string}
     * @memberof Card
     */
    name: string;
    /**
     * 
     * @type {string}
     * @memberof Card
     */
    oracleId: string | null;
    /**
     * Is this from an upcoming set?
     * @type {boolean}
     * @memberof Card
     */
    spoiler: boolean;
    /**
     * 
     * @type {string}
     * @memberof Card
     */
    typeLine: string;
    /**
     * 
     * @type {string}
     * @memberof Card
     */
    imageUriFrontPng: string | null;
    /**
     * 
     * @type {string}
     * @memberof Card
     */
    imageUriFrontLarge: string | null;
    /**
     * 
     * @type {string}
     * @memberof Card
     */
    imageUriFrontNormal: string | null;
    /**
     * 
     * @type {string}
     * @memberof Card
     */
    imageUriFrontSmall: string | null;
    /**
     * 
     * @type {string}
     * @memberof Card
     */
    imageUriFrontArtCrop: string | null;
    /**
     * 
     * @type {LayoutRotationEnum}
     * @memberof Card
     */
    layoutRotationFront: LayoutRotationEnum | null;
    /**
     * 
     * @type {string}
     * @memberof Card
     */
    imageUriBackPng: string | null;
    /**
     * 
     * @type {string}
     * @memberof Card
     */
    imageUriBackLarge: string | null;
    /**
     * 
     * @type {string}
     * @memberof Card
     */
    imageUriBackNormal: string | null;
    /**
     * 
     * @type {string}
     * @memberof Card
     */
    imageUriBackSmall: string | null;
    /**
     * 
     * @type {string}
     * @memberof Card
     */
    imageUriBackArtCrop: string | null;
}



/**
 * Check if a given object implements the Card interface.
 */
export function instanceOfCard(value: object): value is Card {
    if (!('id' in value) || value['id'] === undefined) return false;
    if (!('name' in value) || value['name'] === undefined) return false;
    if (!('oracleId' in value) || value['oracleId'] === undefined) return false;
    if (!('spoiler' in value) || value['spoiler'] === undefined) return false;
    if (!('typeLine' in value) || value['typeLine'] === undefined) return false;
    if (!('imageUriFrontPng' in value) || value['imageUriFrontPng'] === undefined) return false;
    if (!('imageUriFrontLarge' in value) || value['imageUriFrontLarge'] === undefined) return false;
    if (!('imageUriFrontNormal' in value) || value['imageUriFrontNormal'] === undefined) return false;
    if (!('imageUriFrontSmall' in value) || value['imageUriFrontSmall'] === undefined) return false;
    if (!('imageUriFrontArtCrop' in value) || value['imageUriFrontArtCrop'] === undefined) return false;
    if (!('layoutRotationFront' in value) || value['layoutRotationFront'] === undefined) return false;
    if (!('imageUriBackPng' in value) || value['imageUriBackPng'] === undefined) return false;
    if (!('imageUriBackLarge' in value) || value['imageUriBackLarge'] === undefined) return false;
    if (!('imageUriBackNormal' in value) || value['imageUriBackNormal'] === undefined) return false;
    if (!('imageUriBackSmall' in value) || value['imageUriBackSmall'] === undefined) return false;
    if (!('imageUriBackArtCrop' in value) || value['imageUriBackArtCrop'] === undefined) return false;
    return true;
}

export function CardFromJSON(json: any): Card {
    return CardFromJSONTyped(json, false);
}

export function CardFromJSONTyped(json: any, ignoreDiscriminator: boolean): Card {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'],
        'name': json['name'],
        'oracleId': json['oracleId'],
        'spoiler': json['spoiler'],
        'typeLine': json['typeLine'],
        'imageUriFrontPng': json['imageUriFrontPng'],
        'imageUriFrontLarge': json['imageUriFrontLarge'],
        'imageUriFrontNormal': json['imageUriFrontNormal'],
        'imageUriFrontSmall': json['imageUriFrontSmall'],
        'imageUriFrontArtCrop': json['imageUriFrontArtCrop'],
        'layoutRotationFront': LayoutRotationEnumFromJSON(json['layoutRotationFront']),
        'imageUriBackPng': json['imageUriBackPng'],
        'imageUriBackLarge': json['imageUriBackLarge'],
        'imageUriBackNormal': json['imageUriBackNormal'],
        'imageUriBackSmall': json['imageUriBackSmall'],
        'imageUriBackArtCrop': json['imageUriBackArtCrop'],
    };
}

export function CardToJSON(json: any): Card {
    return CardToJSONTyped(json, false);
}

export function CardToJSONTyped(value?: Omit<Card, 'id'> | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'name': value['name'],
        'oracleId': value['oracleId'],
        'spoiler': value['spoiler'],
        'typeLine': value['typeLine'],
        'imageUriFrontPng': value['imageUriFrontPng'],
        'imageUriFrontLarge': value['imageUriFrontLarge'],
        'imageUriFrontNormal': value['imageUriFrontNormal'],
        'imageUriFrontSmall': value['imageUriFrontSmall'],
        'imageUriFrontArtCrop': value['imageUriFrontArtCrop'],
        'layoutRotationFront': LayoutRotationEnumToJSON(value['layoutRotationFront']),
        'imageUriBackPng': value['imageUriBackPng'],
        'imageUriBackLarge': value['imageUriBackLarge'],
        'imageUriBackNormal': value['imageUriBackNormal'],
        'imageUriBackSmall': value['imageUriBackSmall'],
        'imageUriBackArtCrop': value['imageUriBackArtCrop'],
    };
}

