1import type * as qbusiness from "@distilled.cloud/aws/qbusiness";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Index } from "./SearchIndex.ts";
5
6/**
7 * `PutGroup` request with `applicationId` + `indexId` injected from the bound index.
8 */
9export interface PutGroupRequest extends Omit<
10 qbusiness.PutGroupRequest,
11 "applicationId" | "indexId"
12> {}
13
14/**
15 * Runtime binding for the `PutGroup` operation (IAM action
16 * `qbusiness:PutGroup`), scoped to one {@link Index}.
17 *
18 * Creates or replaces a group's membership (users and sub groups)
19 * used to enforce document access control at query time.
20 * Provide the implementation with
21 * `Effect.provide(AWS.QBusiness.PutGroupHttp)`.
22 *
23 * ### Principal Mapping
24 * **Example:** Map a Group's Members
25 * ```typescript
26 * const putGroup = yield* AWS.QBusiness.PutGroup(index);
27 *
28 * yield* putGroup({
29 * groupName: "engineering",
30 * type: "INDEX",
31 * groupMembers: {
32 * memberUsers: [{ userId: "user@example.com", type: "INDEX" }],
33 * },
34 * });
35 * ```
36 *
37 * @binding
38 */
39export interface PutGroup extends Binding.Service<
40 PutGroup,
41 "AWS.QBusiness.PutGroup",
42 (
43 index: Index,
44 ) => Effect.Effect<
45 (
46 request: PutGroupRequest,
47 ) => Effect.Effect<qbusiness.PutGroupResponse, qbusiness.PutGroupError>
48 >
49> {}
50export const PutGroup = Binding.Service<PutGroup>("AWS.QBusiness.PutGroup");