| 1 | import type * as pricing from "@distilled.cloud/aws/pricing"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | export interface ListPriceListsRequest extends pricing.ListPriceListsRequest {} |
| 6 | |
| 7 | /** |
| 8 | * Runtime binding for `pricing:ListPriceLists` — list the bulk Price List |
| 9 | * file references available for a service, currency, and effective date. |
| 10 | * |
| 11 | * Each returned reference carries a `PriceListArn` and the `FileFormats` |
| 12 | * it can be downloaded in (`csv`, `json`); pass the ARN and a format to |
| 13 | * `GetPriceListFileUrl` to obtain a presigned download URL. Use without a |
| 14 | * `RegionCode` to list Price Lists from every AWS Region, or with one to |
| 15 | * narrow to a single Region. The binding takes no arguments and grants the |
| 16 | * function `pricing:ListPriceLists` (the action has no resource-level |
| 17 | * IAM). Calls are pinned to `us-east-1`, the region that serves the Price |
| 18 | * List API. Provide the implementation with |
| 19 | * `Effect.provide(AWS.Pricing.ListPriceListsHttp)`. |
| 20 | * |
| 21 | * ### Listing Price List Files |
| 22 | * **Example:** List EC2 Price Lists for us-east-1 |
| 23 | * ```typescript |
| 24 | * // init |
| 25 | * const listPriceLists = yield* AWS.Pricing.ListPriceLists(); |
| 26 | * |
| 27 | * // runtime |
| 28 | * const result = yield* listPriceLists({ |
| 29 | * ServiceCode: "AmazonEC2", |
| 30 | * CurrencyCode: "USD", |
| 31 | * EffectiveDate: new Date(), |
| 32 | * RegionCode: "us-east-1", |
| 33 | * }); |
| 34 | * const arns = (result.PriceLists ?? []).map((p) => p.PriceListArn); |
| 35 | * ``` |
| 36 | * |
| 37 | * @binding |
| 38 | */ |
| 39 | export interface ListPriceLists extends Binding.Service< |
| 40 | ListPriceLists, |
| 41 | "AWS.Pricing.ListPriceLists", |
| 42 | () => Effect.Effect< |
| 43 | ( |
| 44 | request: ListPriceListsRequest, |
| 45 | ) => Effect.Effect< |
| 46 | pricing.ListPriceListsResponse, |
| 47 | pricing.ListPriceListsError |
| 48 | > |
| 49 | > |
| 50 | > {} |
| 51 | export const ListPriceLists = Binding.Service<ListPriceLists>( |
| 52 | "AWS.Pricing.ListPriceLists", |
| 53 | ); |