| 1 | import type * as textract from "@distilled.cloud/aws/textract"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `textract:StartLendingAnalysis` — start an |
| 7 | * asynchronous lending-document analysis job (classifies pages and routes |
| 8 | * them to the right extraction model) for a document stored in S3. Poll |
| 9 | * the returned `JobId` with `GetLendingAnalysis` / |
| 10 | * `GetLendingAnalysisSummary`. The caller needs `s3:GetObject` on the |
| 11 | * input bucket. |
| 12 | * |
| 13 | * ### Asynchronous Lending Analysis |
| 14 | * **Example:** Start a Lending Analysis Job |
| 15 | * ```typescript |
| 16 | * // init |
| 17 | * const startLendingAnalysis = yield* AWS.Textract.StartLendingAnalysis(); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const { JobId } = yield* startLendingAnalysis({ |
| 21 | * DocumentLocation: { S3Object: { Bucket: bucketName, Name: "loan.pdf" } }, |
| 22 | * }); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface StartLendingAnalysis extends Binding.Service< |
| 28 | StartLendingAnalysis, |
| 29 | "AWS.Textract.StartLendingAnalysis", |
| 30 | () => Effect.Effect< |
| 31 | ( |
| 32 | request: textract.StartLendingAnalysisRequest, |
| 33 | ) => Effect.Effect< |
| 34 | textract.StartLendingAnalysisResponse, |
| 35 | textract.StartLendingAnalysisError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | export const StartLendingAnalysis = Binding.Service<StartLendingAnalysis>( |
| 40 | "AWS.Textract.StartLendingAnalysis", |
| 41 | ); |