export type UpdateApiInternalV1DashboardsProjectIdDashboardIdGridArgs = {project_id: number, dashboard_id: number, body: {gridQuery?: string | undefined}}; export type UpdateApiInternalV1DashboardsProjectIdDashboardIdGridOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update dashboard grid query * * PUT /internal/v1/dashboards/{project_id}/{dashboard_id}/grid * * Also accepts auth: authTokenQuery */ export const updateApiInternalV1DashboardsProjectIdDashboardIdGrid = async (args: UpdateApiInternalV1DashboardsProjectIdDashboardIdGridArgs, options?: UpdateApiInternalV1DashboardsProjectIdDashboardIdGridOptions) => { const {baseUrl = "https://api.uptrace.dev", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/internal/v1/dashboards/${encodeURIComponent(String(args.project_id))}/${encodeURIComponent(String(args.dashboard_id))}/grid${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };