export type DeleteApiEventTypesIdArgs = {Authorization: string, id: string}; export type DeleteApiEventTypesIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete an event type by ID * * DELETE /event-types/{id} */ export const deleteApiEventTypesId = async (args: DeleteApiEventTypesIdArgs, options: DeleteApiEventTypesIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/event-types/${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 };