public static void Run() { var apiInstance = new ReviewApi(Constants.GetConfig()); try { var options = new ApplyRevisionsOptions { SourceFile = new FileInfo { FilePath = "source_files/word/source_with_revs.docx" }, OutputPath = "output/result.docx" }; var revisions = apiInstance.GetRevisions(new GetRevisionsRequest(options.SourceFile)); foreach (var revision in revisions) { revision.Action = RevisionInfo.ActionEnum.Accept; } options.Revisions = revisions; var response = apiInstance.ApplyRevisions(new ApplyRevisionsRequest(options)); Console.WriteLine("ApplyRevisions: Output file link: " + response.Href); } catch (Exception e) { Console.WriteLine("Exception while calling api: " + e.Message); } }
public void RejectAllRevisions() { var options = new ApplyRevisionsOptions { SourceFile = TestFiles.SourceWithRevs.ToFileInfo(), RejectAll = true, OutputPath = "/resultFilePath/" + TestFiles.SourceWithRevs.FileName, }; var response = ReviewApi.ApplyRevisions(new ApplyRevisionsRequest(options)); Assert.AreEqual(response.Rel, options.OutputPath); }
public void ApplyRevisions() { var options = new ApplyRevisionsOptions { SourceFile = TestFiles.SourceWithRevs.ToFileInfo(), Revisions = new[] { new RevisionInfo { Id = 0, Action = RevisionInfo.ActionEnum.Accept }, new RevisionInfo { Id = 1, Action = RevisionInfo.ActionEnum.Reject } }.ToList(), OutputPath = "/resultFilePath/" + TestFiles.SourceWithRevs.FileName, }; var response = ReviewApi.ApplyRevisions(new ApplyRevisionsRequest(options)); Assert.AreEqual(response.Rel, options.OutputPath); }
public static void Run() { var apiInstance = new ReviewApi(Constants.GetConfig()); try { var options = new ApplyRevisionsOptions { SourceFile = new FileInfo { FilePath = "source_files/word/source_with_revs.docx" }, RejectAll = true, OutputPath = "output/result.docx" }; var response = apiInstance.ApplyRevisions(new ApplyRevisionsRequest(options)); Console.WriteLine("RejectAllRevisions: Output file link: " + response.Href); } catch (Exception e) { Console.WriteLine("Exception while calling api: " + e.Message); } }