import { IUserRequestOptions } from "@esri/arcgis-rest-auth" ; import { getPortalUrl } from "../util/get-portal-url" ; import { request } from "@esri/arcgis-rest-request" ; export interface IUpdateGroupUsersResult { /**
     * Array of results
     */ results : any [ ] ; } export interface IUpdateGroupUsersOptions extends IUserRequestOptions { /**
     * Group ID
     */ id : string ; /**
     * An array of usernames to be updated
     */ users : string [ ] ; /**
     * Membership Type to update to
     */ newMemberType : "member" | "admin" ; } param requestOptions returns export function updateUserMemberships ( requestOptions ) { const url = `${ getPortalUrl ( requestOptions ) }/community/groups/${ requestOptions . id }/updateUsers` ; const opts = { authentication : requestOptions . authentication , params : { } } ; if ( requestOptions . newMemberType === "admin" ) { opts . params . admins = requestOptions . users ; } else { opts . params . users = requestOptions . users ; } return request ( url , opts ) ; }