1import type * as ivs from "@distilled.cloud/aws/ivs";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Channel } from "./Channel.ts";
5
6export interface GetStreamSessionRequest extends Omit<
7 ivs.GetStreamSessionRequest,
8 "channelArn"
9> {}
10
11/**
12 * Runtime binding for `ivs:GetStreamSession`.
13 *
14 * Reads the metadata of a specific stream session on the bound
15 * {@link Channel} — ingest configuration, recording details, and the
16 * session's truncated event log. Omit `streamId` to read the most recent
17 * session. The channel ARN is injected from the binding. Provide the
18 * implementation with `Effect.provide(AWS.IVS.GetStreamSessionHttp)`.
19 * ### Monitoring Live Streams
20 * **Example:** Inspect the Latest Broadcast Session
21 * ```typescript
22 * // init — bind the operation to the channel
23 * const getStreamSession = yield* AWS.IVS.GetStreamSession(channel);
24 *
25 * // runtime
26 * const { streamSession } = yield* getStreamSession({});
27 * yield* Effect.log(`codec: ${streamSession?.ingestConfiguration?.video?.codec}`);
28 * ```
29 *
30 * @binding
31 */
32export interface GetStreamSession extends Binding.Service<
33 GetStreamSession,
34 "AWS.IVS.GetStreamSession",
35 (
36 channel: Channel,
37 ) => Effect.Effect<
38 (
39 request?: GetStreamSessionRequest,
40 ) => Effect.Effect<ivs.GetStreamSessionResponse, ivs.GetStreamSessionError>
41 >
42> {}
43export const GetStreamSession = Binding.Service<GetStreamSession>(
44 "AWS.IVS.GetStreamSession",
45);