@space-cow-media/spellbook-client
Version:
An Open Api generated client for the Commander Spellbook backend REST API.
132 lines (120 loc) • 4.49 kB
text/typescript
/* 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 { ZoneLocationsEnum } from './zoneLocationsEnum';
import {
ZoneLocationsEnumFromJSON,
ZoneLocationsEnumFromJSONTyped,
ZoneLocationsEnumToJSON,
ZoneLocationsEnumToJSONTyped,
} from './zoneLocationsEnum';
/**
*
* @export
* @interface CardUsedInVariantSuggestionRequest
*/
export interface CardUsedInVariantSuggestionRequest {
/**
* Card name
* @type {string}
* @memberof CardUsedInVariantSuggestionRequest
*/
card: string;
/**
* Quantity of the card in the combo.
* @type {number}
* @memberof CardUsedInVariantSuggestionRequest
*/
quantity?: number;
/**
*
* @type {Array<ZoneLocationsEnum>}
* @memberof CardUsedInVariantSuggestionRequest
*/
zoneLocations: Array<ZoneLocationsEnum>;
/**
* State of the card on the battlefield, if present.
* @type {string}
* @memberof CardUsedInVariantSuggestionRequest
*/
battlefieldCardState?: string;
/**
* State of the card in exile, if present.
* @type {string}
* @memberof CardUsedInVariantSuggestionRequest
*/
exileCardState?: string;
/**
* State of the card in the library, if present.
* @type {string}
* @memberof CardUsedInVariantSuggestionRequest
*/
libraryCardState?: string;
/**
* State of the card in the graveyard, if present.
* @type {string}
* @memberof CardUsedInVariantSuggestionRequest
*/
graveyardCardState?: string;
/**
* Does the card have to be a commander?
* @type {boolean}
* @memberof CardUsedInVariantSuggestionRequest
*/
mustBeCommander?: boolean;
}
/**
* Check if a given object implements the CardUsedInVariantSuggestionRequest interface.
*/
export function instanceOfCardUsedInVariantSuggestionRequest(value: object): value is CardUsedInVariantSuggestionRequest {
if (!('card' in value) || value['card'] === undefined) return false;
if (!('zoneLocations' in value) || value['zoneLocations'] === undefined) return false;
return true;
}
export function CardUsedInVariantSuggestionRequestFromJSON(json: any): CardUsedInVariantSuggestionRequest {
return CardUsedInVariantSuggestionRequestFromJSONTyped(json, false);
}
export function CardUsedInVariantSuggestionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CardUsedInVariantSuggestionRequest {
if (json == null) {
return json;
}
return {
'card': json['card'],
'quantity': json['quantity'] == null ? undefined : json['quantity'],
'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 CardUsedInVariantSuggestionRequestToJSON(json: any): CardUsedInVariantSuggestionRequest {
return CardUsedInVariantSuggestionRequestToJSONTyped(json, false);
}
export function CardUsedInVariantSuggestionRequestToJSONTyped(value?: CardUsedInVariantSuggestionRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'card': value['card'],
'quantity': value['quantity'],
'zoneLocations': ((value['zoneLocations'] as Array<any>).map(ZoneLocationsEnumToJSON)),
'battlefieldCardState': value['battlefieldCardState'],
'exileCardState': value['exileCardState'],
'libraryCardState': value['libraryCardState'],
'graveyardCardState': value['graveyardCardState'],
'mustBeCommander': value['mustBeCommander'],
};
}