1import type * as ivsrealtime from "@distilled.cloud/aws/ivs-realtime";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Stage } from "./Stage.ts";
5
6/** The `stageArn` is injected by the binding from the bound stage. */
7export interface GetParticipantRequest extends Omit<
8 ivsrealtime.GetParticipantRequest,
9 "stageArn"
10> {}
11
12/**
13 * Read a participant's detail (state, join time, attributes, publish state,
14 * recording state, connection metadata) for a session of the bound stage.
15 *
16 * ### Inspecting Participants
17 * **Example:** Look up a participant
18 * ```typescript
19 * // init
20 * const getParticipant = yield* IVSRealtime.GetParticipant(stage);
21 *
22 * // runtime
23 * const { participant } = yield* getParticipant({
24 * sessionId: "st-a1b2c3d4e5f6",
25 * participantId: "abcDEF123",
26 * });
27 * ```
28 *
29 * @binding
30 */
31export interface GetParticipant extends Binding.Service<
32 GetParticipant,
33 "AWS.IVSRealtime.GetParticipant",
34 (
35 stage: Stage,
36 ) => Effect.Effect<
37 (
38 request: GetParticipantRequest,
39 ) => Effect.Effect<
40 ivsrealtime.GetParticipantResponse,
41 ivsrealtime.GetParticipantError
42 >
43 >
44> {}
45export const GetParticipant = Binding.Service<GetParticipant>(
46 "AWS.IVSRealtime.GetParticipant",
47);