| 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 GetCostAndUsageComparisons}. |
| 7 | */ |
| 8 | export interface GetCostAndUsageComparisonsRequest |
| 9 | extends ce.GetCostAndUsageComparisonsRequest {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `ce:GetCostAndUsageComparisons`. |
| 13 | * |
| 14 | * Compare cost and usage between two periods within the last 13 |
| 15 | * months (up to 38 months with multi-year data enabled). Provide the implementation with |
| 16 | * `Effect.provide(AWS.CostExplorer.GetCostAndUsageComparisonsHttp)`. |
| 17 | * ### Querying Cost and Usage |
| 18 | * **Example:** Compare Two Billing Periods |
| 19 | * ```typescript |
| 20 | * // init — account-level binding takes no resource |
| 21 | * const getCostAndUsageComparisons = yield* AWS.CostExplorer.GetCostAndUsageComparisons(); |
| 22 | * |
| 23 | * // runtime |
| 24 | * const result = yield* getCostAndUsageComparisons({ |
| 25 | * BaselineTimePeriod: { Start: "2026-05-01", End: "2026-06-01" }, |
| 26 | * ComparisonTimePeriod: { Start: "2026-06-01", End: "2026-07-01" }, |
| 27 | * MetricForComparison: "UnblendedCost", |
| 28 | * }); |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface GetCostAndUsageComparisons extends Binding.Service< |
| 34 | GetCostAndUsageComparisons, |
| 35 | "AWS.CostExplorer.GetCostAndUsageComparisons", |
| 36 | () => Effect.Effect< |
| 37 | ( |
| 38 | request: GetCostAndUsageComparisonsRequest, |
| 39 | ) => Effect.Effect< |
| 40 | ce.GetCostAndUsageComparisonsResponse, |
| 41 | ce.GetCostAndUsageComparisonsError |
| 42 | > |
| 43 | > |
| 44 | > {} |
| 45 | |
| 46 | export const GetCostAndUsageComparisons = |
| 47 | Binding.Service<GetCostAndUsageComparisons>( |
| 48 | "AWS.CostExplorer.GetCostAndUsageComparisons", |
| 49 | ); |