export type CreateApiV2AccountsEmptyRecycleBinOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Empties the account's recycle bin. * * POST /v2/accounts/empty-recycle-bin */ export const createApiV2AccountsEmptyRecycleBin = async (options?: CreateApiV2AccountsEmptyRecycleBinOptions) => { const {baseUrl = "https://api.dotdigital.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/octet-stream") const url = `${baseUrl.replace(/\/+$/, '')}/v2/accounts/empty-recycle-bin${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };