| 1 | import type * as forecastquery from "@distilled.cloud/aws/forecastquery"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `forecast:QueryWhatIfForecast` — retrieve the |
| 7 | * predicted time series for a single item from a what-if forecast, so an |
| 8 | * application can compare a scenario (price change, promotion) against the |
| 9 | * baseline served by {@link QueryForecast}. |
| 10 | * |
| 11 | * What-if forecast ARNs are created at runtime, so the binding takes no |
| 12 | * arguments and grants `forecast:QueryWhatIfForecast` on `*`. Provide the |
| 13 | * implementation with `Effect.provide(AWS.Forecast.QueryWhatIfForecastHttp)`. |
| 14 | * |
| 15 | * ### Querying Forecasts |
| 16 | * **Example:** Compare a Scenario |
| 17 | * ```typescript |
| 18 | * // init |
| 19 | * const queryWhatIfForecast = yield* AWS.Forecast.QueryWhatIfForecast(); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const { Forecast } = yield* queryWhatIfForecast({ |
| 23 | * WhatIfForecastArn: whatIfForecastArn, |
| 24 | * Filters: { item_id: "sku_1234" }, |
| 25 | * }); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface QueryWhatIfForecast extends Binding.Service< |
| 31 | QueryWhatIfForecast, |
| 32 | "AWS.Forecast.QueryWhatIfForecast", |
| 33 | () => Effect.Effect< |
| 34 | ( |
| 35 | request: forecastquery.QueryWhatIfForecastRequest, |
| 36 | ) => Effect.Effect< |
| 37 | forecastquery.QueryWhatIfForecastResponse, |
| 38 | forecastquery.QueryWhatIfForecastError |
| 39 | > |
| 40 | > |
| 41 | > {} |
| 42 | export const QueryWhatIfForecast = Binding.Service<QueryWhatIfForecast>( |
| 43 | "AWS.Forecast.QueryWhatIfForecast", |
| 44 | ); |