1import type * as transfer from "@distilled.cloud/aws/transfer";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { User } from "./User.ts";
5
6/**
7 * Runtime binding for `transfer:DeleteSshPublicKey`.
8 *
9 * Removes an SSH public key from the bound {@link User} by
10 * `SshPublicKeyId` (returned by {@link ImportSshPublicKey} or listed via
11 * {@link DescribeUser}) — the revocation half of key rotation. The
12 * `ServerId` and `UserName` are injected from the binding. Deleting a key
13 * that no longer exists fails with the typed `ResourceNotFoundException`.
14 * Provide the implementation with
15 * `Effect.provide(AWS.Transfer.DeleteSshPublicKeyHttp)`.
16 * ### Managing SSH Keys at Runtime
17 * **Example:** Revoke a User's Key
18 * ```typescript
19 * // init — bind the operation to the user
20 * const deleteSshPublicKey = yield* AWS.Transfer.DeleteSshPublicKey(user);
21 *
22 * // runtime
23 * yield* deleteSshPublicKey({ SshPublicKeyId: keyId }).pipe(
24 * Effect.catchTag("ResourceNotFoundException", () => Effect.void),
25 * );
26 * ```
27 *
28 * @binding
29 */
30export interface DeleteSshPublicKey extends Binding.Service<
31 DeleteSshPublicKey,
32 "AWS.Transfer.DeleteSshPublicKey",
33 (
34 user: User,
35 ) => Effect.Effect<
36 (
37 request: Omit<
38 transfer.DeleteSshPublicKeyRequest,
39 "ServerId" | "UserName"
40 >,
41 ) => Effect.Effect<
42 transfer.DeleteSshPublicKeyResponse,
43 transfer.DeleteSshPublicKeyError
44 >
45 >
46> {}
47export const DeleteSshPublicKey = Binding.Service<DeleteSshPublicKey>(
48 "AWS.Transfer.DeleteSshPublicKey",
49);