groupdocs_conversion_cloud 25.9 → 25.12

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.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_conversion_cloud/models/{tsv_convert_options.rb → cad_convert_options.rb} +74 -32
  3. data/lib/groupdocs_conversion_cloud/models/{pps_convert_options.rb → compression_convert_options.rb} +7 -22
  4. data/lib/groupdocs_conversion_cloud/models/compression_load_options.rb +224 -0
  5. data/lib/groupdocs_conversion_cloud/models/database_load_options.rb +214 -0
  6. data/lib/groupdocs_conversion_cloud/models/{odp_convert_options.rb → diagram_convert_options.rb} +14 -24
  7. data/lib/groupdocs_conversion_cloud/models/e_book_load_options.rb +214 -0
  8. data/lib/groupdocs_conversion_cloud/models/{ppt_convert_options.rb → email_convert_options.rb} +7 -32
  9. data/lib/groupdocs_conversion_cloud/models/{otp_convert_options.rb → finance_convert_options.rb} +7 -32
  10. data/lib/groupdocs_conversion_cloud/models/{ppsm_convert_options.rb → finance_load_options.rb} +11 -78
  11. data/lib/groupdocs_conversion_cloud/models/{potm_convert_options.rb → font_convert_options.rb} +7 -32
  12. data/lib/groupdocs_conversion_cloud/models/font_load_options.rb +214 -0
  13. data/lib/groupdocs_conversion_cloud/models/{txt_convert_options.rb → gis_convert_options.rb} +3 -3
  14. data/lib/groupdocs_conversion_cloud/models/gis_load_options.rb +244 -0
  15. data/lib/groupdocs_conversion_cloud/models/image_convert_options.rb +44 -4
  16. data/lib/groupdocs_conversion_cloud/models/jpg_convert_options.rb +1 -265
  17. data/lib/groupdocs_conversion_cloud/models/mbox_load_options.rb +214 -0
  18. data/lib/groupdocs_conversion_cloud/models/{one_load_options.rb → note_load_options.rb} +2 -2
  19. data/lib/groupdocs_conversion_cloud/models/olm_load_options.rb +224 -0
  20. data/lib/groupdocs_conversion_cloud/models/pdl_convert_options.rb +35 -5
  21. data/lib/groupdocs_conversion_cloud/models/pdl_load_options.rb +214 -0
  22. data/lib/groupdocs_conversion_cloud/models/project_management_convert_options.rb +256 -0
  23. data/lib/groupdocs_conversion_cloud/models/psd_convert_options.rb +1 -244
  24. data/lib/groupdocs_conversion_cloud/models/pub_load_options.rb +214 -0
  25. data/lib/groupdocs_conversion_cloud/models/rtf_convert_options.rb +1 -237
  26. data/lib/groupdocs_conversion_cloud/models/spreadsheet_convert_options.rb +4 -19
  27. data/lib/groupdocs_conversion_cloud/models/three_d_convert_options.rb +256 -0
  28. data/lib/groupdocs_conversion_cloud/models/three_d_load_options.rb +214 -0
  29. data/lib/groupdocs_conversion_cloud/models/tiff_convert_options.rb +1 -244
  30. data/lib/groupdocs_conversion_cloud/models/vcf_load_options.rb +224 -0
  31. data/lib/groupdocs_conversion_cloud/models/webp_convert_options.rb +1 -265
  32. data/lib/groupdocs_conversion_cloud/models/word_processing_convert_options.rb +14 -4
  33. data/lib/groupdocs_conversion_cloud/version.rb +1 -1
  34. data/lib/groupdocs_conversion_cloud.rb +27 -53
  35. metadata +24 -50
  36. data/lib/groupdocs_conversion_cloud/models/bmp_convert_options.rb +0 -468
  37. data/lib/groupdocs_conversion_cloud/models/dcm_convert_options.rb +0 -468
  38. data/lib/groupdocs_conversion_cloud/models/djvu_convert_options.rb +0 -468
  39. data/lib/groupdocs_conversion_cloud/models/dng_convert_options.rb +0 -468
  40. data/lib/groupdocs_conversion_cloud/models/doc_convert_options.rb +0 -440
  41. data/lib/groupdocs_conversion_cloud/models/docm_convert_options.rb +0 -440
  42. data/lib/groupdocs_conversion_cloud/models/docx_convert_options.rb +0 -440
  43. data/lib/groupdocs_conversion_cloud/models/dot_convert_options.rb +0 -440
  44. data/lib/groupdocs_conversion_cloud/models/dotm_convert_options.rb +0 -440
  45. data/lib/groupdocs_conversion_cloud/models/dotx_convert_options.rb +0 -440
  46. data/lib/groupdocs_conversion_cloud/models/emf_convert_options.rb +0 -468
  47. data/lib/groupdocs_conversion_cloud/models/gif_convert_options.rb +0 -468
  48. data/lib/groupdocs_conversion_cloud/models/ico_convert_options.rb +0 -468
  49. data/lib/groupdocs_conversion_cloud/models/j2c_convert_options.rb +0 -483
  50. data/lib/groupdocs_conversion_cloud/models/j2k_convert_options.rb +0 -483
  51. data/lib/groupdocs_conversion_cloud/models/jp2_convert_options.rb +0 -483
  52. data/lib/groupdocs_conversion_cloud/models/jpeg_convert_options.rb +0 -483
  53. data/lib/groupdocs_conversion_cloud/models/jpf_convert_options.rb +0 -483
  54. data/lib/groupdocs_conversion_cloud/models/jpm_convert_options.rb +0 -483
  55. data/lib/groupdocs_conversion_cloud/models/jpx_convert_options.rb +0 -483
  56. data/lib/groupdocs_conversion_cloud/models/odg_convert_options.rb +0 -468
  57. data/lib/groupdocs_conversion_cloud/models/ods_convert_options.rb +0 -296
  58. data/lib/groupdocs_conversion_cloud/models/odt_convert_options.rb +0 -440
  59. data/lib/groupdocs_conversion_cloud/models/ots_convert_options.rb +0 -296
  60. data/lib/groupdocs_conversion_cloud/models/ott_convert_options.rb +0 -440
  61. data/lib/groupdocs_conversion_cloud/models/png_convert_options.rb +0 -468
  62. data/lib/groupdocs_conversion_cloud/models/potx_convert_options.rb +0 -281
  63. data/lib/groupdocs_conversion_cloud/models/ppsx_convert_options.rb +0 -281
  64. data/lib/groupdocs_conversion_cloud/models/pptm_convert_options.rb +0 -281
  65. data/lib/groupdocs_conversion_cloud/models/pptx_convert_options.rb +0 -281
  66. data/lib/groupdocs_conversion_cloud/models/tif_convert_options.rb +0 -494
  67. data/lib/groupdocs_conversion_cloud/models/wmf_convert_options.rb +0 -468
  68. data/lib/groupdocs_conversion_cloud/models/xls2003_convert_options.rb +0 -296
  69. data/lib/groupdocs_conversion_cloud/models/xls_convert_options.rb +0 -296
  70. data/lib/groupdocs_conversion_cloud/models/xlsb_convert_options.rb +0 -296
  71. data/lib/groupdocs_conversion_cloud/models/xlsm_convert_options.rb +0 -296
  72. data/lib/groupdocs_conversion_cloud/models/xlsx_convert_options.rb +0 -296
  73. data/lib/groupdocs_conversion_cloud/models/xltm_convert_options.rb +0 -296
  74. data/lib/groupdocs_conversion_cloud/models/xltx_convert_options.rb +0 -296
