Example #1
0
        private PostPresentationMergeRequest createPostPresentationMergeRequest()
        {
            PostPresentationMergeRequest request = new PostPresentationMergeRequest();

            request.Name = "test.pptx";
            return(request);
        }
Example #2
0
        public void postPresentationMergeExample()
        {
            DocumentResponse response = null;

            try
            {
                PostPresentationMergeRequest request = createPostPresentationMergeRequest();
                response = api.PostPresentationMerge(request);
                Console.WriteLine(response);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        /// <summary>
        /// Merge presentations.
        /// </summary>
        /// <param name="request">Request. <see cref="PostPresentationMergeRequest" /></param>
        /// <returns><see cref="DocumentResponse"/></returns>
        public DocumentResponse PostPresentationMerge(PostPresentationMergeRequest request)
        {
            // verify the required parameter 'name' is set
            if (request.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling PostPresentationMerge");
            }

            // create path and map variables
            string resourcePath = GetResourceUrl("/slides/{name}/merge");

            resourcePath = UrlHelper.AddPathParameter(resourcePath, "name", request.Name);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storage", request.Storage);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "folder", request.Folder);
            string contentType;
            var    postBody = SerializationHelper.Serialize(request.Request, out contentType); // http body (model) parameter
            var    files    = new List <FileInfo>();

            PickFiles(files, request);
            return(InvokeApi <DocumentResponse>(resourcePath, "POST", postBody, null, files, contentType));
        }
Example #4
0
        public void PostPresentationMergeInvalidName()
        {
            InvalidPropertyTestExecutor <PostPresentationMergeRequest, DocumentResponse> testExecutor =
                new InvalidPropertyTestExecutor <PostPresentationMergeRequest, DocumentResponse>("PostPresentationMerge", "Name");
            PostPresentationMergeRequest request  = testExecutor.PrepareRequest();
            DocumentResponse             response = null;
            bool needAssertResponse = false;

            try
            {
                response           = m_instance.PostPresentationMerge(request);
                needAssertResponse = true;
            }
            catch (Exception ex)
            {
                testExecutor.AssertException(ex);
            }
            if (needAssertResponse)
            {
                testExecutor.AssertResult(response);
            }
        }