Skip to content

Commit 6619b25

Browse files
committed
Release Aspose.Cells Cloud SDK 21.5
1 parent 742a023 commit 6619b25

File tree

8 files changed

+371
-37
lines changed

8 files changed

+371
-37
lines changed

README.md

Lines changed: 5 additions & 4 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/21.1)
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/21.5)
22

33

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

24-
## Feature & Enhancements in Version 21.1
24+
## Feature & Enhancements in Version 21.5
2525

26-
- Support to convert worksheet on task API.
27-
- Support to add and delete cell or range in worksheet.
26+
- Support autofit columns for workbook and worksheet.
27+
- Improve add and post row/column APIs.
28+
- Improve Task APIs.
2829

2930
## Read & Write Spreadsheet Formats
3031

lib/aspose_cells_cloud.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@
261261
require 'aspose_cells_cloud/models/workbook_response'
262262
require 'aspose_cells_cloud/models/workbook_settings_operate_parameter'
263263
require 'aspose_cells_cloud/models/workbook_settings_response'
264+
require 'aspose_cells_cloud/models/worksheet_operate_parameter'
264265
require 'aspose_cells_cloud/models/worksheet_replace_response'
265266
require 'aspose_cells_cloud/models/worksheet_response'
266267
require 'aspose_cells_cloud/models/worksheets'

lib/aspose_cells_cloud/api/cells_api.rb

Lines changed: 96 additions & 25 deletions
Large diffs are not rendered by default.

lib/aspose_cells_cloud/models/chart_operate_parameter.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module AsposeCellsCloud
2727
class ChartOperateParameter
2828
attr_accessor :operate_type
2929

30-
attr_accessor :string
30+
attr_accessor :title
3131

3232
attr_accessor :area
3333

