| 1 | import type * as repostspace from "@distilled.cloud/aws/repostspace"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Space } from "./Space.ts"; |
| 5 | |
| 6 | export interface RegisterAdminRequest extends Omit< |
| 7 | repostspace.RegisterAdminInput, |
| 8 | "spaceId" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for the `RegisterAdmin` operation (IAM action |
| 13 | * `repostspace:RegisterAdmin` on the space ARN). |
| 14 | * |
| 15 | * Promotes an IAM Identity Center user or group (by accessor id) to |
| 16 | * administrator of the bound {@link Space}. |
| 17 | * Provide the implementation with |
| 18 | * `Effect.provide(AWS.RePostSpace.RegisterAdminHttp)`. |
| 19 | * ### Managing Admins |
| 20 | * **Example:** Register a space administrator |
| 21 | * ```typescript |
| 22 | * const registerAdmin = yield* AWS.RePostSpace.RegisterAdmin(space); |
| 23 | * |
| 24 | * yield* registerAdmin({ adminId: "94682c8d-1234-5678-9abc-e001c76e2c44" }); |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | */ |
| 29 | export interface RegisterAdmin extends Binding.Service< |
| 30 | RegisterAdmin, |
| 31 | "AWS.RePostSpace.RegisterAdmin", |
| 32 | ( |
| 33 | space: Space, |
| 34 | ) => Effect.Effect< |
| 35 | ( |
| 36 | request: RegisterAdminRequest, |
| 37 | ) => Effect.Effect< |
| 38 | repostspace.RegisterAdminResponse, |
| 39 | repostspace.RegisterAdminError |
| 40 | > |
| 41 | > |
| 42 | > {} |
| 43 | export const RegisterAdmin = Binding.Service<RegisterAdmin>( |
| 44 | "AWS.RePostSpace.RegisterAdmin", |
| 45 | ); |