@space-cow-media/spellbook-client
Version:
An Open Api generated client for the Commander Spellbook backend REST API.
56 lines • 1.74 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: 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.instanceOfDeck = instanceOfDeck;
exports.DeckFromJSON = DeckFromJSON;
exports.DeckFromJSONTyped = DeckFromJSONTyped;
exports.DeckToJSON = DeckToJSON;
exports.DeckToJSONTyped = DeckToJSONTyped;
const cardInDeck_1 = require("./cardInDeck");
/**
* Check if a given object implements the Deck interface.
*/
function instanceOfDeck(value) {
if (!('main' in value) || value['main'] === undefined)
return false;
if (!('commanders' in value) || value['commanders'] === undefined)
return false;
return true;
}
function DeckFromJSON(json) {
return DeckFromJSONTyped(json, false);
}
function DeckFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'main': (json['main'].map(cardInDeck_1.CardInDeckFromJSON)),
'commanders': (json['commanders'].map(cardInDeck_1.CardInDeckFromJSON)),
};
}
function DeckToJSON(json) {
return DeckToJSONTyped(json, false);
}
function DeckToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'main': (value['main'].map(cardInDeck_1.CardInDeckToJSON)),
'commanders': (value['commanders'].map(cardInDeck_1.CardInDeckToJSON)),
};
}
//# sourceMappingURL=deck.js.map