# ScreenshotWorkerClient

**Kind:** Class

**Source:** [`atloria-monorepo/packages/doc-automation/src/v2/stages/stage-12-screenshots/screenshot-worker.client.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/packages/doc-automation/src/v2/stages/stage-12-screenshots/screenshot-worker.client.ts#L35)

Client for interacting with the screenshot-worker API

## Methods

| Method | Signature | Returns |
|---|---|---|
| `submitBatch` | `submitBatch(request: ScreenshotBatchRequest)` | `Promise<BatchJobResponse>` |
| `getJobStatus` | `getJobStatus(jobId: string, organizationId: string)` | `Promise<BatchStatusResponse | null>` |
| `waitForCompletion` | `waitForCompletion(jobId: string, organizationId: string, timeoutMs: number)` | `Promise<BatchStatusResponse>` |

## Where it refuses work

- `ScreenshotWorkerClient` stops the work with `Error` when `!response.ok`, in 2 places.
- `ScreenshotWorkerClient` stops the work with `Error` when `status === null`.
- `ScreenshotWorkerClient` stops the work with an early return when `response.status === 404`.
- `ScreenshotWorkerClient` stops the work with an early return when `status.status === 'completed' || status.status === 'failed'`.
