export type DeleteApiAplStarredQueriesIdArgs = {id: string}; export type DeleteApiAplStarredQueriesIdOptions = {baseUrl?: string | undefined, Auth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes a saved query by its ID. With a personal access token, you can only delete queries you saved. * * DELETE /apl-starred-queries/{id} */ export const deleteApiAplStarredQueriesId = async (args: DeleteApiAplStarredQueriesIdArgs, options?: DeleteApiAplStarredQueriesIdOptions) => { const {baseUrl = "https://api.axiom.co/v2", fetch: fetchFn = fetch, Auth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Auth !== undefined) headers.set('authorization', `Bearer ${Auth}`) const url = `${baseUrl.replace(/\/+$/, '')}/apl-starred-queries/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };