/* 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 { ColorEnum } from './ColorEnum.js';
import {
    ColorEnumFromJSON,
    ColorEnumFromJSONTyped,
    ColorEnumToJSON,
    ColorEnumToJSONTyped,
} from './ColorEnum.js';
import type { FeatureOfCard } from './FeatureOfCard.js';
import {
    FeatureOfCardFromJSON,
    FeatureOfCardFromJSONTyped,
    FeatureOfCardToJSON,
    FeatureOfCardToJSONTyped,
} from './FeatureOfCard.js';
import type { LayoutRotationEnum } from './LayoutRotationEnum.js';
import {
    LayoutRotationEnumFromJSON,
    LayoutRotationEnumFromJSONTyped,
    LayoutRotationEnumToJSON,
    LayoutRotationEnumToJSONTyped,
} from './LayoutRotationEnum.js';
import type { CardLegalities } from './CardLegalities.js';
import {
    CardLegalitiesFromJSON,
    CardLegalitiesFromJSONTyped,
    CardLegalitiesToJSON,
    CardLegalitiesToJSONTyped,
} from './CardLegalities.js';
import type { CardPrices } from './CardPrices.js';
import {
    CardPricesFromJSON,
    CardPricesFromJSONTyped,
    CardPricesToJSON,
    CardPricesToJSONTyped,
} from './CardPrices.js';

/**
 * 
 * @export
 * @interface CardDetail
 */
export interface CardDetail {
    /**
     * 
     * @type {number}
     * @memberof CardDetail
     */
    readonly id: number;
    /**
     * 
     * @type {string}
     * @memberof CardDetail
     */
    name: string;
    /**
     * 
     * @type {string}
     * @memberof CardDetail
     */
    oracleId: string | null;
    /**
     * 
     * @type {ColorEnum}
     * @memberof CardDetail
     */
    identity: ColorEnum;
    /**
     * 
     * @type {number}
     * @memberof CardDetail
     */
    readonly variantCount: number;
    /**
     * 
     * @type {ColorEnum}
     * @memberof CardDetail
     */
    color: ColorEnum;
    /**
     * Is this from an upcoming set?
     * @type {boolean}
     * @memberof CardDetail
     */
    spoiler: boolean;
    /**
     * 
     * @type {string}
     * @memberof CardDetail
     */
    typeLine: string;
    /**
     * 
     * @type {string}
     * @memberof CardDetail
     */
    oracleText: string;
    /**
     * 
     * @type {any}
     * @memberof CardDetail
     */
    keywords: any | null;
    /**
     * 
     * @type {number}
     * @memberof CardDetail
     */
    manaValue: number;
    /**
     * Whether this card is part of the Reserved List
     * @type {boolean}
     * @memberof CardDetail
     */
    reserved: boolean;
    /**
     * Set code of latest printing of card
     * @type {string}
     * @memberof CardDetail
     */
    latestPrintingSet: string;
    /**
     * Whether this card has been reprinted
     * @type {boolean}
     * @memberof CardDetail
     */
    reprinted: boolean;
    /**
     * Whether this card is in the official Game Changer card list
     * @type {boolean}
     * @memberof CardDetail
     */
    gameChanger: boolean;
    /**
     * Whether this card can tutor for other cards
     * @type {boolean}
     * @memberof CardDetail
     */
    tutor: boolean;
    /**
     * Whether this card can inhibit or destroy numerous lands
     * @type {boolean}
     * @memberof CardDetail
     */
    massLandDenial: boolean;
    /**
     * Whether this card grants an extra turn
     * @type {boolean}
     * @memberof CardDetail
     */
    extraTurn: boolean;
    /**
     * 
     * @type {string}
     * @memberof CardDetail
     */
    imageUriFrontPng: string | null;
    /**
     * 
     * @type {string}
     * @memberof CardDetail
     */
    imageUriFrontLarge: string | null;
    /**
     * 
     * @type {string}
     * @memberof CardDetail
     */
    imageUriFrontNormal: string | null;
    /**
     * 
     * @type {string}
     * @memberof CardDetail
     */
    imageUriFrontSmall: string | null;
    /**
     * 
     * @type {string}
     * @memberof CardDetail
     */
    imageUriFrontArtCrop: string | null;
    /**
     * 
     * @type {LayoutRotationEnum}
     * @memberof CardDetail
     */
    layoutRotationFront: LayoutRotationEnum | null;
    /**
     * 
     * @type {string}
     * @memberof CardDetail
     */
    imageUriBackPng: string | null;
    /**
     * 
     * @type {string}
     * @memberof CardDetail
     */
    imageUriBackLarge: string | null;
    /**
     * 
     * @type {string}
     * @memberof CardDetail
     */
    imageUriBackNormal: string | null;
    /**
     * 
     * @type {string}
     * @memberof CardDetail
     */
    imageUriBackSmall: string | null;
    /**
     * 
     * @type {string}
     * @memberof CardDetail
     */
    imageUriBackArtCrop: string | null;
    /**
     * 
     * @type {Array<FeatureOfCard>}
     * @memberof CardDetail
     */
    readonly features: Array<FeatureOfCard>;
    /**
     * 
     * @type {CardLegalities}
     * @memberof CardDetail
     */
    readonly legalities: CardLegalities;
    /**
     * 
     * @type {CardPrices}
     * @memberof CardDetail
     */
    readonly prices: CardPrices;
}



