public void PutChangesImagesTest() { string outPath = "result.docx"; PutChangesImagesRequest request = new PutChangesImagesRequest(GetComparisonRequest("source.docx", new List <string> { "target.docx" }), outPath); var response = ChangesApi.PutChangesImages(request); Assert.IsInstanceOf <List <Link> >(response, "response is List<Link>"); }
/// <summary> /// Applies changes to the document and returns images of document with the result of comparison /// </summary> /// <param name="request">Request. <see cref="PutChangesImagesRequest" /></param> /// <returns><see cref="List<Link>"/></returns> public List <Link> PutChangesImages(PutChangesImagesRequest request) { // create path and map variables var resourcePath = this.configuration.GetApiRootUrl() + "/comparison/compareDocuments/changes/images"; resourcePath = Regex .Replace(resourcePath, "\\*", string.Empty) .Replace("&", "&") .Replace("/?", "?"); resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "outFolder", request.OutFolder); var postBody = SerializationHelper.Serialize(request.Request); // http body (model) parameter try { var response = this.apiInvoker.InvokeApi( resourcePath, "PUT", postBody, null, null); if (response != null) { return((List <Link>)SerializationHelper.Deserialize(response, typeof(List <Link>))); } return(null); } catch (ApiException ex) { if (ex.ErrorCode == 404) { return(null); } throw; } }