| 1 | import type * as mq from "@distilled.cloud/aws/mq"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Broker } from "./Broker.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for the `DescribeBroker` operation (IAM action |
| 8 | * `mq:DescribeBroker`), scoped to one {@link Broker}. |
| 9 | * |
| 10 | * Resolves the broker's live state at runtime — engine version, instance |
| 11 | * endpoints (the wire-protocol URIs clients connect to), pending changes, |
| 12 | * and maintenance information. Provide the implementation with |
| 13 | * `Effect.provide(AWS.MQ.DescribeBrokerHttp)`. |
| 14 | * ### Observing a Broker |
| 15 | * **Example:** Resolve the Broker's Endpoints |
| 16 | * ```typescript |
| 17 | * const describeBroker = yield* MQ.DescribeBroker(broker); |
| 18 | * |
| 19 | * const info = yield* describeBroker(); |
| 20 | * // info.BrokerState → "RUNNING" |
| 21 | * // info.BrokerInstances?.[0]?.Endpoints → ["ssl://b-….mq.us-west-2.amazonaws.com:61617", …] |
| 22 | * ``` |
| 23 | * |
| 24 | * @binding |
| 25 | */ |
| 26 | export interface DescribeBroker extends Binding.Service< |
| 27 | DescribeBroker, |
| 28 | "AWS.MQ.DescribeBroker", |
| 29 | ( |
| 30 | broker: Broker, |
| 31 | ) => Effect.Effect< |
| 32 | () => Effect.Effect<mq.DescribeBrokerResponse, mq.DescribeBrokerError> |
| 33 | > |
| 34 | > {} |
| 35 | export const DescribeBroker = Binding.Service<DescribeBroker>( |
| 36 | "AWS.MQ.DescribeBroker", |
| 37 | ); |