import NetInterface, { INetInterface } from './NetInterface';

// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface INetInterfaces {
    [key: string]: INetInterface;
}

export default class NetInterfaces {
    readonly data: Record<string, NetInterface>;

    constructor(props: INetInterfaces) {
        this.data = Object.entries(props).reduce<Record<string, NetInterface>>((prev, [key, value]) => {
            prev[key] = new NetInterface(value!);
            return prev;
        }, {})
    }

    serialize(): INetInterfaces {
        return Object.entries(this.data).reduce<Record<string, INetInterface>>((prev, [key, value]) => {
            prev[key] = value.serialize();
            return prev;
        }, {})
    }

    validate(): string[] {
        return []
    }

    update(props: INetInterfaces): NetInterfaces {
        return new NetInterfaces({ ...this.serialize(), ...props });
    }
}
