Skip to content

Commit e3bab87

Browse files
committed
20220921 update : add convert apis.
1 parent b14bcb3 commit e3bab87

File tree

5 files changed

+249
-4
lines changed

5 files changed

+249
-4
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![Gem](https://img.shields.io/gem/v/aspose_cells_cloud) ![Gem](https://img.shields.io/gem/dt/aspose_cells_cloud) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-ruby)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-ruby/22.8)
1+
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![Gem](https://img.shields.io/gem/v/aspose_cells_cloud) ![Gem](https://img.shields.io/gem/dt/aspose_cells_cloud) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-ruby)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-ruby/22.9)
22

33

44
# Ruby SDK for Spreadsheet Processing in the Cloud
@@ -22,9 +22,11 @@ Ruby Cloud SDK wraps Aspose.Cells REST API so you could seamlessly integrate Mic
2222
- [Convert Excel files to popular formats](https://docs.aspose.cloud/cells/convert-excel-workbook-to-different-file-formats/).
2323

2424

25-
## Feature & Enhancements in Version 22.8
25+
## Feature & Enhancements in Version 22.9
2626

27-
- Support transposing Excel Rows to Columns.
27+
- Add api for converting workbook to png.
28+
- Add api for converting workbook to pdf.
29+
- Add api for converting workbook to docx.
2830

2931
## Read & Write Spreadsheet Formats
3032

lib/aspose_cells_cloud.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@
168168
require 'aspose_cells_cloud/models/convert_task_parameter'
169169
require 'aspose_cells_cloud/models/convert_worksheet_task_parameter'
170170
require 'aspose_cells_cloud/models/dif_save_options'
171+
require 'aspose_cells_cloud/models/docx_save_options'
171172
require 'aspose_cells_cloud/models/file_version'
172173
require 'aspose_cells_cloud/models/fill_format_response'
173174
require 'aspose_cells_cloud/models/format_condition'
@@ -187,6 +188,7 @@
187188
require 'aspose_cells_cloud/models/import_int_array_option'
188189
require 'aspose_cells_cloud/models/import_picture_option'
189190
require 'aspose_cells_cloud/models/import_string_array_option'
191+
require 'aspose_cells_cloud/models/json_save_options'
190192
require 'aspose_cells_cloud/models/legend_response'
191193
require 'aspose_cells_cloud/models/line_format'
192194
require 'aspose_cells_cloud/models/line_response'
@@ -227,6 +229,7 @@
227229
require 'aspose_cells_cloud/models/pivot_table_response'
228230
require 'aspose_cells_cloud/models/pivot_tables'
229231
require 'aspose_cells_cloud/models/pivot_tables_response'
232+
require 'aspose_cells_cloud/models/pptx_save_options'
230233
require 'aspose_cells_cloud/models/range_value_response'
231234
require 'aspose_cells_cloud/models/ranges_response'
232235
require 'aspose_cells_cloud/models/row'
@@ -248,6 +251,7 @@
248251
require 'aspose_cells_cloud/models/split_result_response'
249252
require 'aspose_cells_cloud/models/split_workbook_task_parameter'
250253
require 'aspose_cells_cloud/models/spreadsheet_ml2003_save_options'
254+
require 'aspose_cells_cloud/models/sql_script_save_options'
251255
require 'aspose_cells_cloud/models/style'
252256
require 'aspose_cells_cloud/models/style_response'
253257
require 'aspose_cells_cloud/models/svg_save_options'

lib/aspose_cells_cloud/api/cells_api.rb

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20744,6 +20744,200 @@ def post_batch_convert_with_http_info(batch_convert_request, opts = {})
2074420744
end
2074520745
return data, status_code, headers
2074620746
end
20747+
#
20748+
#
20749+
# @param file File to upload
20750+
# @param [Hash] opts the optional parameters
20751+
# @option opts [String] :password
20752+
# @option opts [BOOLEAN] :check_excel_restriction (default to true)
20753+
# @return [FileInfo]
20754+
def post_convert_workbook_to_docx(file, opts = {})
20755+
data, _status_code, _headers = post_convert_workbook_to_docx_with_http_info(file, opts)
20756+
return data
20757+
end
20758+
20759+
#
20760+
#
20761+
# @param file File to upload
20762+
# @param [Hash] opts the optional parameters
20763+
# @option opts [String] :password
20764+
# @option opts [BOOLEAN] :check_excel_restriction
20765+
# @return [Array<(FileInfo, Fixnum, Hash)>] FileInfo data, response status code and response headers
20766+
def post_convert_workbook_to_docx_with_http_info(file, opts = {})
20767+
if @api_client.config.debugging
20768+
@api_client.config.logger.debug "Calling API: CellsApi.post_convert_workbook_to_docx ..."
20769+
end
20770+
@api_client.request_token_if_needed
20771+
# verify the required parameter 'file' is set
20772+
if @api_client.config.client_side_validation && file.nil?
20773+
fail ArgumentError, "Missing the required parameter 'file' when calling CellsApi.post_convert_workbook_to_docx"
20774+
end
20775+
# resource path
20776+
local_var_path = "/cells/convert/docx"
20777+
20778+
# query parameters
20779+
query_params = {}
20780+
query_params[:'password'] = opts[:'password'] if !opts[:'password'].nil?
20781+
query_params[:'checkExcelRestriction'] = opts[:'check_excel_restriction'] if !opts[:'check_excel_restriction'].nil?
20782+
20783+
# header parameters
20784+
header_params = {}
20785+
# HTTP header 'Accept' (if needed)
20786+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
20787+
# HTTP header 'Content-Type'
20788+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
20789+
20790+
# form parameters
20791+
form_params = {}
20792+
20793+
# http body (model)
20794+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
20795+
post_body =''
20796+
form_params['file'] = file
20797+
#auth_names = []
20798+
auth_names = ['JWT']
20799+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
20800+
:header_params => header_params,
20801+
:query_params => query_params,
20802+
:form_params => form_params,
20803+
:body => post_body,
20804+
:auth_names => auth_names,
20805+
:return_type => 'FileInfo')
20806+
if @api_client.config.debugging
20807+
@api_client.config.logger.debug "API called: CellsApi#post_convert_workbook_to_docx\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
20808+
end
20809+
return data, status_code, headers
20810+
end
20811+
20812+
#
20813+
#
20814+
# @param file File to upload
20815+
# @param [Hash] opts the optional parameters
20816+
# @option opts [String] :password
20817+
# @option opts [BOOLEAN] :check_excel_restriction (default to true)
20818+
# @return [FileInfo]
20819+
def post_convert_workbook_to_pdf(file, opts = {})
20820+
data, _status_code, _headers = post_convert_workbook_to_pdf_with_http_info(file, opts)
20821+
return data
20822+
end
20823+
20824+
#
20825+
#
20826+
# @param file File to upload
20827+
# @param [Hash] opts the optional parameters
20828+
# @option opts [String] :password
20829+
# @option opts [BOOLEAN] :check_excel_restriction
20830+
# @return [Array<(FileInfo, Fixnum, Hash)>] FileInfo data, response status code and response headers
20831+
def post_convert_workbook_to_pdf_with_http_info(file, opts = {})
20832+
if @api_client.config.debugging
20833+
@api_client.config.logger.debug "Calling API: CellsApi.post_convert_workbook_to_pdf ..."
20834+
end
20835+
@api_client.request_token_if_needed
20836+
# verify the required parameter 'file' is set
20837+
if @api_client.config.client_side_validation && file.nil?
20838+
fail ArgumentError, "Missing the required parameter 'file' when calling CellsApi.post_convert_workbook_to_pdf"
20839+
end
20840+
# resource path
20841+
local_var_path = "/cells/convert/pdf"
20842+
20843+
# query parameters
20844+
query_params = {}
20845+
query_params[:'password'] = opts[:'password'] if !opts[:'password'].nil?
20846+
query_params[:'checkExcelRestriction'] = opts[:'check_excel_restriction'] if !opts[:'check_excel_restriction'].nil?
20847+
20848+
# header parameters
20849+
header_params = {}
20850+
# HTTP header 'Accept' (if needed)
20851+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
20852+
# HTTP header 'Content-Type'
20853+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
20854+
20855+
# form parameters
20856+
form_params = {}
20857+
20858+
# http body (model)
20859+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
20860+
post_body =''
20861+
form_params['file'] = file
20862+
#auth_names = []
20863+
auth_names = ['JWT']
20864+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
20865+
:header_params => header_params,
20866+
:query_params => query_params,
20867+
:form_params => form_params,
20868+
:body => post_body,
20869+
:auth_names => auth_names,
20870+
:return_type => 'FileInfo')
20871+
if @api_client.config.debugging
20872+
@api_client.config.logger.debug "API called: CellsApi#post_convert_workbook_to_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
20873+
end
20874+
return data, status_code, headers
20875+
end
20876+
20877+
#
20878+
#
20879+
# @param file File to upload
20880+
# @param [Hash] opts the optional parameters
20881+
# @option opts [String] :password
20882+
# @option opts [BOOLEAN] :check_excel_restriction (default to true)
20883+
# @return [FileInfo]
20884+
def post_convert_workbook_to_png(file, opts = {})
20885+
data, _status_code, _headers = post_convert_workbook_to_png_with_http_info(file, opts)
20886+
return data
20887+
end
20888+
20889+
#
20890+
#
20891+
# @param file File to upload
20892+
# @param [Hash] opts the optional parameters
20893+
# @option opts [String] :password
20894+
# @option opts [BOOLEAN] :check_excel_restriction
20895+
# @return [Array<(FileInfo, Fixnum, Hash)>] FileInfo data, response status code and response headers
20896+
def post_convert_workbook_to_png_with_http_info(file, opts = {})
20897+
if @api_client.config.debugging
20898+
@api_client.config.logger.debug "Calling API: CellsApi.post_convert_workbook_to_png ..."
20899+
end
20900+
@api_client.request_token_if_needed
20901+
# verify the required parameter 'file' is set
20902+
if @api_client.config.client_side_validation && file.nil?
20903+
fail ArgumentError, "Missing the required parameter 'file' when calling CellsApi.post_convert_workbook_to_png"
20904+
end
20905+
# resource path
20906+
local_var_path = "/cells/convert/png"
20907+
20908+
# query parameters
20909+
query_params = {}
20910+
query_params[:'password'] = opts[:'password'] if !opts[:'password'].nil?
20911+
query_params[:'checkExcelRestriction'] = opts[:'check_excel_restriction'] if !opts[:'check_excel_restriction'].nil?
20912+
20913+
# header parameters
20914+
header_params = {}
20915+
# HTTP header 'Accept' (if needed)
20916+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
20917+
# HTTP header 'Content-Type'
20918+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
20919+
20920+
# form parameters
20921+
form_params = {}
20922+
20923+
# http body (model)
20924+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
20925+
post_body =''
20926+
form_params['file'] = file
20927+
#auth_names = []
20928+
auth_names = ['JWT']
20929+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
20930+
:header_params => header_params,
20931+
:query_params => query_params,
20932+
:form_params => form_params,
20933+
:body => post_body,
20934+
:auth_names => auth_names,
20935+
:return_type => 'FileInfo')
20936+
if @api_client.config.debugging
20937+
@api_client.config.logger.debug "API called: CellsApi#post_convert_workbook_to_png\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
20938+
end
20939+
return data, status_code, headers
20940+
end
2074720941

