| 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 { Input } from "./Input.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `medialive:DescribeInput`. |
| 8 | * |
| 9 | * Reads the bound {@link Input}'s live state — attachment state |
| 10 | * (`DETACHED`/`ATTACHED`), resolved push ingest URLs, sources, and |
| 11 | * security groups — e.g. so a stream-key service can hand a contributor |
| 12 | * the RTMP endpoint to push to. The input id is injected from the |
| 13 | * binding. Provide the implementation with |
| 14 | * `Effect.provide(AWS.MediaLive.DescribeInputHttp)`. |
| 15 | * ### Observing Inputs |
| 16 | * **Example:** Read the Input's Ingest Endpoints |
| 17 | * ```typescript |
| 18 | * // init — bind the operation to the input |
| 19 | * const describeInput = yield* AWS.MediaLive.DescribeInput(input); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const { Destinations } = yield* describeInput(); |
| 23 | * const ingestUrl = Destinations?.[0]?.Url; |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface DescribeInput extends Binding.Service< |
| 29 | DescribeInput, |
| 30 | "AWS.MediaLive.DescribeInput", |
| 31 | ( |
| 32 | input: Input, |
| 33 | ) => Effect.Effect< |
| 34 | () => Effect.Effect< |
| 35 | medialive.DescribeInputResponse, |
| 36 | medialive.DescribeInputError |
| 37 | > |
| 38 | > |
| 39 | > {} |
| 40 | export const DescribeInput = Binding.Service<DescribeInput>( |
| 41 | "AWS.MediaLive.DescribeInput", |
| 42 | ); |