/// <summary> /// Update the specified group. /// </summary> /// <param name="group"></param> /// <returns></returns> public async Task <Models.GroupModel> UpdateGroupAsync(Models.GroupModel group) { var json = group.Serialize(); var content = new StringContent(json, Encoding.UTF8, "application/json"); var response = await _client.PutAsync($"{this.Options.Admin.Authority}/groups/{group.Id}", content); return(response.HandleResponse(group)); }
/// <summary> /// Create a sub-group to the parent group specified for the 'parentId'. /// </summary> /// <param name="parentId"></param> /// <param name="group"></param> /// <returns></returns> public async Task <Models.GroupModel> CreateSubGroupAsync(Guid parentId, Models.GroupModel group) { var json = group.Serialize(); var content = new StringContent(json, Encoding.UTF8, "application/json"); var response = await _client.PostAsync($"{this.Options.Admin.Authority}/groups/{parentId}/children", content); return(await response.HandleResponseAsync <Models.GroupModel>()); }