export type DeleteApiConfigsNotificationsEventsEventNameArgs = {eventName: 'REFRESH' | 'DATA_UPDATES' | 'AUTO_REFRESH_UPDATES'}; export type DeleteApiConfigsNotificationsEventsEventNameOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete Notification Subscription * * DELETE /configs/notifications/events/{eventName} */ export const deleteApiConfigsNotificationsEventsEventName = async (args: DeleteApiConfigsNotificationsEventsEventNameArgs, options: DeleteApiConfigsNotificationsEventsEventNameOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/configs/notifications/events/${encodeURIComponent(String(args.eventName))}${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 };