export type DeleteApiIntegrationsGithubArgs = {id?: string | undefined}; export type DeleteApiIntegrationsGithubOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a GitHub integration * * DELETE /integrations/github */ export const deleteApiIntegrationsGithub = async (args: DeleteApiIntegrationsGithubArgs, options?: DeleteApiIntegrationsGithubOptions) => { const {baseUrl = "https://api.magicbell.com/v2", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.id != null) query.append("id", String(args.id)) const url = `${baseUrl.replace(/\/+$/, '')}/integrations/github${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 };