| 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:ListParents`. |
| 7 | * |
| 8 | * Lists the direct parent (root or OU) of the specified child account or OU — walking the organization tree upward. |
| 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.ListParentsHttp)`. |
| 12 | * ### Reading the Organization Tree |
| 13 | * **Example:** Find an Account's Parent |
| 14 | * ```typescript |
| 15 | * // init — account-level binding, no resource argument |
| 16 | * const listParents = yield* AWS.Organizations.ListParents(); |
| 17 | * |
| 18 | * // runtime |
| 19 | * const { Parents } = yield* listParents({ ChildId: accountId }); |
| 20 | * ``` |
| 21 | * |
| 22 | * @binding |
| 23 | */ |
| 24 | export interface ListParents extends Binding.Service< |
| 25 | ListParents, |
| 26 | "AWS.Organizations.ListParents", |
| 27 | () => Effect.Effect< |
| 28 | ( |
| 29 | request: organizations.ListParentsRequest, |
| 30 | ) => Effect.Effect< |
| 31 | organizations.ListParentsResponse, |
| 32 | organizations.ListParentsError |
| 33 | > |
| 34 | > |
| 35 | > {} |
| 36 | export const ListParents = Binding.Service<ListParents>( |
| 37 | "AWS.Organizations.ListParents", |
| 38 | ); |