The best way to control Claude Code, Codex and more from any computer or phone

main
ts 52 lines 1.68 KB
Raw
1 import type * as forecast from "@distilled.cloud/aws/forecast";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4
5 /**
6 * Runtime binding for `forecast:CreateWhatIfForecast` — create a scenario
7 * forecast under a what-if analysis, transforming the baseline time series
8 * (or replacing it from S3) so the outcome can be compared with
9 * {@link QueryWhatIfForecast}.
10 *
11 * What-if forecast ARNs are created at runtime, so the binding takes no
12 * arguments and grants `forecast:CreateWhatIfForecast` on `*`, plus
13 * `iam:PassRole` (conditioned to `forecast.amazonaws.com`) for the
14 * replacement-data-source role. Provide the implementation with
15 * `Effect.provide(AWS.Forecast.CreateWhatIfForecastHttp)`.
16 *
17 * ### What-If Scenarios
18 * **Example:** Create a Price-Drop Scenario
19 * ```typescript
20 * // init
21 * const createWhatIfForecast = yield* AWS.Forecast.CreateWhatIfForecast();
22 *
23 * // runtime
24 * const scenario = yield* createWhatIfForecast({
25 * WhatIfForecastName: "price_drop_10pct",
26 * WhatIfAnalysisArn: analysisArn,
27 * TimeSeriesTransformations: [
28 * {
29 * Action: {
30 * AttributeName: "price",
31 * Operation: "MULTIPLY",
32 * Value: 0.9,
33 * },
34 * },
35 * ],
36 * });
37 * ```
38 *
39 * @binding
40 */
41 export interface CreateWhatIfForecast extends Binding.Service<
42 CreateWhatIfForecast,
43 "AWS.Forecast.CreateWhatIfForecast",
44 () => Effect.Effect<
45 (
46 request: forecast.CreateWhatIfForecastRequest,
47 ) => Effect.Effect<forecast.CreateWhatIfForecastResponse, forecast.CreateWhatIfForecastError>
48 >
49 > {}
50 export const CreateWhatIfForecast = Binding.Service<CreateWhatIfForecast>(
51 "AWS.Forecast.CreateWhatIfForecast",
52 );