aspose_cells_cloud 18.11.1 → 19.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,363 @@
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 'date'
14
+
15
+ module AsposeCellsCloud
16
+
17
+ class MHtmlSaveOptions
18
+ attr_accessor :enable_http_compression
19
+
20
+ attr_accessor :save_format
21
+
22
+ # Make the workbook empty after saving the file.
23
+ attr_accessor :clear_data
24
+
25
+ # The cached file folder is used to store some large data.
26
+ attr_accessor :cached_file_folder
27
+
28
+ # Indicates whether validate merged areas before saving the file. The default value is false.
29
+ attr_accessor :validate_merged_areas
30
+
31
+ attr_accessor :refresh_chart_cache
32
+
33
+ # If true and the directory does not exist, the directory will be automatically created before saving the file.
34
+ attr_accessor :create_directory
35
+
36
+ attr_accessor :sort_names
37
+
38
+ attr_accessor :attached_files_directory
39
+
40
+ attr_accessor :attached_files_url_prefix
41
+
42
+ attr_accessor :encoding
43
+
44
+ attr_accessor :export_active_worksheet_only
45
+
46
+ attr_accessor :export_chart_image_format
47
+
48
+ attr_accessor :export_images_as_base64
49
+
50
+ attr_accessor :hidden_col_display_type
51
+
52
+ attr_accessor :hidden_row_display_type
53
+
54
+ attr_accessor :html_cross_string_type
55
+
56
+ attr_accessor :is_exp_image_to_temp_dir
57
+
58
+ attr_accessor :page_title
59
+
60
+ attr_accessor :parse_html_tag_in_cell
61
+
62
+
63
+ # Attribute mapping from ruby-style variable name to JSON key.
64
+ def self.attribute_map
65
+ {
66
+ :'enable_http_compression' => :'EnableHTTPCompression',
67
+ :'save_format' => :'SaveFormat',
68
+ :'clear_data' => :'ClearData',
69
+ :'cached_file_folder' => :'CachedFileFolder',
70
+ :'validate_merged_areas' => :'ValidateMergedAreas',
71
+ :'refresh_chart_cache' => :'RefreshChartCache',
72
+ :'create_directory' => :'CreateDirectory',
73
+ :'sort_names' => :'SortNames',
74
+ :'attached_files_directory' => :'AttachedFilesDirectory',
75
+ :'attached_files_url_prefix' => :'AttachedFilesUrlPrefix',
76
+ :'encoding' => :'Encoding',
77
+ :'export_active_worksheet_only' => :'ExportActiveWorksheetOnly',
78
+ :'export_chart_image_format' => :'ExportChartImageFormat',
79
+ :'export_images_as_base64' => :'ExportImagesAsBase64',
80
+ :'hidden_col_display_type' => :'HiddenColDisplayType',
81
+ :'hidden_row_display_type' => :'HiddenRowDisplayType',
82
+ :'html_cross_string_type' => :'HtmlCrossStringType',
83
+ :'is_exp_image_to_temp_dir' => :'IsExpImageToTempDir',
84
+ :'page_title' => :'PageTitle',
85
+ :'parse_html_tag_in_cell' => :'ParseHtmlTagInCell'
86
+ }
87
+ end
88
+
89
+ # Attribute type mapping.
90
+ def self.swagger_types
91
+ {
92
+ :'enable_http_compression' => :'BOOLEAN',
93
+ :'save_format' => :'String',
94
+ :'clear_data' => :'BOOLEAN',
95
+ :'cached_file_folder' => :'String',
96
+ :'validate_merged_areas' => :'BOOLEAN',
97
+ :'refresh_chart_cache' => :'BOOLEAN',
98
+ :'create_directory' => :'BOOLEAN',
99
+ :'sort_names' => :'BOOLEAN',
100
+ :'attached_files_directory' => :'String',
101
+ :'attached_files_url_prefix' => :'String',
102
+ :'encoding' => :'String',
103
+ :'export_active_worksheet_only' => :'BOOLEAN',
104
+ :'export_chart_image_format' => :'String',
105
+ :'export_images_as_base64' => :'BOOLEAN',
106
+ :'hidden_col_display_type' => :'String',
107
+ :'hidden_row_display_type' => :'String',
108
+ :'html_cross_string_type' => :'String',
109
+ :'is_exp_image_to_temp_dir' => :'BOOLEAN',
110
+ :'page_title' => :'String',
111
+ :'parse_html_tag_in_cell' => :'BOOLEAN'
112
+ }
113
+ end
114
+
115
+ # Initializes the object
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ def initialize(attributes = {})
118
+ return unless attributes.is_a?(Hash)
119
+
120
+ # convert string to symbol for hash key
121
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
122
+
123
+ if attributes.has_key?(:'EnableHTTPCompression')
124
+ self.enable_http_compression = attributes[:'EnableHTTPCompression']
125
+ end
126
+
127
+ if attributes.has_key?(:'SaveFormat')
128
+ self.save_format = attributes[:'SaveFormat']
129
+ end
130
+
131
+ if attributes.has_key?(:'ClearData')
132
+ self.clear_data = attributes[:'ClearData']
133
+ end
134
+
135
+ if attributes.has_key?(:'CachedFileFolder')
136
+ self.cached_file_folder = attributes[:'CachedFileFolder']
137
+ end
138
+
139
+ if attributes.has_key?(:'ValidateMergedAreas')
140
+ self.validate_merged_areas = attributes[:'ValidateMergedAreas']
141
+ end
142
+
143
+ if attributes.has_key?(:'RefreshChartCache')
144
+ self.refresh_chart_cache = attributes[:'RefreshChartCache']
145
+ end
146
+
147
+ if attributes.has_key?(:'CreateDirectory')
148
+ self.create_directory = attributes[:'CreateDirectory']
149
+ end
150
+
151
+ if attributes.has_key?(:'SortNames')
152
+ self.sort_names = attributes[:'SortNames']
153
+ end
154
+
155
+ if attributes.has_key?(:'AttachedFilesDirectory')
156
+ self.attached_files_directory = attributes[:'AttachedFilesDirectory']
157
+ end
158
+
159
+ if attributes.has_key?(:'AttachedFilesUrlPrefix')
160
+ self.attached_files_url_prefix = attributes[:'AttachedFilesUrlPrefix']
161
+ end
162
+
163
+ if attributes.has_key?(:'Encoding')
164
+ self.encoding = attributes[:'Encoding']
165
+ end
166
+
167
+ if attributes.has_key?(:'ExportActiveWorksheetOnly')
168
+ self.export_active_worksheet_only = attributes[:'ExportActiveWorksheetOnly']
169
+ end
170
+
171
+ if attributes.has_key?(:'ExportChartImageFormat')
172
+ self.export_chart_image_format = attributes[:'ExportChartImageFormat']
173
+ end
174
+
175
+ if attributes.has_key?(:'ExportImagesAsBase64')
176
+ self.export_images_as_base64 = attributes[:'ExportImagesAsBase64']
177
+ end
178
+
179
+ if attributes.has_key?(:'HiddenColDisplayType')
180
+ self.hidden_col_display_type = attributes[:'HiddenColDisplayType']
181
+ end
182
+
183
+ if attributes.has_key?(:'HiddenRowDisplayType')
184
+ self.hidden_row_display_type = attributes[:'HiddenRowDisplayType']
185
+ end
186
+
187
+ if attributes.has_key?(:'HtmlCrossStringType')
188
+ self.html_cross_string_type = attributes[:'HtmlCrossStringType']
189
+ end
190
+
191
+ if attributes.has_key?(:'IsExpImageToTempDir')
192
+ self.is_exp_image_to_temp_dir = attributes[:'IsExpImageToTempDir']
193
+ end
194
+
195
+ if attributes.has_key?(:'PageTitle')
196
+ self.page_title = attributes[:'PageTitle']
197
+ end
198
+
199
+ if attributes.has_key?(:'ParseHtmlTagInCell')
200
+ self.parse_html_tag_in_cell = attributes[:'ParseHtmlTagInCell']
201
+ end
202
+
203
+ end
204
+
205
+ # Show invalid properties with the reasons. Usually used together with valid?
206
+ # @return Array for valid properies with the reasons
207
+ def list_invalid_properties
208
+ invalid_properties = Array.new
209
+ return invalid_properties
210
+ end
211
+
212
+ # Check to see if the all the properties in the model are valid
213
+ # @return true if the model is valid
214
+ def valid?
215
+ return true
216
+ end
217
+
218
+ # Checks equality by comparing each attribute.
219
+ # @param [Object] Object to be compared
220
+ def ==(o)
221
+ return true if self.equal?(o)
222
+ self.class == o.class &&
223
+ enable_http_compression == o.enable_http_compression &&
224
+ save_format == o.save_format &&
225
+ clear_data == o.clear_data &&
226
+ cached_file_folder == o.cached_file_folder &&
227
+ validate_merged_areas == o.validate_merged_areas &&
228
+ refresh_chart_cache == o.refresh_chart_cache &&
229
+ create_directory == o.create_directory &&
230
+ sort_names == o.sort_names &&
231
+ attached_files_directory == o.attached_files_directory &&
232
+ attached_files_url_prefix == o.attached_files_url_prefix &&
233
+ encoding == o.encoding &&
234
+ export_active_worksheet_only == o.export_active_worksheet_only &&
235
+ export_chart_image_format == o.export_chart_image_format &&
236
+ export_images_as_base64 == o.export_images_as_base64 &&
237
+ hidden_col_display_type == o.hidden_col_display_type &&
238
+ hidden_row_display_type == o.hidden_row_display_type &&
239
+ html_cross_string_type == o.html_cross_string_type &&
240
+ is_exp_image_to_temp_dir == o.is_exp_image_to_temp_dir &&
241
+ page_title == o.page_title &&
242
+ parse_html_tag_in_cell == o.parse_html_tag_in_cell
243
+ end
244
+
245
+ # @see the `==` method
246
+ # @param [Object] Object to be compared
247
+ def eql?(o)
248
+ self == o
249
+ end
250
+
251
+ # Calculates hash code according to all attributes.
252
+ # @return [Fixnum] Hash code
253
+ def hash
254
+ [enable_http_compression, save_format, clear_data, cached_file_folder, validate_merged_areas, refresh_chart_cache, create_directory, sort_names, attached_files_directory, attached_files_url_prefix, encoding, export_active_worksheet_only, export_chart_image_format, export_images_as_base64, hidden_col_display_type, hidden_row_display_type, html_cross_string_type, is_exp_image_to_temp_dir, page_title, parse_html_tag_in_cell].hash
255
+ end
256
+
257
+ # Builds the object from hash
258
+ # @param [Hash] attributes Model attributes in the form of hash
259
+ # @return [Object] Returns the model itself
260
+ def build_from_hash(attributes)
261
+ return nil unless attributes.is_a?(Hash)
262
+ self.class.swagger_types.each_pair do |key, type|
263
+ if type =~ /\AArray<(.*)>/i
264
+ # check to ensure the input is an array given that the the attribute
265
+ # is documented as an array but the input is not
266
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
267
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
268
+ end
269
+ elsif !attributes[self.class.attribute_map[key]].nil?
270
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
271
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
272
+ end
273
+
274
+ self
275
+ end
276
+
277
+ # Deserializes the data based on type
278
+ # @param string type Data type
279
+ # @param string value Value to be deserialized
280
+ # @return [Object] Deserialized data
281
+ def _deserialize(type, value)
282
+ case type.to_sym
283
+ when :DateTime
284
+ DateTime.parse(value)
285
+ when :Date
286
+ Date.parse(value)
287
+ when :String
288
+ value.to_s
289
+ when :Integer
290
+ value.to_i
291
+ when :Float
292
+ value.to_f
293
+ when :BOOLEAN
294
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
295
+ true
296
+ else
297
+ false
298
+ end
299
+ when :Object
300
+ # generic object (usually a Hash), return directly
301
+ value
302
+ when /\AArray<(?<inner_type>.+)>\z/
303
+ inner_type = Regexp.last_match[:inner_type]
304
+ value.map { |v| _deserialize(inner_type, v) }
305
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
306
+ k_type = Regexp.last_match[:k_type]
307
+ v_type = Regexp.last_match[:v_type]
308
+ {}.tap do |hash|
309
+ value.each do |k, v|
310
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
311
+ end
312
+ end
313
+ else # model
314
+ temp_model = AsposeCellsCloud.const_get(type).new
315
+ temp_model.build_from_hash(value)
316
+ end
317
+ end
318
+
319
+ # Returns the string representation of the object
320
+ # @return [String] String presentation of the object
321
+ def to_s
322
+ to_hash.to_s
323
+ end
324
+
325
+ # to_body is an alias to to_hash (backward compatibility)
326
+ # @return [Hash] Returns the object in the form of hash
327
+ def to_body
328
+ to_hash
329
+ end
330
+
331
+ # Returns the object in the form of hash
332
+ # @return [Hash] Returns the object in the form of hash
333
+ def to_hash
334
+ hash = {}
335
+ self.class.attribute_map.each_pair do |attr, param|
336
+ value = self.send(attr)
337
+ next if value.nil?
338
+ hash[param] = _to_hash(value)
339
+ end
340
+ hash
341
+ end
342
+
343
+ # Outputs non-array value in the form of hash
344
+ # For object, use to_hash. Otherwise, just return the value
345
+ # @param [Object] value Any valid value
346
+ # @return [Hash] Returns the value in the form of hash
347
+ def _to_hash(value)
348
+ if value.is_a?(Array)
349
+ value.compact.map{ |v| _to_hash(v) }
350
+ elsif value.is_a?(Hash)
351
+ {}.tap do |hash|
352
+ value.each { |k, v| hash[k] = _to_hash(v) }
353
+ end
354
+ elsif value.respond_to? :to_hash
355
+ value.to_hash
356
+ else
357
+ value
358
+ end
359
+ end
360
+
361
+ end
362
+
363
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.3.0-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module AsposeCellsCloud
14
- VERSION = "18.11.1"
14
+ VERSION = "19.2"
15
15
  end
