import { RpcMethod } from './commonTypes'; export type AccountGroupsService_Get = RpcMethod; export type AccountGroupsService_List = RpcMethod; export type AccountGroupsService_Create = RpcMethod; export type AccountGroupsService_Update = RpcMethod; export type AccountGroupsService_Delete = RpcMethod; export type AccountGroupsService_ListGroupMembers = RpcMethod; export type AccountGroupsService_UpdateGroupMembers = RpcMethod; export type AccountGroupsService_UpdateUserMembership = RpcMethod; export interface AccountGroupsService { /** Returns a single account permission group by name with its map of enabled account/application rights. Use after list_account_groups to inspect one group's permissions. */ Get: AccountGroupsService_Get; /** Lists the account's permission groups with paging and optional name search, each with its rights and member count. Use to browse groups before fetching or editing one. */ List: AccountGroupsService_List; /** Creates a new account permission group with the given name and set of enabled rights. Fails if a group with that name already exists; use update_account_group to change an existing group's rights. */ Create: AccountGroupsService_Create; /** Overwrites the enabled rights of an existing account group by name, granting the listed rights and revoking all others. Use to change a group's permissions; the group name itself is not changed. */ Update: AccountGroupsService_Update; /** Deletes an account group by name and reassigns all its members to reassign_group. Irreversible; the group's rights and its own membership records are removed. */ Delete: AccountGroupsService_Delete; /** Lists all users of the account with a flag showing whether each is a member of the named account group. Use to see who belongs to a group before editing membership. */ ListGroupMembers: AccountGroupsService_ListGroupMembers; /** Adds or removes users in a named account group according to a username/email to enabled map, granting membership where true and revoking it where false. Use to edit one group's member list. */ UpdateGroupMembers: AccountGroupsService_UpdateGroupMembers; /** Sets the full list of account groups a single user belongs to, granting the listed groups and revoking all others. Use to manage one user's group memberships across the account; returns the resulting membership list. */ UpdateUserMembership: AccountGroupsService_UpdateUserMembership; } export type ListRequest_OrderBy = 'NAME'; export type ListRequest_OrderDirection = 'ASC' | 'DESC'; export type ListRequest = { page?: number; perPage?: number; orderBy?: ListRequest_OrderBy; orderDirection?: ListRequest_OrderDirection; /** Case-insensitive substring match on account group name (SQL ILIKE '%value%'). */ searchByName?: string; }; export type ListResponse_AccountGroup = { name: string; rights: Record; /** the number of the members belongs to the group */ memberCount: number; }; export type ListResponse = { accountGroups: ListResponse_AccountGroup[]; page: number; perPage: number; total: number; }; export type CreateRequest = { /** Name for the new account group; must be unique within the account. */ name?: string; /** right name => enabled */ rights?: Record; }; export type CreateResponse = {}; export type UpdateRequest = { /** Name of the existing account group to update. */ name?: string; /** right name => enabled */ rights?: Record; }; export type UpdateResponse = {}; export type DeleteRequest = { /** Name of the account group to delete. */ name?: string; /** contains group name, all users will be reassigned to this group */ reassignGroup?: string; }; export type DeleteResponse = {}; export type ListGroupMembersRequest = { /** Account group name whose members to list. */ name?: string; }; export type ListGroupMembersResponse_AccountGroupMember = { username: string; email: string; isMember: boolean; }; export type ListGroupMembersResponse = { accountGroupMembers: ListGroupMembersResponse_AccountGroupMember[]; }; export type UpdateGroupMembersRequest = { /** Account group name whose members to update. */ name?: string; /** username/email => enabled */ members?: Record; }; export type UpdateGroupMembersResponse = {}; export type UpdateUserMembershipRequest = { /** username/email */ username?: string; /** contains account group names in which the user must be a member */ groupMembership?: string[]; }; export type UpdateUserMembershipResponse = { /** contains account group names in which the user is a member */ groupMembership: string[]; }; export type GetRequest = { /** Account group name to fetch. */ name?: string; }; export type GetResponse_AccountGroup = { name: string; rights: Record; }; export type GetResponse = { accountGroup: GetResponse_AccountGroup; };