import { z } from 'zod';
import { APIResponseSchemaNoData } from "../api.js";
import { throwSandboxError } from "./util.js";
export const ResumeResponseSchema = APIResponseSchemaNoData();
export const SandboxResumeParamsSchema = z.object({
    sandboxId: z.string().describe('Sandbox ID to resume'),
    orgId: z.string().optional().describe('Optional org id for CLI auth context'),
});
/**
 * Resumes a paused sandbox from its checkpoint.
 *
 * @param client - The API client to use for the request
 * @param params - Parameters including the sandbox ID to resume
 * @throws {SandboxResponseError} If the sandbox is not found or resume fails
 */
export async function sandboxResume(client, params) {
    const { sandboxId, orgId } = params;
    const queryParams = new URLSearchParams();
    if (orgId) {
        queryParams.set('orgId', orgId);
    }
    const queryString = queryParams.toString();
    const url = `/sandbox/${encodeURIComponent(sandboxId)}/resume${queryString ? `?${queryString}` : ''}`;
    const resp = await client.post(url, undefined, ResumeResponseSchema);
    if (resp.success) {
        return;
    }
    throwSandboxError(resp, { sandboxId });
}
//# sourceMappingURL=resume.js.map