// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export default class ParentalApi {
    static async parentalDisable(): Promise<number | Error> {
        return await fetch(`/control/parental/disable`, {
            method: 'POST',
        }).then(async (res) => {
            if (res.status === 200) {
                return res.status;
            } else {
                return new Error(String(res.status));
            }
        })
    }

    static async parentalEnable(data: string): Promise<number | Error> {
        const params =  String(data);
        return await fetch(`/control/parental/enable`, {
            method: 'POST',
            headers: {
                'Content-Type': 'text/plain',
            },
            body: params,
        }).then(async (res) => {
            if (res.status === 200) {
                return res.status;
            } else {
                return new Error(String(res.status));
            }
        })
    }

    static async parentalStatus(): Promise<any | Error> {
        return await fetch(`/control/parental/status`, {
            method: 'GET',
        }).then(async (res) => {
            if (res.status === 200) {
                return res.json();
            } else {
                return new Error(String(res.status));
            }
        })
    }
}
