| 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 { User } from "./User.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `transfer:DescribeUser`. |
| 8 | * |
| 9 | * Reads the bound {@link User}'s live configuration — home directory, role, |
| 10 | * POSIX profile, and the SSH public keys currently registered (including |
| 11 | * their `SshPublicKeyId`s, which {@link DeleteSshPublicKey} needs). The |
| 12 | * `ServerId` and `UserName` are injected from the binding. Provide the |
| 13 | * implementation with `Effect.provide(AWS.Transfer.DescribeUserHttp)`. |
| 14 | * ### Managing Users at Runtime |
| 15 | * **Example:** Read the User's SSH Keys |
| 16 | * ```typescript |
| 17 | * // init — bind the operation to the user |
| 18 | * const describeUser = yield* AWS.Transfer.DescribeUser(user); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const { User } = yield* describeUser(); |
| 22 | * const keyIds = (User.SshPublicKeys ?? []).map((k) => k.SshPublicKeyId); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface DescribeUser extends Binding.Service< |
| 28 | DescribeUser, |
| 29 | "AWS.Transfer.DescribeUser", |
| 30 | ( |
| 31 | user: User, |
| 32 | ) => Effect.Effect< |
| 33 | ( |
| 34 | request?: Omit<transfer.DescribeUserRequest, "ServerId" | "UserName">, |
| 35 | ) => Effect.Effect< |
| 36 | transfer.DescribeUserResponse, |
| 37 | transfer.DescribeUserError |
| 38 | > |
| 39 | > |
| 40 | > {} |
| 41 | export const DescribeUser = Binding.Service<DescribeUser>( |
| 42 | "AWS.Transfer.DescribeUser", |
| 43 | ); |