| 1 | import type * as organizations from "@distilled.cloud/aws/organizations"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `organizations:ListRoots`. |
| 7 | * |
| 8 | * Lists the roots of the organization, including the policy types enabled on each root. The root id is the starting point for walking the organization tree. |
| 9 | * Account-level operation — Organizations is a management-account-scoped |
| 10 | * global service, so the binding takes no resource argument. Provide the |
| 11 | * implementation with `Effect.provide(AWS.Organizations.ListRootsHttp)`. |
| 12 | * ### Reading the Organization Tree |
| 13 | * **Example:** Find the Root Id |
| 14 | * ```typescript |
| 15 | * // init — account-level binding, no resource argument |
| 16 | * const listRoots = yield* AWS.Organizations.ListRoots(); |
| 17 | * |
| 18 | * // runtime |
| 19 | * const { Roots } = yield* listRoots(); |
| 20 | * const rootId = Roots?.[0]?.Id; |
| 21 | * ``` |
| 22 | * |
| 23 | * @binding |
| 24 | */ |
| 25 | export interface ListRoots extends Binding.Service< |
| 26 | ListRoots, |
| 27 | "AWS.Organizations.ListRoots", |
| 28 | () => Effect.Effect< |
| 29 | ( |
| 30 | request?: organizations.ListRootsRequest, |
| 31 | ) => Effect.Effect< |
| 32 | organizations.ListRootsResponse, |
| 33 | organizations.ListRootsError |
| 34 | > |
| 35 | > |
| 36 | > {} |
| 37 | export const ListRoots = Binding.Service<ListRoots>( |
| 38 | "AWS.Organizations.ListRoots", |
| 39 | ); |