aspose_cells_cloud 22.3 → 22.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/aspose_cells_cloud/api/cells_api.rb +89 -3
- data/lib/aspose_cells_cloud/api/light_cells_api.rb +7 -1
- data/lib/aspose_cells_cloud/api_client.rb +2 -2
- data/lib/aspose_cells_cloud/models/barcode_response.rb +215 -0
- data/lib/aspose_cells_cloud/models/barcode_response_list.rb +200 -0
- data/lib/aspose_cells_cloud/version.rb +1 -1
- data/lib/aspose_cells_cloud.rb +2 -0
- data/spec/api/cells_barcode_spec.rb +41 -0
- data/spec/api/cells_export_spec.rb +21 -2
- data/spec/api/cells_one_spec.rb +37 -0
- data/spec/api/cells_save_as_api_spec.rb +17 -0
- data/spec/api/cells_simple_spec.rb +11 -8
- data/spec/api/cells_workbook_api_spec.rb +32 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6745d2d226a6e26b84452b750095c3d06148cb94f1e22ddbf521bf9cda3973d8
|
4
|
+
data.tar.gz: a4ab4b1e32bac7f4a67fb698db931094e3c588eae644ec5e9d21a99b7d5f6911
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b01d20e815db5695542ccc7e0e18656057aeb0fe1852995844daf32d2777ba55a9f721e1fa01bb3d71a837e2e69904f270f13cb2102c36761b6e9805a2764064
|
7
|
+
data.tar.gz: 62260ab9631c963a11f4ca9d65b76467a5d3ffafc0541e66b3ed54a8559cf822aaf71117bd3da36255ce011c6cce8b3e47a0454db37450e178453e153ca08338
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
   [](https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby/blob/master/LICENSE)    [](https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby/blob/master/LICENSE) 
