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

main
ts 55 lines 1.86 KB
Raw
1 import type * as pricing from "@distilled.cloud/aws/pricing";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4
5 export interface GetPriceListFileUrlRequest extends pricing.GetPriceListFileUrlRequest {}
6
7 /**
8 * Runtime binding for `pricing:GetPriceListFileUrl` — resolve a presigned
9 * download URL for one bulk Price List file.
10 *
11 * Takes a `PriceListArn` and `FileFormat` (`csv` or `json`) obtained from
12 * `ListPriceLists` and returns the URL the full offer file can be fetched
13 * from. The binding takes no arguments and grants the function
14 * `pricing:GetPriceListFileUrl` (the action has no resource-level IAM).
15 * Calls are pinned to `us-east-1`, the region that serves the Price List
16 * API. Provide the implementation with
17 * `Effect.provide(AWS.Pricing.GetPriceListFileUrlHttp)`.
18 *
19 * ### Downloading Price List Files
20 * **Example:** Resolve a Price List Download URL
21 * ```typescript
22 * // init
23 * const listPriceLists = yield* AWS.Pricing.ListPriceLists();
24 * const getPriceListFileUrl = yield* AWS.Pricing.GetPriceListFileUrl();
25 *
26 * // runtime
27 * const lists = yield* listPriceLists({
28 * ServiceCode: "AmazonEC2",
29 * CurrencyCode: "USD",
30 * EffectiveDate: new Date(),
31 * RegionCode: "us-east-1",
32 * });
33 * const arn = lists.PriceLists?.[0]?.PriceListArn;
34 * if (arn !== undefined) {
35 * const { Url } = yield* getPriceListFileUrl({
36 * PriceListArn: arn,
37 * FileFormat: "json",
38 * });
39 * }
40 * ```
41 *
42 * @binding
43 */
44 export interface GetPriceListFileUrl extends Binding.Service<
45 GetPriceListFileUrl,
46 "AWS.Pricing.GetPriceListFileUrl",
47 () => Effect.Effect<
48 (
49 request: GetPriceListFileUrlRequest,
50 ) => Effect.Effect<pricing.GetPriceListFileUrlResponse, pricing.GetPriceListFileUrlError>
51 >
52 > {}
53 export const GetPriceListFileUrl = Binding.Service<GetPriceListFileUrl>(
54 "AWS.Pricing.GetPriceListFileUrl",
55 );