| 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 GetWorkflowRun} runtime callable. The |
| 8 | * `WorkflowArn` is injected from the bound {@link Workflow}. |
| 9 | */ |
| 10 | export type GetWorkflowRunInput = Omit< |
| 11 | mwaa.GetWorkflowRunRequest, |
| 12 | "WorkflowArn" |
| 13 | >; |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `airflow-serverless:GetWorkflowRun`. |
| 17 | * |
| 18 | * Reads the detail of a single run of the bound {@link Workflow} — its |
| 19 | * status, timings, error message, and task-instance ids. Provide the |
| 20 | * implementation with `Effect.provide(AWS.MWAAServerless.GetWorkflowRunHttp)`. |
| 21 | * ### Observing Runs |
| 22 | * **Example:** Read A Run's Status |
| 23 | * ```typescript |
| 24 | * // init — bind the operation to the workflow |
| 25 | * const getWorkflowRun = yield* AWS.MWAAServerless.GetWorkflowRun(workflow); |
| 26 | * |
| 27 | * // runtime |
| 28 | * const run = yield* getWorkflowRun({ RunId: runId }); |
| 29 | * yield* Effect.log(`run ${run.RunId}: ${run.RunDetail?.RunState}`); |
| 30 | * ``` |
| 31 | * |
| 32 | * @binding |
| 33 | */ |
| 34 | export interface GetWorkflowRun extends Binding.Service< |
| 35 | GetWorkflowRun, |
| 36 | "AWS.MWAAServerless.GetWorkflowRun", |
| 37 | ( |
| 38 | workflow: Workflow, |
| 39 | ) => Effect.Effect< |
| 40 | ( |
| 41 | request: GetWorkflowRunInput, |
| 42 | ) => Effect.Effect<mwaa.GetWorkflowRunResponse, mwaa.GetWorkflowRunError> |
| 43 | > |
| 44 | > {} |
| 45 | export const GetWorkflowRun = Binding.Service<GetWorkflowRun>( |
| 46 | "AWS.MWAAServerless.GetWorkflowRun", |
| 47 | ); |