| 1 | import type * as ivsrealtime from "@distilled.cloud/aws/ivs-realtime"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Stage } from "./Stage.ts"; |
| 5 | |
| 6 | /** The `stageArn` is injected by the binding from the bound stage. */ |
| 7 | export interface ListParticipantsRequest extends Omit< |
| 8 | ivsrealtime.ListParticipantsRequest, |
| 9 | "stageArn" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * List all participants in a session of the bound stage, optionally |
| 14 | * filtered by user id, publish state, connection state, or recording state. |
| 15 | * |
| 16 | * ### Inspecting Participants |
| 17 | * **Example:** List a session's participants |
| 18 | * ```typescript |
| 19 | * // init |
| 20 | * const listParticipants = yield* IVSRealtime.ListParticipants(stage); |
| 21 | * |
| 22 | * // runtime |
| 23 | * const { participants } = yield* listParticipants({ |
| 24 | * sessionId: "st-a1b2c3d4e5f6", |
| 25 | * filterByPublished: true, |
| 26 | * }); |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | */ |
| 31 | export interface ListParticipants extends Binding.Service< |
| 32 | ListParticipants, |
| 33 | "AWS.IVSRealtime.ListParticipants", |
| 34 | ( |
| 35 | stage: Stage, |
| 36 | ) => Effect.Effect< |
| 37 | ( |
| 38 | request: ListParticipantsRequest, |
| 39 | ) => Effect.Effect< |
| 40 | ivsrealtime.ListParticipantsResponse, |
| 41 | ivsrealtime.ListParticipantsError |
| 42 | > |
| 43 | > |
| 44 | > {} |
| 45 | export const ListParticipants = Binding.Service<ListParticipants>( |
| 46 | "AWS.IVSRealtime.ListParticipants", |
| 47 | ); |