| 1 | import type * as quicksight from "@distilled.cloud/aws/quicksight"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { DataSet } from "./DataSet.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `quicksight:DescribeIngestion`. |
| 8 | * |
| 9 | * Reads the status, row counts, and error info of a SPICE ingestion on the |
| 10 | * bound {@link DataSet}. `AwsAccountId` and `DataSetId` are injected from |
| 11 | * the binding. Provide the implementation with |
| 12 | * `Effect.provide(AWS.QuickSight.DescribeIngestionHttp)`. |
| 13 | * ### Refreshing SPICE Data |
| 14 | * **Example:** Poll An Ingestion Until It Settles |
| 15 | * ```typescript |
| 16 | * // init — bind the operation to the dataset |
| 17 | * const describeIngestion = yield* AWS.QuickSight.DescribeIngestion(dataSet); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const { Ingestion } = yield* describeIngestion({ |
| 21 | * IngestionId: ingestionId, |
| 22 | * }).pipe( |
| 23 | * Effect.repeat({ |
| 24 | * schedule: Schedule.spaced("5 seconds"), |
| 25 | * until: (r) => |
| 26 | * r.Ingestion?.IngestionStatus === "COMPLETED" || |
| 27 | * r.Ingestion?.IngestionStatus === "FAILED", |
| 28 | * times: 24, |
| 29 | * }), |
| 30 | * ); |
| 31 | * ``` |
| 32 | * |
| 33 | * @binding |
| 34 | */ |
| 35 | export interface DescribeIngestion extends Binding.Service< |
| 36 | DescribeIngestion, |
| 37 | "AWS.QuickSight.DescribeIngestion", |
| 38 | ( |
| 39 | dataSet: DataSet, |
| 40 | ) => Effect.Effect< |
| 41 | ( |
| 42 | request: Omit< |
| 43 | quicksight.DescribeIngestionRequest, |
| 44 | "AwsAccountId" | "DataSetId" |
| 45 | >, |
| 46 | ) => Effect.Effect< |
| 47 | quicksight.DescribeIngestionResponse, |
| 48 | quicksight.DescribeIngestionError |
| 49 | > |
| 50 | > |
| 51 | > {} |
| 52 | export const DescribeIngestion = Binding.Service<DescribeIngestion>( |
| 53 | "AWS.QuickSight.DescribeIngestion", |
| 54 | ); |