public void PutChangesDocumentStreamTest() { PutChangesDocumentStreamRequest request = new PutChangesDocumentStreamRequest(GetComparisonRequest("source.docx", new List <string> { "target.docx" })); var response = ChangesApi.PutChangesDocumentStream(request); Assert.IsInstanceOf <System.IO.Stream>(response, "response is System.IO.Stream"); }
/// <summary> /// Applies changes to the document and returns stream of document with the result of comparison /// </summary> /// <param name="request">Request. <see cref="PutChangesDocumentStreamRequest" /></param> /// <returns><see cref="System.IO.Stream"/></returns> public System.IO.Stream PutChangesDocumentStream(PutChangesDocumentStreamRequest request) { // create path and map variables var resourcePath = this.configuration.GetApiRootUrl() + "/comparison/compareDocuments/changes/stream"; resourcePath = Regex .Replace(resourcePath, "\\*", string.Empty) .Replace("&", "&") .Replace("/?", "?"); var postBody = SerializationHelper.Serialize(request.Request); // http body (model) parameter try { var response = this.apiInvoker.InvokeBinaryApi( resourcePath, "PUT", postBody, null, null); if (response != null) { return(response); } return(null); } catch (ApiException ex) { if (ex.ErrorCode == 404) { return(null); } throw; } }