﻿//----------------------
// <auto-generated>
// </auto-generated>
//----------------------







export class MyClass implements IMyClass {
    dict!: { [key: string]: string; };

    [key: string]: any;

    constructor(data?: IMyClass) {
        if (data) {
            for (var property in data) {
                if (data.hasOwnProperty(property))
                    (this as any)[property] = (data as any)[property];
            }
        }
        if (!data) {
            this.dict = {};
        }
    }

    init(_data?: any) {
        if (_data) {
            for (var property in _data) {
                if (_data.hasOwnProperty(property))
                    this[property] = _data[property];
            }
            if (_data["dict"]) {
                this.dict = {} as any;
                for (let key in _data["dict"]) {
                    if (_data["dict"].hasOwnProperty(key))
                        (this.dict as any)![key] = _data["dict"][key];
                }
            }
        }
    }

    static fromJS(data: any): MyClass {
        data = typeof data === 'object' ? data : {};
        let result = new MyClass();
        result.init(data);
        return result;
    }

    toJSON(data?: any) {
        data = typeof data === 'object' ? data : {};
        for (var property in this) {
            if (this.hasOwnProperty(property))
                data[property] = this[property];
        }
        if (this.dict) {
            data["dict"] = {};
            for (let key in this.dict) {
                if (this.dict.hasOwnProperty(key))
                    (data["dict"] as any)[key] = (this.dict as any)[key];
            }
        }
        return data;
    }
}

export interface IMyClass {
    dict: { [key: string]: string; };

    [key: string]: any;
}