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

main
ts 41 lines 1.42 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 PutMetadataRequest extends Omit<ivs.PutMetadataRequest, "channelArn"> {}
7
8 /**
9 * Runtime binding for `ivs:PutMetadata`.
10 *
11 * Inserts timed metadata (max 1 KB) into the bound {@link Channel}'s
12 * active stream — the payload is embedded in the video and surfaced to
13 * players in sync with playback. Fails with the typed
14 * `ChannelNotBroadcasting` tag when the channel is not live. At most 5
15 * requests per second per channel. The channel ARN is injected from the
16 * binding. Provide the implementation with
17 * `Effect.provide(AWS.IVS.PutMetadataHttp)`.
18 * ### Embedding Timed Metadata
19 * **Example:** Push a Poll Question to Viewers
20 * ```typescript
21 * // init — bind the operation to the channel
22 * const putMetadata = yield* AWS.IVS.PutMetadata(channel);
23 *
24 * // runtime
25 * yield* putMetadata({
26 * metadata: JSON.stringify({ question: "Who wins?", options: ["A", "B"] }),
27 * });
28 * ```
29 *
30 * @binding
31 */
32 export interface PutMetadata extends Binding.Service<
33 PutMetadata,
34 "AWS.IVS.PutMetadata",
35 (
36 channel: Channel,
37 ) => Effect.Effect<
38 (request: PutMetadataRequest) => Effect.Effect<ivs.PutMetadataResponse, ivs.PutMetadataError>
39 >
40 > {}
41 export const PutMetadata = Binding.Service<PutMetadata>("AWS.IVS.PutMetadata");