export type DeleteApiBackupAndDrSnapshotsSnapshotIdArgs = {snapshot_id: string, force?: boolean | undefined}; export type DeleteApiBackupAndDrSnapshotsSnapshotIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete snapshot * * DELETE /backup-and-dr/snapshots/{snapshot_id} */ export const deleteApiBackupAndDrSnapshotsSnapshotId = async (args: DeleteApiBackupAndDrSnapshotsSnapshotIdArgs, options?: DeleteApiBackupAndDrSnapshotsSnapshotIdOptions) => { const {baseUrl = "https://api.firefly.ai/v2", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.force != null) query.append("force", String(args.force)) const url = `${baseUrl.replace(/\/+$/, '')}/backup-and-dr/snapshots/${encodeURIComponent(String(args.snapshot_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 };