export type DeleteApiV1BatchesBatchUuidArgs = {batchUuid: string}; export type DeleteApiV1BatchesBatchUuidOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Cancel a batch * * DELETE /v1/batches/{batchUuid} */ export const deleteApiV1BatchesBatchUuid = async (args: DeleteApiV1BatchesBatchUuidArgs, options?: DeleteApiV1BatchesBatchUuidOptions) => { const {baseUrl = "https://api.fire.com/business", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/batches/${encodeURIComponent(String(args.batchUuid))}${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 };