The best way to control Claude Code, Codex and more from any computer or phone

main
ts 43 lines 1.55 KB
Raw
1 import type * as transfer from "@distilled.cloud/aws/transfer";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { User } from "./User.ts";
5
6 /**
7 * Runtime binding for `transfer:ImportSshPublicKey`.
8 *
9 * Registers an additional SSH public key on the bound {@link User} — the
10 * key-rotation half of a self-service credential portal. The `ServerId` and
11 * `UserName` are injected from the binding; only the public key body is
12 * passed at runtime. Returns the new `SshPublicKeyId` for later
13 * {@link DeleteSshPublicKey}. Importing a key that is already registered
14 * fails with the typed `ResourceExistsException`. Provide the
15 * implementation with `Effect.provide(AWS.Transfer.ImportSshPublicKeyHttp)`.
16 * ### Managing SSH Keys at Runtime
17 * **Example:** Rotate a User's Key
18 * ```typescript
19 * // init — bind the operation to the user
20 * const importSshPublicKey = yield* AWS.Transfer.ImportSshPublicKey(user);
21 *
22 * // runtime
23 * const { SshPublicKeyId } = yield* importSshPublicKey({
24 * SshPublicKeyBody: "ssh-ed25519 AAAA…",
25 * });
26 * ```
27 *
28 * @binding
29 */
30 export interface ImportSshPublicKey extends Binding.Service<
31 ImportSshPublicKey,
32 "AWS.Transfer.ImportSshPublicKey",
33 (
34 user: User,
35 ) => Effect.Effect<
36 (
37 request: Omit<transfer.ImportSshPublicKeyRequest, "ServerId" | "UserName">,
38 ) => Effect.Effect<transfer.ImportSshPublicKeyResponse, transfer.ImportSshPublicKeyError>
39 >
40 > {}
41 export const ImportSshPublicKey = Binding.Service<ImportSshPublicKey>(
42 "AWS.Transfer.ImportSshPublicKey",
43 );