export type DeleteApiApiCustomApisApiIdArgs = {api_id: number}; export type DeleteApiApiCustomApisApiIdOptions = {baseUrl: string, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Custom Api * * DELETE /api/custom-apis/{api_id} */ export const deleteApiApiCustomApisApiId = async (args: DeleteApiApiCustomApisApiIdArgs, options: DeleteApiApiCustomApisApiIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/custom-apis/${encodeURIComponent(String(args.api_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 };