| 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 `ListUsers` operation (IAM action |
| 8 | * `mq:ListUsers`), scoped to one {@link Broker}. |
| 9 | * |
| 10 | * Lists all users on the broker, including any with staged pending changes. |
| 11 | * Provide the implementation with `Effect.provide(AWS.MQ.ListUsersHttp)`. |
| 12 | * ### Managing Users |
| 13 | * **Example:** List Broker Users |
| 14 | * ```typescript |
| 15 | * const listUsers = yield* MQ.ListUsers(broker); |
| 16 | * |
| 17 | * const page = yield* listUsers(); |
| 18 | * // page.Users → [{ Username: "admin" }, { Username: "tenant-42", PendingChange: "CREATE" }] |
| 19 | * ``` |
| 20 | * |
| 21 | * @binding |
| 22 | */ |
| 23 | export interface ListUsers extends Binding.Service< |
| 24 | ListUsers, |
| 25 | "AWS.MQ.ListUsers", |
| 26 | ( |
| 27 | broker: Broker, |
| 28 | ) => Effect.Effect< |
| 29 | ( |
| 30 | request?: Omit<mq.ListUsersRequest, "BrokerId">, |
| 31 | ) => Effect.Effect<mq.ListUsersResponse, mq.ListUsersError> |
| 32 | > |
| 33 | > {} |
| 34 | export const ListUsers = Binding.Service<ListUsers>("AWS.MQ.ListUsers"); |