| 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 GetTaskInstance} runtime callable. The |
| 8 | * `WorkflowArn` is injected from the bound {@link Workflow}. |
| 9 | */ |
| 10 | export type GetTaskInstanceInput = Omit< |
| 11 | mwaa.GetTaskInstanceRequest, |
| 12 | "WorkflowArn" |
| 13 | >; |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `airflow-serverless:GetTaskInstance`. |
| 17 | * |
| 18 | * Reads the detail of a single task instance within a run of the bound |
| 19 | * {@link Workflow} — its status, attempt number, timings, error message, |
| 20 | * log stream, and XCom values. Provide the implementation with |
| 21 | * `Effect.provide(AWS.MWAAServerless.GetTaskInstanceHttp)`. |
| 22 | * ### Observing Tasks |
| 23 | * **Example:** Read A Task Instance |
| 24 | * ```typescript |
| 25 | * // init — bind the operation to the workflow |
| 26 | * const getTaskInstance = yield* AWS.MWAAServerless.GetTaskInstance(workflow); |
| 27 | * |
| 28 | * // runtime |
| 29 | * const task = yield* getTaskInstance({ |
| 30 | * RunId: runId, |
| 31 | * TaskInstanceId: taskInstanceId, |
| 32 | * }); |
| 33 | * yield* Effect.log(`task ${task.TaskId}: ${task.Status}`); |
| 34 | * ``` |
| 35 | * |
| 36 | * @binding |
| 37 | */ |
| 38 | export interface GetTaskInstance extends Binding.Service< |
| 39 | GetTaskInstance, |
| 40 | "AWS.MWAAServerless.GetTaskInstance", |
| 41 | ( |
| 42 | workflow: Workflow, |
| 43 | ) => Effect.Effect< |
| 44 | ( |
| 45 | request: GetTaskInstanceInput, |
| 46 | ) => Effect.Effect<mwaa.GetTaskInstanceResponse, mwaa.GetTaskInstanceError> |
| 47 | > |
| 48 | > {} |
| 49 | export const GetTaskInstance = Binding.Service<GetTaskInstance>( |
| 50 | "AWS.MWAAServerless.GetTaskInstance", |
| 51 | ); |