/* tslint:disable */
/* eslint-disable */
/**
 * Indexea OpenAPI
 * 这是 Indexea 搜索服务平台的 OpenAPI，用于描述平台的所有接口信息，你可以通过这个页面来了解和在线验证平台的所有接口信息。  ### Errors  本 API 使用标准的 HTTP 状态码来指示操作成功或者失败，如果失败将会在 body 中以 JSON 格式提供详细的错误信息，如下所示：  ``` {   \"error\": 404,   \"message\": \"page not found\" } ``` 
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: indexea.com@gmail.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';
import type { OptionForm } from './OptionForm';
import {
    OptionFormFromJSON,
    OptionFormFromJSONTyped,
    OptionFormToJSON,
} from './OptionForm';

/**
 * UI组件状态表单
 * @export
 * @interface WidgetStatusForm
 */
export interface WidgetStatusForm {
    /**
     * 
     * @type {number}
     * @memberof WidgetStatusForm
     */
    status: number;
    /**
     * 
     * @type {Array<OptionForm>}
     * @memberof WidgetStatusForm
     */
    options?: Array<OptionForm>;
}

/**
 * Check if a given object implements the WidgetStatusForm interface.
 */
export function instanceOfWidgetStatusForm(value: object): boolean {
    let isInstance = true;
    isInstance = isInstance && "status" in value;

    return isInstance;
}

export function WidgetStatusFormFromJSON(json: any): WidgetStatusForm {
    return WidgetStatusFormFromJSONTyped(json, false);
}

export function WidgetStatusFormFromJSONTyped(json: any, ignoreDiscriminator: boolean): WidgetStatusForm {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'status': json['status'],
        'options': !exists(json, 'options') ? undefined : ((json['options'] as Array<any>).map(OptionFormFromJSON)),
    };
}

export function WidgetStatusFormToJSON(value?: WidgetStatusForm | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'status': value.status,
        'options': value.options === undefined ? undefined : ((value.options as Array<any>).map(OptionFormToJSON)),
    };
}

