| 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 | |
| 5 | /** |
| 6 | * Runtime binding for `medialive:ListChannels`. |
| 7 | * |
| 8 | * Enumerates the account's MediaLive channels (one page per call — pass |
| 9 | * `NextToken` from the previous response to continue) — e.g. a cost |
| 10 | * sentinel that finds channels left RUNNING outside broadcast hours. |
| 11 | * Account-level: the deploy-time grant is `medialive:ListChannels` on |
| 12 | * `*`. Provide the implementation with |
| 13 | * `Effect.provide(AWS.MediaLive.ListChannelsHttp)`. |
| 14 | * ### Observing Channels |
| 15 | * **Example:** Find Channels Left Running |
| 16 | * ```typescript |
| 17 | * // init — bind the account-level operation |
| 18 | * const listChannels = yield* AWS.MediaLive.ListChannels(); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const { Channels } = yield* listChannels({ MaxResults: 20 }); |
| 22 | * const running = (Channels ?? []).filter((c) => c.State === "RUNNING"); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface ListChannels extends Binding.Service< |
| 28 | ListChannels, |
| 29 | "AWS.MediaLive.ListChannels", |
| 30 | () => Effect.Effect< |
| 31 | ( |
| 32 | request?: medialive.ListChannelsRequest, |
| 33 | ) => Effect.Effect< |
| 34 | medialive.ListChannelsResponse, |
| 35 | medialive.ListChannelsError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | export const ListChannels = Binding.Service<ListChannels>( |
| 40 | "AWS.MediaLive.ListChannels", |
| 41 | ); |