1import type * as medialive from "@distilled.cloud/aws/medialive";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Channel } from "./Channel.ts";
5
6/**
7 * Runtime binding for `medialive:StartChannel`.
8 *
9 * Starts the bound {@link Channel}, transitioning it from `IDLE` through
10 * `STARTING` to `RUNNING`. A RUNNING channel encodes and bills hourly —
11 * pair with {@link StopChannel} to control encoding cost (e.g. a
12 * scheduler Lambda that runs the channel only during broadcast windows).
13 * The channel id is injected from the binding. Provide the implementation
14 * with `Effect.provide(AWS.MediaLive.StartChannelHttp)`.
15 * ### Controlling Channels
16 * **Example:** Start the Channel for a Broadcast Window
17 * ```typescript
18 * // init — bind the operation to the channel
19 * const startChannel = yield* AWS.MediaLive.StartChannel(channel);
20 *
21 * // runtime
22 * const { State } = yield* startChannel();
23 * ```
24 *
25 * @binding
26 */
27export interface StartChannel extends Binding.Service<
28 StartChannel,
29 "AWS.MediaLive.StartChannel",
30 (
31 channel: Channel,
32 ) => Effect.Effect<
33 () => Effect.Effect<
34 medialive.StartChannelResponse,
35 medialive.StartChannelError
36 >
37 >
38> {}
39export const StartChannel = Binding.Service<StartChannel>(
40 "AWS.MediaLive.StartChannel",
41);