Esempio n. 1
0
        public void AddGroupMember(string username, PBIGroupAccessRight accessRight)
        {
            PBIGroupMember newMember = new PBIGroupMember()
            {
                Name = username, AccessRight = accessRight
            };

            AddGroupMember(newMember);
        }
Esempio n. 2
0
        public void AddGroupMember(PBIGroupMember groupMember)
        {
            if (this is PBIAPIClient) // if the caller is a PBIClient, we do not have a ParentGroup but need to use "My Workspace" instead
            {
                throw new Exception("Cannot add users to 'My Workspace'!");
            }

            using (HttpWebResponse response = ParentPowerBIAPI.SendPOSTRequest(ApiURL, PBIAPI.Users, PBIJsonHelper.SerializeObject(groupMember)))
            {
                string result = response.ResponseToString();
            }
        }