@@ -612,6 +612,27 @@ describe 'CellsApi' do
612
612
  end
613
613
  end
614
614
 
615
+ # unit tests for cells_get_cell_html_string
616
+ # Set htmlstring value into cell
617
+ #
618
+ # @param name Workbook name.
619
+ # @param sheet_name Worksheet name.
620
+ # @param cell_name The cell name.
621
+ # @option opts [String] :folder The workbook folder.
622
+ # @option opts [String] :storage storage name.
623
+ # @return [CellResponse]
624
+ describe 'cells_get_cell_html_string test' do
625
+ it "should work" do
626
+ name = $BOOK1
627
+ sheet_name = $SHEET1
628
+ cell_name = $CellName
629
+ folder = $TEMPFOLDER
630
+ storage = nil
631
+ @instance.cells_get_cell_html_string(name, sheet_name, cell_name, { :folder=>folder})
632
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
633
+ end
634
+ end
635
+
615
636
  # unit tests for cells_post_set_cell_html_string
616
637
  # Set htmlstring value into cell
617
638
  #
@@ -0,0 +1,64 @@
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
+ # Unit tests for AsposeCellsCloud::CellsWorkbookApi
16
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
17
+ # Please update as you see appropriate
18
+ describe 'CellsWorkbookApi' do
19
+ before do
20
+ # run before each test
21
+ if $access_token == nil then
22
+ conf = AsposeCellsCloud::Configuration.new
23
+ conf.base_path = ""
24
+ instance = AsposeCellsCloud::OAuthApi.new(AsposeCellsCloud::ApiClient.new(conf))
25
+ $access_token = instance.o_auth_post($grant_type,$client_id,$client_secret).access_token
26
+ end
27
+
28
+ conf = AsposeCellsCloud::Configuration.new
29
+ conf.access_token = $access_token
30
+ client = AsposeCellsCloud::ApiClient.new(conf)
31
+ client.default_headers["Authorization"] ="Bearer " + $access_token
32
+ @instance = AsposeCellsCloud::CellsWorkbookApi.new(client)
33
+ end
34
+
35
+ after do
36
+ # run after each test
37
+ end
38
+ describe 'test an instance of CellsWorkbookApi' do
39
+ it 'should create an instance of CellsWorkbookApi' do
40
+ expect(@instance).to be_instance_of(AsposeCellsCloud::CellsWorkbookApi)
41
+ end
42
+ end
43
+ # unit tests for cells_workbook_post_import_data
44
+ #
45
+ #
46
+ # @param name
47
+ # @param importdata
48
+ # @param [Hash] opts the optional parameters
49
+ # @option opts [String] :folder
50
+ # @option opts [String] :storage storage name.
51
+ # @return [SaaSposeResponse]
52
+ describe 'cells_workbook_post_import_data test' do
53
+ it "should work" do
54
+ name = $BOOK1
55
+ importdata = AsposeCellsCloud::ImportIntArrayOption.new({:DestinationWorksheet=>$SHEET1,:FirstColumn=>1,:FirstRow=>3,:ImportDataType=>'IntArray',:IsVertical=>true,:Data=>[1,2,3,4]})
56
+ folder = $TEMPFOLDER
57
+
58
+ @instance.cells_workbook_post_import_data(name, importdata, { :folder=>folder})
59
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
60
+ print "cells_workbook_post_import_data"
61
+ end
62
+ end
63
+
64
+ end