| 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 | * Runtime binding for the `StartDataSourceSyncJob` operation (IAM action |
| 8 | * `kendra:StartDataSourceSyncJob`), scoped to one {@link DataSource}. |
| 9 | * |
| 10 | * Starts an on-demand sync of the data source into its index — the |
| 11 | * programmatic alternative to the data source's cron `schedule`. Fails |
| 12 | * with `ResourceInUseException` while another sync is already running. |
| 13 | * Provide the implementation with |
| 14 | * `Effect.provide(AWS.Kendra.StartDataSourceSyncJobHttp)`. |
| 15 | * |
| 16 | * ### Syncing Data Sources |
| 17 | * **Example:** Trigger a Sync |
| 18 | * ```typescript |
| 19 | * const startSync = yield* AWS.Kendra.StartDataSourceSyncJob(source); |
| 20 | * |
| 21 | * const { ExecutionId } = yield* startSync(); |
| 22 | * ``` |
| 23 | * |
| 24 | * @binding |
| 25 | */ |
| 26 | export interface StartDataSourceSyncJob extends Binding.Service< |
| 27 | StartDataSourceSyncJob, |
| 28 | "AWS.Kendra.StartDataSourceSyncJob", |
| 29 | ( |
| 30 | dataSource: DataSource, |
| 31 | ) => Effect.Effect< |
| 32 | () => Effect.Effect< |
| 33 | kendra.StartDataSourceSyncJobResponse, |
| 34 | kendra.StartDataSourceSyncJobError |
| 35 | > |
| 36 | > |
| 37 | > {} |
| 38 | export const StartDataSourceSyncJob = Binding.Service<StartDataSourceSyncJob>( |
| 39 | "AWS.Kendra.StartDataSourceSyncJob", |
| 40 | ); |