export type DeleteApiApiV2EcosystemsIdArgs = {id: number}; export type DeleteApiApiV2EcosystemsIdOptions = {baseUrl?: string | undefined, OAuthv2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Removes the ecosystem. * * DELETE /api/v2/ecosystems/{id} */ export const deleteApiApiV2EcosystemsId = async (args: DeleteApiApiV2EcosystemsIdArgs, options?: DeleteApiApiV2EcosystemsIdOptions) => { const {baseUrl = "https://app.blackkitetech.com", fetch: fetchFn = fetch, OAuthv2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/plain") if (OAuthv2 !== undefined) headers.set('authorization', `Bearer ${OAuthv2}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/ecosystems/${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 res.text() };