export type DeleteApiNotificationsIdArgs = {id: string, Accept: string}; export type DeleteApiNotificationsIdOptions = {baseUrl?: string | undefined, applicationRestricted?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve and delete a notification from the queue (deprecated) * * DELETE /notifications/{id} */ export const deleteApiNotificationsId = async (args: DeleteApiNotificationsIdArgs, options?: DeleteApiNotificationsIdOptions) => { const {baseUrl = "https://test-api.service.hmrc.gov.uk", fetch: fetchFn = fetch, applicationRestricted} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/xml") if (args.Accept != null) headers.set("Accept", String(args.Accept)) if (applicationRestricted !== undefined) headers.set('authorization', `Bearer ${applicationRestricted}`) const url = `${baseUrl.replace(/\/+$/, '')}/notifications/${encodeURIComponent(String(args.id))}${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 res.blob() };