| 1 | import type * as kendra from "@distilled.cloud/aws/kendra"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Index } from "./SearchIndex.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `BatchGetDocumentStatus` request with `IndexId` injected from the bound index. |
| 8 | */ |
| 9 | export interface BatchGetDocumentStatusRequest extends Omit< |
| 10 | kendra.BatchGetDocumentStatusRequest, |
| 11 | "IndexId" |
| 12 | > {} |
| 13 | |
| 14 | /** |
| 15 | * Runtime binding for the `BatchGetDocumentStatus` operation (IAM action |
| 16 | * `kendra:BatchGetDocumentStatus`), scoped to one {@link Index}. |
| 17 | * |
| 18 | * Returns the indexing status (`INDEXED`, `PROCESSING`, `FAILED`, …) of |
| 19 | * documents added with {@link BatchPutDocument} or a data-source sync. |
| 20 | * Provide the implementation with |
| 21 | * `Effect.provide(AWS.Kendra.BatchGetDocumentStatusHttp)`. |
| 22 | * |
| 23 | * ### Indexing Documents |
| 24 | * **Example:** Check Document Status |
| 25 | * ```typescript |
| 26 | * const documentStatus = yield* AWS.Kendra.BatchGetDocumentStatus(index); |
| 27 | * |
| 28 | * const status = yield* documentStatus({ |
| 29 | * DocumentInfoList: [{ DocumentId: "welcome" }], |
| 30 | * }); |
| 31 | * console.log(status.DocumentStatusList?.[0]?.DocumentStatus); |
| 32 | * ``` |
| 33 | * |
| 34 | * @binding |
| 35 | */ |
| 36 | export interface BatchGetDocumentStatus extends Binding.Service< |
| 37 | BatchGetDocumentStatus, |
| 38 | "AWS.Kendra.BatchGetDocumentStatus", |
| 39 | ( |
| 40 | index: Index, |
| 41 | ) => Effect.Effect< |
| 42 | ( |
| 43 | request: BatchGetDocumentStatusRequest, |
| 44 | ) => Effect.Effect< |
| 45 | kendra.BatchGetDocumentStatusResponse, |
| 46 | kendra.BatchGetDocumentStatusError |
| 47 | > |
| 48 | > |
| 49 | > {} |
| 50 | export const BatchGetDocumentStatus = Binding.Service<BatchGetDocumentStatus>( |
| 51 | "AWS.Kendra.BatchGetDocumentStatus", |
| 52 | ); |