export type DeleteApiBulksBulkIdArgs = {bulk_id: string}; export type DeleteApiBulksBulkIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Bulk * * DELETE /bulks/{bulk_id} */ export const deleteApiBulksBulkId = async (args: DeleteApiBulksBulkIdArgs, options?: DeleteApiBulksBulkIdOptions) => { const {baseUrl = "https://api.burodeingresos.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKeyAuth !== undefined) headers.set("X-API-Key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/bulks/${encodeURIComponent(String(args.bulk_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 undefined };