| 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:DescribeChannel`. |
| 8 | * |
| 9 | * Reads the bound {@link Channel}'s live state — lifecycle state |
| 10 | * (`IDLE`/`RUNNING`), pipeline details, egress endpoints, and attached |
| 11 | * inputs — e.g. for an operations dashboard or a scheduler that only |
| 12 | * starts a channel that is not already running. The channel id is |
| 13 | * injected from the binding. Provide the implementation with |
| 14 | * `Effect.provide(AWS.MediaLive.DescribeChannelHttp)`. |
| 15 | * ### Observing Channels |
| 16 | * **Example:** Read the Channel's Current State |
| 17 | * ```typescript |
| 18 | * // init — bind the operation to the channel |
| 19 | * const describeChannel = yield* AWS.MediaLive.DescribeChannel(channel); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const { State } = yield* describeChannel(); |
| 23 | * const running = State === "RUNNING"; |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface DescribeChannel extends Binding.Service< |
| 29 | DescribeChannel, |
| 30 | "AWS.MediaLive.DescribeChannel", |
| 31 | ( |
| 32 | channel: Channel, |
| 33 | ) => Effect.Effect< |
| 34 | () => Effect.Effect< |
| 35 | medialive.DescribeChannelResponse, |
| 36 | medialive.DescribeChannelError |
| 37 | > |
| 38 | > |
| 39 | > {} |
| 40 | export const DescribeChannel = Binding.Service<DescribeChannel>( |
| 41 | "AWS.MediaLive.DescribeChannel", |
| 42 | ); |