|
2
2
|
|
3
3
|
|
4
4
|
# Ruby SDK for Spreadsheet Processing in the Cloud
|
@@ -22,10 +22,10 @@ Ruby Cloud SDK wraps Aspose.Cells REST API so you could seamlessly integrate Mic
|
|
22
22
|
- [Convert Excel files to popular formats](https://docs.aspose.cloud/cells/convert-excel-workbook-to-different-file-formats/).
|
23
23
|
|
24
24
|
|
25
|
-
## Feature & Enhancements in Version 22.
|
26
|
-
|
27
|
-
- Add new API about adding digital signature for cloud file.
|
25
|
+
## Feature & Enhancements in Version 22.6
|
28
26
|
|
27
|
+
- Improve save as api.
|
28
|
+
- Improve clear objects api.
|
29
29
|
|
30
30
|
## Read & Write Spreadsheet Formats
|
31
31
|
|
@@ -7353,7 +7353,80 @@ module AsposeCellsCloud
|
|
7353
7353
|
end
|
7354
7354
|
return data, status_code, headers
|
7355
7355
|
end
|
7356
|
+
# Get chart area border info.
|
7357
|
+
#
|
7358
|
+
# @param name Workbook name.
|
7359
|
+
# @param sheet_name Worksheet name.
|
7360
|
+
# @param picture_index The picture index.
|
7361
|
+
# @param [Hash] opts the optional parameters
|
7362
|
+
# @option opts [String] :folder Workbook folder.
|
7363
|
+
# @option opts [String] :storage_name storage name.
|
7364
|
+
# @return [BarcodeResponseList]
|
7365
|
+
def cells_picture_get_extract_barcodes(name, sheet_name, picture_index, opts = {})
|
7366
|
+
data, _status_code, _headers = cells_picture_get_extract_barcodes_with_http_info(name, sheet_name, picture_index, opts)
|
7367
|
+
return data
|
7368
|
+
end
|
7369
|
+
|
7370
|
+
# Get chart area border info.
|
7371
|
+
#
|
7372
|
+
# @param name Workbook name.
|
7373
|
+
# @param sheet_name Worksheet name.
|
7374
|
+
# @param picture_index The picture index.
|
7375
|
+
# @param [Hash] opts the optional parameters
|
7376
|
+
# @option opts [String] :folder Workbook folder.
|
7377
|
+
# @option opts [String] :storage_name storage name.
|
7378
|
+
# @return [Array<(BarcodeResponseList, Fixnum, Hash)>] BarcodeResponseList data, response status code and response headers
|
7379
|
+
def cells_picture_get_extract_barcodes_with_http_info(name, sheet_name, picture_index, opts = {})
|
7380
|
+
if @api_client.config.debugging
|
7381
|
+
@api_client.config.logger.debug "Calling API: CellsApi.cells_picture_get_extract_barcodes ..."
|
7382
|
+
end
|
7383
|
+
@api_client.request_token_if_needed
|
7384
|
+
# verify the required parameter 'name' is set
|
7385
|
+
if @api_client.config.client_side_validation && name.nil?
|
7386
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling CellsApi.cells_picture_get_extract_barcodes"
|
7387
|
+
end
|
7388
|
+
# verify the required parameter 'sheet_name' is set
|
7389
|
+
if @api_client.config.client_side_validation && sheet_name.nil?
|
7390
|
+
fail ArgumentError, "Missing the required parameter 'sheet_name' when calling CellsApi.cells_picture_get_extract_barcodes"
|
7391
|
+
end
|
7392
|
+
# verify the required parameter 'picture_index' is set
|
7393
|
+
if @api_client.config.client_side_validation && picture_index.nil?
|
7394
|
+
fail ArgumentError, "Missing the required parameter 'picture_index' when calling CellsApi.cells_picture_get_extract_barcodes"
|
7395
|
+
end
|
7396
|
+
# resource path
|
7397
|
+
local_var_path = "/cells/{name}/worksheets/{sheetName}/pictures/{pictureIndex}/recognize".sub('{' + 'name' + '}', name.to_s).sub('{' + 'sheetName' + '}', sheet_name.to_s).sub('{' + 'pictureIndex' + '}', picture_index.to_s)
|
7356
7398
|
|
7399
|
+
# query parameters
|
7400
|
+
query_params = {}
|
7401
|
+
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
7402
|
+
query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].nil?
|
7403
|
+
|
7404
|
+
# header parameters
|
7405
|
+
header_params = {}
|
7406
|
+
# HTTP header 'Accept' (if needed)
|
7407
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
7408
|
+
# HTTP header 'Content-Type'
|
7409
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
7410
|
+
|
7411
|
+
# form parameters
|
7412
|
+
form_params = {}
|
7413
|
+
|
7414
|
+
# http body (model)
|
7415
|
+
post_body = nil
|
7416
|
+
#auth_names = []
|
7417
|
+
auth_names = ['JWT']
|
7418
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
7419
|
+
:header_params => header_params,
|
7420
|
+
:query_params => query_params,
|
7421
|
+
:form_params => form_params,
|
7422
|
+
:body => post_body,
|
7423
|
+
:auth_names => auth_names,
|
7424
|
+
:return_type => 'BarcodeResponseList')
|
7425
|
+
if @api_client.config.debugging
|
7426
|
+
@api_client.config.logger.debug "API called: CellsApi#cells_picture_get_extract_barcodes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
7427
|
+
end
|
7428
|
+
return data, status_code, headers
|
7429
|
+
end
|
7357
7430
|
# Delete a picture object in worksheet
|
7358
7431
|
#
|
7359
7432
|
# @param name The workbook name.
|
@@ -13316,7 +13389,12 @@ module AsposeCellsCloud
|
|
13316
13389
|
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
13317
13390
|
query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].nil?
|
13318
13391
|
query_params[:'outStorageName'] = opts[:'out_storage_name'] if !opts[:'out_storage_name'].nil?
|
13319
|
-
|
13392
|
+
query_params[:'checkExcelRestriction'] = opts[:'check_excel_restriction'] if !opts[:'check_excel_restriction'].nil?
|
13393
|
+
if opts[:'extendedQueryParameters']
|
13394
|
+
opts[:'extendedQueryParameters'].each do |key , value|
|
13395
|
+
query_params[key] = value
|
13396
|
+
end
|
13397
|
+
end
|
13320
13398
|
# header parameters
|
13321
13399
|
header_params = {}
|
13322
13400
|
# HTTP header 'Accept' (if needed)
|
@@ -14978,7 +15056,11 @@ module AsposeCellsCloud
|
|
14978
15056
|
query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].nil?
|
14979
15057
|
query_params[:'outPath'] = opts[:'out_path'] if !opts[:'out_path'].nil?
|
14980
15058
|
query_params[:'outStorageName'] = opts[:'out_storage_name'] if !opts[:'out_storage_name'].nil?
|
14981
|
-
|
15059
|
+
if opts[:'extendedQueryParameters']
|
15060
|
+
opts[:'extendedQueryParameters'].each do |key , value|
|
15061
|
+
query_params[key] = value
|
15062
|
+
end
|
15063
|
+
end
|
14982
15064
|
# header parameters
|
14983
15065
|
header_params = {}
|
14984
15066
|
# HTTP header 'Accept' (if needed)
|
@@ -16367,7 +16449,11 @@ module AsposeCellsCloud
|
|
16367
16449
|
query_params[:'password'] = opts[:'password'] if !opts[:'password'].nil?
|
16368
16450
|
query_params[:'outPath'] = opts[:'out_path'] if !opts[:'out_path'].nil?
|
16369
16451
|
query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].nil?
|
16370
|
-
|
16452
|
+
if opts[:'extendedQueryParameters']
|
16453
|
+
opts[:'extendedQueryParameters'].each do |key , value|
|
16454
|
+
query_params[key] = value
|
16455
|
+
end
|
16456
|
+
end
|
16371
16457
|
# header parameters
|
16372
16458
|
header_params = {}
|
16373
16459
|
# HTTP header 'Accept' (if needed)
|
@@ -269,7 +269,8 @@ module AsposeCellsCloud
|
|
269
269
|
# query parameters
|
270
270
|
query_params = {}
|
271
271
|
query_params[:'objecttype'] = objecttype
|
272
|
-
|
272
|
+
query_params[:'sheetname'] = opts[:'sheetname'] if !opts[:'sheetname'].nil?
|
273
|
+
query_params[:'outFormat'] = opts[:'out_format'] if !opts[:'out_format'].nil?
|
273
274
|
# header parameters
|
274
275
|
header_params = {}
|
275
276
|
# HTTP header 'Accept' (if needed)
|
@@ -344,6 +345,11 @@ module AsposeCellsCloud
|
|
344
345
|
query_params = {}
|
345
346
|
query_params[:'objectType'] = object_type
|
346
347
|
query_params[:'format'] = format
|
348
|
+
if opts[:'extendedQueryParameters']
|
349
|
+
opts[:'extendedQueryParameters'].each do |key , value|
|
350
|
+
query_params[key] = value
|
351
|
+
end
|
352
|
+
end
|
347
353
|
|
348
354
|
# header parameters
|
349
355
|
header_params = {}
|
@@ -116,7 +116,7 @@ module AsposeCellsCloud
|
|
116
116
|
:params => query_params,
|
117
117
|
:body => body
|
118
118
|
}
|
119
|
-
|
119
|
+
|
120
120
|
if [:post, :patch, :put, :delete].include?(http_method)
|
121
121
|
req_body = build_request_body(header_params, form_params, opts[:body])
|
122
122
|
req_opts.update :body => req_body
|
@@ -137,7 +137,7 @@ module AsposeCellsCloud
|
|
137
137
|
f.request :url_encoded
|
138
138
|
f.adapter Faraday.default_adapter
|
139
139
|
end
|
140
|
-
|
140
|
+
|
141
141
|
if req_opts[:body] == {}
|
142
142
|
req_opts[:body] = nil
|
143
143
|
end
|
@@ -0,0 +1,215 @@
|
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2022 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 BarcodeResponse
|
28
|
+
attr_accessor :barcode_value
|
29
|
+
|
30
|
+
attr_accessor :barcode_type
|
31
|
+
|
32
|
+
attr_accessor :checksum
|
33
|
+
|
34
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
35
|
+
def self.attribute_map
|
36
|
+
{
|
37
|
+
:'barcode_value' => :'BarcodeValue',
|
38
|
+
:'barcode_type' => :'BarcodeType',
|
39
|
+
:'checksum' => :'Checksum'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# Attribute type mapping.
|
44
|
+
def self.swagger_types
|
45
|
+
{
|
46
|
+
:'barcode_value' => :'String',
|
47
|
+
:'barcode_type' => :'String',
|
48
|
+
:'checksum' => :'String'
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
# Initializes the object
|
53
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
54
|
+
def initialize(attributes = {})
|
55
|
+
return unless attributes.is_a?(Hash)
|
56
|
+
|
57
|
+
# convert string to symbol for hash key
|
58
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
59
|
+
|
60
|
+
if attributes.has_key?(:'BarcodeValue')
|
61
|
+
self.barcode_value = attributes[:'BarcodeValue']
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.has_key?(:'BarcodeType')
|
65
|
+
self.barcode_type = attributes[:'BarcodeType']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.has_key?(:'Checksum')
|
69
|
+
self.checksum = attributes[:'Checksum']
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
75
|
+
# @return Array for valid properies with the reasons
|
76
|
+
def list_invalid_properties
|
77
|
+
invalid_properties = Array.new
|
78
|
+
return invalid_properties
|
79
|
+
end
|
80
|
+
|
81
|
+
# Check to see if the all the properties in the model are valid
|
82
|
+
# @return true if the model is valid
|
83
|
+
def valid?
|
84
|
+
return true
|
85
|
+
end
|
86
|
+
|
87
|
+
# Checks equality by comparing each attribute.
|
88
|
+
# @param [Object] Object to be compared
|
89
|
+
def ==(o)
|
90
|
+
return true if self.equal?(o)
|
91
|
+
self.class == o.class &&
|
92
|
+
barcode_value == o.barcode_value &&
|
93
|
+
barcode_type == o.barcode_type &&
|
94
|
+
checksum == o.checksum
|
95
|
+
end
|
96
|
+
|
97
|
+
# @see the `==` method
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def eql?(o)
|
100
|
+
self == o
|
101
|
+
end
|
102
|
+
|
103
|
+
# Calculates hash code according to all attributes.
|
104
|
+
# @return [Fixnum] Hash code
|
105
|
+
def hash
|
106
|
+
[barcode_value, barcode_type, checksum, region].hash
|
107
|
+
end
|
108
|
+
|
109
|
+
# Builds the object from hash
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
+
# @return [Object] Returns the model itself
|
112
|
+
def build_from_hash(attributes)
|
113
|
+
return nil unless attributes.is_a?(Hash)
|
114
|
+
self.class.swagger_types.each_pair do |key, type|
|
115
|
+
if type =~ /\AArray<(.*)>/i
|
116
|
+
# check to ensure the input is an array given that the the attribute
|
117
|
+
# is documented as an array but the input is not
|
118
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
119
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
120
|
+
end
|
121
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
122
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
123
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
124
|
+
end
|
125
|
+
|
126
|
+
self
|
127
|
+
end
|
128
|
+
|
129
|
+
# Deserializes the data based on type
|
130
|
+
# @param string type Data type
|
131
|
+
# @param string value Value to be deserialized
|
132
|
+
# @return [Object] Deserialized data
|
133
|
+
def _deserialize(type, value)
|
134
|
+
case type.to_sym
|
135
|
+
when :DateTime
|
136
|
+
DateTime.parse(value)
|
137
|
+
when :Date
|
138
|
+
Date.parse(value)
|
139
|
+
when :String
|
140
|
+
value.to_s
|
141
|
+
when :Integer
|
142
|
+
value.to_i
|
143
|
+
when :Float
|
144
|
+
value.to_f
|
145
|
+
when :BOOLEAN
|
146
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
147
|
+
true
|
148
|
+
else
|
149
|
+
false
|
150
|
+
end
|
151
|
+
when :Object
|
152
|
+
# generic object (usually a Hash), return directly
|
153
|
+
value
|
154
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
155
|
+
inner_type = Regexp.last_match[:inner_type]
|
156
|
+
value.map { |v| _deserialize(inner_type, v) }
|
157
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
158
|
+
k_type = Regexp.last_match[:k_type]
|
159
|
+
v_type = Regexp.last_match[:v_type]
|
160
|
+
{}.tap do |hash|
|
161
|
+
value.each do |k, v|
|
162
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
else # model
|
166
|
+
temp_model = AsposeCellsCloud.const_get(type).new
|
167
|
+
temp_model.build_from_hash(value)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
# Returns the string representation of the object
|
172
|
+
# @return [String] String presentation of the object
|
173
|
+
def to_s
|
174
|
+
to_hash.to_s
|
175
|
+
end
|
176
|
+
|
177
|
+
# to_body is an alias to to_hash (backward compatibility)
|
178
|
+
# @return [Hash] Returns the object in the form of hash
|
179
|
+
def to_body
|
180
|
+
to_hash
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the object in the form of hash
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
185
|
+
def to_hash
|
186
|
+
hash = {}
|
187
|
+
self.class.attribute_map.each_pair do |attr, param|
|
188
|
+
value = self.send(attr)
|
189
|
+
next if value.nil?
|
190
|
+
hash[param] = _to_hash(value)
|
191
|
+
end
|
192
|
+
hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Outputs non-array value in the form of hash
|
196
|
+
# For object, use to_hash. Otherwise, just return the value
|
197
|
+
# @param [Object] value Any valid value
|
198
|
+
# @return [Hash] Returns the value in the form of hash
|
199
|
+
def _to_hash(value)
|
200
|
+
if value.is_a?(Array)
|
201
|
+
value.compact.map{ |v| _to_hash(v) }
|
202
|
+
elsif value.is_a?(Hash)
|
203
|
+
{}.tap do |hash|
|
204
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
205
|
+
end
|
206
|
+
elsif value.respond_to? :to_hash
|
207
|
+
value.to_hash
|
208
|
+
else
|
209
|
+
value
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
end
|
214
|
+
|
215
|
+
end
|
@@ -0,0 +1,200 @@
|
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2022 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 BarcodeResponseList
|
28
|
+
attr_accessor :barcodes
|
29
|
+
|
30
|
+
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
32
|
+
def self.attribute_map
|
33
|
+
{
|
34
|
+
:'barcodes' => :'Barcodes'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.swagger_types
|
40
|
+
{
|
41
|
+
:'barcodes' => :'Array<BarcodeResponse>'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
return unless attributes.is_a?(Hash)
|
49
|
+
|
50
|
+
# convert string to symbol for hash key
|
51
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
52
|
+
|
53
|
+
if attributes.has_key?(:'Barcodes')
|
54
|
+
if (value = attributes[:'Barcodes']).is_a?(Array)
|
55
|
+
self.barcodes = value
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
62
|
+
# @return Array for valid properies with the reasons
|
63
|
+
def list_invalid_properties
|
64
|
+
invalid_properties = Array.new
|
65
|
+
return invalid_properties
|
66
|
+
end
|
67
|
+
|
68
|
+
# Check to see if the all the properties in the model are valid
|
69
|
+
# @return true if the model is valid
|
70
|
+
def valid?
|
71
|
+
return true
|
72
|
+
end
|
73
|
+
|
74
|
+
# Checks equality by comparing each attribute.
|
75
|
+
# @param [Object] Object to be compared
|
76
|
+
def ==(o)
|
77
|
+
return true if self.equal?(o)
|
78
|
+
self.class == o.class &&
|
79
|
+
barcodes == o.barcodes
|
80
|
+
end
|
81
|
+
|
82
|
+
# @see the `==` method
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def eql?(o)
|
85
|
+
self == o
|
86
|
+
end
|
87
|
+
|
88
|
+
# Calculates hash code according to all attributes.
|
89
|
+
# @return [Fixnum] Hash code
|
90
|
+
def hash
|
91
|
+
[barcodes].hash
|
92
|
+
end
|
93
|
+
|
94
|
+
# Builds the object from hash
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
96
|
+
# @return [Object] Returns the model itself
|
97
|
+
def build_from_hash(attributes)
|
98
|
+
return nil unless attributes.is_a?(Hash)
|
99
|
+
self.class.swagger_types.each_pair do |key, type|
|
100
|
+
if type =~ /\AArray<(.*)>/i
|
101
|
+
# check to ensure the input is an array given that the the attribute
|
102
|
+
# is documented as an array but the input is not
|
103
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
104
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
105
|
+
end
|
106
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
107
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
108
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
109
|
+
end
|
110
|
+
|
111
|
+
self
|
112
|
+
end
|
113
|
+
|
114
|
+
# Deserializes the data based on type
|
115
|
+
# @param string type Data type
|
116
|
+
# @param string value Value to be deserialized
|
117
|
+
# @return [Object] Deserialized data
|
118
|
+
def _deserialize(type, value)
|
119
|
+
case type.to_sym
|
120
|
+
when :DateTime
|
121
|
+
DateTime.parse(value)
|
122
|
+
when :Date
|
123
|
+
Date.parse(value)
|
124
|
+
when :String
|
125
|
+
value.to_s
|
126
|
+
when :Integer
|
127
|
+
value.to_i
|
128
|
+
when :Float
|
129
|
+
value.to_f
|
130
|
+
when :BOOLEAN
|
131
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
132
|
+
true
|
133
|
+
else
|
134
|
+
false
|
135
|
+
end
|
136
|
+
when :Object
|
137
|
+
# generic object (usually a Hash), return directly
|
138
|
+
value
|
139
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
140
|
+
inner_type = Regexp.last_match[:inner_type]
|
141
|
+
value.map { |v| _deserialize(inner_type, v) }
|
142
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
143
|
+
k_type = Regexp.last_match[:k_type]
|
144
|
+
v_type = Regexp.last_match[:v_type]
|
145
|
+
{}.tap do |hash|
|
146
|
+
value.each do |k, v|
|
147
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
else # model
|
151
|
+
temp_model = AsposeCellsCloud.const_get(type).new
|
152
|
+
temp_model.build_from_hash(value)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
# Returns the string representation of the object
|
157
|
+
# @return [String] String presentation of the object
|
158
|
+
def to_s
|
159
|
+
to_hash.to_s
|
160
|
+
end
|
161
|
+
|
162
|
+
# to_body is an alias to to_hash (backward compatibility)
|
163
|
+
# @return [Hash] Returns the object in the form of hash
|
164
|
+
def to_body
|
165
|
+
to_hash
|
166
|
+
end
|
167
|
+
|
168
|
+
# Returns the object in the form of hash
|
169
|
+
# @return [Hash] Returns the object in the form of hash
|
170
|
+
def to_hash
|
171
|
+
hash = {}
|
172
|
+
self.class.attribute_map.each_pair do |attr, param|
|
173
|
+
value = self.send(attr)
|
174
|
+
next if value.nil?
|
175
|
+
hash[param] = _to_hash(value)
|
176
|
+
end
|
177
|
+
hash
|
178
|
+
end
|
179
|
+
|
180
|
+
# Outputs non-array value in the form of hash
|
181
|
+
# For object, use to_hash. Otherwise, just return the value
|
182
|
+
# @param [Object] value Any valid value
|
183
|
+
# @return [Hash] Returns the value in the form of hash
|
184
|
+
def _to_hash(value)
|
185
|
+
if value.is_a?(Array)
|
186
|
+
value.compact.map{ |v| _to_hash(v) }
|
187
|
+
elsif value.is_a?(Hash)
|
188
|
+
{}.tap do |hash|
|
189
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
190
|
+
end
|
191
|
+
elsif value.respond_to? :to_hash
|
192
|
+
value.to_hash
|
193
|
+
else
|
194
|
+
value
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
end
|
199
|
+
|
200
|
+
end
|
data/lib/aspose_cells_cloud.rb
CHANGED
@@ -31,6 +31,8 @@ require 'aspose_cells_cloud/models/above_average'
|
|
31
31
|
require 'aspose_cells_cloud/models/access_token_response'
|
32
32
|
require 'aspose_cells_cloud/models/area'
|
33
33
|
require 'aspose_cells_cloud/models/auto_fitter_options'
|
34
|
+
require 'aspose_cells_cloud/models/barcode_response'
|
35
|
+
require 'aspose_cells_cloud/models/barcode_response_list'
|
34
36
|
require 'aspose_cells_cloud/models/batch_convert_request'
|
35
37
|
require 'aspose_cells_cloud/models/border'
|
36
38
|
require 'aspose_cells_cloud/models/calculation_options'
|
@@ -0,0 +1,41 @@
|
|
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 'CellsBarcodeApi' 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
|
+
folder = $TEMPFOLDER
|
32
|
+
result = @instance.upload_file( folder+"/"+ $BOOK1, ::File.open(File.expand_path("data/"+ $BOOK1),"r") {|io| io.read(io.size) })
|
33
|
+
expect(result.uploaded.size).to be > 0
|
34
|
+
|
35
|
+
result = @instance.cells_picture_get_extract_barcodes($BOOK1,"Sheet8",0, { :folder=>folder})
|
36
|
+
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
@@ -161,6 +161,7 @@ describe 'LightCellsApi' do
|
|
161
161
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
162
162
|
end
|
163
163
|
end
|
164
|
+
|
164
165
|
describe 'lite_cells_unit export object test' do
|
165
166
|
it "should work" do
|
166
167
|
files = {}
|
@@ -169,11 +170,26 @@ describe 'LightCellsApi' do
|
|
169
170
|
name =$AssemblyTestXlsx
|
170
171
|
files[name] = ::File.open(File.expand_path("data/"+name),"r")
|
171
172
|
|
173
|
+
|
172
174
|
result = @instance.post_export(files ,"workbook","pdf")
|
173
175
|
|
174
176
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
175
|
-
|
177
|
+
end
|
176
178
|
end
|
179
|
+
|
180
|
+
describe 'lite_cells_unit export object test' do
|
181
|
+
it "should work" do
|
182
|
+
files = {}
|
183
|
+
name = $DataSourceXlsx
|
184
|
+
files[name] = ::File.open(File.expand_path("data/"+name),"r")
|
185
|
+
name =$AssemblyTestXlsx
|
186
|
+
files[name] = ::File.open(File.expand_path("data/"+name),"r")
|
187
|
+
|
188
|
+
result = @instance.post_export(files ,"listobject","xlsx")
|
189
|
+
|
190
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
191
|
+
end
|
192
|
+
end
|
177
193
|
|
178
194
|
describe 'lite_cells_unit export object test' do
|
179
195
|
it "should work" do
|
@@ -211,10 +227,13 @@ describe 'LightCellsApi' do
|
|
211
227
|
name =$AssemblyTestXlsx
|
212
228
|
files[name] = ::File.open(File.expand_path("data/"+name),"r")
|
213
229
|
|
214
|
-
|
230
|
+
extendedQueryParameters = {}
|
231
|
+
extendedQueryParameters['OnePagePerSheet'] = 'false'
|
232
|
+
result = @instance.post_export(files ,"listobject","pdf", { :extendedQueryParameters=>extendedQueryParameters})
|
215
233
|
|
216
234
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
217
235
|
end
|
218
236
|
end
|
237
|
+
|
219
238
|
end
|
220
239
|
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
# Unit tests for AsposeCellsCloud::CellsTaskApi
|
5
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
6
|
+
# Please update as you see appropriate
|
7
|
+
describe 'CellsTaskApi' do
|
8
|
+
before do
|
9
|
+
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0",$baseurl)
|
10
|
+
end
|
11
|
+
|
12
|
+
after do
|
13
|
+
# run after each test
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
# unit tests for one case
|
18
|
+
|
19
|
+
describe 'cells_get_worksheet_cell test' do
|
20
|
+
it "should work" do
|
21
|
+
name = $BOOK1
|
22
|
+
sheet_name = $SHEET1
|
23
|
+
cell_or_method_name = 'firstcell'
|
24
|
+
folder = $TEMPFOLDER
|
25
|
+
storage = nil
|
26
|
+
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
|
27
|
+
expect(result.uploaded.size).to be > 0
|
28
|
+
result = @instance.cells_get_worksheet_cell(name, sheet_name, cell_or_method_name, { :folder=>folder})
|
29
|
+
print(result[0])
|
30
|
+
print(result[1])
|
31
|
+
print(result[2])
|
32
|
+
#expect(result.code).to eql(200)
|
33
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
@@ -86,4 +86,21 @@ describe 'CellsSaveAsApi' do
|
|
86
86
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
87
87
|
end
|
88
88
|
end
|
89
|
+
describe 'cells_save_as_post_document_save_as to extend format test' do
|
90
|
+
it "should work" do
|
91
|
+
name = $BOOK1
|
92
|
+
save_options = nil
|
93
|
+
newfilename = 'newbook.xls.md'
|
94
|
+
is_auto_fit_rows = true
|
95
|
+
is_auto_fit_columns = true
|
96
|
+
folder = $TEMPFOLDER
|
97
|
+
extendedQueryParameters = {}
|
98
|
+
extendedQueryParameters['OnePagePerSheet'] = 'false'
|
99
|
+
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
|
100
|
+
expect(result.uploaded.size).to be > 0
|
101
|
+
result = @instance.cells_save_as_post_document_save_as(name, { :save_options=>save_options, :newfilename=>(folder+"/"+newfilename), :is_auto_fit_rows=>is_auto_fit_rows, :is_auto_fit_columns=>is_auto_fit_columns, :folder=>folder,:extendedQueryParameters=>extendedQueryParameters})
|
102
|
+
expect(result.code).to eql(200)
|
103
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
104
|
+
end
|
105
|
+
end
|
89
106
|
end
|
@@ -29,15 +29,18 @@ describe 'CellsApi' do
|
|
29
29
|
describe 'cells_ranges_post_worksheet_cells_range_outline_border test' do
|
30
30
|
it "should work" do
|
31
31
|
name = $BOOK1
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
password = nil
|
33
|
+
format = 'pdf'
|
34
|
+
is_auto_fit = true
|
35
|
+
only_save_table = true
|
36
36
|
folder = $TEMPFOLDER
|
37
|
-
|
38
|
-
|
39
|
-
result
|
40
|
-
|
37
|
+
out_path = nil
|
38
|
+
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
|
39
|
+
expect(result.uploaded.size).to be > 0
|
40
|
+
extendedQueryParameters = {}
|
41
|
+
extendedQueryParameters['OnePagePerSheet'] = 'false'
|
42
|
+
result = @instance.cells_workbook_get_workbook(name, { :password=>password, :format=>format,:folder=>folder, :out_path=>out_path, :extendedQueryParameters=>extendedQueryParameters})
|
43
|
+
# expect(result.code).to eql(200)
|
41
44
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
42
45
|
end
|
43
46
|
end
|
@@ -63,6 +63,24 @@ describe 'CellsWorkbookApi' do
|
|
63
63
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
64
64
|
end
|
65
65
|
end
|
66
|
+
describe 'cells_workbook_get_workbook to extend test' do
|
67
|
+
it "should work" do
|
68
|
+
name = $BOOK1
|
69
|
+
password = nil
|
70
|
+
format = 'XPS'
|
71
|
+
is_auto_fit = true
|
72
|
+
only_save_table = true
|
73
|
+
folder = $TEMPFOLDER
|
74
|
+
out_path = nil
|
75
|
+
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
|
76
|
+
expect(result.uploaded.size).to be > 0
|
77
|
+
extendedQueryParameters = {}
|
78
|
+
extendedQueryParameters['OnePagePerSheet'] = 'false'
|
79
|
+
result = @instance.cells_workbook_get_workbook(name, { :password=>password, :format=>format,:folder=>folder, :out_path=>out_path, :extendedQueryParameters=>extendedQueryParameters})
|
80
|
+
# expect(result.code).to eql(200)
|
81
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
82
|
+
end
|
83
|
+
end
|
66
84
|
# unit tests for cells_workbook_get_workbook
|
67
85
|
# Read workbook info or export.
|
68
86
|
#
|
@@ -512,6 +530,20 @@ describe 'CellsWorkbookApi' do
|
|
512
530
|
end
|
513
531
|
end
|
514
532
|
|
533
|
+
describe 'cells_workbook_put_convert_workbook_extend test' do
|
534
|
+
it "should work" do
|
535
|
+
name = $BOOK1
|
536
|
+
format = 'pdf'
|
537
|
+
password = nil
|
538
|
+
out_path = "Tdd.pdf"
|
539
|
+
extendedQueryParameters = {}
|
540
|
+
extendedQueryParameters['OnePagePerSheet'] = 'false'
|
541
|
+
result = @instance.cells_workbook_put_convert_workbook( ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) },{:format=>format,out_path=>out_path,:extendedQueryParameters=>extendedQueryParameters})
|
542
|
+
# expect(result.code).to eql(200)
|
543
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
544
|
+
end
|
545
|
+
end
|
546
|
+
|
515
547
|
# unit tests for cells_workbook_put_workbook_create
|
516
548
|
# Create new workbook using deferent methods.
|
517
549
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aspose_cells_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '22.
|
4
|
+
version: '22.6'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aspose Cells Cloud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -246,6 +246,8 @@ files:
|
|
246
246
|
- lib/aspose_cells_cloud/models/auto_shape_response.rb
|
247
247
|
- lib/aspose_cells_cloud/models/auto_shapes.rb
|
248
248
|
- lib/aspose_cells_cloud/models/auto_shapes_response.rb
|
249
|
+
- lib/aspose_cells_cloud/models/barcode_response.rb
|
250
|
+
- lib/aspose_cells_cloud/models/barcode_response_list.rb
|
249
251
|
- lib/aspose_cells_cloud/models/batch_convert_request.rb
|
250
252
|
- lib/aspose_cells_cloud/models/border.rb
|
251
253
|
- lib/aspose_cells_cloud/models/calculation_options.rb
|
@@ -494,6 +496,7 @@ files:
|
|
494
496
|
- spec/api/cells_api_spec.rb
|
495
497
|
- spec/api/cells_assembly_spec.rb
|
496
498
|
- spec/api/cells_auto_filter_api_spec.rb
|
499
|
+
- spec/api/cells_barcode_spec.rb
|
497
500
|
- spec/api/cells_batch_spec.rb
|
498
501
|
- spec/api/cells_chart_area_api_spec.rb
|
499
502
|
- spec/api/cells_charts_api_spec.rb
|
@@ -507,6 +510,7 @@ files:
|
|
507
510
|
- spec/api/cells_merge_spec.rb
|
508
511
|
- spec/api/cells_metadata_spec.rb
|
509
512
|
- spec/api/cells_ole_objects_api_spec.rb
|
513
|
+
- spec/api/cells_one_spec.rb
|
510
514
|
- spec/api/cells_page_breaks_api_spec.rb
|
511
515
|
- spec/api/cells_page_setup_api_spec.rb
|
512
516
|
- spec/api/cells_pictures_api_spec.rb
|