| 1 | import type * as mediaconnect from "@distilled.cloud/aws/mediaconnect"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Flow } from "./Flow.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `mediaconnect:StopFlow`. |
| 8 | * |
| 9 | * Stops the bound {@link Flow}, transitioning it from `ACTIVE` through |
| 10 | * `STOPPING` back to `STANDBY` (where it no longer bills for transport). |
| 11 | * Stopping a flow that is not running fails with the typed |
| 12 | * `BadRequestException` tag. The flow ARN is injected from the binding. |
| 13 | * Provide the implementation with |
| 14 | * `Effect.provide(AWS.MediaConnect.StopFlowHttp)`. |
| 15 | * ### Controlling Flows |
| 16 | * **Example:** Stop the Flow After the Broadcast |
| 17 | * ```typescript |
| 18 | * // init — bind the operation to the flow |
| 19 | * const stopFlow = yield* AWS.MediaConnect.StopFlow(flow); |
| 20 | * |
| 21 | * // runtime — a flow that is already in STANDBY answers with the typed |
| 22 | * // BadRequestException tag |
| 23 | * yield* stopFlow().pipe( |
| 24 | * Effect.catchTag("BadRequestException", () => Effect.void), |
| 25 | * ); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface StopFlow extends Binding.Service< |
| 31 | StopFlow, |
| 32 | "AWS.MediaConnect.StopFlow", |
| 33 | ( |
| 34 | flow: Flow, |
| 35 | ) => Effect.Effect< |
| 36 | () => Effect.Effect< |
| 37 | mediaconnect.StopFlowResponse, |
| 38 | mediaconnect.StopFlowError |
| 39 | > |
| 40 | > |
| 41 | > {} |
| 42 | export const StopFlow = Binding.Service<StopFlow>("AWS.MediaConnect.StopFlow"); |