| 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:CreateIngestion`. |
| 8 | * |
| 9 | * Triggers a SPICE refresh (ingestion) of the bound {@link DataSet} — e.g. |
| 10 | * after a pipeline lands new data. `AwsAccountId` and `DataSetId` are |
| 11 | * injected from the binding; the caller supplies a unique `IngestionId`. |
| 12 | * Poll the refresh with |
| 13 | * {@link DescribeIngestion | AWS.QuickSight.DescribeIngestion}. Provide the |
| 14 | * implementation with `Effect.provide(AWS.QuickSight.CreateIngestionHttp)`. |
| 15 | * ### Refreshing SPICE Data |
| 16 | * **Example:** Trigger A Full Refresh |
| 17 | * ```typescript |
| 18 | * // init — bind the operation to the dataset |
| 19 | * const createIngestion = yield* AWS.QuickSight.CreateIngestion(dataSet); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const { IngestionId, IngestionStatus } = yield* createIngestion({ |
| 23 | * IngestionId: crypto.randomUUID(), |
| 24 | * IngestionType: "FULL_REFRESH", |
| 25 | * }); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface CreateIngestion extends Binding.Service< |
| 31 | CreateIngestion, |
| 32 | "AWS.QuickSight.CreateIngestion", |
| 33 | ( |
| 34 | dataSet: DataSet, |
| 35 | ) => Effect.Effect< |
| 36 | ( |
| 37 | request: Omit< |
| 38 | quicksight.CreateIngestionRequest, |
| 39 | "AwsAccountId" | "DataSetId" |
| 40 | >, |
| 41 | ) => Effect.Effect< |
| 42 | quicksight.CreateIngestionResponse, |
| 43 | quicksight.CreateIngestionError |
| 44 | > |
| 45 | > |
| 46 | > {} |
| 47 | export const CreateIngestion = Binding.Service<CreateIngestion>( |
| 48 | "AWS.QuickSight.CreateIngestion", |
| 49 | ); |