// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IDhcpSearchResultOtherServer {
    error?: string;
    found?: string;
}

export default class DhcpSearchResultOtherServer {
    readonly _error: string | undefined;

    /** */
    get error(): string | undefined {
        return this._error;
    }

    readonly _found: string | undefined;

    /**
     * Description: The result of searching the other DHCP server.
     *
     * Example: no
     */
    get found(): string | undefined {
        return this._found;
    }

    constructor(props: IDhcpSearchResultOtherServer) {
        if (typeof props.error === 'string') {
            this._error = props.error.trim();
        }
        if (typeof props.found === 'string') {
            this._found = props.found.trim();
        }
    }

    serialize(): IDhcpSearchResultOtherServer {
        const data: IDhcpSearchResultOtherServer = {
        };
        if (typeof this._error !== 'undefined') {
            data.error = this._error;
        }
        if (typeof this._found !== 'undefined') {
            data.found = this._found;
        }
        return data;
    }

    validate(): string[] {
        const validate = {
            found: !this._found ? true : typeof this._found === 'string' && !this._found ? true : this._found,
            error: !this._error ? true : typeof this._error === 'string' && !this._error ? true : this._error,
        };
        const isError: string[] = [];
        Object.keys(validate).forEach((key) => {
            if (!(validate as any)[key]) {
                isError.push(key);
            }
        });
        return isError;
    }

    update(props: Partial<IDhcpSearchResultOtherServer>): DhcpSearchResultOtherServer {
        return new DhcpSearchResultOtherServer({ ...this.serialize(), ...props });
    }
}
