sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ QuickSight/ CreateIngestion.ts

import type * as quicksight from "@distilled.cloud/aws/quicksight";
import * as Binding from "alchemy/Binding";
import type * as Effect from "effect/Effect";
import type { DataSet } from "./DataSet.ts";

/**
 * Runtime binding for `quicksight:CreateIngestion`.
 *
 * Triggers a SPICE refresh (ingestion) of the bound {@link DataSet} — e.g.
 * after a pipeline lands new data. `AwsAccountId` and `DataSetId` are
 * injected from the binding; the caller supplies a unique `IngestionId`.
 * Poll the refresh with
 * {@link DescribeIngestion | AWS.QuickSight.DescribeIngestion}. Provide the
 * implementation with `Effect.provide(AWS.QuickSight.CreateIngestionHttp)`.
 * ### Refreshing SPICE Data
 * **Example:** Trigger A Full Refresh
 * ```typescript
 * // init — bind the operation to the dataset
 * const createIngestion = yield* AWS.QuickSight.CreateIngestion(dataSet);
 *
 * // runtime
 * const { IngestionId, IngestionStatus } = yield* createIngestion({
 *   IngestionId: crypto.randomUUID(),
 *   IngestionType: "FULL_REFRESH",
 * });
 * ```
 *
 * @binding
 */
export interface CreateIngestion extends Binding.Service<
  CreateIngestion,
  "AWS.QuickSight.CreateIngestion",
  (
    dataSet: DataSet,
  ) => Effect.Effect<
    (
      request: Omit<quicksight.CreateIngestionRequest, "AwsAccountId" | "DataSetId">,
    ) => Effect.Effect<quicksight.CreateIngestionResponse, quicksight.CreateIngestionError>
  >
> {}
export const CreateIngestion = Binding.Service<CreateIngestion>("AWS.QuickSight.CreateIngestion");