/**
 * Check if a given object implements the CardDetail interface.
 */
export function instanceOfCardDetail(value: object): value is CardDetail {
    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 (!('identity' in value) || value['identity'] === undefined) return false;
    if (!('variantCount' in value) || value['variantCount'] === undefined) return false;
    if (!('color' in value) || value['color'] === undefined) return false;
    if (!('spoiler' in value) || value['spoiler'] === undefined) return false;
    if (!('typeLine' in value) || value['typeLine'] === undefined) return false;
    if (!('oracleText' in value) || value['oracleText'] === undefined) return false;
    if (!('keywords' in value) || value['keywords'] === undefined) return false;
    if (!('manaValue' in value) || value['manaValue'] === undefined) return false;
    if (!('reserved' in value) || value['reserved'] === undefined) return false;
    if (!('latestPrintingSet' in value) || value['latestPrintingSet'] === undefined) return false;
    if (!('reprinted' in value) || value['reprinted'] === undefined) return false;
    if (!('gameChanger' in value) || value['gameChanger'] === undefined) return false;
    if (!('tutor' in value) || value['tutor'] === undefined) return false;
    if (!('massLandDenial' in value) || value['massLandDenial'] === undefined) return false;
    if (!('extraTurn' in value) || value['extraTurn'] === 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;
    if (!('features' in value) || value['features'] === undefined) return false;
    if (!('legalities' in value) || value['legalities'] === undefined) return false;
    if (!('prices' in value) || value['prices'] === undefined) return false;
    return true;
}

export function CardDetailFromJSON(json: any): CardDetail {
    return CardDetailFromJSONTyped(json, false);
}

export function CardDetailFromJSONTyped(json: any, ignoreDiscriminator: boolean): CardDetail {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'],
        'name': json['name'],
        'oracleId': json['oracleId'],
        'identity': ColorEnumFromJSON(json['identity']),
        'variantCount': json['variantCount'],
        'color': ColorEnumFromJSON(json['color']),
        'spoiler': json['spoiler'],
        'typeLine': json['typeLine'],
        'oracleText': json['oracleText'],
        'keywords': json['keywords'],
        'manaValue': json['manaValue'],
        'reserved': json['reserved'],
        'latestPrintingSet': json['latestPrintingSet'],
        'reprinted': json['reprinted'],
        'gameChanger': json['gameChanger'],
        'tutor': json['tutor'],
        'massLandDenial': json['massLandDenial'],
        'extraTurn': json['extraTurn'],
        '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'],
        'features': ((json['features'] as Array<any>).map(FeatureOfCardFromJSON)),
        'legalities': CardLegalitiesFromJSON(json['legalities']),
        'prices': CardPricesFromJSON(json['prices']),
    };
}

export function CardDetailToJSON(json: any): CardDetail {
    return CardDetailToJSONTyped(json, false);
}

export function CardDetailToJSONTyped(value?: Omit<CardDetail, 'id'|'variantCount'|'features'|'legalities'|'prices'> | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'name': value['name'],
        'oracleId': value['oracleId'],
        'identity': ColorEnumToJSON(value['identity']),
        'color': ColorEnumToJSON(value['color']),
        'spoiler': value['spoiler'],
        'typeLine': value['typeLine'],
        'oracleText': value['oracleText'],
        'keywords': value['keywords'],
        'manaValue': value['manaValue'],
        'reserved': value['reserved'],
        'latestPrintingSet': value['latestPrintingSet'],
        'reprinted': value['reprinted'],
        'gameChanger': value['gameChanger'],
        'tutor': value['tutor'],
        'massLandDenial': value['massLandDenial'],
        'extraTurn': value['extraTurn'],
        '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'],
    };
}

