public void postAddNotesSlideExample()
        {
            NotesSlideResponse response = null;

            try
            {
                PostAddNotesSlideRequest request = createPostAddNotesSlideRequest();
                response = api.PostAddNotesSlide(request);
                Console.WriteLine(response.Code);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        private PostAddNotesSlideRequest createPostAddNotesSlideRequest()
        {
            PostAddNotesSlideRequest request = new PostAddNotesSlideRequest();

            request.Name       = "test.pptx";
            request.SlideIndex = 1;

            NotesSlide slide = new NotesSlide();

            slide.Text = "Hello World";

            request.Dto = slide;

            return(request);
        }
Ejemplo n.º 3
0
        public void PostAddNotesSlideInvalidStorage()
        {
            InvalidPropertyTestExecutor <PostAddNotesSlideRequest, NotesSlideResponse> testExecutor =
                new InvalidPropertyTestExecutor <PostAddNotesSlideRequest, NotesSlideResponse>("PostAddNotesSlide", "Storage");
            PostAddNotesSlideRequest request  = testExecutor.PrepareRequest();
            NotesSlideResponse       response = null;
            bool needAssertResponse           = false;

            try
            {
                response           = m_instance.PostAddNotesSlide(request);
                needAssertResponse = true;
            }
            catch (Exception ex)
            {
                testExecutor.AssertException(ex);
            }
            if (needAssertResponse)
            {
                testExecutor.AssertResult(response);
            }
        }
        /// <summary>
        /// Add new Notes Slide.
        /// </summary>
        /// <param name="request">Request. <see cref="PostAddNotesSlideRequest" /></param>
        /// <returns><see cref="NotesSlideResponse"/></returns>
        public NotesSlideResponse PostAddNotesSlide(PostAddNotesSlideRequest request)
        {
            // verify the required parameter 'name' is set
            if (request.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling PostAddNotesSlide");
            }

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

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

            PickFiles(files, request);
            return(InvokeApi <NotesSlideResponse>(resourcePath, "POST", postBody, null, files, contentType));
        }