| 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:GetDocumentAnalysis` — read the status and |
| 7 | * results of an asynchronous document-analysis job started with |
| 8 | * `StartDocumentAnalysis`. Page through large result sets with `NextToken`. |
| 9 | * |
| 10 | * ### Asynchronous Document Analysis |
| 11 | * **Example:** Poll an Analysis Job |
| 12 | * ```typescript |
| 13 | * // init |
| 14 | * const getDocumentAnalysis = yield* AWS.Textract.GetDocumentAnalysis(); |
| 15 | * |
| 16 | * // runtime |
| 17 | * const result = yield* getDocumentAnalysis({ JobId: jobId }); |
| 18 | * if (result.JobStatus === "SUCCEEDED") { |
| 19 | * const blocks = result.Blocks; |
| 20 | * } |
| 21 | * ``` |
| 22 | * |
| 23 | * @binding |
| 24 | */ |
| 25 | export interface GetDocumentAnalysis extends Binding.Service< |
| 26 | GetDocumentAnalysis, |
| 27 | "AWS.Textract.GetDocumentAnalysis", |
| 28 | () => Effect.Effect< |
| 29 | ( |
| 30 | request: textract.GetDocumentAnalysisRequest, |
| 31 | ) => Effect.Effect< |
| 32 | textract.GetDocumentAnalysisResponse, |
| 33 | textract.GetDocumentAnalysisError |
| 34 | > |
| 35 | > |
| 36 | > {} |
| 37 | export const GetDocumentAnalysis = Binding.Service<GetDocumentAnalysis>( |
| 38 | "AWS.Textract.GetDocumentAnalysis", |
| 39 | ); |