@space-cow-media/spellbook-client
Version:
An Open Api generated client for the Commander Spellbook backend REST API.
168 lines • 7.4 kB
JavaScript
/* 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 { ColorEnumFromJSON, ColorEnumToJSON, } from './ColorEnum.js';
import { FeatureOfCardFromJSON, } from './FeatureOfCard.js';
import { LayoutRotationEnumFromJSON, LayoutRotationEnumToJSON, } from './LayoutRotationEnum.js';
import { CardLegalitiesFromJSON, } from './CardLegalities.js';
import { CardPricesFromJSON, } from './CardPrices.js';
/**
* Check if a given object implements the CardDetail interface.
*/
export function instanceOfCardDetail(value) {
if (!('id' in value) || value['id'] === undefined)
return false;
if (!('name' in value) || value['name'] === undefined)
return false;
if (!('oracleId' in value) || value['oracleId'] === undefined)
return false;
if (!('identity' in value) || value['identity'] === undefined)
return false;
if (!('variantCount' in value) || value['variantCount'] === undefined)
return false;
if (!('color' in value) || value['color'] === undefined)
return false;
if (!('spoiler' in value) || value['spoiler'] === undefined)
return false;
if (!('typeLine' in value) || value['typeLine'] === undefined)
return false;
if (!('oracleText' in value) || value['oracleText'] === undefined)
return false;
if (!('keywords' in value) || value['keywords'] === undefined)
return false;
if (!('manaValue' in value) || value['manaValue'] === undefined)
return false;
if (!('reserved' in value) || value['reserved'] === undefined)
return false;
if (!('latestPrintingSet' in value) || value['latestPrintingSet'] === undefined)
return false;
if (!('reprinted' in value) || value['reprinted'] === undefined)
return false;
if (!('gameChanger' in value) || value['gameChanger'] === undefined)
return false;
if (!('tutor' in value) || value['tutor'] === undefined)
return false;
if (!('massLandDenial' in value) || value['massLandDenial'] === undefined)
return false;
if (!('extraTurn' in value) || value['extraTurn'] === undefined)
return false;
if (!('imageUriFrontPng' in value) || value['imageUriFrontPng'] === undefined)
return false;
if (!('imageUriFrontLarge' in value) || value['imageUriFrontLarge'] === undefined)
return false;
if (!('imageUriFrontNormal' in value) || value['imageUriFrontNormal'] === undefined)
return false;
if (!('imageUriFrontSmall' in value) || value['imageUriFrontSmall'] === undefined)
return false;
if (!('imageUriFrontArtCrop' in value) || value['imageUriFrontArtCrop'] === undefined)
return false;
if (!('layoutRotationFront' in value) || value['layoutRotationFront'] === undefined)
return false;
if (!('imageUriBackPng' in value) || value['imageUriBackPng'] === undefined)
return false;
if (!('imageUriBackLarge' in value) || value['imageUriBackLarge'] === undefined)
return false;
if (!('imageUriBackNormal' in value) || value['imageUriBackNormal'] === undefined)
return false;
if (!('imageUriBackSmall' in value) || value['imageUriBackSmall'] === undefined)
return false;
if (!('imageUriBackArtCrop' in value) || value['imageUriBackArtCrop'] === undefined)
return false;
if (!('features' in value) || value['features'] === undefined)
return false;
if (!('legalities' in value) || value['legalities'] === undefined)
return false;
if (!('prices' in value) || value['prices'] === undefined)
return false;
return true;
}
export function CardDetailFromJSON(json) {
return CardDetailFromJSONTyped(json, false);
}
export function CardDetailFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'id': json['id'],
'name': json['name'],
'oracleId': json['oracleId'],
'identity': ColorEnumFromJSON(json['identity']),
'variantCount': json['variantCount'],
'color': ColorEnumFromJSON(json['color']),
'spoiler': json['spoiler'],
'typeLine': json['typeLine'],
'oracleText': json['oracleText'],
'keywords': json['keywords'],
'manaValue': json['manaValue'],
'reserved': json['reserved'],
'latestPrintingSet': json['latestPrintingSet'],
'reprinted': json['reprinted'],
'gameChanger': json['gameChanger'],
'tutor': json['tutor'],
'massLandDenial': json['massLandDenial'],
'extraTurn': json['extraTurn'],
'imageUriFrontPng': json['imageUriFrontPng'],
'imageUriFrontLarge': json['imageUriFrontLarge'],
'imageUriFrontNormal': json['imageUriFrontNormal'],
'imageUriFrontSmall': json['imageUriFrontSmall'],
'imageUriFrontArtCrop': json['imageUriFrontArtCrop'],
'layoutRotationFront': LayoutRotationEnumFromJSON(json['layoutRotationFront']),
'imageUriBackPng': json['imageUriBackPng'],
'imageUriBackLarge': json['imageUriBackLarge'],
'imageUriBackNormal': json['imageUriBackNormal'],
'imageUriBackSmall': json['imageUriBackSmall'],
'imageUriBackArtCrop': json['imageUriBackArtCrop'],
'features': (json['features'].map(FeatureOfCardFromJSON)),
'legalities': CardLegalitiesFromJSON(json['legalities']),
'prices': CardPricesFromJSON(json['prices']),
};
}
export function CardDetailToJSON(json) {
return CardDetailToJSONTyped(json, false);
}
export function CardDetailToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'name': value['name'],
'oracleId': value['oracleId'],
'identity': ColorEnumToJSON(value['identity']),
'color': ColorEnumToJSON(value['color']),
'spoiler': value['spoiler'],
'typeLine': value['typeLine'],
'oracleText': value['oracleText'],
'keywords': value['keywords'],
'manaValue': value['manaValue'],
'reserved': value['reserved'],
'latestPrintingSet': value['latestPrintingSet'],
'reprinted': value['reprinted'],
'gameChanger': value['gameChanger'],
'tutor': value['tutor'],
'massLandDenial': value['massLandDenial'],
'extraTurn': value['extraTurn'],
'imageUriFrontPng': value['imageUriFrontPng'],
'imageUriFrontLarge': value['imageUriFrontLarge'],
'imageUriFrontNormal': value['imageUriFrontNormal'],
'imageUriFrontSmall': value['imageUriFrontSmall'],
'imageUriFrontArtCrop': value['imageUriFrontArtCrop'],
'layoutRotationFront': LayoutRotationEnumToJSON(value['layoutRotationFront']),
'imageUriBackPng': value['imageUriBackPng'],
'imageUriBackLarge': value['imageUriBackLarge'],
'imageUriBackNormal': value['imageUriBackNormal'],
'imageUriBackSmall': value['imageUriBackSmall'],
'imageUriBackArtCrop': value['imageUriBackArtCrop'],
};
}
//# sourceMappingURL=CardDetail.js.map