The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 06:00 UTC
| 1 | import type * as glue from "@distilled.cloud/aws/glue"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type * as Effect from "effect/Effect"; |
| 4 | import type { Job } from "./Job.ts"; |
| 5 | |
| 6 | export interface GetJobRunsRequest extends Omit<glue.GetJobRunsRequest, "JobName"> {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `glue:GetJobRuns`. |
| 10 | * |
| 11 | * Lists the runs of the bound {@link Job} (newest first, paginated via |
| 12 | * `NextToken`), so a function can report run history or find in-flight runs. |
| 13 | * The job name is injected from the binding. Provide the implementation with |
| 14 | * `Effect.provide(AWS.Glue.GetJobRunsHttp)`. |
| 15 | * ### Running Jobs |
| 16 | * **Example:** List Recent Runs |
| 17 | * ```typescript |
| 18 | * // init |
| 19 | * const getJobRuns = yield* AWS.Glue.GetJobRuns(job); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const { JobRuns } = yield* getJobRuns({ MaxResults: 10 }); |
| 23 | * const running = (JobRuns ?? []).filter( |
| 24 | * (run) => run.JobRunState === "RUNNING", |
| 25 | * ); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface GetJobRuns extends Binding.Service< |
| 31 | GetJobRuns, |
| 32 | "AWS.Glue.GetJobRuns", |
| 33 | ( |
| 34 | job: Job, |
| 35 | ) => Effect.Effect< |
| 36 | (request?: GetJobRunsRequest) => Effect.Effect<glue.GetJobRunsResponse, glue.GetJobRunsError> |
| 37 | > |
| 38 | > {} |
| 39 | |
| 40 | export const GetJobRuns = Binding.Service<GetJobRuns>("AWS.Glue.GetJobRuns"); |