/* 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';
/**
 * 
 * @export
 * @interface Template
 */
export interface Template {
    /**
     * 
     * @type {number}
     * @memberof Template
     */
    readonly id: number;
    /**
     * short description of the template in natural language
     * @type {string}
     * @memberof Template
     */
    name: string;
    /**
     * 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 Template
     */
    scryfallQuery: string | null;
    /**
     * 
     * @type {string}
     * @memberof Template
     */
    readonly scryfallApi: string | null;
}

/**
 * Check if a given object implements the Template interface.
 */
export function instanceOfTemplate(value: object): value is Template {
    if (!('id' in value) || value['id'] === undefined) return false;
    if (!('name' in value) || value['name'] === undefined) return false;
    if (!('scryfallQuery' in value) || value['scryfallQuery'] === undefined) return false;
    if (!('scryfallApi' in value) || value['scryfallApi'] === undefined) return false;
    return true;
}

export function TemplateFromJSON(json: any): Template {
    return TemplateFromJSONTyped(json, false);
}

export function TemplateFromJSONTyped(json: any, ignoreDiscriminator: boolean): Template {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'],
        'name': json['name'],
        'scryfallQuery': json['scryfallQuery'],
        'scryfallApi': json['scryfallApi'],
    };
}

export function TemplateToJSON(json: any): Template {
    return TemplateToJSONTyped(json, false);
}

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

    return {
        
        'name': value['name'],
        'scryfallQuery': value['scryfallQuery'],
    };
}

