| 1 | import type * as account from "@distilled.cloud/aws/account"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `account:ListRegions`. |
| 7 | * |
| 8 | * Lists every Region available to the calling account together with its |
| 9 | * opt-in status (`ENABLED`, `DISABLED`, `ENABLED_BY_DEFAULT`, …), optionally |
| 10 | * filtered by `RegionOptStatusContains`. Account Management is an account |
| 11 | * singleton, so the binding takes no resource argument. Provide the |
| 12 | * implementation with `Effect.provide(AWS.Account.ListRegionsHttp)`. |
| 13 | * ### Reading Region Opt Status |
| 14 | * **Example:** List the Enabled-by-Default Regions |
| 15 | * ```typescript |
| 16 | * // init — account-level binding, no resource argument |
| 17 | * const listRegions = yield* AWS.Account.ListRegions(); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const { Regions } = yield* listRegions({ |
| 21 | * RegionOptStatusContains: ["ENABLED_BY_DEFAULT"], |
| 22 | * }); |
| 23 | * for (const region of Regions ?? []) { |
| 24 | * console.log(region.RegionName, region.RegionOptStatus); |
| 25 | * } |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface ListRegions extends Binding.Service< |
| 31 | ListRegions, |
| 32 | "AWS.Account.ListRegions", |
| 33 | () => Effect.Effect< |
| 34 | ( |
| 35 | request?: account.ListRegionsRequest, |
| 36 | ) => Effect.Effect<account.ListRegionsResponse, account.ListRegionsError> |
| 37 | > |
| 38 | > {} |
| 39 | export const ListRegions = Binding.Service<ListRegions>( |
| 40 | "AWS.Account.ListRegions", |
| 41 | ); |