@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

main
ts 45 lines 1.54 KB
Raw
1 import type * as scheduler from "@distilled.cloud/aws/scheduler";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { ScheduleGroup } from "./ScheduleGroup.ts";
5
6 export interface DeleteScheduleRequest extends Omit<scheduler.DeleteScheduleInput, "GroupName"> {}
7
8 /**
9 * Runtime binding for `scheduler:DeleteSchedule`.
10 *
11 * Pairs with {@link CreateSchedule} for the dynamic-scheduling pattern: a
12 * deployed Lambda deletes schedules it minted at runtime (cancel a reminder,
13 * clean up a completed one-shot). Optionally scoped to a `ScheduleGroup`;
14 * without one it covers the default group.
15 * ### Deleting Schedules At Runtime
16 * **Example:** Cancel A Reminder
17 * ```typescript
18 * const deleteSchedule = yield* AWS.Scheduler.DeleteSchedule();
19 *
20 * // runtime
21 * yield* deleteSchedule({ Name: `reminder-${userId}` }).pipe(
22 * // already gone — cancellation is idempotent
23 * Effect.catchTag("ResourceNotFoundException", () => Effect.void),
24 * );
25 * ```
26 *
27 * **Example:** Scope Deletion To A Schedule Group
28 * ```typescript
29 * const deleteSchedule = yield* AWS.Scheduler.DeleteSchedule(group);
30 * ```
31 *
32 * @binding
33 */
34 export interface DeleteSchedule extends Binding.Service<
35 DeleteSchedule,
36 "AWS.Scheduler.DeleteSchedule",
37 (
38 group?: ScheduleGroup,
39 ) => Effect.Effect<
40 (
41 request: DeleteScheduleRequest,
42 ) => Effect.Effect<scheduler.DeleteScheduleOutput, scheduler.DeleteScheduleError>
43 >
44 > {}
45 export const DeleteSchedule = Binding.Service<DeleteSchedule>("AWS.Scheduler.DeleteSchedule");