1import type * as mwaa from "@distilled.cloud/aws/mwaa-serverless";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Workflow } from "./Workflow.ts";
5
6/**
7 * Request accepted by the {@link ListTaskInstances} runtime callable. The
8 * `WorkflowArn` is injected from the bound {@link Workflow}.
9 */
10export type ListTaskInstancesInput = Omit<
11 mwaa.ListTaskInstancesRequest,
12 "WorkflowArn"
13>;
14
15/**
16 * Runtime binding for `airflow-serverless:ListTaskInstances`.
17 *
18 * Lists the task instances of a run of the bound {@link Workflow} with
19 * their statuses and durations. Provide the implementation with
20 * `Effect.provide(AWS.MWAAServerless.ListTaskInstancesHttp)`.
21 * ### Observing Tasks
22 * **Example:** List A Run's Task Instances
23 * ```typescript
24 * // init — bind the operation to the workflow
25 * const listTaskInstances = yield* AWS.MWAAServerless.ListTaskInstances(workflow);
26 *
27 * // runtime
28 * const { TaskInstances } = yield* listTaskInstances({ RunId: runId });
29 * for (const task of TaskInstances ?? []) {
30 * yield* Effect.log(`${task.TaskInstanceId}: ${task.Status}`);
31 * }
32 * ```
33 *
34 * @binding
35 */
36export interface ListTaskInstances extends Binding.Service<
37 ListTaskInstances,
38 "AWS.MWAAServerless.ListTaskInstances",
39 (
40 workflow: Workflow,
41 ) => Effect.Effect<
42 (
43 request: ListTaskInstancesInput,
44 ) => Effect.Effect<
45 mwaa.ListTaskInstancesResponse,
46 mwaa.ListTaskInstancesError
47 >
48 >
49> {}
50export const ListTaskInstances = Binding.Service<ListTaskInstances>(
51 "AWS.MWAAServerless.ListTaskInstances",
52);