| 1 | import type * as qbusiness from "@distilled.cloud/aws/qbusiness"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Application } from "./Application.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `CreateUser` request with `applicationId` injected from the bound application. |
| 8 | */ |
| 9 | export interface CreateUserRequest extends Omit< |
| 10 | qbusiness.CreateUserRequest, |
| 11 | "applicationId" |
| 12 | > {} |
| 13 | |
| 14 | /** |
| 15 | * Runtime binding for the `CreateUser` operation (IAM action |
| 16 | * `qbusiness:CreateUser`), scoped to one {@link Application}. |
| 17 | * |
| 18 | * Creates a user in the application's user store, mapping the user |
| 19 | * id to data-source-specific aliases used for document access |
| 20 | * control. |
| 21 | * Provide the implementation with |
| 22 | * `Effect.provide(AWS.QBusiness.CreateUserHttp)`. |
| 23 | * |
| 24 | * ### User Management |
| 25 | * **Example:** Create a User with Aliases |
| 26 | * ```typescript |
| 27 | * const createUser = yield* AWS.QBusiness.CreateUser(app); |
| 28 | * |
| 29 | * yield* createUser({ |
| 30 | * userId: "user@example.com", |
| 31 | * userAliases: [{ userId: "corp\\user" }], |
| 32 | * }); |
| 33 | * ``` |
| 34 | * |
| 35 | * @binding |
| 36 | */ |
| 37 | export interface CreateUser extends Binding.Service< |
| 38 | CreateUser, |
| 39 | "AWS.QBusiness.CreateUser", |
| 40 | ( |
| 41 | application: Application, |
| 42 | ) => Effect.Effect< |
| 43 | ( |
| 44 | request: CreateUserRequest, |
| 45 | ) => Effect.Effect<qbusiness.CreateUserResponse, qbusiness.CreateUserError> |
| 46 | > |
| 47 | > {} |
| 48 | export const CreateUser = Binding.Service<CreateUser>( |
| 49 | "AWS.QBusiness.CreateUser", |
| 50 | ); |