| 1 | import type * as medialive from "@distilled.cloud/aws/medialive"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Channel } from "./Channel.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `medialive:StopChannel`. |
| 8 | * |
| 9 | * Stops the bound {@link Channel}, transitioning it from `RUNNING` |
| 10 | * through `STOPPING` back to `IDLE` — the other half of a broadcast-window |
| 11 | * scheduler built on {@link StartChannel}. Stopping a channel that is not |
| 12 | * running fails with the typed `ConflictException` tag. The channel id is |
| 13 | * injected from the binding. Provide the implementation with |
| 14 | * `Effect.provide(AWS.MediaLive.StopChannelHttp)`. |
| 15 | * ### Controlling Channels |
| 16 | * **Example:** Stop the Channel After the Broadcast |
| 17 | * ```typescript |
| 18 | * // init — bind the operation to the channel |
| 19 | * const stopChannel = yield* AWS.MediaLive.StopChannel(channel); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const { State } = yield* stopChannel(); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface StopChannel extends Binding.Service< |
| 28 | StopChannel, |
| 29 | "AWS.MediaLive.StopChannel", |
| 30 | ( |
| 31 | channel: Channel, |
| 32 | ) => Effect.Effect< |
| 33 | () => Effect.Effect< |
| 34 | medialive.StopChannelResponse, |
| 35 | medialive.StopChannelError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | export const StopChannel = Binding.Service<StopChannel>( |
| 40 | "AWS.MediaLive.StopChannel", |
| 41 | ); |