| 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 { EventBus } from "./EventBus.ts"; |
| 5 | |
| 6 | export interface ListRulesRequest extends Omit< |
| 7 | eventbridge.ListRulesRequest, |
| 8 | "EventBusName" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Lists the rules on an EventBridge event bus (`events:ListRules`). |
| 13 | * |
| 14 | * Bind this operation to an {@link EventBus} inside a function runtime to get |
| 15 | * a callable scoped to that bus; omit the bus argument to list rules on the |
| 16 | * account's default bus. Provide the `ListRulesHttp` layer on the Function to |
| 17 | * satisfy the binding. |
| 18 | * ### Listing Rules |
| 19 | * **Example:** List Rules on a Bus |
| 20 | * ```typescript |
| 21 | * // init — bind the bus (provide AWS.EventBridge.ListRulesHttp on the Function) |
| 22 | * const listRules = yield* AWS.EventBridge.ListRules(bus); |
| 23 | * |
| 24 | * // runtime — list rules, optionally filtered by name prefix |
| 25 | * const { Rules } = yield* listRules({ NamePrefix: "orders-" }); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface ListRules extends Binding.Service< |
| 31 | ListRules, |
| 32 | "AWS.EventBridge.ListRules", |
| 33 | ( |
| 34 | bus?: EventBus, |
| 35 | ) => Effect.Effect< |
| 36 | ( |
| 37 | request?: ListRulesRequest, |
| 38 | ) => Effect.Effect< |
| 39 | eventbridge.ListRulesResponse, |
| 40 | eventbridge.ListRulesError |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | export const ListRules = Binding.Service<ListRules>( |
| 45 | "AWS.EventBridge.ListRules", |
| 46 | ); |