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

/**
 * 
 * @export
 * @interface TemplateRequiredInVariantSuggestionRequest
 */
export interface TemplateRequiredInVariantSuggestionRequest {
    /**
     * Template name
     * @type {string}
     * @memberof TemplateRequiredInVariantSuggestionRequest
     */
    template: string;
    /**
     * Quantity of the card in the combo.
     * @type {number}
     * @memberof TemplateRequiredInVariantSuggestionRequest
     */
    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 TemplateRequiredInVariantSuggestionRequest
     */
    scryfallQuery?: string | null;
    /**
     * 
     * @type {Array<ZoneLocationsEnum>}
     * @memberof TemplateRequiredInVariantSuggestionRequest
     */
    zoneLocations: Array<ZoneLocationsEnum>;
    /**
     * State of the card on the battlefield, if present.
     * @type {string}
     * @memberof TemplateRequiredInVariantSuggestionRequest
     */
    battlefieldCardState?: string;
    /**
     * State of the card in exile, if present.
     * @type {string}
     * @memberof TemplateRequiredInVariantSuggestionRequest
     */
    exileCardState?: string;
    /**
     * State of the card in the library, if present.
     * @type {string}
     * @memberof TemplateRequiredInVariantSuggestionRequest
     */
    libraryCardState?: string;
    /**
     * State of the card in the graveyard, if present.
     * @type {string}
     * @memberof TemplateRequiredInVariantSuggestionRequest
     */
    graveyardCardState?: string;
    /**
     * Does the card have to be a commander?
     * @type {boolean}
     * @memberof TemplateRequiredInVariantSuggestionRequest
     */
    mustBeCommander?: boolean;
}

/**
 * Check if a given object implements the TemplateRequiredInVariantSuggestionRequest interface.
 */
export function instanceOfTemplateRequiredInVariantSuggestionRequest(value: object): value is TemplateRequiredInVariantSuggestionRequest {
    if (!('template' in value) || value['template'] === undefined) return false;
    if (!('zoneLocations' in value) || value['zoneLocations'] === undefined) return false;
    return true;
}

export function TemplateRequiredInVariantSuggestionRequestFromJSON(json: any): TemplateRequiredInVariantSuggestionRequest {
    return TemplateRequiredInVariantSuggestionRequestFromJSONTyped(json, false);
}

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

export function TemplateRequiredInVariantSuggestionRequestToJSON(json: any): TemplateRequiredInVariantSuggestionRequest {
    return TemplateRequiredInVariantSuggestionRequestToJSONTyped(json, false);
}

export function TemplateRequiredInVariantSuggestionRequestToJSONTyped(value?: TemplateRequiredInVariantSuggestionRequest | 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'],
    };
}

