export type DeleteApiCompaniesCompanyIdCustomfieldsCustomfieldidArgs = {companyId: string, customfieldid: string}; export type DeleteApiCompaniesCompanyIdCustomfieldsCustomfieldidOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Custom Field * * DELETE /companies/{companyId}/customfields/{customfieldid} */ export const deleteApiCompaniesCompanyIdCustomfieldsCustomfieldid = async (args: DeleteApiCompaniesCompanyIdCustomfieldsCustomfieldidArgs, options?: DeleteApiCompaniesCompanyIdCustomfieldsCustomfieldidOptions) => { const {baseUrl = "https://api.paychex.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/companies/${encodeURIComponent(String(args.companyId))}/customfields/${encodeURIComponent(String(args.customfieldid))}${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 };