1import * as eventbridge from "@distilled.cloud/aws/eventbridge";
2import * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { EventBus } from "./EventBus.ts";
5
6export interface DescribeEventBusRequest extends Omit<
7 eventbridge.DescribeEventBusRequest,
8 "Name"
9> {}
10
11/**
12 * Reads the configuration of an EventBridge event bus
13 * (`events:DescribeEventBus`).
14 *
15 * Bind this operation to an {@link EventBus} inside a function runtime to get
16 * a callable that automatically injects the bus name. Provide the
17 * `DescribeEventBusHttp` layer on the Function to satisfy the binding.
18 * ### Describing Event Buses
19 * **Example:** Describe the Bound Bus
20 * ```typescript
21 * // init — bind the bus (provide AWS.EventBridge.DescribeEventBusHttp on the Function)
22 * const describeEventBus = yield* AWS.EventBridge.DescribeEventBus(bus);
23 *
24 * // runtime — read the bus configuration
25 * const info = yield* describeEventBus();
26 * console.log(info.Arn, info.Policy);
27 * ```
28 *
29 * @binding
30 */
31export interface DescribeEventBus extends Binding.Service<
32 DescribeEventBus,
33 "AWS.EventBridge.DescribeEventBus",
34 (
35 bus: EventBus,
36 ) => Effect.Effect<
37 (
38 request?: DescribeEventBusRequest,
39 ) => Effect.Effect<
40 eventbridge.DescribeEventBusResponse,
41 eventbridge.DescribeEventBusError
42 >
43 >
44> {}
45export const DescribeEventBus = Binding.Service<DescribeEventBus>(
46 "AWS.EventBridge.DescribeEventBus",
47);