| 1 | import type * as SVC from "@distilled.cloud/aws/codepipeline"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Pipeline } from "./Pipeline.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `codepipeline:GetPipelineState` — returns the current |
| 8 | * state of every stage and action in the pipeline, including in-flight |
| 9 | * executions, transition states, and manual-approval tokens. |
| 10 | * ### Observing Pipelines |
| 11 | * **Example:** Read the Pipeline State |
| 12 | * ```typescript |
| 13 | * const getState = yield* AWS.CodePipeline.GetPipelineState(pipeline); |
| 14 | * |
| 15 | * const state = yield* getState(); |
| 16 | * const approval = state.stageStates |
| 17 | * ?.find((s) => s.stageName === "Approve") |
| 18 | * ?.actionStates?.find((a) => a.actionName === "ManualApproval"); |
| 19 | * ``` |
| 20 | * |
| 21 | * @binding |
| 22 | */ |
| 23 | export interface GetPipelineState extends Binding.Service< |
| 24 | GetPipelineState, |
| 25 | "AWS.CodePipeline.GetPipelineState", |
| 26 | <P extends Pipeline>( |
| 27 | pipeline: P, |
| 28 | ) => Effect.Effect< |
| 29 | () => Effect.Effect<SVC.GetPipelineStateOutput, SVC.GetPipelineStateError> |
| 30 | > |
| 31 | > {} |
| 32 | export const GetPipelineState = Binding.Service<GetPipelineState>( |
| 33 | "AWS.CodePipeline.GetPipelineState", |
| 34 | ); |