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 UpdateQAppSession} — `instanceId` is injected from the bound Q App.
8 */
9export interface UpdateQAppSessionRequest extends Omit<
10 qapps.UpdateQAppSessionInput,
11 "instanceId" | "appId"
12> {}
13
14/**
15 * Runtime binding for `qapps:UpdateQAppSession`.
16 *
17 * Submits new card values into a running Q App session (e.g. answers a text-input card). Provide the implementation with
18 * `Effect.provide(AWS.QApps.UpdateQAppSessionHttp)`.
19 * ### Sessions
20 * **Example:** Submit Card Values
21 * ```typescript
22 * // init — bind the operation to the Q App
23 * const updateQAppSession = yield* AWS.QApps.UpdateQAppSession(app);
24 *
25 * // runtime
26 * yield* updateQAppSession({
27 * sessionId,
28 * values: [{ cardId, value: "Hello, Q Apps!" }],
29 * });
30 * ```
31 *
32 * @binding
33 */
34export interface UpdateQAppSession extends Binding.Service<
35 UpdateQAppSession,
36 "AWS.QApps.UpdateQAppSession",
37 (
38 app: QApp,
39 ) => Effect.Effect<
40 (
41 request: UpdateQAppSessionRequest,
42 ) => Effect.Effect<
43 qapps.UpdateQAppSessionOutput,
44 qapps.UpdateQAppSessionError
45 >
46 >
47> {}
48
49export const UpdateQAppSession = Binding.Service<UpdateQAppSession>(
50 "AWS.QApps.UpdateQAppSession",
51);