aspose_cells_cloud 24.11 → 24.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f7fcc6414eeb5754bceeea3d62f3a11d54af7f0599fae516d71fa5ab05aac1e
4
- data.tar.gz: 8dfe734152684a810dbfe89e32ecedec9f9563ed870e2b0ba55a9d29c5c89bda
3
+ metadata.gz: ff6d0ee0d82fca8840f4c97b7c2094a7a2bd4cb24ed350f0a47104abbcbdad4a
4
+ data.tar.gz: '05280ca5886d3c9b8ea86ffdcf7bc115c7bc679b16e3abe02791f7555cefe375'
5
5
  SHA512:
6
- metadata.gz: 5aae98df0ea3ecab9cf55139c00b6fa8aedeaa55486ca66ea8f6c661e18df11db6d06f4532b3c7768be8de1301cd262804f19b07a5303e2ef09b753671c28816
7
- data.tar.gz: c64837e1db7785f3c2d75a2574ee0c2c5d3e7e44a57409823f1c0f4e87acfdabc2f868edf1fdd364e622ca72c8ecdc4bea55564c3eea1560ff605691d334ef5f
6
+ metadata.gz: 59396933772c60af85bcbbf7e204f9c88aa6f85ccbc24bea0fadb6b151245dfb53ea0e2070777809cfdb2092b3ec2a94dbbbc5eabbd96c820ac5b015f1df8695
7
+ data.tar.gz: 4623128923f3624c3e16985920e6fbad278fc4fa6fb32ac7cbc3ea6061a4f985c19cce32b6fff1a1960b1e50c17598c7cb9442176a1780f17b6d45de62af94fc
data/README.md CHANGED
@@ -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/24.11)
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/24.12)
2
2
 
3
3
  Aspose.Cells Cloud for Ruby enables you to handle various aspects of Excel files, including cell data, styles, formulas, charts, pivot tables, data validation, comments, drawing objects, images, hyperlinks, and so on. Additionally, it supports operations such as splitting, merging, repairing, and converting to other compatible file formats.
4
4
 
