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 GetLibraryItem} — `instanceId` is injected from the bound Q App.
8 */
9export interface GetLibraryItemRequest extends Omit<
10 qapps.GetLibraryItemInput,
11 "instanceId"
12> {}
13
14/**
15 * Runtime binding for `qapps:GetLibraryItem`.
16 *
17 * Retrieves a library item — its published app version, categories, status, and rating counts. Provide the implementation with
18 * `Effect.provide(AWS.QApps.GetLibraryItemHttp)`.
19 * ### Library Items
20 * **Example:** Read a Library Item
21 * ```typescript
22 * // init — bind the operation to the Q App
23 * const getLibraryItem = yield* AWS.QApps.GetLibraryItem(app);
24 *
25 * // runtime
26 * const item = yield* getLibraryItem({ libraryItemId });
27 * console.log(item.ratingCount);
28 * ```
29 *
30 * @binding
31 */
32export interface GetLibraryItem extends Binding.Service<
33 GetLibraryItem,
34 "AWS.QApps.GetLibraryItem",
35 (
36 app: QApp,
37 ) => Effect.Effect<
38 (
39 request: GetLibraryItemRequest,
40 ) => Effect.Effect<qapps.GetLibraryItemOutput, qapps.GetLibraryItemError>
41 >
42> {}
43
44export const GetLibraryItem = Binding.Service<GetLibraryItem>(
45 "AWS.QApps.GetLibraryItem",
46);