aspose_cells_cloud 22.4 → 22.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,265 @@
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 PptxSaveOptions
28
+ attr_accessor :enable_http_compression
29
+
30
+ attr_accessor :save_format
31
+
32
+ # Make the workbook empty after saving the file.
33
+ attr_accessor :clear_data
34
+
35
+ # The cached file folder is used to store some large data.
36
+ attr_accessor :cached_file_folder
37
+
38
+ # Indicates whether validate merged areas before saving the file. The default value is false.
39
+ attr_accessor :validate_merged_areas
40
+
41
+ attr_accessor :refresh_chart_cache
42
+
43
+ # If true and the directory does not exist, the directory will be automatically created before saving the file.
44
+ attr_accessor :create_directory
45
+
46
+ attr_accessor :sort_names
47
+
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'enable_http_compression' => :'EnableHTTPCompression',
53
+ :'save_format' => :'SaveFormat',
54
+ :'clear_data' => :'ClearData',
55
+ :'cached_file_folder' => :'CachedFileFolder',
56
+ :'validate_merged_areas' => :'ValidateMergedAreas',
57
+ :'refresh_chart_cache' => :'RefreshChartCache',
58
+ :'create_directory' => :'CreateDirectory',
59
+ :'sort_names' => :'SortNames'
60
+ }
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.swagger_types
65
+ {
66
+ :'enable_http_compression' => :'BOOLEAN',
67
+ :'save_format' => :'String',
68
+ :'clear_data' => :'BOOLEAN',
69
+ :'cached_file_folder' => :'String',
70
+ :'validate_merged_areas' => :'BOOLEAN',
71
+ :'refresh_chart_cache' => :'BOOLEAN',
72
+ :'create_directory' => :'BOOLEAN',
73
+ :'sort_names' => :'BOOLEAN'
74
+ }
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ return unless attributes.is_a?(Hash)
81
+
82
+ # convert string to symbol for hash key
83
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
84
+
85
+ if attributes.has_key?(:'EnableHTTPCompression')
86
+ self.enable_http_compression = attributes[:'EnableHTTPCompression']
87
+ end
88
+
89
+ if attributes.has_key?(:'SaveFormat')
90
+ self.save_format = attributes[:'SaveFormat']
91
+ end
92
+
93
+ if attributes.has_key?(:'ClearData')
94
+ self.clear_data = attributes[:'ClearData']
95
+ end
96
+
97
+ if attributes.has_key?(:'CachedFileFolder')
98
+ self.cached_file_folder = attributes[:'CachedFileFolder']
99
+ end
100
+
101
+ if attributes.has_key?(:'ValidateMergedAreas')
102
+ self.validate_merged_areas = attributes[:'ValidateMergedAreas']
103
+ end
104
+
105
+ if attributes.has_key?(:'RefreshChartCache')
106
+ self.refresh_chart_cache = attributes[:'RefreshChartCache']
107
+ end
108
+
109
+ if attributes.has_key?(:'CreateDirectory')
110
+ self.create_directory = attributes[:'CreateDirectory']
111
+ end
112
+
113
+ if attributes.has_key?(:'SortNames')
114
+ self.sort_names = attributes[:'SortNames']
115
+ end
116
+
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properies with the reasons
121
+ def list_invalid_properties
122
+ invalid_properties = Array.new
123
+ return invalid_properties
124
+ end
125
+
126
+ # Check to see if the all the properties in the model are valid
127
+ # @return true if the model is valid
128
+ def valid?
129
+ return true
130
+ end
131
+
132
+ # Checks equality by comparing each attribute.
133
+ # @param [Object] Object to be compared
134
+ def ==(o)
135
+ return true if self.equal?(o)
136
+ self.class == o.class &&
137
+ enable_http_compression == o.enable_http_compression &&
138
+ save_format == o.save_format &&
139
+ clear_data == o.clear_data &&
140
+ cached_file_folder == o.cached_file_folder &&
141
+ validate_merged_areas == o.validate_merged_areas &&
142
+ refresh_chart_cache == o.refresh_chart_cache &&
143
+ create_directory == o.create_directory &&
144
+ sort_names == o.sort_names
145
+ end
146
+
147
+ # @see the `==` method
148
+ # @param [Object] Object to be compared
149
+ def eql?(o)
150
+ self == o
151
+ end
152
+
153
+ # Calculates hash code according to all attributes.
154
+ # @return [Fixnum] Hash code
155
+ def hash
156
+ [enable_http_compression, save_format, clear_data, cached_file_folder, validate_merged_areas, refresh_chart_cache, create_directory, sort_names].hash
157
+ end
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def build_from_hash(attributes)
163
+ return nil unless attributes.is_a?(Hash)
164
+ self.class.swagger_types.each_pair do |key, type|
165
+ if type =~ /\AArray<(.*)>/i
166
+ # check to ensure the input is an array given that the the attribute
167
+ # is documented as an array but the input is not
168
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
169
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
170
+ end
171
+ elsif !attributes[self.class.attribute_map[key]].nil?
172
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
173
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
174
+ end
175
+
176
+ self
177
+ end
178
+
179
+ # Deserializes the data based on type
180
+ # @param string type Data type
181
+ # @param string value Value to be deserialized
182
+ # @return [Object] Deserialized data
183
+ def _deserialize(type, value)
184
+ case type.to_sym
185
+ when :DateTime
186
+ DateTime.parse(value)
187
+ when :Date
188
+ Date.parse(value)
189
+ when :String
190
+ value.to_s
191
+ when :Integer
192
+ value.to_i
193
+ when :Float
194
+ value.to_f
195
+ when :BOOLEAN
196
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
197
+ true
198
+ else
199
+ false
200
+ end
201
+ when :Object
202
+ # generic object (usually a Hash), return directly
203
+ value
204
+ when /\AArray<(?<inner_type>.+)>\z/
205
+ inner_type = Regexp.last_match[:inner_type]
206
+ value.map { |v| _deserialize(inner_type, v) }
207
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
208
+ k_type = Regexp.last_match[:k_type]
209
+ v_type = Regexp.last_match[:v_type]
210
+ {}.tap do |hash|
211
+ value.each do |k, v|
212
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
213
+ end
214
+ end
215
+ else # model
216
+ temp_model = AsposeCellsCloud.const_get(type).new
217
+ temp_model.build_from_hash(value)
218
+ end
219
+ end
220
+
221
+ # Returns the string representation of the object
222
+ # @return [String] String presentation of the object
223
+ def to_s
224
+ to_hash.to_s
225
+ end
226
+
227
+ # to_body is an alias to to_hash (backward compatibility)
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_body
230
+ to_hash
231
+ end
232
+
233
+ # Returns the object in the form of hash
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_hash
236
+ hash = {}
237
+ self.class.attribute_map.each_pair do |attr, param|
238
+ value = self.send(attr)
239
+ next if value.nil?
240
+ hash[param] = _to_hash(value)
241
+ end
242
+ hash
243
+ end
244
+
245
+ # Outputs non-array value in the form of hash
246
+ # For object, use to_hash. Otherwise, just return the value
247
+ # @param [Object] value Any valid value
248
+ # @return [Hash] Returns the value in the form of hash
249
+ def _to_hash(value)
250
+ if value.is_a?(Array)
251
+ value.compact.map{ |v| _to_hash(v) }
252
+ elsif value.is_a?(Hash)
253
+ {}.tap do |hash|
254
+ value.each { |k, v| hash[k] = _to_hash(v) }
255
+ end
256
+ elsif value.respond_to? :to_hash
257
+ value.to_hash
258
+ else
259
+ value
260
+ end
261
+ end
262
+
263
+ end
264
+
265
+ end
@@ -0,0 +1,373 @@
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 SqlScriptSaveOptions
28
+ attr_accessor :enable_http_compression
29
+
30
+ attr_accessor :save_format
31
+
32
+ # Make the workbook empty after saving the file.
33
+ attr_accessor :clear_data
34
+
35
+ # The cached file folder is used to store some large data.
36
+ attr_accessor :cached_file_folder
37
+
38
+ # Indicates whether validate merged areas before saving the file. The default value is false.
39
+ attr_accessor :validate_merged_areas
40
+
41
+ attr_accessor :refresh_chart_cache
42
+
43
+ # If true and the directory does not exist, the directory will be automatically created before saving the file.
44
+ attr_accessor :create_directory
45
+
46
+ attr_accessor :sort_names
47
+
48
+ attr_accessor :check_if_table_exists
49
+
50
+ attr_accessor :column_type_map
51
+
52
+ attr_accessor :check_all_data_for_column_type
53
+
54
+ attr_accessor :add_blank_line_between_rows
55
+
56
+ attr_accessor :operator_type
57
+
58
+ attr_accessor :create_table
59
+
60
+ attr_accessor :id_name
61
+
62
+ attr_accessor :start_id
63
+
64
+ attr_accessor :table_name
65
+
66
+ attr_accessor :export_as_string
67
+
68
+ attr_accessor :export_area
69
+
70
+ attr_accessor :has_header_row
71
+
72
+
73
+ # Attribute mapping from ruby-style variable name to JSON key.
74
+ def self.attribute_map
75
+ {
76
+ :'enable_http_compression' => :'EnableHTTPCompression',
77
+ :'save_format' => :'SaveFormat',
78
+ :'clear_data' => :'ClearData',
79
+ :'cached_file_folder' => :'CachedFileFolder',
80
+ :'validate_merged_areas' => :'ValidateMergedAreas',
81
+ :'refresh_chart_cache' => :'RefreshChartCache',
82
+ :'create_directory' => :'CreateDirectory',
83
+ :'sort_names' => :'SortNames',
84
+ :'check_if_table_exists' => :'CheckIfTableExists',
85
+ :'column_type_map' => :'ColumnTypeMap',
86
+ :'check_all_data_for_column_type' => :'CheckAllDataForColumnType',
87
+ :'add_blank_line_between_rows' => :'AddBlankLineBetweenRows',
88
+ :'operator_type' => :'OperatorType',
89
+ :'create_table' => :'CreateTable',
90
+ :'id_name' => :'IdName',
91
+ :'start_id' => :'StartId',
92
+ :'table_name' => :'TableName',
93
+ :'export_as_string' => :'ExportAsString',
94
+ :'export_area' => :'ExportArea',
95
+ :'has_header_row' => :'HasHeaderRow'
96
+ }
97
+ end
98
+
99
+ # Attribute type mapping.
100
+ def self.swagger_types
101
+ {
102
+ :'enable_http_compression' => :'BOOLEAN',
103
+ :'save_format' => :'String',
104
+ :'clear_data' => :'BOOLEAN',
105
+ :'cached_file_folder' => :'String',
106
+ :'validate_merged_areas' => :'BOOLEAN',
107
+ :'refresh_chart_cache' => :'BOOLEAN',
108
+ :'create_directory' => :'BOOLEAN',
109
+ :'sort_names' => :'BOOLEAN',
110
+ :'check_if_table_exists' => :'BOOLEAN',
111
+ :'column_type_map' => :'String',
112
+ :'check_all_data_for_column_type' => :'BOOLEAN',
113
+ :'add_blank_line_between_rows' => :'BOOLEAN',
114
+ :'operator_type' => :'String',
115
+ :'create_table' => :'BOOLEAN',
116
+ :'id_name' => :'String',
117
+ :'start_id' => :'Integer',
118
+ :'table_name' => :'String',
119
+ :'export_as_string' => :'BOOLEAN',
120
+ :'export_area' => :'CellArea',
121
+ :'has_header_row' => :'BOOLEAN'
122
+ }
123
+ end
124
+
125
+ # Initializes the object
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ def initialize(attributes = {})
128
+ return unless attributes.is_a?(Hash)
129
+
130
+ # convert string to symbol for hash key
131
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
132
+
133
+ if attributes.has_key?(:'EnableHTTPCompression')
134
+ self.enable_http_compression = attributes[:'EnableHTTPCompression']
135
+ end
136
+
137
+ if attributes.has_key?(:'SaveFormat')
138
+ self.save_format = attributes[:'SaveFormat']
139
+ end
140
+
141
+ if attributes.has_key?(:'ClearData')
142
+ self.clear_data = attributes[:'ClearData']
143
+ end
144
+
145
+ if attributes.has_key?(:'CachedFileFolder')
146
+ self.cached_file_folder = attributes[:'CachedFileFolder']
147
+ end
148
+
149
+ if attributes.has_key?(:'ValidateMergedAreas')
150
+ self.validate_merged_areas = attributes[:'ValidateMergedAreas']
151
+ end
152
+
153
+ if attributes.has_key?(:'RefreshChartCache')
154
+ self.refresh_chart_cache = attributes[:'RefreshChartCache']
155
+ end
156
+
157
+ if attributes.has_key?(:'CreateDirectory')
158
+ self.create_directory = attributes[:'CreateDirectory']
159
+ end
160
+
161
+ if attributes.has_key?(:'SortNames')
162
+ self.sort_names = attributes[:'SortNames']
163
+ end
164
+
165
+ if attributes.has_key?(:'CheckIfTableExists')
166
+ self.check_if_table_exists = attributes[:'CheckIfTableExists']
167
+ end
168
+
169
+ if attributes.has_key?(:'ColumnTypeMap')
170
+ self.column_type_map = attributes[:'ColumnTypeMap']
171
+ end
172
+
173
+ if attributes.has_key?(:'CheckAllDataForColumnType')
174
+ self.check_all_data_for_column_type = attributes[:'CheckAllDataForColumnType']
175
+ end
176
+
177
+ if attributes.has_key?(:'AddBlankLineBetweenRows')
178
+ self.add_blank_line_between_rows = attributes[:'AddBlankLineBetweenRows']
179
+ end
180
+
181
+ if attributes.has_key?(:'OperatorType')
182
+ self.operator_type = attributes[:'OperatorType']
183
+ end
184
+
185
+ if attributes.has_key?(:'CreateTable')
186
+ self.create_table = attributes[:'CreateTable']
187
+ end
188
+
189
+ if attributes.has_key?(:'IdName')
190
+ self.id_name = attributes[:'IdName']
191
+ end
192
+
193
+ if attributes.has_key?(:'StartId')
194
+ self.start_id = attributes[:'StartId']
195
+ end
196
+
197
+ if attributes.has_key?(:'TableName')
198
+ self.table_name = attributes[:'TableName']
199
+ end
200
+
201
+ if attributes.has_key?(:'ExportAsString')
202
+ self.export_as_string = attributes[:'ExportAsString']
203
+ end
204
+
205
+ if attributes.has_key?(:'ExportArea')
206
+ self.export_area = attributes[:'ExportArea']
207
+ end
208
+
209
+ if attributes.has_key?(:'HasHeaderRow')
210
+ self.has_header_row = attributes[:'HasHeaderRow']
211
+ end
212
+
213
+ end
214
+
215
+ # Show invalid properties with the reasons. Usually used together with valid?
216
+ # @return Array for valid properies with the reasons
217
+ def list_invalid_properties
218
+ invalid_properties = Array.new
219
+ return invalid_properties
220
+ end
221
+
222
+ # Check to see if the all the properties in the model are valid
223
+ # @return true if the model is valid
224
+ def valid?
225
+ return true
226
+ end
227
+
228
+ # Checks equality by comparing each attribute.
229
+ # @param [Object] Object to be compared
230
+ def ==(o)
231
+ return true if self.equal?(o)
232
+ self.class == o.class &&
233
+ enable_http_compression == o.enable_http_compression &&
234
+ save_format == o.save_format &&
235
+ clear_data == o.clear_data &&
236
+ cached_file_folder == o.cached_file_folder &&
237
+ validate_merged_areas == o.validate_merged_areas &&
238
+ refresh_chart_cache == o.refresh_chart_cache &&
239
+ create_directory == o.create_directory &&
240
+ sort_names == o.sort_names &&
241
+ check_if_table_exists == o.check_if_table_exists &&
242
+ column_type_map == o.column_type_map &&
243
+ check_all_data_for_column_type == o.check_all_data_for_column_type &&
244
+ add_blank_line_between_rows == o.add_blank_line_between_rows &&
245
+ operator_type == o.operator_type &&
246
+ create_table == o.create_table &&
247
+ id_name == o.id_name &&
248
+ start_id == o.start_id &&
249
+ table_name == o.table_name &&
250
+ export_as_string == o.export_as_string &&
251
+ export_area == o.export_area &&
252
+ has_header_row == o.has_header_row
253
+ end
254
+
255
+ # @see the `==` method
256
+ # @param [Object] Object to be compared
257
+ def eql?(o)
258
+ self == o
259
+ end
260
+
261
+ # Calculates hash code according to all attributes.
262
+ # @return [Fixnum] Hash code
263
+ def hash
264
+ [enable_http_compression, save_format, clear_data, cached_file_folder, validate_merged_areas, refresh_chart_cache, create_directory, sort_names, check_if_table_exists, column_type_map, check_all_data_for_column_type, add_blank_line_between_rows, operator_type, create_table, id_name, start_id, table_name, export_as_string, export_area, has_header_row].hash
265
+ end
266
+
267
+ # Builds the object from hash
268
+ # @param [Hash] attributes Model attributes in the form of hash
269
+ # @return [Object] Returns the model itself
270
+ def build_from_hash(attributes)
271
+ return nil unless attributes.is_a?(Hash)
272
+ self.class.swagger_types.each_pair do |key, type|
273
+ if type =~ /\AArray<(.*)>/i
274
+ # check to ensure the input is an array given that the the attribute
275
+ # is documented as an array but the input is not
276
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
277
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
278
+ end
279
+ elsif !attributes[self.class.attribute_map[key]].nil?
280
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
281
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
282
+ end
283
+
284
+ self
285
+ end
286
+
287
+ # Deserializes the data based on type
288
+ # @param string type Data type
289
+ # @param string value Value to be deserialized
290
+ # @return [Object] Deserialized data
291
+ def _deserialize(type, value)
292
+ case type.to_sym
293
+ when :DateTime
294
+ DateTime.parse(value)
295
+ when :Date
296
+ Date.parse(value)
297
+ when :String
298
+ value.to_s
299
+ when :Integer
300
+ value.to_i
301
+ when :Float
302
+ value.to_f
303
+ when :BOOLEAN
304
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
305
+ true
306
+ else
307
+ false
308
+ end
309
+ when :Object
310
+ # generic object (usually a Hash), return directly
311
+ value
312
+ when /\AArray<(?<inner_type>.+)>\z/
313
+ inner_type = Regexp.last_match[:inner_type]
314
+ value.map { |v| _deserialize(inner_type, v) }
315
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
316
+ k_type = Regexp.last_match[:k_type]
317
+ v_type = Regexp.last_match[:v_type]
318
+ {}.tap do |hash|
319
+ value.each do |k, v|
320
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
321
+ end
322
+ end
323
+ else # model
324
+ temp_model = AsposeCellsCloud.const_get(type).new
325
+ temp_model.build_from_hash(value)
326
+ end
327
+ end
328
+
329
+ # Returns the string representation of the object
330
+ # @return [String] String presentation of the object
331
+ def to_s
332
+ to_hash.to_s
333
+ end
334
+
335
+ # to_body is an alias to to_hash (backward compatibility)
336
+ # @return [Hash] Returns the object in the form of hash
337
+ def to_body
338
+ to_hash
339
+ end
340
+
341
+ # Returns the object in the form of hash
342
+ # @return [Hash] Returns the object in the form of hash
343
+ def to_hash
344
+ hash = {}
345
+ self.class.attribute_map.each_pair do |attr, param|
346
+ value = self.send(attr)
347
+ next if value.nil?
348
+ hash[param] = _to_hash(value)
349
+ end
350
+ hash
351
+ end
352
+
353
+ # Outputs non-array value in the form of hash
354
+ # For object, use to_hash. Otherwise, just return the value
355
+ # @param [Object] value Any valid value
356
+ # @return [Hash] Returns the value in the form of hash
357
+ def _to_hash(value)
358
+ if value.is_a?(Array)
359
+ value.compact.map{ |v| _to_hash(v) }
360
+ elsif value.is_a?(Hash)
361
+ {}.tap do |hash|
362
+ value.each { |k, v| hash[k] = _to_hash(v) }
363
+ end
364
+ elsif value.respond_to? :to_hash
365
+ value.to_hash
366
+ else
367
+ value
368
+ end
369
+ end
370
+
371
+ end
372
+
373
+ end
@@ -21,5 +21,5 @@ SOFTWARE.
21
21
  =end
22
22
 
23
23
  module AsposeCellsCloud
24
- VERSION = "22.4"
24
+ VERSION = "22.7"
25
25
  end
@@ -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
+