import ClientFindSubEntry, { IClientFindSubEntry } from './ClientFindSubEntry';

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

export default class ClientsFindEntry {
    readonly data: Record<string, ClientFindSubEntry>;

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

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

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

    update(props: IClientsFindEntry): ClientsFindEntry {
        return new ClientsFindEntry({ ...this.serialize(), ...props });
    }
}
