| 1 | import type * as mediatailor from "@distilled.cloud/aws/mediatailor"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { PlaybackConfiguration } from "./PlaybackConfiguration.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `CreatePrefetchSchedule` request with `PlaybackConfigurationName` injected |
| 8 | * from the bound {@link PlaybackConfiguration}. |
| 9 | */ |
| 10 | export interface CreatePrefetchScheduleRequest extends Omit< |
| 11 | mediatailor.CreatePrefetchScheduleRequest, |
| 12 | "PlaybackConfigurationName" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `mediatailor:CreatePrefetchSchedule` — tell MediaTailor |
| 17 | * to fetch and prepare ads for upcoming ad breaks ahead of time (e.g. right |
| 18 | * before a live event's scheduled break) so avails fill without ADS latency. |
| 19 | * |
| 20 | * The bound {@link PlaybackConfiguration}'s name is injected; the grant is |
| 21 | * scoped to that configuration's prefetch-schedule ARN space. Provide the |
| 22 | * implementation with `Effect.provide(AWS.MediaTailor.CreatePrefetchScheduleHttp)`. |
| 23 | * |
| 24 | * ### Prefetching Ads |
| 25 | * **Example:** Prefetch ads for an upcoming break |
| 26 | * ```typescript |
| 27 | * const createPrefetchSchedule = yield* AWS.MediaTailor.CreatePrefetchSchedule(config); |
| 28 | * |
| 29 | * const schedule = yield* createPrefetchSchedule({ |
| 30 | * Name: `event-${eventId}`, |
| 31 | * Retrieval: { EndTime: retrievalDeadline }, |
| 32 | * Consumption: { EndTime: breakEnd }, |
| 33 | * }); |
| 34 | * ``` |
| 35 | * |
| 36 | * @binding |
| 37 | */ |
| 38 | export interface CreatePrefetchSchedule extends Binding.Service< |
| 39 | CreatePrefetchSchedule, |
| 40 | "AWS.MediaTailor.CreatePrefetchSchedule", |
| 41 | ( |
| 42 | config: PlaybackConfiguration, |
| 43 | ) => Effect.Effect< |
| 44 | ( |
| 45 | request: CreatePrefetchScheduleRequest, |
| 46 | ) => Effect.Effect< |
| 47 | mediatailor.CreatePrefetchScheduleResponse, |
| 48 | mediatailor.CreatePrefetchScheduleError |
| 49 | > |
| 50 | > |
| 51 | > {} |
| 52 | export const CreatePrefetchSchedule = Binding.Service<CreatePrefetchSchedule>( |
| 53 | "AWS.MediaTailor.CreatePrefetchSchedule", |
| 54 | ); |