export type DeleteApiApiOrgIdDashboardsDashboardIdAnnotationsArgs = {org_id: string, dashboard_id: string, body: {annotation_ids: Array}}; export type DeleteApiApiOrgIdDashboardsDashboardIdAnnotationsOptions = {baseUrl: string, Authorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete timed annotations from dashboard * * DELETE /api/{org_id}/dashboards/{dashboard_id}/annotations */ export const deleteApiApiOrgIdDashboardsDashboardIdAnnotations = async (args: DeleteApiApiOrgIdDashboardsDashboardIdAnnotationsArgs, options: DeleteApiApiOrgIdDashboardsDashboardIdAnnotationsOptions) => { const {baseUrl, fetch: fetchFn = fetch, Authorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Authorization !== undefined) headers.set("Authorization", Authorization) const url = `${baseUrl.replace(/\/+$/, '')}/api/${encodeURIComponent(String(args.org_id))}/dashboards/${encodeURIComponent(String(args.dashboard_id))}/annotations${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", 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 };