export type DeleteApiApiV1PushNotificationsPkArgs = {pk: string}; export type DeleteApiApiV1PushNotificationsPkOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete a registered push notification device * * DELETE /api/v1/push-notifications/{pk}/ */ export const deleteApiApiV1PushNotificationsPk = async (args: DeleteApiApiV1PushNotificationsPkArgs, options: DeleteApiApiV1PushNotificationsPkOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/push-notifications/${encodeURIComponent(String(args.pk))}/${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 };