export type GetApiApiDashboardHomeArgs = {'Accept-Encoding'?: string | undefined}; export type GetApiApiDashboardHomeOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get Home Dashboard (getHomeDashboard) * * GET /api/dashboard/home */ export const getApiApiDashboardHome = async (args: GetApiApiDashboardHomeArgs, options?: GetApiApiDashboardHomeOptions) => { const {baseUrl = "https://demo.thingsboard.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Accept-Encoding'] != null) headers.set("Accept-Encoding", String(args['Accept-Encoding'])) const url = `${baseUrl.replace(/\/+$/, '')}/api/dashboard/home${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };