aspose_cells_cloud 24.3 → 24.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -6
  3. data/lib/aspose_cells_cloud/api/cells_api.rb +8 -0
  4. data/lib/aspose_cells_cloud/models/cells_object_operate_task_parameter.rb +13 -1
  5. data/lib/aspose_cells_cloud/models/convert_task_parameter.rb +13 -1
  6. data/lib/aspose_cells_cloud/models/convert_worksheet_task_parameter.rb +25 -1
  7. data/lib/aspose_cells_cloud/models/data_item.rb +222 -0
  8. data/lib/aspose_cells_cloud/models/data_source.rb +222 -0
  9. data/lib/aspose_cells_cloud/models/data_transformation_request.rb +258 -0
  10. data/lib/aspose_cells_cloud/models/import2_dimension_double_array_option.rb +13 -1
  11. data/lib/aspose_cells_cloud/models/import2_dimension_int_array_option.rb +13 -1
  12. data/lib/aspose_cells_cloud/models/import2_dimension_string_array_option.rb +13 -1
  13. data/lib/aspose_cells_cloud/models/import_batch_data_option.rb +13 -1
  14. data/lib/aspose_cells_cloud/models/import_csv_data_option.rb +13 -1
  15. data/lib/aspose_cells_cloud/models/import_data_task_parameter.rb +25 -1
  16. data/lib/aspose_cells_cloud/models/import_double_array_option.rb +13 -1
  17. data/lib/aspose_cells_cloud/models/import_int_array_option.rb +13 -1
  18. data/lib/aspose_cells_cloud/models/import_json_request.rb +1 -1
  19. data/lib/aspose_cells_cloud/models/import_option.rb +13 -1
  20. data/lib/aspose_cells_cloud/models/import_picture_option.rb +13 -1
  21. data/lib/aspose_cells_cloud/models/import_string_array_option.rb +13 -1
  22. data/lib/aspose_cells_cloud/models/import_xml_request.rb +1 -1
  23. data/lib/aspose_cells_cloud/models/load_data.rb +246 -0
  24. data/lib/aspose_cells_cloud/models/load_to.rb +234 -0
  25. data/lib/aspose_cells_cloud/models/operate_object_position.rb +13 -1
  26. data/lib/aspose_cells_cloud/models/pivot_column.rb +222 -0
  27. data/lib/aspose_cells_cloud/models/pptx_save_options.rb +3 -3
  28. data/lib/aspose_cells_cloud/models/query_data_source.rb +234 -0
  29. data/lib/aspose_cells_cloud/models/save_files_to_cloud_result.rb +1 -1
  30. data/lib/aspose_cells_cloud/models/smart_marker_task_parameter.rb +40 -4
  31. data/lib/aspose_cells_cloud/models/split_workbook_task_parameter.rb +25 -1
  32. data/lib/aspose_cells_cloud/models/task_run_result.rb +1 -1
  33. data/lib/aspose_cells_cloud/models/transformation.rb +222 -0
  34. data/lib/aspose_cells_cloud/models/unpivot_column.rb +234 -0
  35. data/lib/aspose_cells_cloud/requests/post_data_transformation_request.rb +103 -0
  36. data/lib/aspose_cells_cloud/version.rb +1 -1
  37. data/lib/aspose_cells_cloud.rb +12 -2
  38. data/spec/api/xml_controller_spec.rb +1 -1
  39. metadata +25 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aafed91fd5ad7d98ee6419cfba2ee2848b047fcdb51f54caa0b5af02a40e6848
4
- data.tar.gz: c74e7fb34b6de9b7eef3ef31ad8c42acbf5a97207d239d6411919f319668ff8c
3
+ metadata.gz: 3bb70a08debd2ae25df9674a51c2df42427482c9b42a2569cdf78ac565cbbf3f
4
+ data.tar.gz: 5c4e6872336078e23af85fb57a991396dfc0ebb8f6bfc5d1dbda18b39c8ce93c
5
5
  SHA512:
6
- metadata.gz: 04a1a41e6b5b55714df4d68b779ac2a525f4b531820300b2d87533dbe9dc897f3f1c373bc750170a74e1a9cab7d43921e92369d52d32b95a743fc8261e583adf
7
- data.tar.gz: 879f04967f923f4e9410015739d5cd63fc894509a6581390f59012b91b62c2911159b425d570ed4daa948670dcce0d2a98194466248e1b2d61e66efd24c398b1
6
+ metadata.gz: 4f712212a26840f1e9516cf3f7d66a4398825463e9940334f3c81766474996c58d1bfe74dcfe674fd03ab1aa9822497beb89a8a4faee4a7ad3fcb14d0a6fadea
7
+ data.tar.gz: d86955c3d59d2b1d659ab87b2d3163ba86aab0c1203603a89b9f3a8469efe67ae5d61f2807498c3c02a72e92beebdfabb8456991de470d8aff0d3ff4cdc4241c
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.3)
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.4)
2
2
 
3
3
 
4
4
  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.
@@ -23,14 +23,11 @@ Enhance your Ruby applications with the [Aspose.Cells Cloud](https://products.as
23
23
 
24
24
 
25
25
 
26
- ## Feature & Enhancements in Version 24.3
26
+ ## Feature & Enhancements in Version 24.4
27
27
 
28
28
  Full list of issues covering all changes in this release:
29
29
 
30
- - Support data deduplication.
31
- - Support data filling.
32
- - Support to delete incomplete rows.
33
- - Support data cleansing.
30
+ - Support data transformation.
34
31
 
35
32
  ## Support file format
36
33
 
@@ -129,6 +126,13 @@ request = AsposeCellsCloud::PutConvertWorkbookRequest.new(:File=>mapFiles,:for
129
126
 
130
127
  # Release history version
131
128
 
129
+ ## Enhancements in Version 24.3
130
+
131
+ - Support data deduplication.
132
+ - Support data filling.
133
+ - Support to delete incomplete rows.
134
+ - Support data cleansing.
135
+
132
136
  ## Enhancements in Version 24.2.1
133
137
 
134
138
  - Support data deduplication.
@@ -1025,6 +1025,14 @@ module AsposeCellsCloud
1025
1025
  return data
1026
1026
  end
1027
1027
 
1028
+ # Transform spreadsheet data is mainly used to pivot columns, unpivot columns.
1029
+
1030
+ def post_data_transformation( post_data_transformation_request, opts = {})
1031
+
1032
+ data, _status_code, _headers = post_data_transformation_request.create_http_request(@api_client,opts )
1033
+ return data
1034
+ end
1035
+
1028
1036
  # Retrieve descriptions of hyperlinks in the worksheet.
1029
1037
 
1030
1038
  def get_worksheet_hyperlinks( get_worksheet_hyperlinks_request, opts = {})
@@ -36,6 +36,8 @@ module AsposeCellsCloud
36
36
  #
37
37
  attr_accessor :operate_parameter
38
38
  #
39
+ attr_accessor :destinatio_data_source
40
+ #
39
41
  attr_accessor :destination_workbook
40
42
 
41
43
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -43,6 +45,7 @@ module AsposeCellsCloud
43
45
  {
44
46
  :'operate_object' => :'OperateObject',
45
47
  :'operate_parameter' => :'OperateParameter',
48
+ :'destinatio_data_source' => :'DestinatioDataSource',
46
49
  :'destination_workbook' => :'DestinationWorkbook'
47
50
  }
48
51
  end
@@ -52,6 +55,7 @@ module AsposeCellsCloud
52
55
  {
53
56
  :'operate_object' => :'OperateObject',
54
57
  :'operate_parameter' => :'OperateParameter',
58
+ :'destinatio_data_source' => :'DataSource',
55
59
  :'destination_workbook' => :'FileSource'
56
60
  }
57
61
  end
@@ -70,6 +74,9 @@ module AsposeCellsCloud
70
74
  if attributes.has_key?(:'OperateParameter')
71
75
  self.operate_parameter = attributes[:'OperateParameter']
72
76
  end
77
+ if attributes.has_key?(:'DestinatioDataSource')
78
+ self.destinatio_data_source = attributes[:'DestinatioDataSource']
79
+ end
73
80
  if attributes.has_key?(:'DestinationWorkbook')
74
81
  self.destination_workbook = attributes[:'DestinationWorkbook']
75
82
  end
@@ -86,6 +93,9 @@ module AsposeCellsCloud
86
93
  if @operate_parameter.nil?
87
94
  invalid_properties.push("invalid value for 'operate_parameter', operate_parameter cannot be nil.")
88
95
  end
96
+ if @destinatio_data_source.nil?
97
+ invalid_properties.push("invalid value for 'destinatio_data_source', destinatio_data_source cannot be nil.")
98
+ end
89
99
  if @destination_workbook.nil?
90
100
  invalid_properties.push("invalid value for 'destination_workbook', destination_workbook cannot be nil.")
91
101
  end
@@ -98,6 +108,7 @@ module AsposeCellsCloud
98
108
  def valid?
99
109
  return false if @operate_object.nil?
100
110
  return false if @operate_parameter.nil?
111
+ return false if @destinatio_data_source.nil?
101
112
  return false if @destination_workbook.nil?
102
113
  return true
103
114
  end
@@ -109,6 +120,7 @@ module AsposeCellsCloud
109
120
  self.class == o.class &&
110
121
  operate_object == o.operate_object &&
111
122
  operate_parameter == o.operate_parameter &&
123
+ destinatio_data_source == o.destinatio_data_source &&
112
124
  destination_workbook == o.destination_workbook
113
125
  std_dev == o.std_dev
114
126
  end
@@ -122,7 +134,7 @@ module AsposeCellsCloud
122
134
  # Calculates hash code according to all attributes.
123
135
  # @return [Fixnum] Hash code
124
136
  def hash
125
- [ operate_object , operate_parameter , destination_workbook ].hash
137
+ [ operate_object , operate_parameter , destinatio_data_source , destination_workbook ].hash
126
138
  end
127
139
 
128
140
  # Builds the object from hash
@@ -31,6 +31,8 @@ require 'date'
31
31
  module AsposeCellsCloud
32
32
 
33
33
  class ConvertTaskParameter
34
+ #
35
+ attr_accessor :data_source
34
36
  #
35
37
  attr_accessor :workbook
36
38
  #
@@ -43,6 +45,7 @@ module AsposeCellsCloud
43
45
  # Attribute mapping from ruby-style variable name to JSON key.
44
46
  def self.attribute_map
45
47
  {
48
+ :'data_source' => :'DataSource',
46
49
  :'workbook' => :'Workbook',
47
50
  :'destination_file' => :'DestinationFile',
48
51
  :'region' => :'Region',
@@ -53,6 +56,7 @@ module AsposeCellsCloud
53
56
  # Attribute type mapping.
54
57
  def self.swagger_types
55
58
  {
59
+ :'data_source' => :'DataSource',
56
60
  :'workbook' => :'FileSource',
57
61
  :'destination_file' => :'String',
58
62
  :'region' => :'String',
@@ -68,6 +72,9 @@ module AsposeCellsCloud
68
72
  # convert string to symbol for hash key
69
73
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
70
74
 
75
+ if attributes.has_key?(:'DataSource')
76
+ self.data_source = attributes[:'DataSource']
77
+ end
71
78
  if attributes.has_key?(:'Workbook')
72
79
  self.workbook = attributes[:'Workbook']
73
80
  end
@@ -87,6 +94,9 @@ module AsposeCellsCloud
87
94
  # @return Array for valid properies with the reasons
88
95
  def list_invalid_properties
89
96
  invalid_properties = Array.new
97
+ if @data_source.nil?
98
+ invalid_properties.push("invalid value for 'data_source', data_source cannot be nil.")
99
+ end
90
100
  if @workbook.nil?
91
101
  invalid_properties.push("invalid value for 'workbook', workbook cannot be nil.")
92
102
  end
@@ -106,6 +116,7 @@ module AsposeCellsCloud
106
116
  # Check to see if the all the properties in the model are valid
107
117
  # @return true if the model is valid
108
118
  def valid?
119
+ return false if @data_source.nil?
109
120
  return false if @workbook.nil?
110
121
  return false if @destination_file.nil?
111
122
  return false if @region.nil?
@@ -118,6 +129,7 @@ module AsposeCellsCloud
118
129
  def ==(o)
119
130
  return true if self.equal?(o)
120
131
  self.class == o.class &&
132
+ data_source == o.data_source &&
121
133
  workbook == o.workbook &&
122
134
  destination_file == o.destination_file &&
123
135
  region == o.region &&
@@ -134,7 +146,7 @@ module AsposeCellsCloud
134
146
  # Calculates hash code according to all attributes.
135
147
  # @return [Fixnum] Hash code
136
148
  def hash
137
- [ workbook , destination_file , region , save_options ].hash
149
+ [ data_source , workbook , destination_file , region , save_options ].hash
138
150
  end
139
151
 
140
152
  # Builds the object from hash
@@ -31,11 +31,15 @@ require 'date'
31
31
  module AsposeCellsCloud
32
32
 
33
33
  class ConvertWorksheetTaskParameter
34
+ #
35
+ attr_accessor :data_source
34
36
  #
35
37
  attr_accessor :workbook
36
38
  #
37
39
  attr_accessor :sheet
38
40
  #
41
+ attr_accessor :target_data_source
42
+ #
39
43
  attr_accessor :target
40
44
  #
41
45
  attr_accessor :format
@@ -51,8 +55,10 @@ module AsposeCellsCloud
51
55
  # Attribute mapping from ruby-style variable name to JSON key.
52
56
  def self.attribute_map
53
57
  {
58
+ :'data_source' => :'DataSource',
54
59
  :'workbook' => :'Workbook',
55
60
  :'sheet' => :'Sheet',
61
+ :'target_data_source' => :'TargetDataSource',
56
62
  :'target' => :'Target',
57
63
  :'format' => :'Format',
58
64
  :'area' => :'Area',
@@ -65,8 +71,10 @@ module AsposeCellsCloud
65
71
  # Attribute type mapping.
66
72
  def self.swagger_types
67
73
  {
74
+ :'data_source' => :'DataSource',
68
75
  :'workbook' => :'FileSource',
69
76
  :'sheet' => :'String',
77
+ :'target_data_source' => :'DataSource',
70
78
  :'target' => :'FileSource',
71
79
  :'format' => :'String',
72
80
  :'area' => :'String',
@@ -84,12 +92,18 @@ module AsposeCellsCloud
84
92
  # convert string to symbol for hash key
85
93
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
86
94
 
95
+ if attributes.has_key?(:'DataSource')
96
+ self.data_source = attributes[:'DataSource']
97
+ end
87
98
  if attributes.has_key?(:'Workbook')
88
99
  self.workbook = attributes[:'Workbook']
89
100
  end
90
101
  if attributes.has_key?(:'Sheet')
91
102
  self.sheet = attributes[:'Sheet']
92
103
  end
104
+ if attributes.has_key?(:'TargetDataSource')
105
+ self.target_data_source = attributes[:'TargetDataSource']
106
+ end
93
107
  if attributes.has_key?(:'Target')
94
108
  self.target = attributes[:'Target']
95
109
  end
@@ -115,12 +129,18 @@ module AsposeCellsCloud
115
129
  # @return Array for valid properies with the reasons
116
130
  def list_invalid_properties
117
131
  invalid_properties = Array.new
132
+ if @data_source.nil?
133
+ invalid_properties.push("invalid value for 'data_source', data_source cannot be nil.")
134
+ end
118
135
  if @workbook.nil?
119
136
  invalid_properties.push("invalid value for 'workbook', workbook cannot be nil.")
120
137
  end
121
138
  if @sheet.nil?
122
139
  invalid_properties.push("invalid value for 'sheet', sheet cannot be nil.")
123
140
  end
141
+ if @target_data_source.nil?
142
+ invalid_properties.push("invalid value for 'target_data_source', target_data_source cannot be nil.")
143
+ end
124
144
  if @target.nil?
125
145
  invalid_properties.push("invalid value for 'target', target cannot be nil.")
126
146
  end
@@ -146,8 +166,10 @@ module AsposeCellsCloud
146
166
  # Check to see if the all the properties in the model are valid
147
167
  # @return true if the model is valid
148
168
  def valid?
169
+ return false if @data_source.nil?
149
170
  return false if @workbook.nil?
150
171
  return false if @sheet.nil?
172
+ return false if @target_data_source.nil?
151
173
  return false if @target.nil?
152
174
  return false if @format.nil?
153
175
  return false if @area.nil?
@@ -162,8 +184,10 @@ module AsposeCellsCloud
162
184
  def ==(o)
163
185
  return true if self.equal?(o)
164
186
  self.class == o.class &&
187
+ data_source == o.data_source &&
165
188
  workbook == o.workbook &&
166
189
  sheet == o.sheet &&
190
+ target_data_source == o.target_data_source &&
167
191
  target == o.target &&
168
192
  format == o.format &&
169
193
  area == o.area &&
@@ -182,7 +206,7 @@ module AsposeCellsCloud
182
206
  # Calculates hash code according to all attributes.
183
207
  # @return [Fixnum] Hash code
184
208
  def hash
185
- [ workbook , sheet , target , format , area , page_index , vertical_resolution , horizontal_resolution ].hash
209
+ [ data_source , workbook , sheet , target_data_source , target , format , area , page_index , vertical_resolution , horizontal_resolution ].hash
186
210
  end
187
211
 
188
212
  # Builds the object from hash
@@ -0,0 +1,222 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ <copyright company="Aspose" file="DataItemrb.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 DataItem
34
+ #
35
+ attr_accessor :data_item_type
36
+ #
37
+ attr_accessor :value
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'data_item_type' => :'DataItemType',
43
+ :'value' => :'Value'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.swagger_types
49
+ {
50
+ :'data_item_type' => :'String',
51
+ :'value' => :'String'
52
+ }
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ return unless attributes.is_a?(Hash)
59
+
60
+ # convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
62
+
63
+ if attributes.has_key?(:'DataItemType')
64
+ self.data_item_type = attributes[:'DataItemType']
65
+ end
66
+ if attributes.has_key?(:'Value')
67
+ self.value = attributes[:'Value']
68
+ end
69
+
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properies with the reasons
74
+ def list_invalid_properties
75
+ invalid_properties = Array.new
76
+ if @data_item_type.nil?
77
+ invalid_properties.push("invalid value for 'data_item_type', data_item_type cannot be nil.")
78
+ end
79
+ if @value.nil?
80
+ invalid_properties.push("invalid value for 'value', value cannot be nil.")
81
+ end
82
+
83
+ return invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ return false if @data_item_type.nil?
90
+ return false if @value.nil?
91
+ return true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ data_item_type == o.data_item_type &&
100
+ value == o.value
101
+ std_dev == o.std_dev
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Fixnum] Hash code
112
+ def hash
113
+ [ data_item_type , value ].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ self.class.swagger_types.each_pair do |key, type|
122
+ if type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
126
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
127
+ end
128
+ elsif !attributes[self.class.attribute_map[key]].nil?
129
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
130
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
131
+ end
132
+
133
+ self
134
+ end
135
+
136
+ # Deserializes the data based on type
137
+ # @param string type Data type
138
+ # @param string value Value to be deserialized
139
+ # @return [Object] Deserialized data
140
+ def _deserialize(type, value)
141
+ case type.to_sym
142
+ when :DateTime
143
+ DateTime.parse(value)
144
+ when :Date
145
+ Date.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :BOOLEAN
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ temp_model = AsposeCellsCloud.const_get(type).new
174
+ temp_model.build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ next if value.nil?
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map{ |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+
220
+ end
221
+
222
+ end