1import type * as quicksight from "@distilled.cloud/aws/quicksight";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import 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 */
33export interface DescribeDashboardSnapshotJob extends Binding.Service<
34 DescribeDashboardSnapshotJob,
35 "AWS.QuickSight.DescribeDashboardSnapshotJob",
36 (
37 dashboard: Dashboard,
38 ) => Effect.Effect<
39 (
40 request: Omit<
41 quicksight.DescribeDashboardSnapshotJobRequest,
42 "AwsAccountId" | "DashboardId"
43 >,
44 ) => Effect.Effect<
45 quicksight.DescribeDashboardSnapshotJobResponse,
46 quicksight.DescribeDashboardSnapshotJobError
47 >
48 >
49> {}
50export const DescribeDashboardSnapshotJob =
51 Binding.Service<DescribeDashboardSnapshotJob>(
52 "AWS.QuickSight.DescribeDashboardSnapshotJob",
53 );