UNPKG

@space-cow-media/spellbook-client

Version:

An Open Api generated client for the Commander Spellbook backend REST API.

131 lines (119 loc) 3.7 kB
/* 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.8.19 * * * 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 { Card } from './card'; import { CardFromJSON, CardFromJSONTyped, CardToJSON, CardToJSONTyped, } from './card'; /** * * @export * @interface CardInVariant */ export interface CardInVariant { /** * * @type {Card} * @memberof CardInVariant */ readonly card: Card; /** * * @type {Array<string>} * @memberof CardInVariant */ readonly zoneLocations: Array<string>; /** * * @type {string} * @memberof CardInVariant */ readonly battlefieldCardState: string; /** * * @type {string} * @memberof CardInVariant */ readonly exileCardState: string; /** * * @type {string} * @memberof CardInVariant */ readonly libraryCardState: string; /** * * @type {string} * @memberof CardInVariant */ readonly graveyardCardState: string; /** * * @type {boolean} * @memberof CardInVariant */ readonly mustBeCommander: boolean; /** * Quantity of the card in the combo. * @type {number} * @memberof CardInVariant */ quantity: number; } /** * Check if a given object implements the CardInVariant interface. */ export function instanceOfCardInVariant(value: object): value is CardInVariant { if (!('card' in value) || value['card'] === 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; if (!('quantity' in value) || value['quantity'] === undefined) return false; return true; } export function CardInVariantFromJSON(json: any): CardInVariant { return CardInVariantFromJSONTyped(json, false); } export function CardInVariantFromJSONTyped(json: any, ignoreDiscriminator: boolean): CardInVariant { if (json == null) { return json; } return { 'card': CardFromJSON(json['card']), 'zoneLocations': json['zoneLocations'], 'battlefieldCardState': json['battlefieldCardState'], 'exileCardState': json['exileCardState'], 'libraryCardState': json['libraryCardState'], 'graveyardCardState': json['graveyardCardState'], 'mustBeCommander': json['mustBeCommander'], 'quantity': json['quantity'], }; } export function CardInVariantToJSON(json: any): CardInVariant { return CardInVariantToJSONTyped(json, false); } export function CardInVariantToJSONTyped(value?: Omit<CardInVariant, 'card'|'zoneLocations'|'battlefieldCardState'|'exileCardState'|'libraryCardState'|'graveyardCardState'|'mustBeCommander'> | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'quantity': value['quantity'], }; }