/// <summary> /// Create presentation document from html /// </summary> /// <param name="request">Request. <see cref="PutSlidesDocumentFromHtmlRequest" /></param> /// <returns><see cref="DocumentResponse"/></returns> public DocumentResponse PutSlidesDocumentFromHtml(PutSlidesDocumentFromHtmlRequest request) { // verify the required parameter 'name' is set if (request.Name == null) { throw new ApiException(400, "Missing required parameter 'name' when calling PutSlidesDocumentFromHtml"); } // verify the required parameter 'html' is set if (request.Html == null) { throw new ApiException(400, "Missing required parameter 'html' when calling PutSlidesDocumentFromHtml"); } // create path and map variables string resourcePath = GetResourceUrl("/slides/{name}/fromHtml"); resourcePath = UrlHelper.AddPathParameter(resourcePath, "name", request.Name); resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "password", request.Password); resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storage", request.Storage); resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "folder", request.Folder); string contentType; var postBody = SerializationHelper.Serialize(request.Html, out contentType); // http body (model) parameter var files = new List <FileInfo>(); PickFiles(files, request); return(InvokeApi <DocumentResponse>(resourcePath, "PUT", postBody, null, files, contentType)); }
private static PutSlidesDocumentFromHtmlRequest createPutSlidesDocumentFromHtmlRequest() { PutSlidesDocumentFromHtmlRequest request = new PutSlidesDocumentFromHtmlRequest(); request.Name = "test.pptx"; request.Html = "<html></html>"; return(request); }
public void PutSlidesDocumentFromHtmlExample() { DocumentResponse response = null; try { PutSlidesDocumentFromHtmlRequest request = createPutSlidesDocumentFromHtmlRequest(); response = api.PutSlidesDocumentFromHtml(request); Console.WriteLine(response.Code); } catch (Exception ex) { Console.WriteLine(ex.Message); } }