| 1 | import type * as controltower from "@distilled.cloud/aws/controltower"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `controltower:GetControlOperation`. |
| 7 | * |
| 8 | * An account-level operation that reads the status of an asynchronous |
| 9 | * control operation (`ENABLE_CONTROL`, `DISABLE_CONTROL`, |
| 10 | * `UPDATE_ENABLED_CONTROL`, `RESET_ENABLED_CONTROL`). Pair it with |
| 11 | * {@link ResetEnabledControl} to poll a drift-remediation run to |
| 12 | * completion. Provide the implementation with |
| 13 | * `Effect.provide(AWS.ControlTower.GetControlOperationHttp)`. |
| 14 | * ### Polling Asynchronous Operations |
| 15 | * **Example:** Poll a Control Operation |
| 16 | * ```typescript |
| 17 | * // init — account-level binding takes no resource |
| 18 | * const getControlOperation = yield* AWS.ControlTower.GetControlOperation(); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const { controlOperation } = yield* getControlOperation({ |
| 22 | * operationIdentifier, |
| 23 | * }); |
| 24 | * console.log(controlOperation.status); |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | */ |
| 29 | export interface GetControlOperation extends Binding.Service< |
| 30 | GetControlOperation, |
| 31 | "AWS.ControlTower.GetControlOperation", |
| 32 | () => Effect.Effect< |
| 33 | ( |
| 34 | request: controltower.GetControlOperationInput, |
| 35 | ) => Effect.Effect< |
| 36 | controltower.GetControlOperationOutput, |
| 37 | controltower.GetControlOperationError |
| 38 | > |
| 39 | > |
| 40 | > {} |
| 41 | |
| 42 | export const GetControlOperation = Binding.Service<GetControlOperation>( |
| 43 | "AWS.ControlTower.GetControlOperation", |
| 44 | ); |