/// <summary>
        /// Copy masterSlide from source presentation.
        /// </summary>
        /// <param name="request">Request. <see cref="PostCopyMasterSlideFromSourcePresentationRequest" /></param>
        /// <returns><see cref="MasterSlideResponse"/></returns>
        public MasterSlideResponse PostCopyMasterSlideFromSourcePresentation(PostCopyMasterSlideFromSourcePresentationRequest request)
        {
            // verify the required parameter 'name' is set
            if (request.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling PostCopyMasterSlideFromSourcePresentation");
            }

            // verify the required parameter 'cloneFrom' is set
            if (request.CloneFrom == null)
            {
                throw new ApiException(400, "Missing required parameter 'cloneFrom' when calling PostCopyMasterSlideFromSourcePresentation");
            }

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

            resourcePath = UrlHelper.AddPathParameter(resourcePath, "name", request.Name);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "cloneFrom", request.CloneFrom);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "cloneFromPosition", request.CloneFromPosition);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "cloneFromStorage", request.CloneFromStorage);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "applyToAll", request.ApplyToAll);
            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 <MasterSlideResponse>(resourcePath, "POST", null, null, files, contentType));
        }
Exemple #2
0
        private PostCopyMasterSlideFromSourcePresentationRequest createPostCopyMasterSlideFromSourcePresentationRequest()
        {
            PostCopyMasterSlideFromSourcePresentationRequest request = new PostCopyMasterSlideFromSourcePresentationRequest();

            request.Name              = "test.pptx";
            request.CloneFrom         = "test.pptx";
            request.CloneFromPosition = 1;
            request.ApplyToAll        = true;
            return(request);
        }
Exemple #3
0
        public void postCopyMasterSlideFromSourcePresentationExample()
        {
            MasterSlideResponse response = null;

            try
            {
                PostCopyMasterSlideFromSourcePresentationRequest request = createPostCopyMasterSlideFromSourcePresentationRequest();
                response = api.PostCopyMasterSlideFromSourcePresentation(request);
                Console.WriteLine(response);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        public void PostCopyMasterSlideFromSourcePresentationInvalidStorage()
        {
            InvalidPropertyTestExecutor <PostCopyMasterSlideFromSourcePresentationRequest, MasterSlideResponse> testExecutor =
                new InvalidPropertyTestExecutor <PostCopyMasterSlideFromSourcePresentationRequest, MasterSlideResponse>("PostCopyMasterSlideFromSourcePresentation", "Storage");
            PostCopyMasterSlideFromSourcePresentationRequest request = testExecutor.PrepareRequest();
            MasterSlideResponse response = null;
            bool needAssertResponse      = false;

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