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







export class Test implements ITest {
    resource!: { [key: string]: string; };

    [key: string]: any;

    constructor(data?: ITest) {
        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 (_data["resource"]) {
                this.resource = {} as any;
                for (let key in _data["resource"]) {
                    if (_data["resource"].hasOwnProperty(key))
                        (this.resource as any)![key] = _data["resource"][key];
                }
            }
        }
    }

    static fromJS(data: any): Test {
        data = typeof data === 'object' ? data : {};
        let result = new Test();
        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.resource) {
            data["resource"] = {};
            for (let key in this.resource) {
                if (this.resource.hasOwnProperty(key))
                    (data["resource"] as any)[key] = (this.resource as any)[key];
            }
        }
        return data;
    }
}

export interface ITest {
    resource: { [key: string]: string; };

    [key: string]: any;
}