sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ MediaLive/ DescribeChannel.ts

import type * as medialive from "@distilled.cloud/aws/medialive";
import * as Binding from "alchemy/Binding";
import type * as Effect from "effect/Effect";
import type { Channel } from "./Channel.ts";

/**
 * Runtime binding for `medialive:DescribeChannel`.
 *
 * Reads the bound {@link Channel}'s live state — lifecycle state
 * (`IDLE`/`RUNNING`), pipeline details, egress endpoints, and attached
 * inputs — e.g. for an operations dashboard or a scheduler that only
 * starts a channel that is not already running. The channel id is
 * injected from the binding. Provide the implementation with
 * `Effect.provide(AWS.MediaLive.DescribeChannelHttp)`.
 * ### Observing Channels
 * **Example:** Read the Channel's Current State
 * ```typescript
 * // init — bind the operation to the channel
 * const describeChannel = yield* AWS.MediaLive.DescribeChannel(channel);
 *
 * // runtime
 * const { State } = yield* describeChannel();
 * const running = State === "RUNNING";
 * ```
 *
 * @binding
 */
export interface DescribeChannel extends Binding.Service<
  DescribeChannel,
  "AWS.MediaLive.DescribeChannel",
  (
    channel: Channel,
  ) => Effect.Effect<
    () => Effect.Effect<medialive.DescribeChannelResponse, medialive.DescribeChannelError>
  >
> {}
export const DescribeChannel = Binding.Service<DescribeChannel>("AWS.MediaLive.DescribeChannel");