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

export default class RemoveUrlRequest {
    readonly _url: string | undefined;

    /**
     * Description: Previously added URL containing filtering rules
     * Example: https://filters.adtidy.org/windows/filters/15.txt
     */
    get url(): string | undefined {
        return this._url;
    }

    constructor(props: IRemoveUrlRequest) {
        if (typeof props.url === 'string') {
            this._url = props.url.trim();
        }
    }

    serialize(): IRemoveUrlRequest {
        const data: IRemoveUrlRequest = {
        };
        if (typeof this._url !== 'undefined') {
            data.url = this._url;
        }
        return data;
    }

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

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