| 1 | import type * as mwaa from "@distilled.cloud/aws/mwaa-serverless"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Workflow } from "./Workflow.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Request accepted by the {@link ListWorkflowVersions} runtime callable. |
| 8 | * The `WorkflowArn` is injected from the bound {@link Workflow}. |
| 9 | */ |
| 10 | export type ListWorkflowVersionsInput = Omit< |
| 11 | mwaa.ListWorkflowVersionsRequest, |
| 12 | "WorkflowArn" |
| 13 | >; |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `airflow-serverless:ListWorkflowVersions`. |
| 17 | * |
| 18 | * Lists the versions of the bound {@link Workflow} (each update to the |
| 19 | * workflow's definition or configuration publishes a new version). Useful |
| 20 | * for pinning `StartWorkflowRun` to a specific version. Provide the |
| 21 | * implementation with |
| 22 | * `Effect.provide(AWS.MWAAServerless.ListWorkflowVersionsHttp)`. |
| 23 | * ### Observing Workflows |
| 24 | * **Example:** List Workflow Versions |
| 25 | * ```typescript |
| 26 | * // init — bind the operation to the workflow |
| 27 | * const listWorkflowVersions = |
| 28 | * yield* AWS.MWAAServerless.ListWorkflowVersions(workflow); |
| 29 | * |
| 30 | * // runtime |
| 31 | * const { WorkflowVersions } = yield* listWorkflowVersions(); |
| 32 | * const latest = WorkflowVersions?.find((v) => v.IsLatestVersion); |
| 33 | * ``` |
| 34 | * |
| 35 | * @binding |
| 36 | */ |
| 37 | export interface ListWorkflowVersions extends Binding.Service< |
| 38 | ListWorkflowVersions, |
| 39 | "AWS.MWAAServerless.ListWorkflowVersions", |
| 40 | ( |
| 41 | workflow: Workflow, |
| 42 | ) => Effect.Effect< |
| 43 | ( |
| 44 | request?: ListWorkflowVersionsInput, |
| 45 | ) => Effect.Effect< |
| 46 | mwaa.ListWorkflowVersionsResponse, |
| 47 | mwaa.ListWorkflowVersionsError |
| 48 | > |
| 49 | > |
| 50 | > {} |
| 51 | export const ListWorkflowVersions = Binding.Service<ListWorkflowVersions>( |
| 52 | "AWS.MWAAServerless.ListWorkflowVersions", |
| 53 | ); |