@space-cow-media/spellbook-client
Version:
An Open Api generated client for the Commander Spellbook backend REST API.
82 lines (70 loc) • 2.27 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 { CardInDeckRequest } from './cardInDeckRequest';
import {
CardInDeckRequestFromJSON,
CardInDeckRequestFromJSONTyped,
CardInDeckRequestToJSON,
CardInDeckRequestToJSONTyped,
} from './cardInDeckRequest';
/**
*
* @export
* @interface DeckRequest
*/
export interface DeckRequest {
/**
*
* @type {Array<CardInDeckRequest>}
* @memberof DeckRequest
*/
main?: Array<CardInDeckRequest>;
/**
*
* @type {Array<CardInDeckRequest>}
* @memberof DeckRequest
*/
commanders?: Array<CardInDeckRequest>;
}
/**
* Check if a given object implements the DeckRequest interface.
*/
export function instanceOfDeckRequest(value: object): value is DeckRequest {
return true;
}
export function DeckRequestFromJSON(json: any): DeckRequest {
return DeckRequestFromJSONTyped(json, false);
}
export function DeckRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeckRequest {
if (json == null) {
return json;
}
return {
'main': json['main'] == null ? undefined : ((json['main'] as Array<any>).map(CardInDeckRequestFromJSON)),
'commanders': json['commanders'] == null ? undefined : ((json['commanders'] as Array<any>).map(CardInDeckRequestFromJSON)),
};
}
export function DeckRequestToJSON(json: any): DeckRequest {
return DeckRequestToJSONTyped(json, false);
}
export function DeckRequestToJSONTyped(value?: DeckRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'main': value['main'] == null ? undefined : ((value['main'] as Array<any>).map(CardInDeckRequestToJSON)),
'commanders': value['commanders'] == null ? undefined : ((value['commanders'] as Array<any>).map(CardInDeckRequestToJSON)),
};
}