| 1 | import type * as bedrock from "@distilled.cloud/aws/bedrock-agent"; |
| 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 | * The `StopIngestionJob` request with the binding-injected |
| 8 | * `knowledgeBaseId` and `dataSourceId` removed — they are supplied |
| 9 | * automatically from the bound {@link DataSource}. |
| 10 | */ |
| 11 | export interface StopIngestionJobRequest extends Omit< |
| 12 | bedrock.StopIngestionJobRequest, |
| 13 | "knowledgeBaseId" | "dataSourceId" |
| 14 | > {} |
| 15 | |
| 16 | /** |
| 17 | * Runtime binding for `bedrock-agent:StopIngestionJob` — stop an in-flight |
| 18 | * ingestion job on the bound {@link DataSource}. |
| 19 | * |
| 20 | * The binding grants the function `bedrock:StopIngestionJob` scoped to the |
| 21 | * data source's parent knowledge base. |
| 22 | * |
| 23 | * ### Syncing a Data Source |
| 24 | * **Example:** Stop a Running Ingestion Job |
| 25 | * ```typescript |
| 26 | * // init |
| 27 | * const stopIngestionJob = yield* Bedrock.StopIngestionJob(dataSource); |
| 28 | * |
| 29 | * // runtime |
| 30 | * const { ingestionJob } = yield* stopIngestionJob({ |
| 31 | * ingestionJobId: jobId, |
| 32 | * }); |
| 33 | * ``` |
| 34 | * |
| 35 | * @binding |
| 36 | */ |
| 37 | export interface StopIngestionJob extends Binding.Service< |
| 38 | StopIngestionJob, |
| 39 | "AWS.Bedrock.StopIngestionJob", |
| 40 | <D extends DataSource>( |
| 41 | dataSource: D, |
| 42 | ) => Effect.Effect< |
| 43 | ( |
| 44 | request: StopIngestionJobRequest, |
| 45 | ) => Effect.Effect< |
| 46 | bedrock.StopIngestionJobResponse, |
| 47 | bedrock.StopIngestionJobError |
| 48 | > |
| 49 | > |
| 50 | > {} |
| 51 | export const StopIngestionJob = Binding.Service<StopIngestionJob>( |
| 52 | "AWS.Bedrock.StopIngestionJob", |
| 53 | ); |