| 1 | import type * as ce from "@distilled.cloud/aws/cost-explorer"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Request for {@link GetCostForecast}. |
| 7 | */ |
| 8 | export interface GetCostForecastRequest extends ce.GetCostForecastRequest {} |
| 9 | |
| 10 | /** |
| 11 | * Runtime binding for `ce:GetCostForecast`. |
| 12 | * |
| 13 | * Forecast how much AWS predicts you will spend over a future time |
| 14 | * period, with an optional prediction interval. Provide the implementation with |
| 15 | * `Effect.provide(AWS.CostExplorer.GetCostForecastHttp)`. |
| 16 | * ### Forecasting |
| 17 | * **Example:** Forecast Next Month's Spend |
| 18 | * ```typescript |
| 19 | * // init — account-level binding takes no resource |
| 20 | * const getCostForecast = yield* AWS.CostExplorer.GetCostForecast(); |
| 21 | * |
| 22 | * // runtime |
| 23 | * const result = yield* getCostForecast({ |
| 24 | * TimePeriod: { Start: "2026-08-01", End: "2026-09-01" }, |
| 25 | * Metric: "UNBLENDED_COST", |
| 26 | * Granularity: "MONTHLY", |
| 27 | * }); |
| 28 | * const forecast = result.Total?.Amount; |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface GetCostForecast extends Binding.Service< |
| 34 | GetCostForecast, |
| 35 | "AWS.CostExplorer.GetCostForecast", |
| 36 | () => Effect.Effect< |
| 37 | ( |
| 38 | request: GetCostForecastRequest, |
| 39 | ) => Effect.Effect<ce.GetCostForecastResponse, ce.GetCostForecastError> |
| 40 | > |
| 41 | > {} |
| 42 | |
| 43 | export const GetCostForecast = Binding.Service<GetCostForecast>( |
| 44 | "AWS.CostExplorer.GetCostForecast", |
| 45 | ); |