sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ Textract/ StartDocumentTextDetection.ts

import type * as textract from "@distilled.cloud/aws/textract";
import * as Binding from "alchemy/Binding";
import type * as Effect from "effect/Effect";

/**
 * Runtime binding for `textract:StartDocumentTextDetection` — start an
 * asynchronous OCR job for a (possibly multi-page) document stored in S3.
 * Poll the returned `JobId` with `GetDocumentTextDetection`. The caller
 * needs `s3:GetObject` on the input bucket.
 *
 * ### Asynchronous Text Detection
 * **Example:** Start a Text Detection Job
 * ```typescript
 * // init
 * const startDocumentTextDetection =
 *   yield* AWS.Textract.StartDocumentTextDetection();
 *
 * // runtime
 * const { JobId } = yield* startDocumentTextDetection({
 *   DocumentLocation: { S3Object: { Bucket: bucketName, Name: "doc.pdf" } },
 * });
 * ```
 *
 * @binding
 */
export interface StartDocumentTextDetection extends Binding.Service<
  StartDocumentTextDetection,
  "AWS.Textract.StartDocumentTextDetection",
  () => Effect.Effect<
    (
      request: textract.StartDocumentTextDetectionRequest,
    ) => Effect.Effect<
      textract.StartDocumentTextDetectionResponse,
      textract.StartDocumentTextDetectionError
    >
  >
> {}
export const StartDocumentTextDetection = Binding.Service<StartDocumentTextDetection>(
  "AWS.Textract.StartDocumentTextDetection",
);