The best way to control Claude Code, Codex and more from any computer or phone

main
ts 39 lines 1.43 KB
Raw
1 import type * as dlm from "@distilled.cloud/aws/dlm";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { LifecyclePolicy } from "./LifecyclePolicy.ts";
5
6 /**
7 * Runtime binding for `dlm:GetLifecyclePolicy`.
8 *
9 * Reads the bound {@link LifecyclePolicy}'s full detail — state (including
10 * the observed-only `ERROR`), status message, execution role, and the
11 * complete policy document — so an ops function can audit backup coverage
12 * or alert on a policy that stopped running. The policy id is injected from
13 * the binding. Provide the implementation with
14 * `Effect.provide(AWS.DLM.GetLifecyclePolicyHttp)`.
15 * ### Monitoring Lifecycle Policies
16 * **Example:** Check A Policy's State
17 * ```typescript
18 * // init — bind the operation to the lifecycle policy
19 * const getLifecyclePolicy = yield* AWS.DLM.GetLifecyclePolicy(policy);
20 *
21 * // runtime
22 * const { Policy } = yield* getLifecyclePolicy();
23 * if (Policy?.State === "ERROR") {
24 * yield* Effect.logError(`DLM policy failed: ${Policy.StatusMessage}`);
25 * }
26 * ```
27 *
28 * @binding
29 */
30 export interface GetLifecyclePolicy extends Binding.Service<
31 GetLifecyclePolicy,
32 "AWS.DLM.GetLifecyclePolicy",
33 (
34 policy: LifecyclePolicy,
35 ) => Effect.Effect<
36 () => Effect.Effect<dlm.GetLifecyclePolicyResponse, dlm.GetLifecyclePolicyError>
37 >
38 > {}
39 export const GetLifecyclePolicy = Binding.Service<GetLifecyclePolicy>("AWS.DLM.GetLifecyclePolicy");