export type DeleteApiV1CustomFieldsIdArgs = {id: string}; export type DeleteApiV1CustomFieldsIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Custom Fields V1 * * DELETE /v1/custom_fields/{id} */ export const deleteApiV1CustomFieldsId = async (args: DeleteApiV1CustomFieldsIdArgs, options?: DeleteApiV1CustomFieldsIdOptions) => { const {baseUrl = "https:////api.incident.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v1/custom_fields/${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 };