1import type * as forecastquery from "@distilled.cloud/aws/forecastquery";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4
5/**
6 * Runtime binding for `forecast:QueryForecast` — the Forecast Query data
7 * plane. Retrieves the predicted time series for a single item from a
8 * generated forecast, the call an API or personalization function makes to
9 * serve predictions.
10 *
11 * Forecast ARNs are created at runtime, so the binding takes no arguments
12 * and grants `forecast:QueryForecast` on `*`. Provide the implementation
13 * with `Effect.provide(AWS.Forecast.QueryForecastHttp)`.
14 *
15 * ### Querying Forecasts
16 * **Example:** Serve a Prediction
17 * ```typescript
18 * // init
19 * const queryForecast = yield* AWS.Forecast.QueryForecast();
20 *
21 * // runtime
22 * const { Forecast } = yield* queryForecast({
23 * ForecastArn: forecastArn,
24 * Filters: { item_id: "sku_1234" },
25 * });
26 * const p50 = Forecast?.Predictions?.p50 ?? [];
27 * ```
28 *
29 * @binding
30 */
31export interface QueryForecast extends Binding.Service<
32 QueryForecast,
33 "AWS.Forecast.QueryForecast",
34 () => Effect.Effect<
35 (
36 request: forecastquery.QueryForecastRequest,
37 ) => Effect.Effect<
38 forecastquery.QueryForecastResponse,
39 forecastquery.QueryForecastError
40 >
41 >
42> {}
43export const QueryForecast = Binding.Service<QueryForecast>(
44 "AWS.Forecast.QueryForecast",
45);