| 1 | import type * as dataexchange from "@distilled.cloud/aws/dataexchange"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { DataSet } from "./DataSet.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `dataexchange:ListDataSetRevisions`. |
| 8 | * |
| 9 | * Enumerates the bound data set's revisions, newest first — the |
| 10 | * building block of "process the latest published revision" consumers. |
| 11 | * The data set id is injected from the binding. |
| 12 | * Provide the implementation with |
| 13 | * `Effect.provide(AWS.DataExchange.ListDataSetRevisionsHttp)`. |
| 14 | * ### Reading Data Sets |
| 15 | * **Example:** Find The Latest Finalized Revision |
| 16 | * ```typescript |
| 17 | * const listRevisions = yield* AWS.DataExchange.ListDataSetRevisions(dataSet); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const { Revisions } = yield* listRevisions(); |
| 21 | * const latest = (Revisions ?? []).find((r) => r.Finalized); |
| 22 | * ``` |
| 23 | * |
| 24 | * @binding |
| 25 | */ |
| 26 | export interface ListDataSetRevisions extends Binding.Service< |
| 27 | ListDataSetRevisions, |
| 28 | "AWS.DataExchange.ListDataSetRevisions", |
| 29 | ( |
| 30 | dataSet: DataSet, |
| 31 | ) => Effect.Effect< |
| 32 | ( |
| 33 | request?: Omit<dataexchange.ListDataSetRevisionsRequest, "DataSetId">, |
| 34 | ) => Effect.Effect< |
| 35 | dataexchange.ListDataSetRevisionsResponse, |
| 36 | dataexchange.ListDataSetRevisionsError |
| 37 | > |
| 38 | > |
| 39 | > {} |
| 40 | export const ListDataSetRevisions = Binding.Service<ListDataSetRevisions>( |
| 41 | "AWS.DataExchange.ListDataSetRevisions", |
| 42 | ); |