@space-cow-media/spellbook-client
Version:
An Open Api generated client for the Commander Spellbook backend REST API.
109 lines (95 loc) • 2.93 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 { FeatureStatusEnum } from './featureStatusEnum';
import {
FeatureStatusEnumFromJSON,
FeatureStatusEnumFromJSONTyped,
FeatureStatusEnumToJSON,
FeatureStatusEnumToJSONTyped,
} from './featureStatusEnum';
/**
*
* @export
* @interface Feature
*/
export interface Feature {
/**
*
* @type {number}
* @memberof Feature
*/
readonly id: number;
/**
* Short name for a produced effect
* @type {string}
* @memberof Feature
*/
name: string;
/**
* Is this an uncountable feature? Uncountable features can only appear in one copy and speed up variant generation.
* @type {boolean}
* @memberof Feature
*/
uncountable: boolean;
/**
* Is this feature an utility for variant generation, a helper to be exploited somehow, or a standalone, probably impactful effect? (public utilities are visible to combo submitters)
*
* * `HU` - Hidden Utility
* * `PU` - Public Utility
* * `H` - Helper
* * `C` - Contextual
* * `S` - Standalone
* @type {FeatureStatusEnum}
* @memberof Feature
*/
status: FeatureStatusEnum;
}
/**
* Check if a given object implements the Feature interface.
*/
export function instanceOfFeature(value: object): value is Feature {
if (!('id' in value) || value['id'] === undefined) return false;
if (!('name' in value) || value['name'] === undefined) return false;
if (!('uncountable' in value) || value['uncountable'] === undefined) return false;
if (!('status' in value) || value['status'] === undefined) return false;
return true;
}
export function FeatureFromJSON(json: any): Feature {
return FeatureFromJSONTyped(json, false);
}
export function FeatureFromJSONTyped(json: any, ignoreDiscriminator: boolean): Feature {
if (json == null) {
return json;
}
return {
'id': json['id'],
'name': json['name'],
'uncountable': json['uncountable'],
'status': FeatureStatusEnumFromJSON(json['status']),
};
}
export function FeatureToJSON(json: any): Feature {
return FeatureToJSONTyped(json, false);
}
export function FeatureToJSONTyped(value?: Omit<Feature, 'id'> | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'name': value['name'],
'uncountable': value['uncountable'],
'status': FeatureStatusEnumToJSON(value['status']),
};
}