/// <summary> /// Replace text with a new value. /// </summary> /// <param name="request">Request. <see cref="PostSlidesPresentationReplaceTextRequest" /></param> /// <returns><see cref="PresentationStringReplaceResponse"/></returns> public PresentationStringReplaceResponse PostSlidesPresentationReplaceText(PostSlidesPresentationReplaceTextRequest request) { // verify the required parameter 'name' is set if (request.Name == null) { throw new ApiException(400, "Missing required parameter 'name' when calling PostSlidesPresentationReplaceText"); } // verify the required parameter 'oldValue' is set if (request.OldValue == null) { throw new ApiException(400, "Missing required parameter 'oldValue' when calling PostSlidesPresentationReplaceText"); } // verify the required parameter 'newValue' is set if (request.NewValue == null) { throw new ApiException(400, "Missing required parameter 'newValue' when calling PostSlidesPresentationReplaceText"); } // create path and map variables string resourcePath = GetResourceUrl("/slides/{name}/replaceText"); resourcePath = UrlHelper.AddPathParameter(resourcePath, "name", request.Name); resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "oldValue", request.OldValue); resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "newValue", request.NewValue); resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "ignoreCase", request.IgnoreCase); resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "folder", request.Folder); resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storage", request.Storage); string contentType = "application/json"; var files = new List <FileInfo>(); PickFiles(files, request); return(InvokeApi <PresentationStringReplaceResponse>(resourcePath, "POST", null, null, files, contentType)); }
private PostSlidesPresentationReplaceTextRequest createPostSlidesPresentationReplaceTextRequest() { PostSlidesPresentationReplaceTextRequest request = new PostSlidesPresentationReplaceTextRequest(); request.Name = "test.pptx"; request.OldValue = "hello"; request.NewValue = "world"; request.IgnoreCase = true; return(request); }
public void postSlidesPresentationReplaceTextTest() { PresentationStringReplaceResponse response = null; try { PostSlidesPresentationReplaceTextRequest request = createPostSlidesPresentationReplaceTextRequest(); response = api.PostSlidesPresentationReplaceText(request); Console.WriteLine(response.Code); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public void PostSlidesPresentationReplaceTextInvalidStorage() { InvalidPropertyTestExecutor <PostSlidesPresentationReplaceTextRequest, PresentationStringReplaceResponse> testExecutor = new InvalidPropertyTestExecutor <PostSlidesPresentationReplaceTextRequest, PresentationStringReplaceResponse>("PostSlidesPresentationReplaceText", "Storage"); PostSlidesPresentationReplaceTextRequest request = testExecutor.PrepareRequest(); PresentationStringReplaceResponse response = null; bool needAssertResponse = false; try { response = m_instance.PostSlidesPresentationReplaceText(request); needAssertResponse = true; } catch (Exception ex) { testExecutor.AssertException(ex); } if (needAssertResponse) { testExecutor.AssertResult(response); } }