1import type * as mediaconnect from "@distilled.cloud/aws/mediaconnect";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import 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 */
30export 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> {}
42export const StopFlow = Binding.Service<StopFlow>("AWS.MediaConnect.StopFlow");