| 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 BatchAddRoleRequest extends Omit< |
| 7 | repostspace.BatchAddRoleInput, |
| 8 | "spaceId" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for the `BatchAddRole` operation (IAM action |
| 13 | * `repostspace:BatchAddRole` on the space ARN). |
| 14 | * |
| 15 | * Grants a space-level role (`EXPERT`, `MODERATOR`, `ADMINISTRATOR`, or |
| 16 | * `SUPPORTREQUESTOR`) to up to 100 users or groups of the bound |
| 17 | * {@link Space} in one call. Per-accessor failures are reported in the |
| 18 | * output's `errors` list rather than failing the whole call. |
| 19 | * Provide the implementation with |
| 20 | * `Effect.provide(AWS.RePostSpace.BatchAddRoleHttp)`. |
| 21 | * ### Managing Roles |
| 22 | * **Example:** Grant the EXPERT role to users |
| 23 | * ```typescript |
| 24 | * const batchAddRole = yield* AWS.RePostSpace.BatchAddRole(space); |
| 25 | * |
| 26 | * const result = yield* batchAddRole({ |
| 27 | * accessorIds: ["94682c8d-1234-5678-9abc-e001c76e2c44"], |
| 28 | * role: "EXPERT", |
| 29 | * }); |
| 30 | * console.log(result.addedAccessorIds, result.errors); |
| 31 | * ``` |
| 32 | * |
| 33 | * @binding |
| 34 | */ |
| 35 | export interface BatchAddRole extends Binding.Service< |
| 36 | BatchAddRole, |
| 37 | "AWS.RePostSpace.BatchAddRole", |
| 38 | ( |
| 39 | space: Space, |
| 40 | ) => Effect.Effect< |
| 41 | ( |
| 42 | request: BatchAddRoleRequest, |
| 43 | ) => Effect.Effect< |
| 44 | repostspace.BatchAddRoleOutput, |
| 45 | repostspace.BatchAddRoleError |
| 46 | > |
| 47 | > |
| 48 | > {} |
| 49 | export const BatchAddRole = Binding.Service<BatchAddRole>( |
| 50 | "AWS.RePostSpace.BatchAddRole", |
| 51 | ); |