| 1 | import type * as identitystore from "@distilled.cloud/aws/identitystore"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Instance } from "./Instance.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for the `DescribeUser` operation (IAM action |
| 8 | * `identitystore:DescribeUser`), scoped to one {@link Instance}. |
| 9 | * |
| 10 | * Reads a user's metadata and attributes (user name, display name, emails) from the bound instance's identity store by `UserId`. The instance's |
| 11 | * `IdentityStoreId` is injected from the binding. Provide the implementation with |
| 12 | * `Effect.provide(AWS.IdentityCenter.DescribeUserHttp)`. |
| 13 | * ### Looking Up Users |
| 14 | * **Example:** Read a User's Profile |
| 15 | * ```typescript |
| 16 | * // init — bind the operation to the Identity Center instance |
| 17 | * const describeUser = yield* AWS.IdentityCenter.DescribeUser(instance); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const user = yield* describeUser({ UserId: userId }); |
| 21 | * console.log(user.UserName, user.DisplayName); |
| 22 | * ``` |
| 23 | * |
| 24 | * @binding |
| 25 | */ |
| 26 | export interface DescribeUser extends Binding.Service< |
| 27 | DescribeUser, |
| 28 | "AWS.IdentityCenter.DescribeUser", |
| 29 | ( |
| 30 | instance: Instance, |
| 31 | ) => Effect.Effect< |
| 32 | ( |
| 33 | request: Omit<identitystore.DescribeUserRequest, "IdentityStoreId">, |
| 34 | ) => Effect.Effect< |
| 35 | identitystore.DescribeUserResponse, |
| 36 | identitystore.DescribeUserError |
| 37 | > |
| 38 | > |
| 39 | > {} |
| 40 | export const DescribeUser = Binding.Service<DescribeUser>( |
| 41 | "AWS.IdentityCenter.DescribeUser", |
| 42 | ); |