| 1 | import type * as ivs from "@distilled.cloud/aws/ivs"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Channel } from "./Channel.ts"; |
| 5 | |
| 6 | export interface StartViewerSessionRevocationRequest extends Omit< |
| 7 | ivs.StartViewerSessionRevocationRequest, |
| 8 | "channelArn" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `ivs:StartViewerSessionRevocation`. |
| 13 | * |
| 14 | * Starts revoking the viewer session for a given viewer ID on the bound |
| 15 | * {@link Channel} — used with private channels to eject a viewer whose |
| 16 | * playback authorization token carries that `viewerId`. Optionally revoke |
| 17 | * every session at or below a token version. The channel ARN is injected |
| 18 | * from the binding. Provide the implementation with |
| 19 | * `Effect.provide(AWS.IVS.StartViewerSessionRevocationHttp)`. |
| 20 | * ### Revoking Viewer Sessions |
| 21 | * **Example:** Eject a Banned Viewer |
| 22 | * ```typescript |
| 23 | * // init — bind the operation to the channel |
| 24 | * const revokeViewerSession = yield* AWS.IVS.StartViewerSessionRevocation(channel); |
| 25 | * |
| 26 | * // runtime |
| 27 | * yield* revokeViewerSession({ viewerId: "user-123" }); |
| 28 | * ``` |
| 29 | * |
| 30 | * @binding |
| 31 | */ |
| 32 | export interface StartViewerSessionRevocation extends Binding.Service< |
| 33 | StartViewerSessionRevocation, |
| 34 | "AWS.IVS.StartViewerSessionRevocation", |
| 35 | ( |
| 36 | channel: Channel, |
| 37 | ) => Effect.Effect< |
| 38 | ( |
| 39 | request: StartViewerSessionRevocationRequest, |
| 40 | ) => Effect.Effect< |
| 41 | ivs.StartViewerSessionRevocationResponse, |
| 42 | ivs.StartViewerSessionRevocationError |
| 43 | > |
| 44 | > |
| 45 | > {} |
| 46 | export const StartViewerSessionRevocation = |
| 47 | Binding.Service<StartViewerSessionRevocation>( |
| 48 | "AWS.IVS.StartViewerSessionRevocation", |
| 49 | ); |