@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 49 lines 1.7 KB
Raw
1 import type * as quicksight from "@distilled.cloud/aws/quicksight";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Dashboard } from "./Dashboard.ts";
5
6 /**
7 * Runtime binding for `quicksight:DescribeDashboardSnapshotJob`.
8 *
9 * Reads the status (`QUEUED`, `RUNNING`, `COMPLETED`, `FAILED`) and
10 * configuration of a snapshot job started on the bound {@link Dashboard}.
11 * `AwsAccountId` and `DashboardId` are injected from the binding. Provide the
12 * implementation with
13 * `Effect.provide(AWS.QuickSight.DescribeDashboardSnapshotJobHttp)`.
14 * ### Dashboard Snapshots
15 * **Example:** Poll A Snapshot Job Until It Completes
16 * ```typescript
17 * // init — bind the operation to the dashboard
18 * const describeSnapshotJob =
19 * yield* AWS.QuickSight.DescribeDashboardSnapshotJob(dashboard);
20 *
21 * // runtime
22 * const job = yield* describeSnapshotJob({ SnapshotJobId: jobId }).pipe(
23 * Effect.repeat({
24 * schedule: Schedule.spaced("5 seconds"),
25 * until: (j) => j.JobStatus === "COMPLETED" || j.JobStatus === "FAILED",
26 * times: 24,
27 * }),
28 * );
29 * ```
30 *
31 * @binding
32 */
33 export interface DescribeDashboardSnapshotJob extends Binding.Service<
34 DescribeDashboardSnapshotJob,
35 "AWS.QuickSight.DescribeDashboardSnapshotJob",
36 (
37 dashboard: Dashboard,
38 ) => Effect.Effect<
39 (
40 request: Omit<quicksight.DescribeDashboardSnapshotJobRequest, "AwsAccountId" | "DashboardId">,
41 ) => Effect.Effect<
42 quicksight.DescribeDashboardSnapshotJobResponse,
43 quicksight.DescribeDashboardSnapshotJobError
44 >
45 >
46 > {}
47 export const DescribeDashboardSnapshotJob = Binding.Service<DescribeDashboardSnapshotJob>(
48 "AWS.QuickSight.DescribeDashboardSnapshotJob",
49 );