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

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

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

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

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

    update(props: IUpstreamsConfigResponse): UpstreamsConfigResponse {
        return new UpstreamsConfigResponse({ ...this.serialize(), ...props });
    }
}
