// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface ITopArrayEntry {
    domain_or_ip?: number;
}

export default class TopArrayEntry {
    readonly _domain_or_ip: number | undefined;

    get domainOrIp(): number | undefined {
        return this._domain_or_ip;
    }

    constructor(props: ITopArrayEntry) {
        if (typeof props.domain_or_ip === 'number') {
            this._domain_or_ip = props.domain_or_ip;
        }
    }

    serialize(): ITopArrayEntry {
        const data: ITopArrayEntry = {
        };
        if (typeof this._domain_or_ip !== 'undefined') {
            data.domain_or_ip = this._domain_or_ip;
        }
        return data;
    }

    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<ITopArrayEntry>): TopArrayEntry {
        return new TopArrayEntry({ ...this.serialize(), ...props });
    }
}
