export type DeleteApiGovernanceInsightsIdArgs = {id: string}; export type DeleteApiGovernanceInsightsIdOptions = {baseUrl?: string | undefined, JWTAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an Insight * * DELETE /governance/insights/{id} */ export const deleteApiGovernanceInsightsId = async (args: DeleteApiGovernanceInsightsIdArgs, options?: DeleteApiGovernanceInsightsIdOptions) => { const {baseUrl = "https://api.firefly.ai/v2", fetch: fetchFn = fetch, JWTAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (JWTAuth !== undefined) headers.set('authorization', `Bearer ${JWTAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/governance/insights/${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 };