import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient"; import * as core from "../../../../core"; import * as Extend from "../../../index"; export declare namespace ClassifyRunsClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } export declare class ClassifyRunsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: ClassifyRunsClient.Options); /** * List all classify runs. * * Returns a summary of each run. Use `GET /classify_runs/{id}` to retrieve the full object including `output` and `config`. * * @param {Extend.ClassifyRunsListRequest} request * @param {ClassifyRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.classifyRuns.list({ * nextPageToken: "xK9mLPqRtN3vS8wF5hB2cQ==:zWvUxYjM4nKpL7aDgE9HbTcR2mAyX3/Q+CNkfBSw1dZ=" * }) */ list(request?: Extend.ClassifyRunsListRequest, requestOptions?: ClassifyRunsClient.RequestOptions): core.HttpResponsePromise; private __list; /** * Classify a document using an existing classifier or an inline configuration. * * The request returns immediately with a `PROCESSING` status. Use webhooks or poll the Get Classify Run endpoint for results. * * @param {Extend.ClassifyRunsCreateRequest} request * @param {ClassifyRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.classifyRuns.create({ * classifier: { * id: "cl_1234567890" * }, * file: { * url: "https://example.com/document.pdf" * } * }) */ create(request: Extend.ClassifyRunsCreateRequest, requestOptions?: ClassifyRunsClient.RequestOptions): core.HttpResponsePromise; private __create; /** * Retrieve details about a specific classify run, including its status and outputs. * * A common use case for this endpoint is to poll for the status and final output of a classify run when using the [Create Classify Run](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/classify/create-classify-run) endpoint. For instance, if you do not want to not configure webhooks to receive the output via completion/failure events. * * @param {string} id - The unique identifier for this classify run. * * Example: `"cl_Xj8mK2pL9nR4vT7qY5wZ"` * @param {Extend.ClassifyRunsRetrieveRequest} request * @param {ClassifyRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.classifyRuns.retrieve("classify_run_id_here") */ retrieve(id: string, request?: Extend.ClassifyRunsRetrieveRequest, requestOptions?: ClassifyRunsClient.RequestOptions): core.HttpResponsePromise; private __retrieve; /** * Delete a classify run and all associated data from Extend. This operation is permanent and cannot be undone. * * This endpoint can be used if you'd like to manage data retention on your own rather than automated data retention policies. Or make one-off deletions for your downstream customers. * * @param {string} id - The ID of the classify run. * @param {Extend.ClassifyRunsDeleteRequest} request * @param {ClassifyRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.classifyRuns.delete("id") */ delete(id: string, request?: Extend.ClassifyRunsDeleteRequest, requestOptions?: ClassifyRunsClient.RequestOptions): core.HttpResponsePromise; private __delete; /** * Cancel an in-progress classify run. * * Note: Only classify runs with a status of `"PROCESSING"` can be cancelled. Classifier runs that have already completed, failed, or been cancelled cannot be cancelled again. * * @param {string} id - The ID of the classify run to cancel. * * Example: `"cl_Xj8mK2pL9nR4vT7qY5wZ"` * @param {Extend.ClassifyRunsCancelRequest} request * @param {ClassifyRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.classifyRuns.cancel("classify_run_id_here") */ cancel(id: string, request?: Extend.ClassifyRunsCancelRequest, requestOptions?: ClassifyRunsClient.RequestOptions): core.HttpResponsePromise; private __cancel; /** * Submit up to **1,000 files** for classification in a single request. Each file is processed as an independent classify run using the same classifier and configuration. * * Unlike the single [Classify File (Async)](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/classify/create-classify-run) endpoint, this batch endpoint accepts an `inputs` array and immediately returns a `BatchRun` object containing a batch `id` and a `PENDING` status. The individual runs are then queued and processed asynchronously. * * **Monitoring results:** * - **Webhooks (recommended):** Subscribe to `batch_processor_run.processed` and `batch_processor_run.failed` events. The webhook payload indicates the batch has finished — fetch individual run results using `GET /classify_runs?batchId={id}`. * - **Polling:** Call `GET /batch_runs/{id}` to check the overall batch status, and use `GET /classify_runs` filtered by `batchId` to retrieve individual run results. * * **Notes:** * - A processor reference (`classifier.id`) is required — inline `config` is not supported for batch requests. * - `inputs` must contain between 1 and 1,000 items. * - All inputs in a batch use the same classifier version and override config. * * @param {Extend.ClassifyRunsCreateBatchRequest} request * @param {ClassifyRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.classifyRuns.createBatch({ * classifier: { * id: "cl_xK9mLPqRtN3vS8wF5hB2cQ" * }, * inputs: [{ * file: { * url: "https://example.com/document1.pdf" * }, * metadata: { * "customerId": "cust_abc123" * } * }, { * file: { * url: "https://example.com/document2.pdf" * }, * metadata: { * "customerId": "cust_def456" * } * }, { * file: { * url: "https://example.com/document3.pdf" * }, * metadata: { * "customerId": "cust_ghi789" * } * }] * }) */ createBatch(request: Extend.ClassifyRunsCreateBatchRequest, requestOptions?: ClassifyRunsClient.RequestOptions): core.HttpResponsePromise; private __createBatch; }