@@ -19,10 +19,14 @@ Enhance your Ruby applications with the [Aspose.Cells Cloud](https://products.as
19
19
  - Import/Export: Facilitates importing data from various sources into spreadsheets and exporting spreadsheet data to other formats.
20
20
  - Security Management: Offers a range of security features like data encryption, access control, and permission management to safeguard the security and integrity of spreadsheet data.
21
21
 
22
- ## Feature & Enhancements in Version 24.11
22
+ ## Feature & Enhancements in Version 24.12
23
23
 
24
24
  Full list of issues covering all changes in this release:
25
25
 
26
+ - Add the new remove duplicates api.
27
+ - Add the new extract text API.
28
+ - The pivot filter could not be created successfully.
29
+
26
30
  ## Support file format
27
31
 
28
32
  |**Format**|**Description**|**Load**|**Save**|
@@ -96,11 +100,11 @@ remote_name = 'Book1.xlsx'
96
100
 
97
101
  format = "csv"
98
102
 
99
-
103
+
100
104
  mapFiles = { }
101
105
  mapFiles = { }
102
106
  mapFiles[local_name] = ::File.open(File.expand_path("TestData/"+local_name),"r")
103
-
107
+
104
108
  uploadrequest = AsposeCellsCloud::UploadFileRequest.new( { :UploadFiles=>mapFiles,:path=>remote_folder })
105
109
  @instance.upload_file(uploadrequest)
106
110
  mapFiles[local_name]= ::File.open(File.expand_path("TestData/"+local_name),"r")
@@ -118,257 +122,4 @@ request = AsposeCellsCloud::PutConvertWorkbookRequest.new(:File=>mapFiles,:for
118
122
 
119
123
  [Product Page](https://products.aspose.cloud/cells/ruby) | [Documentation](https://docs.aspose.cloud/cells/) | [Live Demo](https://products.aspose.app/cells/family) | [API Reference](https://apireference.aspose.cloud/cells/) | [Code Samples](https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby/tree/master/spec) | [Blog](https://blog.aspose.cloud/category/cells/) | [Free Support](https://forum.aspose.cloud/c/cells) | [Free Trial](https://dashboard.aspose.cloud/#/apps)
120
124
 
121
- # Release history version
122
-
123
- ## Enhancements in Version 24.10
124
-
125
- - Add the new feature about removing characters on TextProcessingController.
126
-
127
- ## Enhancements in Version 24.9
128
-
129
- - Add word case function for TextProcessingController.
130
- - Support to export Worksheet to HTML with cell address or id.
131
-
132
- ## Enhancements in Version 24.8
133
-
134
- - Add text trim feature on Cells Cloud Services.
135
-
136
- ## Enhancements in Version 24.7
137
-
138
- - Add a new feature about adding text content.
139
- - Add get access token by client id and client secret.
140
-
141
- ## Enhancements in Version 24.6
142
-
143
- - Optimize load data function of data transformation.
144
- - Optimize the data conversion applied steps.
145
-
146
- ## Enhancements in Version 24.5
147
-
148
- - Add merge queries method for loading data of data transformation.
149
- - Optimize chart data model.
150
-
151
- ## Enhancements in Version 24.4
152
-
153
- - Support data transformation.
154
-
155
- ## Enhancements in Version 24.3
156
-
157
- - Support data deduplication.
158
- - Support data filling.
159
- - Support to delete incomplete rows.
160
- - Support data cleansing.
161
-
162
- ## Enhancements in Version 24.2.1
163
-
164
- - Support data deduplication.
165
-
166
- ## Enhancements in Version 24.1.1
167
-
168
- - Fixed spelling mistakes for several functions.
169
- - Add the PostFitTallToPages method for page setup controller.
170
- - Add the PostFitWideToPages method for page setup controller.
171
- - Optimize save options about paginated.
172
-
173
- ## Enhancements in Version 23.12.0
174
-
175
- - Conversion APIs add region parameter.
176
- - Protection APIs add region parameter.
177
- - Assemble data API adds region parameter.
178
- - Merge files API adds region parameter.
179
- - Split files API adds region parameter.
180
- - Import data API adds region parameter.
181
- - Watermark API adds region parameter.
182
- - Clear object API adds region parameter.
183
- - Reverse data API adds region parameter.
184
- - Rotate data API adds region parameter.
185
-
186
- ## Enhancements in Version 23.11
187
-
188
- - Optimize import xml data into Excel file.
189
- - Optimize import json data into Excel file.
190
- - Remove deprecated functions, class and test case.
191
-
192
- ## Enhancements in Version 23.10
193
-
194
- - Fix protect workbook request.
195
- - Fix range copy API.
196
- - Optimize workbook protect API.
197
-
198
- ## Enhancements in Version 23.9
199
-
200
- - Support to data sorting on range controller.
201
- - Support to remove duplicate data on list object.
202
- - Support to insert slicer for list object.
203
- - Optimize list object and related objects.
204
-
205
- ## Enhancements in Version 23.8
206
-
207
- - Support to lock API.
208
- - Optimize protect API.
209
-
210
- ## Enhancements in Version 23.7
211
-
212
- - Support to repair API.
213
- - Remove GetExtractBarcodes API.
214
-
215
- ## Enhancements in Version 23.6
216
-
217
- - Support to batch lock multi-files.
218
- - Support to batch unlock multi-files.
219
- - Support to protect lock multi-files.
220
- - Support to split lock multi-files.
221
- - Fix put document property api.
222
-
223
- ## Enhancements in Version 23.5
224
-
225
- - Fix few method names for spelling error.
226
-
227
- ## Enhancements in Version 23.4
228
-
229
- -Add import xml data api.
230
- -Add export xml data api.
231
-
232
- ## Enhancements in Version 23.3
233
-
234
- - Adopt the new model.
235
-
236
- ## Enhancements in Version 22.12
237
-
238
- - Support chart axis operations.
239
-
240
- ## Enhancements in Version 22.11
241
-
242
- - Add api for converting workbook to json.
243
- - Add api for converting workbook to sql.
244
- - Add api for converting workbook to csv.
245
-
246
- ## Enhancements in Version 22.10
247
-
248
- - Add api for converting workbook to pptx.
249
- - Add api for converting workbook to html.
250
- - Add api for converting workbook to markdown.
251
-
252
- ## Enhancements in Version 22.9
253
-
254
- - Add api for converting workbook to png.
255
- - Add api for converting workbook to pdf.
256
- - Add api for converting workbook to docx
257
-
258
- ## Enhancements in Version 22.8
259
-
260
- - Support transposing Excel Rows to Columns.
261
-
262
- ## Enhancements in Version 22.7
263
-
264
- - Add 4 kinds of Save Option.
265
- - Add the checkExcelRestriction parameter for multiple APIs.
266
-
267
- ## Enhancements in Version 22.5
268
-
269
- - Add a new API for getting barcode description.
270
-
271
- ## Enhancements in Version 22.4
272
-
273
- - Export API adds extended query parameters.
274
- - Convert API adds extended query parameters.
275
- - SaveAs API adds extended query parameters.
276
- - Get Workbook API adds extended query parameters.
277
-
278
- ## Enhancements in Version 22.3
279
-
280
- -Add new API about adding digital signature for cloud file.
281
-
282
- ## Enhancements in Version 22.2
283
-
284
- - Update return value for the DeleteUnprotectWorksheet API on Aspose.Cells Cloud.
285
- - Update return value for the PutProtectWorksheet API on Aspose.Cells Cloud.
286
- - Update return value for the PostSetCellHtmlString API on Aspose.Cells Cloud.
287
- - Update return value for the PostUpdateWorksheetProperty API on Aspose.Cells Cloud.
288
-
289
- ## Enhancements in Version 22.1
290
-
291
- - SaveAs API add the parameter of target storage name.
292
- - Workbok merged API add the parameter of merged file storage name.
293
- - Workbok split API add the parameter of target storage name
294
- - Workbok smart marker API add the parameter of output storage name.
295
- - Batch convert API add the parameters of intput and output storage name.
296
- - Remove AutoshapesController from Aspose.Cells Cloud.
297
- - Rename LiteCellsApi to LightCellsApi.
298
-
299
- ## Enhancements in Version 21.12
300
-
301
- - Improvement for conversion API.
302
- - Improvement for batch data import to support to set cell formula.
303
- - Improvement for setting row height and column wight to support to set multi-rows and multi-columns.
304
- - Support to set cell formula in batch data import.
305
- - Add a new API for updating the list column.
306
- - Add a new API for reversing columns and rows.
307
- - Add new APIs for grouping and ungrouping shapes.
308
-
309
- ## Enhancements in Version 21.11
310
-
311
- - Add new API for workbook get page count on Aspose.Cells Cloud.
312
- - Add new API for worksheet get page count on Aspose.Cells Cloud.
313
- - Add new API for compress excel file on Aspose.Cells Cloud.
314
- - Add new feature for replace API.
315
-
316
- ## Enhancements in Version 21.10
317
-
318
- - Add new API for support delete multiple worksheets in a single call.
319
- - Add new API for supports batch convert excel files.
320
-
321
- ## Enhancements in Version 21.9
322
-
323
- - Correct the return type of the following REST APIs.
324
-
325
- ## Enhancements in Version 21.8
326
-
327
- - Improvement for getting list object Api.
328
- - Add import Api.
329
-
330
- ## Enhancements in Version 21.7
331
-
332
- - Fix search API.
333
- - Fix split API.
334
-
335
- ## Enhancements in Version 21.6
336
-
337
- - Improvement document properties.
338
- - Update the return value of put/post/delete.
339
- - Improvement export API.
340
- - Improve split API.
341
- - Improve merge API.
342
- - Improve unlock API.
343
- - Improve protected API.
344
- - Improve watermark API.
345
-
346
- ## Enhancements in Version 21.5
347
-
348
- - Support autofit columns for workbook and worksheet.
349
- - Improve add and post row/column APIs.
350
- - Improve Task APIs.
351
-
352
- ## Enhancements in Version 21.1
353
-
354
- - Support to convert worksheet on task API
355
- - Support to add and delete cell or range in worksheet.
356
-
357
- ## Enhancements in Version 20.11
358
-
359
- - Support Aspose.Cells Cloud for Docker.
360
-
361
- ## Enhancements in Version 20.10
362
-
363
- - Support to upload large file.
364
-
365
- ## Enhancements in Version 20.9
366
-
367
- - Support sparkline groups.
368
- - Add API about updating pivot field.
369
-
370
- ## Enhancements in Version 20.8
371
-
372
- - Aspose.Cells Cloud API calls are not working with explicit storage name but only default storage.
373
- - Get output file size without downloading during conversion.
374
- - Enhancement for CellsShapesPutWorksheetShape API.
125
+ ## [Release history version](HistoryVersions.md)
@@ -2108,6 +2108,20 @@ module AsposeCellsCloud
2108
2108
  return data
2109
2109
  end
2110
2110
 
2111
+
2112
+ def post_remove_duplicates( post_remove_duplicates_request, opts = {})
2113
+
2114
+ data, _status_code, _headers = post_remove_duplicates_request.create_http_request(@api_client,opts )
2115
+ return data
2116
+ end
2117
+
2118
+
2119
+ def post_extract_text( post_extract_text_request, opts = {})
2120
+
2121
+ data, _status_code, _headers = post_extract_text_request.create_http_request(@api_client,opts )
2122
+ return data
2123
+ end
2124
+
2111
2125
  # Retrieve the description of the default style for the workbook .
2112
2126
 
2113
2127
  def get_workbook_default_style( get_workbook_default_style_request, opts = {})
@@ -0,0 +1,330 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ <copyright company="Aspose" file="ExtractTextOptionsrb.cs">
4
+ Copyright (c) 2024 Aspose.Cells Cloud
5
+ </copyright>
6
+ <summary>
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
24
+ </summary>
25
+ --------------------------------------------------------------------------------------------------------------------
26
+ =end
27
+
28
+
29
+ require 'date'
30
+
31
+ module AsposeCellsCloud
32
+
33
+ class ExtractTextOptions
34
+ #
35
+ attr_accessor :name
36
+ #
37
+ attr_accessor :data_source
38
+ #
39
+ attr_accessor :file_info
40
+ #
41
+ attr_accessor :worksheet
42
+ #
43
+ attr_accessor :range
44
+ #
45
+ attr_accessor :extract_text_type
46
+ #
47
+ attr_accessor :before_text
48
+ #
49
+ attr_accessor :after_text
50
+ #
51
+ attr_accessor :before_position
52
+ #
53
+ attr_accessor :after_position
54
+ #
55
+ attr_accessor :out_position_range
56
+
57
+ # Attribute mapping from ruby-style variable name to JSON key.
58
+ def self.attribute_map
59
+ {
60
+ :'name' => :'Name',
61
+ :'data_source' => :'DataSource',
62
+ :'file_info' => :'FileInfo',
63
+ :'worksheet' => :'Worksheet',
64
+ :'range' => :'Range',
65
+ :'extract_text_type' => :'ExtractTextType',
66
+ :'before_text' => :'BeforeText',
67
+ :'after_text' => :'AfterText',
68
+ :'before_position' => :'BeforePosition',
69
+ :'after_position' => :'AfterPosition',
70
+ :'out_position_range' => :'OutPositionRange'
71
+ }
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.swagger_types
76
+ {
77
+ :'name' => :'String',
78
+ :'data_source' => :'DataSource',
79
+ :'file_info' => :'FileInfo',
80
+ :'worksheet' => :'String',
81
+ :'range' => :'String',
82
+ :'extract_text_type' => :'String',
83
+ :'before_text' => :'String',
84
+ :'after_text' => :'String',
85
+ :'before_position' => :'Integer',
86
+ :'after_position' => :'Integer',
87
+ :'out_position_range' => :'String'
88
+ }
89
+ end
90
+
91
+ # Initializes the object
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ def initialize(attributes = {})
94
+ return unless attributes.is_a?(Hash)
95
+
96
+ # convert string to symbol for hash key
97
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
98
+
99
+ if attributes.has_key?(:'Name')
100
+ self.name = attributes[:'Name']
101
+ end
102
+ if attributes.has_key?(:'DataSource')
103
+ self.data_source = attributes[:'DataSource']
104
+ end
105
+ if attributes.has_key?(:'FileInfo')
106
+ self.file_info = attributes[:'FileInfo']
107
+ end
108
+ if attributes.has_key?(:'Worksheet')
109
+ self.worksheet = attributes[:'Worksheet']
110
+ end
111
+ if attributes.has_key?(:'Range')
112
+ self.range = attributes[:'Range']
113
+ end
114
+ if attributes.has_key?(:'ExtractTextType')
115
+ self.extract_text_type = attributes[:'ExtractTextType']
116
+ end
117
+ if attributes.has_key?(:'BeforeText')
118
+ self.before_text = attributes[:'BeforeText']
119
+ end
120
+ if attributes.has_key?(:'AfterText')
121
+ self.after_text = attributes[:'AfterText']
122
+ end
123
+ if attributes.has_key?(:'BeforePosition')
124
+ self.before_position = attributes[:'BeforePosition']
125
+ end
126
+ if attributes.has_key?(:'AfterPosition')
127
+ self.after_position = attributes[:'AfterPosition']
128
+ end
129
+ if attributes.has_key?(:'OutPositionRange')
130
+ self.out_position_range = attributes[:'OutPositionRange']
131
+ end
132
+
133
+ end
134
+
135
+ # Show invalid properties with the reasons. Usually used together with valid?
136
+ # @return Array for valid properies with the reasons
137
+ def list_invalid_properties
138
+ invalid_properties = Array.new
139
+ if @name.nil?
140
+ invalid_properties.push("invalid value for 'name', name cannot be nil.")
141
+ end
142
+ if @data_source.nil?
143
+ invalid_properties.push("invalid value for 'data_source', data_source cannot be nil.")
144
+ end
145
+ if @file_info.nil?
146
+ invalid_properties.push("invalid value for 'file_info', file_info cannot be nil.")
147
+ end
148
+ if @worksheet.nil?
149
+ invalid_properties.push("invalid value for 'worksheet', worksheet cannot be nil.")
150
+ end
151
+ if @range.nil?
152
+ invalid_properties.push("invalid value for 'range', range cannot be nil.")
153
+ end
154
+ if @extract_text_type.nil?
155
+ invalid_properties.push("invalid value for 'extract_text_type', extract_text_type cannot be nil.")
156
+ end
157
+ if @before_text.nil?
158
+ invalid_properties.push("invalid value for 'before_text', before_text cannot be nil.")
159
+ end
160
+ if @after_text.nil?
161
+ invalid_properties.push("invalid value for 'after_text', after_text cannot be nil.")
162
+ end
163
+ if @before_position.nil?
164
+ invalid_properties.push("invalid value for 'before_position', before_position cannot be nil.")
165
+ end
166
+ if @after_position.nil?
167
+ invalid_properties.push("invalid value for 'after_position', after_position cannot be nil.")
168
+ end
169
+ if @out_position_range.nil?
170
+ invalid_properties.push("invalid value for 'out_position_range', out_position_range cannot be nil.")
171
+ end
172
+
173
+ return invalid_properties
174
+ end
175
+
176
+ # Check to see if the all the properties in the model are valid
177
+ # @return true if the model is valid
178
+ def valid?
179
+ return false if @name.nil?
180
+ return false if @data_source.nil?
181
+ return false if @file_info.nil?
182
+ return false if @worksheet.nil?
183
+ return false if @range.nil?
184
+ return false if @extract_text_type.nil?
185
+ return false if @before_text.nil?
186
+ return false if @after_text.nil?
187
+ return false if @before_position.nil?
188
+ return false if @after_position.nil?
189
+ return false if @out_position_range.nil?
190
+ return true
191
+ end
192
+
193
+ # Checks equality by comparing each attribute.
194
+ # @param [Object] Object to be compared
195
+ def ==(o)
196
+ return true if self.equal?(o)
197
+ self.class == o.class &&
198
+ name == o.name &&
199
+ data_source == o.data_source &&
200
+ file_info == o.file_info &&
201
+ worksheet == o.worksheet &&
202
+ range == o.range &&
203
+ extract_text_type == o.extract_text_type &&
204
+ before_text == o.before_text &&
205
+ after_text == o.after_text &&
206
+ before_position == o.before_position &&
207
+ after_position == o.after_position &&
208
+ out_position_range == o.out_position_range
209
+ std_dev == o.std_dev
210
+ end
211
+
212
+ # @see the `==` method
213
+ # @param [Object] Object to be compared
214
+ def eql?(o)
215
+ self == o
216
+ end
217
+
218
+ # Calculates hash code according to all attributes.
219
+ # @return [Fixnum] Hash code
220
+ def hash
221
+ [ name , data_source , file_info , worksheet , range , extract_text_type , before_text , after_text , before_position , after_position , out_position_range ].hash
222
+ end
223
+
224
+ # Builds the object from hash
225
+ # @param [Hash] attributes Model attributes in the form of hash
226
+ # @return [Object] Returns the model itself
227
+ def build_from_hash(attributes)
228
+ return nil unless attributes.is_a?(Hash)
229
+ self.class.swagger_types.each_pair do |key, type|
230
+ if type =~ /\AArray<(.*)>/i
231
+ # check to ensure the input is an array given that the the attribute
232
+ # is documented as an array but the input is not
233
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
234
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
235
+ end
236
+ elsif !attributes[self.class.attribute_map[key]].nil?
237
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
238
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
239
+ end
240
+
241
+ self
242
+ end
243
+
244
+ # Deserializes the data based on type
245
+ # @param string type Data type
246
+ # @param string value Value to be deserialized
247
+ # @return [Object] Deserialized data
248
+ def _deserialize(type, value)
249
+ case type.to_sym
250
+ when :DateTime
251
+ DateTime.parse(value)
252
+ when :Date
253
+ Date.parse(value)
254
+ when :String
255
+ value.to_s
256
+ when :Integer
257
+ value.to_i
258
+ when :Float
259
+ value.to_f
260
+ when :BOOLEAN
261
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
262
+ true
263
+ else
264
+ false
265
+ end
266
+ when :Object
267
+ # generic object (usually a Hash), return directly
268
+ value
269
+ when /\AArray<(?<inner_type>.+)>\z/
270
+ inner_type = Regexp.last_match[:inner_type]
271
+ value.map { |v| _deserialize(inner_type, v) }
272
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
273
+ k_type = Regexp.last_match[:k_type]
274
+ v_type = Regexp.last_match[:v_type]
275
+ {}.tap do |hash|
276
+ value.each do |k, v|
277
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
278
+ end
279
+ end
280
+ else # model
281
+ temp_model = AsposeCellsCloud.const_get(type).new
282
+ temp_model.build_from_hash(value)
283
+ end
284
+ end
285
+
286
+ # Returns the string representation of the object
287
+ # @return [String] String presentation of the object
288
+ def to_s
289
+ to_hash.to_s
290
+ end
291
+
292
+ # to_body is an alias to to_hash (backward compatibility)
293
+ # @return [Hash] Returns the object in the form of hash
294
+ def to_body
295
+ to_hash
296
+ end
297
+
298
+ # Returns the object in the form of hash
299
+ # @return [Hash] Returns the object in the form of hash
300
+ def to_hash
301
+ hash = {}
302
+ self.class.attribute_map.each_pair do |attr, param|
303
+ value = self.send(attr)
304
+ next if value.nil?
305
+ hash[param] = _to_hash(value)
306
+ end
307
+ hash
308
+ end
309
+
310
+ # Outputs non-array value in the form of hash
311
+ # For object, use to_hash. Otherwise, just return the value
312
+ # @param [Object] value Any valid value
313
+ # @return [Hash] Returns the value in the form of hash
314
+ def _to_hash(value)
315
+ if value.is_a?(Array)
316
+ value.compact.map{ |v| _to_hash(v) }
317
+ elsif value.is_a?(Hash)
318
+ {}.tap do |hash|
319
+ value.each { |k, v| hash[k] = _to_hash(v) }
320
+ end
321
+ elsif value.respond_to? :to_hash
322
+ value.to_hash
323
+ else
324
+ value
325
+ end
326
+ end
327
+
328
+ end
329
+
330
+ end