| 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 `ListIngestionJobs` request with the binding-injected |
| 8 | * `knowledgeBaseId` and `dataSourceId` removed — they are supplied |
| 9 | * automatically from the bound {@link DataSource}. |
| 10 | */ |
| 11 | export interface ListIngestionJobsRequest extends Omit< |
| 12 | bedrock.ListIngestionJobsRequest, |
| 13 | "knowledgeBaseId" | "dataSourceId" |
| 14 | > {} |
| 15 | |
| 16 | /** |
| 17 | * Runtime binding for `bedrock-agent:ListIngestionJobs` — list the ingestion |
| 18 | * jobs that have run against the bound {@link DataSource}, optionally |
| 19 | * filtered and sorted. |
| 20 | * |
| 21 | * The binding grants the function `bedrock:ListIngestionJobs` scoped to the |
| 22 | * data source's parent knowledge base. |
| 23 | * |
| 24 | * ### Syncing a Data Source |
| 25 | * **Example:** List Recent Ingestion Jobs |
| 26 | * ```typescript |
| 27 | * // init |
| 28 | * const listIngestionJobs = yield* Bedrock.ListIngestionJobs(dataSource); |
| 29 | * |
| 30 | * // runtime |
| 31 | * const { ingestionJobSummaries } = yield* listIngestionJobs({ |
| 32 | * sortBy: { attribute: "STARTED_AT", order: "DESCENDING" }, |
| 33 | * maxResults: 10, |
| 34 | * }); |
| 35 | * ``` |
| 36 | * |
| 37 | * @binding |
| 38 | */ |
| 39 | export interface ListIngestionJobs extends Binding.Service< |
| 40 | ListIngestionJobs, |
| 41 | "AWS.Bedrock.ListIngestionJobs", |
| 42 | <D extends DataSource>( |
| 43 | dataSource: D, |
| 44 | ) => Effect.Effect< |
| 45 | ( |
| 46 | request: ListIngestionJobsRequest, |
| 47 | ) => Effect.Effect< |
| 48 | bedrock.ListIngestionJobsResponse, |
| 49 | bedrock.ListIngestionJobsError |
| 50 | > |
| 51 | > |
| 52 | > {} |
| 53 | export const ListIngestionJobs = Binding.Service<ListIngestionJobs>( |
| 54 | "AWS.Bedrock.ListIngestionJobs", |
| 55 | ); |