/* 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.2.2
 * 
 *
 * 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?
     * 
     * * `U` - 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']),
    };
}

