export type DeleteApiApiV1CompaniesCompanyCompanyIdArgs = {companyId: string}; export type DeleteApiApiV1CompaniesCompanyCompanyIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete company * * DELETE /api/v1/companies/company/{companyId} */ export const deleteApiApiV1CompaniesCompanyCompanyId = async (args: DeleteApiApiV1CompaniesCompanyCompanyIdArgs, options?: DeleteApiApiV1CompaniesCompanyCompanyIdOptions) => { const {baseUrl = "https://api.getprospect.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("apiKey", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/companies/company/${encodeURIComponent(String(args.companyId))}${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 };