sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ MQ/ ListUsers.ts

import type * as mq from "@distilled.cloud/aws/mq";
import * as Binding from "alchemy/Binding";
import type * as Effect from "effect/Effect";
import type { Broker } from "./Broker.ts";

/**
 * Runtime binding for the `ListUsers` operation (IAM action
 * `mq:ListUsers`), scoped to one {@link Broker}.
 *
 * Lists all users on the broker, including any with staged pending changes.
 * Provide the implementation with `Effect.provide(AWS.MQ.ListUsersHttp)`.
 * ### Managing Users
 * **Example:** List Broker Users
 * ```typescript
 * const listUsers = yield* MQ.ListUsers(broker);
 *
 * const page = yield* listUsers();
 * // page.Users → [{ Username: "admin" }, { Username: "tenant-42", PendingChange: "CREATE" }]
 * ```
 *
 * @binding
 */
export interface ListUsers extends Binding.Service<
  ListUsers,
  "AWS.MQ.ListUsers",
  (
    broker: Broker,
  ) => Effect.Effect<
    (
      request?: Omit<mq.ListUsersRequest, "BrokerId">,
    ) => Effect.Effect<mq.ListUsersResponse, mq.ListUsersError>
  >
> {}
export const ListUsers = Binding.Service<ListUsers>("AWS.MQ.ListUsers");