| 1 | import type * as emrc from "@distilled.cloud/aws/emr-containers"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { VirtualCluster } from "./VirtualCluster.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `emr-containers:ListJobRuns`. |
| 8 | * |
| 9 | * Lists job runs on the bound {@link VirtualCluster}, optionally filtered by |
| 10 | * state, name, or creation time. The virtual cluster ID is injected from the |
| 11 | * binding. Provide the implementation with |
| 12 | * `Effect.provide(AWS.EMRContainers.ListJobRunsHttp)`. |
| 13 | * ### Running Jobs |
| 14 | * **Example:** Count Active Job Runs |
| 15 | * ```typescript |
| 16 | * // init |
| 17 | * const listJobRuns = yield* AWS.EMRContainers.ListJobRuns(virtualCluster); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const { jobRuns } = yield* listJobRuns({ |
| 21 | * states: ["PENDING", "SUBMITTED", "RUNNING"], |
| 22 | * }); |
| 23 | * yield* Effect.log(`${jobRuns?.length ?? 0} active job runs`); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface ListJobRuns extends Binding.Service< |
| 29 | ListJobRuns, |
| 30 | "AWS.EMRContainers.ListJobRuns", |
| 31 | ( |
| 32 | virtualCluster: VirtualCluster, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request?: Omit<emrc.ListJobRunsRequest, "virtualClusterId">, |
| 36 | ) => Effect.Effect<emrc.ListJobRunsResponse, emrc.ListJobRunsError> |
| 37 | > |
| 38 | > {} |
| 39 | export const ListJobRuns = Binding.Service<ListJobRuns>( |
| 40 | "AWS.EMRContainers.ListJobRuns", |
| 41 | ); |