@space-cow-media/spellbook-client
Version:
An Open Api generated client for the Commander Spellbook backend REST API.
106 lines • 4.2 kB
JavaScript
"use strict";
/* 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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfCard = instanceOfCard;
exports.CardFromJSON = CardFromJSON;
exports.CardFromJSONTyped = CardFromJSONTyped;
exports.CardToJSON = CardToJSON;
exports.CardToJSONTyped = CardToJSONTyped;
/**
* Check if a given object implements the Card interface.
*/
function instanceOfCard(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 (!('spoiler' in value) || value['spoiler'] === undefined)
return false;
if (!('typeLine' in value) || value['typeLine'] === 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 (!('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;
return true;
}
function CardFromJSON(json) {
return CardFromJSONTyped(json, false);
}
function CardFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'id': json['id'],
'name': json['name'],
'oracleId': json['oracleId'],
'spoiler': json['spoiler'],
'typeLine': json['typeLine'],
'imageUriFrontPng': json['imageUriFrontPng'],
'imageUriFrontLarge': json['imageUriFrontLarge'],
'imageUriFrontNormal': json['imageUriFrontNormal'],
'imageUriFrontSmall': json['imageUriFrontSmall'],
'imageUriFrontArtCrop': json['imageUriFrontArtCrop'],
'imageUriBackPng': json['imageUriBackPng'],
'imageUriBackLarge': json['imageUriBackLarge'],
'imageUriBackNormal': json['imageUriBackNormal'],
'imageUriBackSmall': json['imageUriBackSmall'],
'imageUriBackArtCrop': json['imageUriBackArtCrop'],
};
}
function CardToJSON(json) {
return CardToJSONTyped(json, false);
}
function CardToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'name': value['name'],
'oracleId': value['oracleId'],
'spoiler': value['spoiler'],
'typeLine': value['typeLine'],
'imageUriFrontPng': value['imageUriFrontPng'],
'imageUriFrontLarge': value['imageUriFrontLarge'],
'imageUriFrontNormal': value['imageUriFrontNormal'],
'imageUriFrontSmall': value['imageUriFrontSmall'],
'imageUriFrontArtCrop': value['imageUriFrontArtCrop'],
'imageUriBackPng': value['imageUriBackPng'],
'imageUriBackLarge': value['imageUriBackLarge'],
'imageUriBackNormal': value['imageUriBackNormal'],
'imageUriBackSmall': value['imageUriBackSmall'],
'imageUriBackArtCrop': value['imageUriBackArtCrop'],
};
}
//# sourceMappingURL=card.js.map