1import type * as qapps from "@distilled.cloud/aws/qapps";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { QApp } from "./QApp.ts";
5
6/**
7 * Request for {@link StartQAppSession} — `instanceId` and `appId` are injected from the bound Q App.
8 */
9export interface StartQAppSessionRequest extends Omit<
10 qapps.StartQAppSessionInput,
11 "instanceId" | "appId"
12> {}
13
14/**
15 * Runtime binding for `qapps:StartQAppSession`.
16 *
17 * Starts a new session of the bound Q App, optionally seeding initial card values. Provide the implementation with
18 * `Effect.provide(AWS.QApps.StartQAppSessionHttp)`.
19 * ### Sessions
20 * **Example:** Start a Session
21 * ```typescript
22 * // init — bind the operation to the Q App
23 * const startQAppSession = yield* AWS.QApps.StartQAppSession(app);
24 *
25 * // runtime
26 * const session = yield* startQAppSession({ appVersion: 1 });
27 * console.log(session.sessionId);
28 * ```
29 *
30 * @binding
31 */
32export interface StartQAppSession extends Binding.Service<
33 StartQAppSession,
34 "AWS.QApps.StartQAppSession",
35 (
36 app: QApp,
37 ) => Effect.Effect<
38 (
39 request: StartQAppSessionRequest,
40 ) => Effect.Effect<
41 qapps.StartQAppSessionOutput,
42 qapps.StartQAppSessionError
43 >
44 >
45> {}
46
47export const StartQAppSession = Binding.Service<StartQAppSession>(
48 "AWS.QApps.StartQAppSession",
49);