| 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:ListChildren`. |
| 7 | * |
| 8 | * Lists the child accounts or organizational units directly under the specified parent root or OU — one level of the organization tree at a time. |
| 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.ListChildrenHttp)`. |
| 12 | * ### Reading the Organization Tree |
| 13 | * **Example:** Walk One Tree Level |
| 14 | * ```typescript |
| 15 | * // init — account-level binding, no resource argument |
| 16 | * const listChildren = yield* AWS.Organizations.ListChildren(); |
| 17 | * |
| 18 | * // runtime |
| 19 | * const { Children } = yield* listChildren({ |
| 20 | * ParentId: rootId, |
| 21 | * ChildType: "ORGANIZATIONAL_UNIT", |
| 22 | * }); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface ListChildren extends Binding.Service< |
| 28 | ListChildren, |
| 29 | "AWS.Organizations.ListChildren", |
| 30 | () => Effect.Effect< |
| 31 | ( |
| 32 | request: organizations.ListChildrenRequest, |
| 33 | ) => Effect.Effect< |
| 34 | organizations.ListChildrenResponse, |
| 35 | organizations.ListChildrenError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | export const ListChildren = Binding.Service<ListChildren>( |
| 40 | "AWS.Organizations.ListChildren", |
| 41 | ); |