/* tslint:disable */
/* eslint-disable */
/**
 * Indexea OpenAPI
 * OpenAPI of Indexea
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: support@indexea.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { exists, mapValues } from '../runtime';
/**
 * 设置选项
 * @export
 * @interface OptionForm
 */
export interface OptionForm {
    /**
     * 配置项名称
     * @type {string}
     * @memberof OptionForm
     */
    key: string;
    /**
     * 配置值类型
     * @type {string}
     * @memberof OptionForm
     */
    type: OptionFormTypeEnum;
    /**
     * 配置值
     * @type {string}
     * @memberof OptionForm
     */
    value: string;
    /**
     * 验证码(非必须，只有在配置通知邮箱和手机的时候才需要)
     * @type {string}
     * @memberof OptionForm
     */
    vcode?: string;
}


/**
 * @export
 */
export const OptionFormTypeEnum = {
    Int: 'int',
    Bool: 'bool',
    String: 'string'
} as const;
export type OptionFormTypeEnum = typeof OptionFormTypeEnum[keyof typeof OptionFormTypeEnum];


/**
 * Check if a given object implements the OptionForm interface.
 */
export function instanceOfOptionForm(value: object): boolean {
    let isInstance = true;
    isInstance = isInstance && "key" in value;
    isInstance = isInstance && "type" in value;
    isInstance = isInstance && "value" in value;

    return isInstance;
}

export function OptionFormFromJSON(json: any): OptionForm {
    return OptionFormFromJSONTyped(json, false);
}

export function OptionFormFromJSONTyped(json: any, ignoreDiscriminator: boolean): OptionForm {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'key': json['key'],
        'type': json['type'],
        'value': json['value'],
        'vcode': !exists(json, 'vcode') ? undefined : json['vcode'],
    };
}

export function OptionFormToJSON(value?: OptionForm | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'key': value.key,
        'type': value.type,
        'value': value.value,
        'vcode': value.vcode,
    };
}

