/* 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: 4.2.2
 * 
 *
 * 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 { ZoneLocationsEnum } from './zoneLocationsEnum';
import {
    ZoneLocationsEnumFromJSON,
    ZoneLocationsEnumFromJSONTyped,
    ZoneLocationsEnumToJSON,
    ZoneLocationsEnumToJSONTyped,
} from './zoneLocationsEnum';

/**
 * 
 * @export
 * @interface TemplateRequiredInVariantSuggestion
 */
export interface TemplateRequiredInVariantSuggestion {
    /**
     * Template name
     * @type {string}
     * @memberof TemplateRequiredInVariantSuggestion
     */
    template: string;
    /**
     * Quantity of the card in the combo.
     * @type {number}
     * @memberof TemplateRequiredInVariantSuggestion
     */
    quantity: number;
    /**
     * Variables supported: mv, manavalue, power, pow, toughness, tou, pt, powtou, loyalty, loy, c, color, id, identity, produces, has, t, type, keyword, kw, is, o, oracle, function, otag, oracletag, oracleid, m, mana, devotion.
     * Operators supported: =, !=, <, >, <=, >=, :.
     * You can compose a "and"/"or" expression made of "and"/"or" expressions, like "(c:W or c:U) and (t:creature or t:artifact)".
     * You can also omit parentheses when not necessary, like "(c:W or c:U) t:creature".
     * Card names are only supported if wrapped in double quotes and preceded by an exclamation mark (!) in order to match the exact name, like !"Lightning Bolt".
     * You can negate any expression by prepending a dash (-), like "-t:creature".
     * More info at: https://scryfall.com/docs/syntax.
     * 
     * @type {string}
     * @memberof TemplateRequiredInVariantSuggestion
     */
    scryfallQuery: string | null;
    /**
     * 
     * @type {Array<ZoneLocationsEnum>}
     * @memberof TemplateRequiredInVariantSuggestion
     */
    zoneLocations: Array<ZoneLocationsEnum>;
    /**
     * State of the card on the battlefield, if present.
     * @type {string}
     * @memberof TemplateRequiredInVariantSuggestion
     */
    battlefieldCardState: string;
    /**
     * State of the card in exile, if present.
     * @type {string}
     * @memberof TemplateRequiredInVariantSuggestion
     */
    exileCardState: string;
    /**
     * State of the card in the library, if present.
     * @type {string}
     * @memberof TemplateRequiredInVariantSuggestion
     */
    libraryCardState: string;
    /**
     * State of the card in the graveyard, if present.
     * @type {string}
     * @memberof TemplateRequiredInVariantSuggestion
     */
    graveyardCardState: string;
    /**
     * Does the card have to be a commander?
     * @type {boolean}
     * @memberof TemplateRequiredInVariantSuggestion
     */
    mustBeCommander: boolean;
}

/**
 * Check if a given object implements the TemplateRequiredInVariantSuggestion interface.
 */
export function instanceOfTemplateRequiredInVariantSuggestion(value: object): value is TemplateRequiredInVariantSuggestion {
    if (!('template' in value) || value['template'] === undefined) return false;
    if (!('quantity' in value) || value['quantity'] === undefined) return false;
    if (!('scryfallQuery' in value) || value['scryfallQuery'] === undefined) return false;
    if (!('zoneLocations' in value) || value['zoneLocations'] === undefined) return false;
    if (!('battlefieldCardState' in value) || value['battlefieldCardState'] === undefined) return false;
    if (!('exileCardState' in value) || value['exileCardState'] === undefined) return false;
    if (!('libraryCardState' in value) || value['libraryCardState'] === undefined) return false;
    if (!('graveyardCardState' in value) || value['graveyardCardState'] === undefined) return false;
    if (!('mustBeCommander' in value) || value['mustBeCommander'] === undefined) return false;
    return true;
}

export function TemplateRequiredInVariantSuggestionFromJSON(json: any): TemplateRequiredInVariantSuggestion {
    return TemplateRequiredInVariantSuggestionFromJSONTyped(json, false);
}

export function TemplateRequiredInVariantSuggestionFromJSONTyped(json: any, ignoreDiscriminator: boolean): TemplateRequiredInVariantSuggestion {
    if (json == null) {
        return json;
    }
    return {
        
        'template': json['template'],
        'quantity': json['quantity'],
        'scryfallQuery': json['scryfallQuery'],
        'zoneLocations': ((json['zoneLocations'] as Array<any>).map(ZoneLocationsEnumFromJSON)),
        'battlefieldCardState': json['battlefieldCardState'],
        'exileCardState': json['exileCardState'],
        'libraryCardState': json['libraryCardState'],
        'graveyardCardState': json['graveyardCardState'],
        'mustBeCommander': json['mustBeCommander'],
    };
}

export function TemplateRequiredInVariantSuggestionToJSON(json: any): TemplateRequiredInVariantSuggestion {
    return TemplateRequiredInVariantSuggestionToJSONTyped(json, false);
}

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

    return {
        
        'template': value['template'],
        'quantity': value['quantity'],
        'scryfallQuery': value['scryfallQuery'],
        'zoneLocations': ((value['zoneLocations'] as Array<any>).map(ZoneLocationsEnumToJSON)),
        'battlefieldCardState': value['battlefieldCardState'],
        'exileCardState': value['exileCardState'],
        'libraryCardState': value['libraryCardState'],
        'graveyardCardState': value['graveyardCardState'],
        'mustBeCommander': value['mustBeCommander'],
    };
}

