// This file was autogenerated. Please do not change. // All changes will be overwrited on commit. export interface ITopArrayEntry { domain_or_ip?: number; [key: string]: number | undefined; } export default class TopArrayEntry { readonly _domain_or_ip: number | undefined; get domainOrIp(): number | undefined { return this._domain_or_ip; } readonly numberData: Record; constructor(props: ITopArrayEntry) { this.numberData = Object.entries(props).reduce>((prev, [key, value]) => { prev[key] = value!; return prev; }, {}) } serialize(): ITopArrayEntry { return Object.entries(this.numberData).reduce>((prev, [key, value]) => { prev[key] = value; return prev; }, {}) } validate(): string[] { const validate = { domain_or_ip: !this._domain_or_ip ? true : typeof this._domain_or_ip === 'number', }; const isError: string[] = []; Object.keys(validate).forEach((key) => { if (!(validate as any)[key]) { isError.push(key); } }); return isError; } update(props: Partial): TopArrayEntry { return new TopArrayEntry({ ...this.serialize(), ...props }); } }