export type DeleteApiApiPublicV1UserUserIdIncidentNotificationSettingsArgs = {userId: string, organizationId?: string | undefined}; export type DeleteApiApiPublicV1UserUserIdIncidentNotificationSettingsOptions = {baseUrl: string, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete incident notification settings for a user * * DELETE /api/public/v1/user/{userId}/incident-notification-settings */ export const deleteApiApiPublicV1UserUserIdIncidentNotificationSettings = async (args: DeleteApiApiPublicV1UserUserIdIncidentNotificationSettingsArgs, options: DeleteApiApiPublicV1UserUserIdIncidentNotificationSettingsOptions) => { const {baseUrl, fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.organizationId != null) query.append("organizationId", String(args.organizationId)) if (ApiKey !== undefined) headers.set("Authorization", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/public/v1/user/${encodeURIComponent(String(args.userId))}/incident-notification-settings${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 };