@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 40 lines 1.36 KB
Raw
1 import type * as ivs from "@distilled.cloud/aws/ivs";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Channel } from "./Channel.ts";
5
6 export interface InsertAdBreakRequest extends Omit<ivs.InsertAdBreakRequest, "channelArn"> {}
7
8 /**
9 * Runtime binding for `ivs:InsertAdBreak`.
10 *
11 * Triggers a server-side ad break of the requested duration in the bound
12 * {@link Channel}'s active stream (the channel must have an ad
13 * configuration attached). Fails with the typed `ChannelNotBroadcasting`
14 * tag when the channel is not live. The channel ARN is injected from the
15 * binding. Provide the implementation with
16 * `Effect.provide(AWS.IVS.InsertAdBreakHttp)`.
17 * ### Inserting Ad Breaks
18 * **Example:** Trigger a 30-Second Ad Break
19 * ```typescript
20 * // init — bind the operation to the channel
21 * const insertAdBreak = yield* AWS.IVS.InsertAdBreak(channel);
22 *
23 * // runtime
24 * const { adBreakId } = yield* insertAdBreak({ durationSeconds: 30 });
25 * ```
26 *
27 * @binding
28 */
29 export interface InsertAdBreak extends Binding.Service<
30 InsertAdBreak,
31 "AWS.IVS.InsertAdBreak",
32 (
33 channel: Channel,
34 ) => Effect.Effect<
35 (
36 request: InsertAdBreakRequest,
37 ) => Effect.Effect<ivs.InsertAdBreakResponse, ivs.InsertAdBreakError>
38 >
39 > {}
40 export const InsertAdBreak = Binding.Service<InsertAdBreak>("AWS.IVS.InsertAdBreak");