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







export class MyClass implements IMyClass {
    custom4!: { [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];
            }
        }
    }

    init(_data?: any) {
        if (_data) {
            for (var property in _data) {
                if (_data.hasOwnProperty(property))
                    this[property] = _data[property];
            }
            if (Array.isArray(_data["custom4"])) {
                this.custom4 = [] as any;
                for (let item of _data["custom4"])
                    this.custom4!.push(item);
            }
        }
    }

    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 (Array.isArray(this.custom4)) {
            data["custom4"] = [];
            for (let item of this.custom4)
                data["custom4"].push(item);
        }
        return data;
    }
}

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

    [key: string]: any;
}