1import type * as kv from "@distilled.cloud/aws/kinesis-video";
2import type * as kvam from "@distilled.cloud/aws/kinesis-video-archived-media";
3import type * as Effect from "effect/Effect";
4import * as Binding from "../../Binding.ts";
5import type { Stream } from "./Stream.ts";
6
7export interface GetImagesRequest extends Omit<
8 kvam.GetImagesInput,
9 "StreamName" | "StreamARN"
10> {}
11
12/**
13 * Runtime binding for `kinesisvideo:GetImages` (archived media data plane).
14 *
15 * Bind this operation to a `Stream` inside a function runtime to get a
16 * callable that resolves the per-stream data endpoint (`GetDataEndpoint`)
17 * and extracts base64-encoded still images (JPEG/PNG) from the stored
18 * media at the requested sampling interval.
19 * ### Reading Media
20 * **Example:** Extract Thumbnails
21 * ```typescript
22 * // init
23 * const getImages = yield* AWS.KinesisVideo.GetImages(stream);
24 *
25 * // runtime
26 * const { Images } = yield* getImages({
27 * ImageSelectorType: "SERVER_TIMESTAMP",
28 * StartTimestamp: start,
29 * EndTimestamp: end,
30 * Format: "JPEG",
31 * });
32 * ```
33 *
34 * @binding
35 */
36export interface GetImages extends Binding.Service<
37 GetImages,
38 "AWS.KinesisVideo.GetImages",
39 <S extends Stream>(
40 stream: S,
41 ) => Effect.Effect<
42 (
43 request: GetImagesRequest,
44 ) => Effect.Effect<
45 kvam.GetImagesOutput,
46 kvam.GetImagesError | kv.GetDataEndpointError
47 >
48 >
49> {}
50
51export const GetImages = Binding.Service<GetImages>(
52 "AWS.KinesisVideo.GetImages",
53);