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 GetMediaForFragmentListRequest extends Omit<
8 kvam.GetMediaForFragmentListInput,
9 "StreamName" | "StreamARN"
10> {}
11
12/**
13 * Runtime binding for `kinesisvideo:GetMediaForFragmentList` (archived
14 * media data plane).
15 *
16 * Bind this operation to a `Stream` inside a function runtime to get a
17 * callable that resolves the per-stream data endpoint (`GetDataEndpoint`)
18 * and downloads MKV-packaged media for an explicit list of fragment
19 * numbers (typically discovered via `ListFragments`). The response
20 * `Payload` is a streaming body.
21 * ### Reading Media
22 * **Example:** Fetch Media for Specific Fragments
23 * ```typescript
24 * // init
25 * const getFragmentMedia =
26 * yield* AWS.KinesisVideo.GetMediaForFragmentList(stream);
27 *
28 * // runtime
29 * const media = yield* getFragmentMedia({
30 * Fragments: fragments.map((f) => f.FragmentNumber!),
31 * });
32 * ```
33 *
34 * @binding
35 */
36export interface GetMediaForFragmentList extends Binding.Service<
37 GetMediaForFragmentList,
38 "AWS.KinesisVideo.GetMediaForFragmentList",
39 <S extends Stream>(
40 stream: S,
41 ) => Effect.Effect<
42 (
43 request: GetMediaForFragmentListRequest,
44 ) => Effect.Effect<
45 kvam.GetMediaForFragmentListOutput,
46 kvam.GetMediaForFragmentListError | kv.GetDataEndpointError
47 >
48 >
49> {}
50
51export const GetMediaForFragmentList = Binding.Service<GetMediaForFragmentList>(
52 "AWS.KinesisVideo.GetMediaForFragmentList",
53);