export type GetApiApiDashboardDashboardIdArgs = {dashboardId: string, includeResources?: boolean | undefined, 'Accept-Encoding'?: string | undefined}; export type GetApiApiDashboardDashboardIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get Dashboard (getDashboardById) * * GET /api/dashboard/{dashboardId} */ export const getApiApiDashboardDashboardId = async (args: GetApiApiDashboardDashboardIdArgs, options?: GetApiApiDashboardDashboardIdOptions) => { const {baseUrl = "https://demo.thingsboard.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.includeResources != null) query.append("includeResources", String(args.includeResources)) if (args['Accept-Encoding'] != null) headers.set("Accept-Encoding", String(args['Accept-Encoding'])) const url = `${baseUrl.replace(/\/+$/, '')}/api/dashboard/${encodeURIComponent(String(args.dashboardId))}${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 };