| 1 | import type * as fis from "@distilled.cloud/aws/fis"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `fis:GetExperiment`. |
| 7 | * |
| 8 | * Reads a running or finished experiment — its state (`pending`, |
| 9 | * `initiating`, `running`, `completed`, `stopped`, `failed`), per-action |
| 10 | * progress, and log/report configuration. Experiments are created |
| 11 | * dynamically, so this is an account-level binding addressed by experiment |
| 12 | * id. Provide the implementation with |
| 13 | * `Effect.provide(AWS.FIS.GetExperimentHttp)`. |
| 14 | * ### Running Experiments |
| 15 | * **Example:** Poll an Experiment's State |
| 16 | * ```typescript |
| 17 | * // init — account-level binding, no resource argument |
| 18 | * const getExperiment = yield* AWS.FIS.GetExperiment(); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const { experiment } = yield* getExperiment({ id: experimentId }); |
| 22 | * console.log(experiment?.state?.status); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface GetExperiment extends Binding.Service< |
| 28 | GetExperiment, |
| 29 | "AWS.FIS.GetExperiment", |
| 30 | () => Effect.Effect< |
| 31 | ( |
| 32 | request: fis.GetExperimentRequest, |
| 33 | ) => Effect.Effect<fis.GetExperimentResponse, fis.GetExperimentError> |
| 34 | > |
| 35 | > {} |
| 36 | export const GetExperiment = Binding.Service<GetExperiment>( |
| 37 | "AWS.FIS.GetExperiment", |
| 38 | ); |