export type DeleteApiV2ProvidersUsersUserIdArgs = {userId: string, Authorization: string, Accept: string}; export type DeleteApiV2ProvidersUsersUserIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a specific provider user record * * DELETE /v2/providers/users/{userId} */ export const deleteApiV2ProvidersUsersUserId = async (args: DeleteApiV2ProvidersUsersUserIdArgs, options?: DeleteApiV2ProvidersUsersUserIdOptions) => { const {baseUrl = "https://api.loket.nl", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() 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/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 };