1import type * as eventbridge from "@distilled.cloud/aws/eventbridge";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Rule } from "./Rule.ts";
5
6/**
7 * Disables an EventBridge rule (`events:DisableRule`) so it stops matching
8 * events without deleting it.
9 *
10 * Bind this operation to a {@link Rule} inside a function runtime to get a
11 * callable that pauses the rule — the runtime half of a feature toggle or
12 * kill switch. Provide the `DisableRuleHttp` layer on the Function to
13 * satisfy the binding.
14 * ### Toggling Rules
15 * **Example:** Pause the Bound Rule
16 * ```typescript
17 * // init — bind the rule (provide AWS.EventBridge.DisableRuleHttp on the Function)
18 * const disableRule = yield* AWS.EventBridge.DisableRule(rule);
19 *
20 * // runtime — stop event routing until re-enabled
21 * yield* disableRule();
22 * ```
23 *
24 * @binding
25 */
26export interface DisableRule extends Binding.Service<
27 DisableRule,
28 "AWS.EventBridge.DisableRule",
29 (
30 rule: Rule,
31 ) => Effect.Effect<
32 () => Effect.Effect<
33 eventbridge.DisableRuleResponse,
34 eventbridge.DisableRuleError
35 >
36 >
37> {}
38export const DisableRule = Binding.Service<DisableRule>(
39 "AWS.EventBridge.DisableRule",
40);