1import type * as rbin from "@distilled.cloud/aws/rbin";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Rule } from "./Rule.ts";
5
6/**
7 * Runtime binding for `rbin:GetRule`.
8 *
9 * Reads the bound retention {@link Rule}'s full detail — retention period,
10 * resource type, resource/exclusion tags, lock state, and status — so a
11 * function can audit its Recycle Bin coverage or alert on an unexpected
12 * unlock at runtime. The rule's identifier is injected from the binding.
13 * Provide the implementation with `Effect.provide(AWS.Rbin.GetRuleHttp)`.
14 * ### Reading Retention Rules
15 * **Example:** Check the bound rule's retention period
16 * ```typescript
17 * // init — grants rbin:GetRule on the rule's ARN
18 * const getRule = yield* AWS.Rbin.GetRule(rule);
19 *
20 * // runtime
21 * const detail = yield* getRule();
22 * yield* Effect.log(
23 * `rule ${detail.Identifier} retains ${detail.ResourceType} for ` +
24 * `${detail.RetentionPeriod?.RetentionPeriodValue} days (${detail.LockState ?? "unlocked"})`,
25 * );
26 * ```
27 *
28 * @binding
29 */
30export interface GetRule extends Binding.Service<
31 GetRule,
32 "AWS.Rbin.GetRule",
33 (
34 rule: Rule,
35 ) => Effect.Effect<
36 () => Effect.Effect<rbin.GetRuleResponse, rbin.GetRuleError>
37 >
38> {}
39export const GetRule = Binding.Service<GetRule>("AWS.Rbin.GetRule");