| 1 | import type * as osis from "@distilled.cloud/aws/osis"; |
| 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 `osis:StopPipeline`. |
| 8 | * |
| 9 | * Stops the bound {@link Pipeline} — ingestion halts and OCU billing stops |
| 10 | * (persistent-buffer storage is retained) — e.g. pausing a non-production |
| 11 | * pipeline outside working hours. The pipeline name is injected from the |
| 12 | * binding. Provide the implementation with |
| 13 | * `Effect.provide(AWS.OSIS.StopPipelineHttp)`. |
| 14 | * ### Controlling a Pipeline |
| 15 | * **Example:** Pause Ingestion |
| 16 | * ```typescript |
| 17 | * // init — bind the operation to the pipeline |
| 18 | * const stopPipeline = yield* AWS.OSIS.StopPipeline(pipeline); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const { Pipeline } = yield* stopPipeline(); |
| 22 | * // Pipeline?.Status === "STOPPING" |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface StopPipeline extends Binding.Service< |
| 28 | StopPipeline, |
| 29 | "AWS.OSIS.StopPipeline", |
| 30 | ( |
| 31 | pipeline: Pipeline, |
| 32 | ) => Effect.Effect< |
| 33 | () => Effect.Effect<osis.StopPipelineResponse, osis.StopPipelineError> |
| 34 | > |
| 35 | > {} |
| 36 | export const StopPipeline = Binding.Service<StopPipeline>( |
| 37 | "AWS.OSIS.StopPipeline", |
| 38 | ); |