@@ -1,281 +0,0 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="potx_convert_options.rb">
4
- # Copyright (c) Aspose Pty Ltd
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
- #
27
-
28
- require 'date'
29
-
30
- module GroupDocsConversionCloud
31
- # Potx convert options
32
- class PotxConvertOptions
33
-
34
- # Start conversion from FromPage page
35
- attr_accessor :from_page
36
-
37
- # Number of pages to convert
38
- attr_accessor :pages_count
39
-
40
- # Convert specific pages. The list contains the page indexes of the pages to be converted
41
- attr_accessor :pages
42
-
43
- # Watermark specific options
44
- attr_accessor :watermark_options
45
-
46
- # Set this property if you want to protect the converted document with a password
47
- attr_accessor :password
48
-
49
- # Specifies the zoom level in percentage. Default is 100. Default zoom is supported till Microsoft Powerpoint 2010. Starting from Microsoft Powerpoint 2013 default zoom is no longer set to document, instead it appears to use the zoom factor of the last document that was opened.
50
- attr_accessor :zoom
51
-
52
- # Attribute mapping from ruby-style variable name to JSON key.
53
- def self.attribute_map
54
- {
55
- :'from_page' => :'FromPage',
56
- :'pages_count' => :'PagesCount',
57
- :'pages' => :'Pages',
58
- :'watermark_options' => :'WatermarkOptions',
59
- :'password' => :'Password',
60
- :'zoom' => :'Zoom'
61
- }
62
- end
63
-
64
- # Attribute type mapping.
65
- def self.swagger_types
66
- {
67
- :'from_page' => :'Integer',
68
- :'pages_count' => :'Integer',
69
- :'pages' => :'Array<Integer>',
70
- :'watermark_options' => :'WatermarkOptions',
71
- :'password' => :'String',
72
- :'zoom' => :'Integer'
73
- }
74
- end
75
-
76
- # Initializes the object
77
- # @param [Hash] attributes Model attributes in the form of hash
78
- def initialize(attributes = {})
79
- return unless attributes.is_a?(Hash)
80
-
81
- # convert string to symbol for hash key
82
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
83
-
84
- if attributes.key?(:'FromPage')
85
- self.from_page = attributes[:'FromPage']
86
- end
87
-
88
- if attributes.key?(:'PagesCount')
89
- self.pages_count = attributes[:'PagesCount']
90
- end
91
-
92
- if attributes.key?(:'Pages')
93
- if (value = attributes[:'Pages']).is_a?(Array)
94
- self.pages = value
95
- end
96
- end
97
-
98
- if attributes.key?(:'WatermarkOptions')
99
- self.watermark_options = attributes[:'WatermarkOptions']
100
- end
101
-
102
- if attributes.key?(:'Password')
103
- self.password = attributes[:'Password']
104
- end
105
-
106
- if attributes.key?(:'Zoom')
107
- self.zoom = attributes[:'Zoom']
108
- end
109
-
110
- end
111
-
112
- # Show invalid properties with the reasons. Usually used together with valid?
113
- # @return Array for valid properies with the reasons
114
- def list_invalid_properties
115
- invalid_properties = []
116
- if @from_page.nil?
117
- invalid_properties.push("invalid value for 'from_page', from_page cannot be nil.")
118
- end
119
-
120
- if @pages_count.nil?
121
- invalid_properties.push("invalid value for 'pages_count', pages_count cannot be nil.")
122
- end
123
-
124
- if @zoom.nil?
125
- invalid_properties.push("invalid value for 'zoom', zoom cannot be nil.")
126
- end
127
-
128
- return invalid_properties
129
- end
130
-
131
- # Check to see if the all the properties in the model are valid
132
- # @return true if the model is valid
133
- def valid?
134
- return false if @from_page.nil?
135
- return false if @pages_count.nil?
136
- return false if @zoom.nil?
137
- return true
138
- end
139
-
140
- # Checks equality by comparing each attribute.
141
- # @param [Object] Object to be compared
142
- def ==(other)
143
- return true if self.equal?(other)
144
- self.class == other.class &&
145
- from_page == other.from_page &&
146
- pages_count == other.pages_count &&
147
- pages == other.pages &&
148
- watermark_options == other.watermark_options &&
149
- password == other.password &&
150
- zoom == other.zoom
151
- end
152
-
153
- # @see the `==` method
154
- # @param [Object] Object to be compared
155
- def eql?(other)
156
- self == other
157
- end
158
-
159
- # Calculates hash code according to all attributes.
160
- # @return [Fixnum] Hash code
161
- def hash
162
- [from_page, pages_count, pages, watermark_options, password, zoom].hash
163
- end
164
-
165
- # Downcases first letter.
166
- # @return downcased string
167
- def uncap(str)
168
- str[0, 1].downcase + str[1..-1]
169
- end
170
-
171
- # Builds the object from hash
172
- # @param [Hash] attributes Model attributes in the form of hash
173
- # @return [Object] Returns the model itself
174
- def build_from_hash(attributes)
175
- return nil unless attributes.is_a?(Hash)
176
- self.class.swagger_types.each_pair do |key, type|
177
- pname = uncap(self.class.attribute_map[key]).intern
178
- value = attributes[pname]
179
- if type =~ /\AArray<(.*)>/i
180
- # check to ensure the input is an array given that the the attribute
181
- # is documented as an array but the input is not
182
- if value.is_a?(Array)
183
- self.send("#{key}=", value.map { |v| _deserialize($1, v) })
184
- end
185
- elsif !value.nil?
186
- self.send("#{key}=", _deserialize(type, value))
187
- end
188
- # or else data not found in attributes(hash), not an issue as the data can be optional
189
- end
190
-
191
- self
192
- end
193
-
194
- # Deserializes the data based on type
195
- # @param string type Data type
196
- # @param string value Value to be deserialized
197
- # @return [Object] Deserialized data
198
- def _deserialize(type, value)
199
- case type.to_sym
200
- when :DateTime
201
- Date.parse value
202
- when :Date
203
- Date.parse value
204
- when :String
205
- value.to_s
206
- when :Integer
207
- value.to_i
208
- when :Float
209
- value.to_f
210
- when :BOOLEAN
211
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
212
- true
213
- else
214
- false
215
- end
216
- when :Object
217
- # generic object (usually a Hash), return directly
218
- value
219
- when /\AArray<(?<inner_type>.+)>\z/
220
- inner_type = Regexp.last_match[:inner_type]
221
- value.map { |v| _deserialize(inner_type, v) }
222
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
223
- k_type = Regexp.last_match[:k_type]
224
- v_type = Regexp.last_match[:v_type]
225
- {}.tap do |hash|
226
- value.each do |k, v|
227
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
- end
229
- end
230
- else
231
- # model
232
- temp_model = GroupDocsConversionCloud.const_get(type).new
233
- temp_model.build_from_hash(value)
234
- end
235
- end
236
-
237
- # Returns the string representation of the object
238
- # @return [String] String presentation of the object
239
- def to_s
240
- to_hash.to_s
241
- end
242
-
243
- # to_body is an alias to to_hash (backward compatibility)
244
- # @return [Hash] Returns the object in the form of hash
245
- def to_body
246
- to_hash
247
- end
248
-
249
- # Returns the object in the form of hash
250
- # @return [Hash] Returns the object in the form of hash
251
- def to_hash
252
- hash = {}
253
- self.class.attribute_map.each_pair do |attr, param|
254
- value = self.send(attr)
255
- next if value.nil?
256
- hash[param] = _to_hash(value)
257
- end
258
- hash
259
- end
260
-
261
- # Outputs non-array value in the form of hash
262
- # For object, use to_hash. Otherwise, just return the value
263
- # @param [Object] value Any valid value
264
- # @return [Hash] Returns the value in the form of hash
265
- def _to_hash(value)
266
- if value.is_a?(Array)
267
- value.compact.map { |v| _to_hash(v) }
268
- elsif value.is_a?(Hash)
269
- {}.tap do |hash|
270
- value.each { |k, v| hash[k] = _to_hash(v) }
271
- end
272
- elsif value.respond_to? :to_hash
273
- value.to_hash
274
- else
275
- value
276
- end
277
- end
278
-
279
- end
280
-
281
- end
@@ -1,281 +0,0 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="ppsx_convert_options.rb">
4
- # Copyright (c) Aspose Pty Ltd
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
- #
27
-
28
- require 'date'
29
-
30
- module GroupDocsConversionCloud
31
- # Ppsx convert options
32
- class PpsxConvertOptions
33
-
34
- # Start conversion from FromPage page
35
- attr_accessor :from_page
36
-
37
- # Number of pages to convert
38
- attr_accessor :pages_count
39
-
40
- # Convert specific pages. The list contains the page indexes of the pages to be converted
41
- attr_accessor :pages
42
-
43
- # Watermark specific options
44
- attr_accessor :watermark_options
45
-
46
- # Set this property if you want to protect the converted document with a password
47
- attr_accessor :password
48
-
49
- # Specifies the zoom level in percentage. Default is 100. Default zoom is supported till Microsoft Powerpoint 2010. Starting from Microsoft Powerpoint 2013 default zoom is no longer set to document, instead it appears to use the zoom factor of the last document that was opened.
50
- attr_accessor :zoom
51
-
52
- # Attribute mapping from ruby-style variable name to JSON key.
53
- def self.attribute_map
54
- {
55
- :'from_page' => :'FromPage',
56
- :'pages_count' => :'PagesCount',
57
- :'pages' => :'Pages',
58
- :'watermark_options' => :'WatermarkOptions',
59
- :'password' => :'Password',
60
- :'zoom' => :'Zoom'
61
- }
62
- end
63
-
64
- # Attribute type mapping.
65
- def self.swagger_types
66
- {
67
- :'from_page' => :'Integer',
68
- :'pages_count' => :'Integer',
69
- :'pages' => :'Array<Integer>',
70
- :'watermark_options' => :'WatermarkOptions',
71
- :'password' => :'String',
72
- :'zoom' => :'Integer'
73
- }
74
- end
75
-
76
- # Initializes the object
77
- # @param [Hash] attributes Model attributes in the form of hash
78
- def initialize(attributes = {})
79
- return unless attributes.is_a?(Hash)
80
-
81
- # convert string to symbol for hash key
82
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
83
-
84
- if attributes.key?(:'FromPage')
85
- self.from_page = attributes[:'FromPage']
86
- end
87
-
88
- if attributes.key?(:'PagesCount')
89
- self.pages_count = attributes[:'PagesCount']
90
- end
91
-
92
- if attributes.key?(:'Pages')
93
- if (value = attributes[:'Pages']).is_a?(Array)
94
- self.pages = value
95
- end
96
- end
97
-
98
- if attributes.key?(:'WatermarkOptions')
99
- self.watermark_options = attributes[:'WatermarkOptions']
100
- end
101
-
102
- if attributes.key?(:'Password')
103
- self.password = attributes[:'Password']
104
- end
105
-
106
- if attributes.key?(:'Zoom')
107
- self.zoom = attributes[:'Zoom']
108
- end
109
-
110
- end
111
-
112
- # Show invalid properties with the reasons. Usually used together with valid?
113
- # @return Array for valid properies with the reasons
114
- def list_invalid_properties
115
- invalid_properties = []
116
- if @from_page.nil?
117
- invalid_properties.push("invalid value for 'from_page', from_page cannot be nil.")
118
- end
119
-
120
- if @pages_count.nil?
121
- invalid_properties.push("invalid value for 'pages_count', pages_count cannot be nil.")
122
- end
123
-
124
- if @zoom.nil?
125
- invalid_properties.push("invalid value for 'zoom', zoom cannot be nil.")
126
- end
127
-
128
- return invalid_properties
129
- end
130
-
131
- # Check to see if the all the properties in the model are valid
132
- # @return true if the model is valid
133
- def valid?
134
- return false if @from_page.nil?
135
- return false if @pages_count.nil?
136
- return false if @zoom.nil?
137
- return true
138
- end
139
-
140
- # Checks equality by comparing each attribute.
141
- # @param [Object] Object to be compared
142
- def ==(other)
143
- return true if self.equal?(other)
144
- self.class == other.class &&
145
- from_page == other.from_page &&
146
- pages_count == other.pages_count &&
147
- pages == other.pages &&
148
- watermark_options == other.watermark_options &&
149
- password == other.password &&
150
- zoom == other.zoom
151
- end
152
-
153
- # @see the `==` method
154
- # @param [Object] Object to be compared
155
- def eql?(other)
156
- self == other
157
- end
158
-
159
- # Calculates hash code according to all attributes.
160
- # @return [Fixnum] Hash code
161
- def hash
162
- [from_page, pages_count, pages, watermark_options, password, zoom].hash
163
- end
164
-
165
- # Downcases first letter.
166
- # @return downcased string
167
- def uncap(str)
168
- str[0, 1].downcase + str[1..-1]
169
- end
170
-
171
- # Builds the object from hash
172
- # @param [Hash] attributes Model attributes in the form of hash
173
- # @return [Object] Returns the model itself
174
- def build_from_hash(attributes)
175
- return nil unless attributes.is_a?(Hash)
176
- self.class.swagger_types.each_pair do |key, type|
177
- pname = uncap(self.class.attribute_map[key]).intern
178
- value = attributes[pname]
179
- if type =~ /\AArray<(.*)>/i
180
- # check to ensure the input is an array given that the the attribute
181
- # is documented as an array but the input is not
182
- if value.is_a?(Array)
183
- self.send("#{key}=", value.map { |v| _deserialize($1, v) })
184
- end
185
- elsif !value.nil?
186
- self.send("#{key}=", _deserialize(type, value))
187
- end
188
- # or else data not found in attributes(hash), not an issue as the data can be optional
189
- end
190
-
191
- self
192
- end
193
-
194
- # Deserializes the data based on type
195
- # @param string type Data type
196
- # @param string value Value to be deserialized
197
- # @return [Object] Deserialized data
198
- def _deserialize(type, value)
199
- case type.to_sym
200
- when :DateTime
201
- Date.parse value
202
- when :Date
203
- Date.parse value
204
- when :String
205
- value.to_s
206
- when :Integer
207
- value.to_i
208
- when :Float
209
- value.to_f
210
- when :BOOLEAN
211
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
212
- true
213
- else
214
- false
215
- end
216
- when :Object
217
- # generic object (usually a Hash), return directly
218
- value
219
- when /\AArray<(?<inner_type>.+)>\z/
220
- inner_type = Regexp.last_match[:inner_type]
221
- value.map { |v| _deserialize(inner_type, v) }
222
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
223
- k_type = Regexp.last_match[:k_type]
224
- v_type = Regexp.last_match[:v_type]
225
- {}.tap do |hash|
226
- value.each do |k, v|
227
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
- end
229
- end
230
- else
231
- # model
232
- temp_model = GroupDocsConversionCloud.const_get(type).new
233
- temp_model.build_from_hash(value)
234
- end
235
- end
236
-
237
- # Returns the string representation of the object
238
- # @return [String] String presentation of the object
239
- def to_s
240
- to_hash.to_s
241
- end
242
-
243
- # to_body is an alias to to_hash (backward compatibility)
244
- # @return [Hash] Returns the object in the form of hash
245
- def to_body
246
- to_hash
247
- end
248
-
249
- # Returns the object in the form of hash
250
- # @return [Hash] Returns the object in the form of hash
251
- def to_hash
252
- hash = {}
253
- self.class.attribute_map.each_pair do |attr, param|
254
- value = self.send(attr)
255
- next if value.nil?
256
- hash[param] = _to_hash(value)
257
- end
258
- hash
259
- end
260
-
261
- # Outputs non-array value in the form of hash
262
- # For object, use to_hash. Otherwise, just return the value
263
- # @param [Object] value Any valid value
264
- # @return [Hash] Returns the value in the form of hash
265
- def _to_hash(value)
266
- if value.is_a?(Array)
267
- value.compact.map { |v| _to_hash(v) }
268
- elsif value.is_a?(Hash)
269
- {}.tap do |hash|
270
- value.each { |k, v| hash[k] = _to_hash(v) }
271
- end
272
- elsif value.respond_to? :to_hash
273
- value.to_hash
274
- else
275
- value
276
- end
277
- end
278
-
279
- end
280
-
281
- end