| 1 | import type * as forecast from "@distilled.cloud/aws/forecast"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `forecast:CreateAutoPredictor` — kick off (re)training |
| 7 | * of an AutoPredictor from a dataset group, the scheduled-retraining step of |
| 8 | * a grandfathered Forecast deployment. Also grants `iam:PassRole` |
| 9 | * (conditioned to `forecast.amazonaws.com`) for the KMS-encryption role an |
| 10 | * `EncryptionConfig` passes to the service. |
| 11 | * |
| 12 | * Predictor ARNs are created at runtime, so the binding takes no arguments |
| 13 | * and grants `forecast:CreateAutoPredictor` on `*`. Provide the |
| 14 | * implementation with `Effect.provide(AWS.Forecast.CreateAutoPredictorHttp)`. |
| 15 | * |
| 16 | * ### Training Predictors |
| 17 | * **Example:** Retrain a Predictor |
| 18 | * ```typescript |
| 19 | * // init |
| 20 | * const createAutoPredictor = yield* AWS.Forecast.CreateAutoPredictor(); |
| 21 | * |
| 22 | * // runtime |
| 23 | * const predictor = yield* createAutoPredictor({ |
| 24 | * PredictorName: "demand_2026_07", |
| 25 | * ForecastHorizon: 14, |
| 26 | * ForecastFrequency: "D", |
| 27 | * DataConfig: { DatasetGroupArn: group.datasetGroupArn }, |
| 28 | * }); |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface CreateAutoPredictor extends Binding.Service< |
| 34 | CreateAutoPredictor, |
| 35 | "AWS.Forecast.CreateAutoPredictor", |
| 36 | () => Effect.Effect< |
| 37 | ( |
| 38 | request: forecast.CreateAutoPredictorRequest, |
| 39 | ) => Effect.Effect< |
| 40 | forecast.CreateAutoPredictorResponse, |
| 41 | forecast.CreateAutoPredictorError |
| 42 | > |
| 43 | > |
| 44 | > {} |
| 45 | export const CreateAutoPredictor = Binding.Service<CreateAutoPredictor>( |
| 46 | "AWS.Forecast.CreateAutoPredictor", |
| 47 | ); |