The best way to control Claude Code, Codex and more from any computer or phone
| 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 GetJobBookmarkRequest extends Omit<glue.GetJobBookmarkRequest, "JobName"> {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `glue:GetJobBookmark`. |
| 10 | * |
| 11 | * Reads the bound {@link Job}'s bookmark entry — the incremental-processing |
| 12 | * checkpoint Glue keeps when a job runs with `--job-bookmark-option |
| 13 | * job-bookmark-enable`. Fails with the typed `EntityNotFoundException` when |
| 14 | * the job has never recorded a bookmark. The job name is injected from the |
| 15 | * binding. Provide the implementation with |
| 16 | * `Effect.provide(AWS.Glue.GetJobBookmarkHttp)`. |
| 17 | * ### Job Bookmarks |
| 18 | * **Example:** Read the Bookmark |
| 19 | * ```typescript |
| 20 | * // init |
| 21 | * const getJobBookmark = yield* AWS.Glue.GetJobBookmark(job); |
| 22 | * |
| 23 | * // runtime |
| 24 | * const entry = yield* getJobBookmark().pipe( |
| 25 | * Effect.map((r) => r.JobBookmarkEntry), |
| 26 | * Effect.catchTag("EntityNotFoundException", () => |
| 27 | * Effect.succeed(undefined), |
| 28 | * ), |
| 29 | * ); |
| 30 | * ``` |
| 31 | * |
| 32 | * @binding |
| 33 | */ |
| 34 | export interface GetJobBookmark extends Binding.Service< |
| 35 | GetJobBookmark, |
| 36 | "AWS.Glue.GetJobBookmark", |
| 37 | ( |
| 38 | job: Job, |
| 39 | ) => Effect.Effect< |
| 40 | ( |
| 41 | request?: GetJobBookmarkRequest, |
| 42 | ) => Effect.Effect<glue.GetJobBookmarkResponse, glue.GetJobBookmarkError> |
| 43 | > |
| 44 | > {} |
| 45 | |
| 46 | export const GetJobBookmark = Binding.Service<GetJobBookmark>("AWS.Glue.GetJobBookmark"); |