private GetSlidesImageWithFormatRequest createGetSlidesImageWithFormatRequest()
        {
            GetSlidesImageWithFormatRequest request = new GetSlidesImageWithFormatRequest();

            request.Name   = "test.pptx";
            request.Index  = 1;
            request.Format = ImageExportFormat.Jpeg;
            return(request);
        }
        public void GetSlidesImageWithFormatExample()
        {
            Stream response = null;

            try
            {
                GetSlidesImageWithFormatRequest request = createGetSlidesImageWithFormatRequest();
                response = api.GetSlidesImageWithFormat(request);
                Console.WriteLine(response);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Beispiel #3
0
        /// <summary>
        /// Gets image in specified format.
        /// </summary>
        /// <param name="request">Request. <see cref="GetSlidesImageWithFormatRequest" /></param>
        /// <returns><see cref="System.IO.Stream"/></returns>
        public System.IO.Stream GetSlidesImageWithFormat(GetSlidesImageWithFormatRequest request)
        {
            // verify the required parameter 'name' is set
            if (request.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling GetSlidesImageWithFormat");
            }

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

            resourcePath = UrlHelper.AddPathParameter(resourcePath, "name", request.Name);
            resourcePath = UrlHelper.AddPathParameter(resourcePath, "index", request.Index);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "format", request.Format);
            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(InvokeBinaryApi(resourcePath, "GET", null, null, files, contentType));
        }
        public void GetSlidesImageWithFormatInvalidName()
        {
            InvalidPropertyTestExecutor <GetSlidesImageWithFormatRequest, System.IO.Stream> testExecutor =
                new InvalidPropertyTestExecutor <GetSlidesImageWithFormatRequest, System.IO.Stream>("GetSlidesImageWithFormat", "Name");
            GetSlidesImageWithFormatRequest request = testExecutor.PrepareRequest();

            System.IO.Stream response           = null;
            bool             needAssertResponse = false;

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