2074820942
# Check if storage exists
2074920943
#

lib/aspose_cells_cloud/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121
=end
2222

2323
module AsposeCellsCloud
24-
VERSION = "22.8"
24+
VERSION = "22.9"
2525
end

spec/api/cells_convert_spec.rb

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
=begin
2+
#Web API Swagger specification
3+
4+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5+
6+
OpenAPI spec version: 1.0
7+
8+
Generated by: https://github.com/swagger-api/swagger-codegen.git
9+
Swagger Codegen version: 2.3.0-SNAPSHOT
10+
11+
=end
12+
13+
require 'spec_helper'
14+
require 'json'
15+
16+
# Unit tests for AsposeCellsCloud::CellsApi
17+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18+
# Please update as you see appropriate
19+
describe 'CellsConvertApi' do
20+
before do
21+
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
22+
$VERBOSE = nil
23+
end
24+
25+
after do
26+
# run after each test
27+
end
28+
29+
describe 'cells_unit test' do
30+
it "should work" do
31+
result = @instance.post_convert_workbook_to_docx(::File.open(File.expand_path("data/"+ $BOOK1),"r") )
32+
end
33+
end
34+
describe 'cells_unit test' do
35+
it "should work" do
36+
result = @instance.post_convert_workbook_to_png(::File.open(File.expand_path("data/"+ $BOOK1),"r") )
37+
end
38+
end
39+
describe 'cells_unit test' do
40+
it "should work" do
41+
result = @instance.post_convert_workbook_to_pdf(::File.open(File.expand_path("data/"+ $BOOK1),"r") )
42+
end
43+
end
44+
end
45+

0 commit comments

Comments
 (0)