public async Task <ObjectUpdateResult> UpdateAsync(int workspaceId, RelativityObject obj, CallingContext context, CancellationToken token) { var request = RelativityObjectUpdateRestPrep.Prep(obj, context); var result = await _request.PostAsJsonAsync($"/Relativity.REST/api/Relativity.Objects/workspace/{workspaceId}/object/update", request, token); var error = await result.EnsureSuccessAsync(); try { error.ThrowIfNotNull(); } catch (EventHandlerFailedException ehfe) { return(new ObjectUpdateResult(ehfe.Message)); } var ret = await result.Content.ReadAsAsync <ObjectUpdateResult>(); return(ret); }
public async Task <ObjectUpdateResult> UpdateAsync(int workspaceId, RelativityObject obj, CallingContext context, CancellationToken token) { var request = RelativityObjectUpdateRestPrep.PrepareForUpdateRequst(obj); var result = await _request.PostAsJsonAsync($"{BASE_PATH}/{workspaceId}/objects/{obj.ArtifactId}", new { RelativityObject = request, CallingContext = context }, token); var error = await result.EnsureSuccessAsync(); try { error.ThrowIfNotNull(); } catch (EventHandlerFailedException ehfe) { return(new ObjectUpdateResult(ehfe.Message)); } var ret = await result.Content.ReadAsAsync <ObjectUpdateResult>(); return(ret); }