| 1 | import type * as ds from "@distilled.cloud/aws/directory-service"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Directory } from "./Directory.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for the `ResetUserPassword` operation (IAM action |
| 8 | * `ds:ResetUserPassword`), scoped to one {@link Directory}. |
| 9 | * |
| 10 | * Resets the password of any user in the bound Simple AD or Managed |
| 11 | * Microsoft AD directory — the backbone of a self-service password-reset |
| 12 | * function. `NewPassword` is sensitive; pass a `Redacted` value so it never |
| 13 | * leaks into logs. The directory id is injected from the binding. Provide |
| 14 | * the implementation with |
| 15 | * `Effect.provide(AWS.DirectoryService.ResetUserPasswordHttp)`. |
| 16 | * ### Managing Users |
| 17 | * **Example:** Reset a User's Password |
| 18 | * ```typescript |
| 19 | * // init — bind the operation to the directory |
| 20 | * const resetUserPassword = yield* AWS.DirectoryService.ResetUserPassword(directory); |
| 21 | * |
| 22 | * // runtime |
| 23 | * yield* resetUserPassword({ |
| 24 | * UserName: "jdoe", |
| 25 | * NewPassword: Redacted.make("N3w-Secret!"), |
| 26 | * }); |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | */ |
| 31 | export interface ResetUserPassword extends Binding.Service< |
| 32 | ResetUserPassword, |
| 33 | "AWS.DirectoryService.ResetUserPassword", |
| 34 | ( |
| 35 | directory: Directory, |
| 36 | ) => Effect.Effect< |
| 37 | ( |
| 38 | request: Omit<ds.ResetUserPasswordRequest, "DirectoryId">, |
| 39 | ) => Effect.Effect<ds.ResetUserPasswordResult, ds.ResetUserPasswordError> |
| 40 | > |
| 41 | > {} |
| 42 | export const ResetUserPassword = Binding.Service<ResetUserPassword>( |
| 43 | "AWS.DirectoryService.ResetUserPassword", |
| 44 | ); |