| 1 | import * as eventbridge from "@distilled.cloud/aws/eventbridge"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Rule } from "./Rule.ts"; |
| 5 | |
| 6 | export interface ListTargetsByRuleRequest extends Omit< |
| 7 | eventbridge.ListTargetsByRuleRequest, |
| 8 | "Rule" | "EventBusName" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Lists the targets attached to an EventBridge rule |
| 13 | * (`events:ListTargetsByRule`). |
| 14 | * |
| 15 | * Bind this operation to a {@link Rule} inside a function runtime to get a |
| 16 | * callable that automatically injects the rule and bus names. Provide the |
| 17 | * `ListTargetsByRuleHttp` layer on the Function to satisfy the binding. |
| 18 | * ### Listing Targets |
| 19 | * **Example:** List a Rule's Targets |
| 20 | * ```typescript |
| 21 | * // init — bind the rule (provide AWS.EventBridge.ListTargetsByRuleHttp on the Function) |
| 22 | * const listTargets = yield* AWS.EventBridge.ListTargetsByRule(rule); |
| 23 | * |
| 24 | * // runtime — enumerate the rule's targets |
| 25 | * const { Targets } = yield* listTargets(); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface ListTargetsByRule extends Binding.Service< |
| 31 | ListTargetsByRule, |
| 32 | "AWS.EventBridge.ListTargetsByRule", |
| 33 | ( |
| 34 | rule: Rule, |
| 35 | ) => Effect.Effect< |
| 36 | ( |
| 37 | request?: ListTargetsByRuleRequest, |
| 38 | ) => Effect.Effect< |
| 39 | eventbridge.ListTargetsByRuleResponse, |
| 40 | eventbridge.ListTargetsByRuleError |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | export const ListTargetsByRule = Binding.Service<ListTargetsByRule>( |
| 45 | "AWS.EventBridge.ListTargetsByRule", |
| 46 | ); |