@@ -50,7 +50,7 @@ class ChartOperateParameter
5050
def self.attribute_map
5151
{
5252
:'operate_type' => :'OperateType',
53-
:'string' => :'string',
53+
:'title' => :'Title',
5454
:'area' => :'Area',
5555
:'category_data' => :'CategoryData',
5656
:'upper_left_row' => :'UpperLeftRow',
@@ -66,7 +66,7 @@ def self.attribute_map
6666
def self.swagger_types
6767
{
6868
:'operate_type' => :'String',
69-
:'string' => :'String',
69+
:'title' => :'String',
7070
:'area' => :'String',
7171
:'category_data' => :'String',
7272
:'upper_left_row' => :'Integer',
@@ -90,8 +90,8 @@ def initialize(attributes = {})
9090
self.operate_type = attributes[:'OperateType']
9191
end
9292

93-
if attributes.has_key?(:'string')
94-
self.string = attributes[:'string']
93+
if attributes.has_key?(:'Title')
94+
self.title = attributes[:'Title']
9595
end
9696

9797
if attributes.has_key?(:'Area')
@@ -147,7 +147,7 @@ def ==(o)
147147
return true if self.equal?(o)
148148
self.class == o.class &&
149149
operate_type == o.operate_type &&
150-
string == o.string &&
150+
title == o.title &&
151151
area == o.area &&
152152
category_data == o.category_data &&
153153
upper_left_row == o.upper_left_row &&
@@ -167,7 +167,7 @@ def eql?(o)
167167
# Calculates hash code according to all attributes.
168168
# @return [Fixnum] Hash code
169169
def hash
170-
[operate_type, string, area, category_data, upper_left_row, lower_right_column, lower_right_row, is_auto_get_serial_name, chart_type, is_vertical].hash
170+
[operate_type, title, area, category_data, upper_left_row, lower_right_column, lower_right_row, is_auto_get_serial_name, chart_type, is_vertical].hash
171171
end
172172

173173
# Builds the object from hash
Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
=begin
2+
--------------------------------------------------------------------------------------------------------------------
3+
Copyright (c) 2021 Aspose.Cells Cloud
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to deal
6+
in the Software without restriction, including without limitation the rights
7+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18+
SOFTWARE.
19+
--------------------------------------------------------------------------------------------------------------------
20+
21+
=end
22+
23+
require 'date'
24+
25+
module AsposeCellsCloud
26+
27+
class WorksheetOperateParameter
28+
attr_accessor :operate_type
29+
30+
attr_accessor :name
31+
32+
attr_accessor :sheet_type
33+
34+
attr_accessor :new_name
35+
36+
attr_accessor :moving_request
37+
38+
39+
# Attribute mapping from ruby-style variable name to JSON key.
40+
def self.attribute_map
41+
{
42+
:'operate_type' => :'OperateType',
43+
:'name' => :'Name',
44+
:'sheet_type' => :'SheetType',
45+
:'new_name' => :'NewName',
46+
:'moving_request' => :'MovingRequest'
47+
}
48+
end
49+
50+
# Attribute type mapping.
51+
def self.swagger_types
52+
{
53+
:'operate_type' => :'String',
54+
:'name' => :'String',
55+
:'sheet_type' => :'String',
56+
:'new_name' => :'String',
57+
:'moving_request' => :'WorksheetMovingRequest'
58+
}
59+
end
60+
61+
# Initializes the object
62+
# @param [Hash] attributes Model attributes in the form of hash
63+
def initialize(attributes = {})
64+
return unless attributes.is_a?(Hash)
65+
66+
# convert string to symbol for hash key
67+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
68+
69+
if attributes.has_key?(:'OperateType')
70+
self.operate_type = attributes[:'OperateType']
71+
end
72+
73+
if attributes.has_key?(:'Name')
74+
self.name = attributes[:'Name']
75+
end
76+
77+
if attributes.has_key?(:'SheetType')
78+
self.sheet_type = attributes[:'SheetType']
79+
end
80+
81+
if attributes.has_key?(:'NewName')
82+
self.new_name = attributes[:'NewName']
83+
end
84+
85+
if attributes.has_key?(:'MovingRequest')
86+
self.moving_request = attributes[:'MovingRequest']
87+
end
88+
89+
end
90+
91+
# Show invalid properties with the reasons. Usually used together with valid?
92+
# @return Array for valid properies with the reasons
93+
def list_invalid_properties
94+
invalid_properties = Array.new
95+
return invalid_properties
96+
end
97+
98+
# Check to see if the all the properties in the model are valid
99+
# @return true if the model is valid
100+
def valid?
101+
return true
102+
end
103+
104+
# Checks equality by comparing each attribute.
105+
# @param [Object] Object to be compared
106+
def ==(o)
107+
return true if self.equal?(o)
108+
self.class == o.class &&
109+
operate_type == o.operate_type &&
110+
name == o.name &&
111+
sheet_type == o.sheet_type &&
112+
new_name == o.new_name &&
113+
moving_request == o.moving_request
114+
end
115+
116+
# @see the `==` method
117+
# @param [Object] Object to be compared
118+
def eql?(o)
119+
self == o
120+
end
121+
122+
# Calculates hash code according to all attributes.
123+
# @return [Fixnum] Hash code
124+
def hash
125+
[operate_type, name, sheet_type, new_name, moving_request].hash
126+
end
127+
128+
# Builds the object from hash
129+
# @param [Hash] attributes Model attributes in the form of hash
130+
# @return [Object] Returns the model itself
131+
def build_from_hash(attributes)
132+
return nil unless attributes.is_a?(Hash)
133+
self.class.swagger_types.each_pair do |key, type|
134+
if type =~ /\AArray<(.*)>/i
135+
# check to ensure the input is an array given that the the attribute
136+
# is documented as an array but the input is not
137+
if attributes[self.class.attribute_map[key]].is_a?(Array)
138+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
139+
end
140+
elsif !attributes[self.class.attribute_map[key]].nil?
141+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
142+
end # or else data not found in attributes(hash), not an issue as the data can be optional
143+
end
144+
145+
self
146+
end
147+
148+
# Deserializes the data based on type
149+
# @param string type Data type
150+
# @param string value Value to be deserialized
151+
# @return [Object] Deserialized data
152+
def _deserialize(type, value)
153+
case type.to_sym
154+
when :DateTime
155+
DateTime.parse(value)
156+
when :Date
157+
Date.parse(value)
158+
when :String
159+
value.to_s
160+
when :Integer
161+
value.to_i
162+
when :Float
163+
value.to_f
164+
when :BOOLEAN
165+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166+
true
167+
else
168+
false
169+
end
170+
when :Object
171+
# generic object (usually a Hash), return directly
172+
value
173+
when /\AArray<(?<inner_type>.+)>\z/
174+
inner_type = Regexp.last_match[:inner_type]
175+
value.map { |v| _deserialize(inner_type, v) }
176+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177+
k_type = Regexp.last_match[:k_type]
178+
v_type = Regexp.last_match[:v_type]
179+
{}.tap do |hash|
180+
value.each do |k, v|
181+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182+
end
183+
end
184+
else # model
185+
temp_model = AsposeCellsCloud.const_get(type).new
186+
temp_model.build_from_hash(value)
187+
end
188+
end
189+
190+
# Returns the string representation of the object
191+
# @return [String] String presentation of the object
192+
def to_s
193+
to_hash.to_s
194+
end
195+
196+
# to_body is an alias to to_hash (backward compatibility)
197+
# @return [Hash] Returns the object in the form of hash
198+
def to_body
199+
to_hash
200+
end
201+
202+
# Returns the object in the form of hash
203+
# @return [Hash] Returns the object in the form of hash
204+
def to_hash
205+
hash = {}
206+
self.class.attribute_map.each_pair do |attr, param|
207+
value = self.send(attr)
208+
next if value.nil?
209+
hash[param] = _to_hash(value)
210+
end
211+
hash
212+
end
213+
214+
# Outputs non-array value in the form of hash
215+
# For object, use to_hash. Otherwise, just return the value
216+
# @param [Object] value Any valid value
217+
# @return [Hash] Returns the value in the form of hash
218+
def _to_hash(value)
219+
if value.is_a?(Array)
220+
value.compact.map{ |v| _to_hash(v) }
221+
elsif value.is_a?(Hash)
222+
{}.tap do |hash|
223+
value.each { |k, v| hash[k] = _to_hash(v) }
224+
end
225+
elsif value.respond_to? :to_hash
226+
value.to_hash
227+
else
228+
value
229+
end
230+
end
231+
232+
end
233+
234+
end

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 = "21.1"
24+
VERSION = "21.5"
2525
end

spec/api/cells_workbook_api_spec.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,32 @@
230230
end
231231
end
232232

233+
# unit tests for cells_workbook_post_autofit_workbook_columns
234+
# Autofit workbook columns.
235+
#
236+
# @param name Document name.
237+
# @param [Hash] opts the optional parameters
238+
# @option opts [AutoFitterOptions] :auto_fitter_options Auto Fitter Options.
239+
# @option opts [Integer] :start_column Start column.
240+
# @option opts [Integer] :end_column End column.
241+
# @option opts [String] :folder Document&#39;s folder.
242+
# @option opts [String] :storage storage name.
243+
# @return [CellsCloudResponse]
244+
describe 'cells_workbook_post_autofit_workbook_columns test' do
245+
it "should work" do
246+
name = $BOOK1
247+
auto_fitter_options = nil
248+
start_column = 1
249+
end_column = 100
250+
only_auto = true
251+
folder = $TEMPFOLDER
252+
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
253+
expect(result.uploaded.size).to be > 0
254+
result = @instance.cells_workbook_post_autofit_workbook_columns(name, {:auto_fitter_options=>auto_fitter_options, :start_column=>start_column, :end_column=>end_column, :folder=>folder})
255+
expect(result.code).to eql(200)
256+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
257+
end
258+
end
233259

234260
# unit tests for cells_workbook_post_import_data
235261
#

spec/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1111
=end
1212
require 'openssl'
13+
require 'bundler'
1314
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
1415
# load the gem
1516
require 'aspose_cells_cloud'

0 commit comments

Comments
 (0)