sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ OSIS/ GetPipelineChangeProgress.ts

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

/**
 * Runtime binding for `osis:GetPipelineChangeProgress`.
 *
 * Reads progress information for the current change happening on the bound
 * {@link Pipeline} (stage-by-stage status while the pipeline is being
 * created) — useful for surfacing provisioning progress in an operational
 * dashboard. The pipeline name is injected from the binding. Provide the
 * implementation with `Effect.provide(AWS.OSIS.GetPipelineChangeProgressHttp)`.
 * ### Monitoring a Pipeline
 * **Example:** Report Creation Progress
 * ```typescript
 * // init — bind the operation to the pipeline
 * const getChangeProgress = yield* AWS.OSIS.GetPipelineChangeProgress(pipeline);
 *
 * // runtime
 * const { ChangeProgressStatuses } = yield* getChangeProgress();
 * for (const status of ChangeProgressStatuses ?? []) {
 *   yield* Effect.log(`${status.Status}: ${status.ChangeProgressStages?.length} stages`);
 * }
 * ```
 *
 * @binding
 */
export interface GetPipelineChangeProgress extends Binding.Service<
  GetPipelineChangeProgress,
  "AWS.OSIS.GetPipelineChangeProgress",
  (
    pipeline: Pipeline,
  ) => Effect.Effect<
    () => Effect.Effect<osis.GetPipelineChangeProgressResponse, osis.GetPipelineChangeProgressError>
  >
> {}
export const GetPipelineChangeProgress = Binding.Service<GetPipelineChangeProgress>(
  "AWS.OSIS.GetPipelineChangeProgress",
);