export type DeleteApiV2ProvidersEmployersUsersUserIdArgs = {userId: string, transferNotificationsTo?: string | undefined, Authorization: string, Accept: string}; export type DeleteApiV2ProvidersEmployersUsersUserIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a specific employer user record * * DELETE /v2/providers/employers/users/{userId} */ export const deleteApiV2ProvidersEmployersUsersUserId = async (args: DeleteApiV2ProvidersEmployersUsersUserIdArgs, options?: DeleteApiV2ProvidersEmployersUsersUserIdOptions) => { const {baseUrl = "https://api.loket.nl", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.transferNotificationsTo != null) query.append("transferNotificationsTo", String(args.transferNotificationsTo)) if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (args.Accept != null) headers.set("Accept", String(args.Accept)) const url = `${baseUrl.replace(/\/+$/, '')}/v2/providers/employers/users/${encodeURIComponent(String(args.userId))}${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 };