| 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:BatchUpdateSchedule`. |
| 8 | * |
| 9 | * Adds and/or removes schedule actions on the bound {@link Channel} — ad |
| 10 | * breaks (SCTE-35 splices), input switches, static image overlays, pause |
| 11 | * states — the primary data-plane API for driving a live broadcast (e.g. |
| 12 | * a playout-automation Lambda that switches inputs on a timecode). The |
| 13 | * channel id is injected from the binding. Provide the implementation |
| 14 | * with `Effect.provide(AWS.MediaLive.BatchUpdateScheduleHttp)`. |
| 15 | * ### Driving the Channel Schedule |
| 16 | * **Example:** Schedule an Input Switch |
| 17 | * ```typescript |
| 18 | * // init — bind the operation to the channel |
| 19 | * const updateSchedule = yield* AWS.MediaLive.BatchUpdateSchedule(channel); |
| 20 | * |
| 21 | * // runtime |
| 22 | * yield* updateSchedule({ |
| 23 | * Creates: { |
| 24 | * ScheduleActions: [ |
| 25 | * { |
| 26 | * ActionName: "switch-to-backup", |
| 27 | * ScheduleActionStartSettings: { |
| 28 | * FixedModeScheduleActionStartSettings: { |
| 29 | * Time: "2026-01-01T00:00:00.000Z", |
| 30 | * }, |
| 31 | * }, |
| 32 | * ScheduleActionSettings: { |
| 33 | * InputSwitchSettings: { InputAttachmentNameReference: "backup" }, |
| 34 | * }, |
| 35 | * }, |
| 36 | * ], |
| 37 | * }, |
| 38 | * }); |
| 39 | * ``` |
| 40 | * |
| 41 | * @binding |
| 42 | */ |
| 43 | export interface BatchUpdateSchedule extends Binding.Service< |
| 44 | BatchUpdateSchedule, |
| 45 | "AWS.MediaLive.BatchUpdateSchedule", |
| 46 | ( |
| 47 | channel: Channel, |
| 48 | ) => Effect.Effect< |
| 49 | ( |
| 50 | request?: Omit<medialive.BatchUpdateScheduleRequest, "ChannelId">, |
| 51 | ) => Effect.Effect< |
| 52 | medialive.BatchUpdateScheduleResponse, |
| 53 | medialive.BatchUpdateScheduleError |
| 54 | > |
| 55 | > |
| 56 | > {} |
| 57 | export const BatchUpdateSchedule = Binding.Service<BatchUpdateSchedule>( |
| 58 | "AWS.MediaLive.BatchUpdateSchedule", |
| 59 | ); |