| 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 { DataSource } from "./DataSource.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `ListDataSourceSyncJobs` request with `Id` and `IndexId` injected from the bound data source. |
| 8 | */ |
| 9 | export interface ListDataSourceSyncJobsRequest extends Omit< |
| 10 | kendra.ListDataSourceSyncJobsRequest, |
| 11 | "Id" | "IndexId" |
| 12 | > {} |
| 13 | |
| 14 | /** |
| 15 | * Runtime binding for the `ListDataSourceSyncJobs` operation (IAM action |
| 16 | * `kendra:ListDataSourceSyncJobs`), scoped to one {@link DataSource}. |
| 17 | * |
| 18 | * Lists the data source's sync-job history — status, error details, and |
| 19 | * per-run document add/modify/delete/fail metrics. |
| 20 | * Provide the implementation with |
| 21 | * `Effect.provide(AWS.Kendra.ListDataSourceSyncJobsHttp)`. |
| 22 | * |
| 23 | * ### Syncing Data Sources |
| 24 | * **Example:** Sync Job History |
| 25 | * ```typescript |
| 26 | * const listSyncJobs = yield* AWS.Kendra.ListDataSourceSyncJobs(source); |
| 27 | * |
| 28 | * const jobs = yield* listSyncJobs({ StatusFilter: "SUCCEEDED" }); |
| 29 | * console.log(jobs.History?.[0]?.Metrics); |
| 30 | * ``` |
| 31 | * |
| 32 | * @binding |
| 33 | */ |
| 34 | export interface ListDataSourceSyncJobs extends Binding.Service< |
| 35 | ListDataSourceSyncJobs, |
| 36 | "AWS.Kendra.ListDataSourceSyncJobs", |
| 37 | ( |
| 38 | dataSource: DataSource, |
| 39 | ) => Effect.Effect< |
| 40 | ( |
| 41 | request?: ListDataSourceSyncJobsRequest, |
| 42 | ) => Effect.Effect< |
| 43 | kendra.ListDataSourceSyncJobsResponse, |
| 44 | kendra.ListDataSourceSyncJobsError |
| 45 | > |
| 46 | > |
| 47 | > {} |
| 48 | export const ListDataSourceSyncJobs = Binding.Service<ListDataSourceSyncJobs>( |
| 49 | "AWS.Kendra.ListDataSourceSyncJobs", |
| 50 | ); |