| 1 | import type * as transfer from "@distilled.cloud/aws/transfer"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Server } from "./Server.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `transfer:ListUsers`. |
| 8 | * |
| 9 | * Lists the users attached to the bound {@link Server} — the `ServerId` is |
| 10 | * injected from the binding. Pass `MaxResults`/`NextToken` to page through |
| 11 | * large user sets. The building block for self-service user portals over a |
| 12 | * service-managed server. Provide the implementation with |
| 13 | * `Effect.provide(AWS.Transfer.ListUsersHttp)`. |
| 14 | * ### Managing Users at Runtime |
| 15 | * **Example:** List the Server's Users |
| 16 | * ```typescript |
| 17 | * // init — bind the operation to the server |
| 18 | * const listUsers = yield* AWS.Transfer.ListUsers(server); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const { Users } = yield* listUsers(); |
| 22 | * yield* Effect.log(`users: ${Users.map((u) => u.UserName).join(", ")}`); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface ListUsers extends Binding.Service< |
| 28 | ListUsers, |
| 29 | "AWS.Transfer.ListUsers", |
| 30 | ( |
| 31 | server: Server, |
| 32 | ) => Effect.Effect< |
| 33 | ( |
| 34 | request?: Omit<transfer.ListUsersRequest, "ServerId">, |
| 35 | ) => Effect.Effect<transfer.ListUsersResponse, transfer.ListUsersError> |
| 36 | > |
| 37 | > {} |
| 38 | export const ListUsers = Binding.Service<ListUsers>("AWS.Transfer.ListUsers"); |