export type DeleteApiCompaniesCompanyIdPhonesIdArgs = {company_id: number, id: number}; export type DeleteApiCompaniesCompanyIdPhonesIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a company phone * * DELETE /companies/{company_id}/phones/{id} */ export const deleteApiCompaniesCompanyIdPhonesId = async (args: DeleteApiCompaniesCompanyIdPhonesIdArgs, options?: DeleteApiCompaniesCompanyIdPhonesIdOptions) => { const {baseUrl = "https://api.catsone.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/companies/${encodeURIComponent(String(args.company_id))}/phones/${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 };