groupdocs_editor_cloud 19.11

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 (43) hide show
  1. checksums.yaml +7 -0
  2. data/lib/groupdocs_editor_cloud.rb +70 -0
  3. data/lib/groupdocs_editor_cloud/api/edit_api.rb +314 -0
  4. data/lib/groupdocs_editor_cloud/api/file_api.rb +729 -0
  5. data/lib/groupdocs_editor_cloud/api/folder_api.rb +694 -0
  6. data/lib/groupdocs_editor_cloud/api/info_api.rb +266 -0
  7. data/lib/groupdocs_editor_cloud/api/storage_api.rb +541 -0
  8. data/lib/groupdocs_editor_cloud/api_client.rb +380 -0
  9. data/lib/groupdocs_editor_cloud/api_error.rb +58 -0
  10. data/lib/groupdocs_editor_cloud/configuration.rb +95 -0
  11. data/lib/groupdocs_editor_cloud/models/delimited_text_load_options.rb +279 -0
  12. data/lib/groupdocs_editor_cloud/models/delimited_text_save_options.rb +304 -0
  13. data/lib/groupdocs_editor_cloud/models/disc_usage.rb +234 -0
  14. data/lib/groupdocs_editor_cloud/models/document_result.rb +214 -0
  15. data/lib/groupdocs_editor_cloud/models/error.rb +244 -0
  16. data/lib/groupdocs_editor_cloud/models/error_details.rb +229 -0
  17. data/lib/groupdocs_editor_cloud/models/file_info.rb +244 -0
  18. data/lib/groupdocs_editor_cloud/models/file_version.rb +289 -0
  19. data/lib/groupdocs_editor_cloud/models/file_versions.rb +216 -0
  20. data/lib/groupdocs_editor_cloud/models/files_list.rb +216 -0
  21. data/lib/groupdocs_editor_cloud/models/files_upload_result.rb +228 -0
  22. data/lib/groupdocs_editor_cloud/models/format.rb +224 -0
  23. data/lib/groupdocs_editor_cloud/models/formats_result.rb +216 -0
  24. data/lib/groupdocs_editor_cloud/models/info_result.rb +269 -0
  25. data/lib/groupdocs_editor_cloud/models/load_options.rb +224 -0
  26. data/lib/groupdocs_editor_cloud/models/load_result.rb +224 -0
  27. data/lib/groupdocs_editor_cloud/models/object_exist.rb +234 -0
  28. data/lib/groupdocs_editor_cloud/models/options.rb +224 -0
  29. data/lib/groupdocs_editor_cloud/models/pdf_save_options.rb +316 -0
  30. data/lib/groupdocs_editor_cloud/models/presentation_load_options.rb +254 -0
  31. data/lib/groupdocs_editor_cloud/models/presentation_save_options.rb +264 -0
  32. data/lib/groupdocs_editor_cloud/models/save_options.rb +254 -0
  33. data/lib/groupdocs_editor_cloud/models/spreadsheet_load_options.rb +254 -0
  34. data/lib/groupdocs_editor_cloud/models/spreadsheet_save_options.rb +326 -0
  35. data/lib/groupdocs_editor_cloud/models/storage_exist.rb +219 -0
  36. data/lib/groupdocs_editor_cloud/models/storage_file.rb +264 -0
  37. data/lib/groupdocs_editor_cloud/models/text_load_options.rb +347 -0
  38. data/lib/groupdocs_editor_cloud/models/text_save_options.rb +294 -0
  39. data/lib/groupdocs_editor_cloud/models/word_processing_load_options.rb +306 -0
  40. data/lib/groupdocs_editor_cloud/models/word_processing_save_options.rb +371 -0
  41. data/lib/groupdocs_editor_cloud/models/xml_load_options.rb +346 -0
  42. data/lib/groupdocs_editor_cloud/version.rb +29 -0
  43. metadata +153 -0
@@ -0,0 +1,294 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="text_save_options.rb">
4
+ # Copyright (c) 2003-2019 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 GroupDocsEditorCloud
31
+ # Allows to specify custom options for generating and saving plain text (TXT) documents
32
+ class TextSaveOptions
33
+
34
+ # File info
35
+ attr_accessor :file_info
36
+
37
+ # The full output path
38
+ attr_accessor :output_path
39
+
40
+ # The Html document path
41
+ attr_accessor :html_path
42
+
43
+ # Resources path
44
+ attr_accessor :resources_path
45
+
46
+ # Document format
47
+ attr_accessor :format
48
+
49
+ # Character encoding of the text document, which will be applied for its saving
50
+ attr_accessor :encoding
51
+
52
+ # Specifies whether to add bi-directional marks before each BiDi run when exporting in plain text format
53
+ attr_accessor :add_bidi_marks
54
+
55
+ # Specifies whether the program should attempt to preserve layout of tables when saving in the plain text format. The default value is false.
56
+ attr_accessor :preserve_table_layout
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'file_info' => :'FileInfo',
62
+ :'output_path' => :'OutputPath',
63
+ :'html_path' => :'HtmlPath',
64
+ :'resources_path' => :'ResourcesPath',
65
+ :'format' => :'Format',
66
+ :'encoding' => :'Encoding',
67
+ :'add_bidi_marks' => :'AddBidiMarks',
68
+ :'preserve_table_layout' => :'PreserveTableLayout'
69
+ }
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.swagger_types
74
+ {
75
+ :'file_info' => :'FileInfo',
76
+ :'output_path' => :'String',
77
+ :'html_path' => :'String',
78
+ :'resources_path' => :'String',
79
+ :'format' => :'String',
80
+ :'encoding' => :'String',
81
+ :'add_bidi_marks' => :'BOOLEAN',
82
+ :'preserve_table_layout' => :'BOOLEAN'
83
+ }
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ return unless attributes.is_a?(Hash)
90
+
91
+ # convert string to symbol for hash key
92
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
93
+
94
+ if attributes.key?(:'FileInfo')
95
+ self.file_info = attributes[:'FileInfo']
96
+ end
97
+
98
+ if attributes.key?(:'OutputPath')
99
+ self.output_path = attributes[:'OutputPath']
100
+ end
101
+
102
+ if attributes.key?(:'HtmlPath')
103
+ self.html_path = attributes[:'HtmlPath']
104
+ end
105
+
106
+ if attributes.key?(:'ResourcesPath')
107
+ self.resources_path = attributes[:'ResourcesPath']
108
+ end
109
+
110
+ if attributes.key?(:'Format')
111
+ self.format = attributes[:'Format']
112
+ end
113
+
114
+ if attributes.key?(:'Encoding')
115
+ self.encoding = attributes[:'Encoding']
116
+ end
117
+
118
+ if attributes.key?(:'AddBidiMarks')
119
+ self.add_bidi_marks = attributes[:'AddBidiMarks']
120
+ end
121
+
122
+ if attributes.key?(:'PreserveTableLayout')
123
+ self.preserve_table_layout = attributes[:'PreserveTableLayout']
124
+ end
125
+
126
+ end
127
+
128
+ # Show invalid properties with the reasons. Usually used together with valid?
129
+ # @return Array for valid properies with the reasons
130
+ def list_invalid_properties
131
+ invalid_properties = []
132
+ if @add_bidi_marks.nil?
133
+ invalid_properties.push("invalid value for 'add_bidi_marks', add_bidi_marks cannot be nil.")
134
+ end
135
+
136
+ if @preserve_table_layout.nil?
137
+ invalid_properties.push("invalid value for 'preserve_table_layout', preserve_table_layout cannot be nil.")
138
+ end
139
+
140
+ return invalid_properties
141
+ end
142
+
143
+ # Check to see if the all the properties in the model are valid
144
+ # @return true if the model is valid
145
+ def valid?
146
+ return false if @add_bidi_marks.nil?
147
+ return false if @preserve_table_layout.nil?
148
+ return true
149
+ end
150
+
151
+ # Checks equality by comparing each attribute.
152
+ # @param [Object] Object to be compared
153
+ def ==(other)
154
+ return true if self.equal?(other)
155
+ self.class == other.class &&
156
+ file_info == other.file_info &&
157
+ output_path == other.output_path &&
158
+ html_path == other.html_path &&
159
+ resources_path == other.resources_path &&
160
+ format == other.format &&
161
+ encoding == other.encoding &&
162
+ add_bidi_marks == other.add_bidi_marks &&
163
+ preserve_table_layout == other.preserve_table_layout
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(other)
169
+ self == other
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Fixnum] Hash code
174
+ def hash
175
+ [file_info, output_path, html_path, resources_path, format, encoding, add_bidi_marks, preserve_table_layout].hash
176
+ end
177
+
178
+ # Downcases first letter.
179
+ # @return downcased string
180
+ def uncap(str)
181
+ str[0, 1].downcase + str[1..-1]
182
+ end
183
+
184
+ # Builds the object from hash
185
+ # @param [Hash] attributes Model attributes in the form of hash
186
+ # @return [Object] Returns the model itself
187
+ def build_from_hash(attributes)
188
+ return nil unless attributes.is_a?(Hash)
189
+ self.class.swagger_types.each_pair do |key, type|
190
+ pname = uncap(self.class.attribute_map[key]).intern
191
+ value = attributes[pname]
192
+ if type =~ /\AArray<(.*)>/i
193
+ # check to ensure the input is an array given that the the attribute
194
+ # is documented as an array but the input is not
195
+ if value.is_a?(Array)
196
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
197
+ end
198
+ elsif !value.nil?
199
+ self.send("#{key}=", _deserialize(type, value))
200
+ end
201
+ # or else data not found in attributes(hash), not an issue as the data can be optional
202
+ end
203
+
204
+ self
205
+ end
206
+
207
+ # Deserializes the data based on type
208
+ # @param string type Data type
209
+ # @param string value Value to be deserialized
210
+ # @return [Object] Deserialized data
211
+ def _deserialize(type, value)
212
+ case type.to_sym
213
+ when :DateTime
214
+ Date.parse value
215
+ when :Date
216
+ Date.parse value
217
+ when :String
218
+ value.to_s
219
+ when :Integer
220
+ value.to_i
221
+ when :Float
222
+ value.to_f
223
+ when :BOOLEAN
224
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
225
+ true
226
+ else
227
+ false
228
+ end
229
+ when :Object
230
+ # generic object (usually a Hash), return directly
231
+ value
232
+ when /\AArray<(?<inner_type>.+)>\z/
233
+ inner_type = Regexp.last_match[:inner_type]
234
+ value.map { |v| _deserialize(inner_type, v) }
235
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
236
+ k_type = Regexp.last_match[:k_type]
237
+ v_type = Regexp.last_match[:v_type]
238
+ {}.tap do |hash|
239
+ value.each do |k, v|
240
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
241
+ end
242
+ end
243
+ else
244
+ # model
245
+ temp_model = GroupDocsEditorCloud.const_get(type).new
246
+ temp_model.build_from_hash(value)
247
+ end
248
+ end
249
+
250
+ # Returns the string representation of the object
251
+ # @return [String] String presentation of the object
252
+ def to_s
253
+ to_hash.to_s
254
+ end
255
+
256
+ # to_body is an alias to to_hash (backward compatibility)
257
+ # @return [Hash] Returns the object in the form of hash
258
+ def to_body
259
+ to_hash
260
+ end
261
+
262
+ # Returns the object in the form of hash
263
+ # @return [Hash] Returns the object in the form of hash
264
+ def to_hash
265
+ hash = {}
266
+ self.class.attribute_map.each_pair do |attr, param|
267
+ value = self.send(attr)
268
+ next if value.nil?
269
+ hash[param] = _to_hash(value)
270
+ end
271
+ hash
272
+ end
273
+
274
+ # Outputs non-array value in the form of hash
275
+ # For object, use to_hash. Otherwise, just return the value
276
+ # @param [Object] value Any valid value
277
+ # @return [Hash] Returns the value in the form of hash
278
+ def _to_hash(value)
279
+ if value.is_a?(Array)
280
+ value.compact.map { |v| _to_hash(v) }
281
+ elsif value.is_a?(Hash)
282
+ {}.tap do |hash|
283
+ value.each { |k, v| hash[k] = _to_hash(v) }
284
+ end
285
+ elsif value.respond_to? :to_hash
286
+ value.to_hash
287
+ else
288
+ value
289
+ end
290
+ end
291
+
292
+ end
293
+
294
+ end
@@ -0,0 +1,306 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="word_processing_load_options.rb">
4
+ # Copyright (c) 2003-2019 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 GroupDocsEditorCloud
31
+ # Allows to specify custom options for loading WordProcessing-compliant documents
32
+ class WordProcessingLoadOptions
33
+
34
+ # File info
35
+ attr_accessor :file_info
36
+
37
+ # The full output path
38
+ attr_accessor :output_path
39
+
40
+ # Allows to enable or disable pagination in the resultant HTML document. By default is disabled (false).
41
+ attr_accessor :enable_pagination
42
+
43
+ # Specifies whether language information is exported to the HTML markup in a form of 'lang' HTML attributes. This option may be useful for roundtrip conversion of the multi-language documents. By default it is disabled (false).
44
+ attr_accessor :enable_language_information
45
+
46
+ # Responsible for extracting font resources, which are used in the input WordProcessing document. By default doesn't extract any fonts (NotExtract).
47
+ attr_accessor :font_extraction
48
+ class EnumAttributeValidator
49
+ attr_reader :datatype
50
+ attr_reader :allowable_values
51
+
52
+ def initialize(datatype, allowable_values)
53
+ @allowable_values = allowable_values.map do |value|
54
+ case datatype.to_s
55
+ when /Integer/i
56
+ value.to_i
57
+ when /Float/i
58
+ value.to_f
59
+ else
60
+ value
61
+ end
62
+ end
63
+ end
64
+
65
+ def valid?(value)
66
+ !value || allowable_values.include?(value)
67
+ end
68
+ end
69
+
70
+ # Attribute mapping from ruby-style variable name to JSON key.
71
+ def self.attribute_map
72
+ {
73
+ :'file_info' => :'FileInfo',
74
+ :'output_path' => :'OutputPath',
75
+ :'enable_pagination' => :'EnablePagination',
76
+ :'enable_language_information' => :'EnableLanguageInformation',
77
+ :'font_extraction' => :'FontExtraction'
78
+ }
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.swagger_types
83
+ {
84
+ :'file_info' => :'FileInfo',
85
+ :'output_path' => :'String',
86
+ :'enable_pagination' => :'BOOLEAN',
87
+ :'enable_language_information' => :'BOOLEAN',
88
+ :'font_extraction' => :'String'
89
+ }
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ return unless attributes.is_a?(Hash)
96
+
97
+ # convert string to symbol for hash key
98
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
99
+
100
+ if attributes.key?(:'FileInfo')
101
+ self.file_info = attributes[:'FileInfo']
102
+ end
103
+
104
+ if attributes.key?(:'OutputPath')
105
+ self.output_path = attributes[:'OutputPath']
106
+ end
107
+
108
+ if attributes.key?(:'EnablePagination')
109
+ self.enable_pagination = attributes[:'EnablePagination']
110
+ end
111
+
112
+ if attributes.key?(:'EnableLanguageInformation')
113
+ self.enable_language_information = attributes[:'EnableLanguageInformation']
114
+ end
115
+
116
+ if attributes.key?(:'FontExtraction')
117
+ self.font_extraction = attributes[:'FontExtraction']
118
+ end
119
+
120
+ end
121
+
122
+ # Show invalid properties with the reasons. Usually used together with valid?
123
+ # @return Array for valid properies with the reasons
124
+ def list_invalid_properties
125
+ invalid_properties = []
126
+ if @enable_pagination.nil?
127
+ invalid_properties.push("invalid value for 'enable_pagination', enable_pagination cannot be nil.")
128
+ end
129
+
130
+ if @enable_language_information.nil?
131
+ invalid_properties.push("invalid value for 'enable_language_information', enable_language_information cannot be nil.")
132
+ end
133
+
134
+ if @font_extraction.nil?
135
+ invalid_properties.push("invalid value for 'font_extraction', font_extraction cannot be nil.")
136
+ end
137
+
138
+ return invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+ return false if @enable_pagination.nil?
145
+ return false if @enable_language_information.nil?
146
+ return false if @font_extraction.nil?
147
+ font_extraction_validator = EnumAttributeValidator.new('String', ["NotExtract", "ExtractAllEmbedded", "ExtractEmbeddedWithoutSystem", "ExtractAll"])
148
+ return false unless font_extraction_validator.valid?(@font_extraction)
149
+ return true
150
+ end
151
+
152
+ # Custom attribute writer method checking allowed values (enum).
153
+ # @param [Object] font_extraction Object to be assigned
154
+ def font_extraction=(font_extraction)
155
+ validator = EnumAttributeValidator.new('String', ["NotExtract", "ExtractAllEmbedded", "ExtractEmbeddedWithoutSystem", "ExtractAll"])
156
+ if font_extraction.to_i == 0
157
+ unless validator.valid?(font_extraction)
158
+ raise ArgumentError, "invalid value for 'font_extraction', must be one of #{validator.allowable_values}."
159
+ end
160
+ @font_extraction = font_extraction
161
+ else
162
+ @font_extraction = validator.allowable_values[font_extraction.to_i]
163
+ end
164
+ end
165
+
166
+ # Checks equality by comparing each attribute.
167
+ # @param [Object] Object to be compared
168
+ def ==(other)
169
+ return true if self.equal?(other)
170
+ self.class == other.class &&
171
+ file_info == other.file_info &&
172
+ output_path == other.output_path &&
173
+ enable_pagination == other.enable_pagination &&
174
+ enable_language_information == other.enable_language_information &&
175
+ font_extraction == other.font_extraction
176
+ end
177
+
178
+ # @see the `==` method
179
+ # @param [Object] Object to be compared
180
+ def eql?(other)
181
+ self == other
182
+ end
183
+
184
+ # Calculates hash code according to all attributes.
185
+ # @return [Fixnum] Hash code
186
+ def hash
187
+ [file_info, output_path, enable_pagination, enable_language_information, font_extraction].hash
188
+ end
189
+
190
+ # Downcases first letter.
191
+ # @return downcased string
192
+ def uncap(str)
193
+ str[0, 1].downcase + str[1..-1]
194
+ end
195
+
196
+ # Builds the object from hash
197
+ # @param [Hash] attributes Model attributes in the form of hash
198
+ # @return [Object] Returns the model itself
199
+ def build_from_hash(attributes)
200
+ return nil unless attributes.is_a?(Hash)
201
+ self.class.swagger_types.each_pair do |key, type|
202
+ pname = uncap(self.class.attribute_map[key]).intern
203
+ value = attributes[pname]
204
+ if type =~ /\AArray<(.*)>/i
205
+ # check to ensure the input is an array given that the the attribute
206
+ # is documented as an array but the input is not
207
+ if value.is_a?(Array)
208
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
209
+ end
210
+ elsif !value.nil?
211
+ self.send("#{key}=", _deserialize(type, value))
212
+ end
213
+ # or else data not found in attributes(hash), not an issue as the data can be optional
214
+ end
215
+
216
+ self
217
+ end
218
+
219
+ # Deserializes the data based on type
220
+ # @param string type Data type
221
+ # @param string value Value to be deserialized
222
+ # @return [Object] Deserialized data
223
+ def _deserialize(type, value)
224
+ case type.to_sym
225
+ when :DateTime
226
+ Date.parse value
227
+ when :Date
228
+ Date.parse value
229
+ when :String
230
+ value.to_s
231
+ when :Integer
232
+ value.to_i
233
+ when :Float
234
+ value.to_f
235
+ when :BOOLEAN
236
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
237
+ true
238
+ else
239
+ false
240
+ end
241
+ when :Object
242
+ # generic object (usually a Hash), return directly
243
+ value
244
+ when /\AArray<(?<inner_type>.+)>\z/
245
+ inner_type = Regexp.last_match[:inner_type]
246
+ value.map { |v| _deserialize(inner_type, v) }
247
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
248
+ k_type = Regexp.last_match[:k_type]
249
+ v_type = Regexp.last_match[:v_type]
250
+ {}.tap do |hash|
251
+ value.each do |k, v|
252
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
253
+ end
254
+ end
255
+ else
256
+ # model
257
+ temp_model = GroupDocsEditorCloud.const_get(type).new
258
+ temp_model.build_from_hash(value)
259
+ end
260
+ end
261
+
262
+ # Returns the string representation of the object
263
+ # @return [String] String presentation of the object
264
+ def to_s
265
+ to_hash.to_s
266
+ end
267
+
268
+ # to_body is an alias to to_hash (backward compatibility)
269
+ # @return [Hash] Returns the object in the form of hash
270
+ def to_body
271
+ to_hash
272
+ end
273
+
274
+ # Returns the object in the form of hash
275
+ # @return [Hash] Returns the object in the form of hash
276
+ def to_hash
277
+ hash = {}
278
+ self.class.attribute_map.each_pair do |attr, param|
279
+ value = self.send(attr)
280
+ next if value.nil?
281
+ hash[param] = _to_hash(value)
282
+ end
283
+ hash
284
+ end
285
+
286
+ # Outputs non-array value in the form of hash
287
+ # For object, use to_hash. Otherwise, just return the value
288
+ # @param [Object] value Any valid value
289
+ # @return [Hash] Returns the value in the form of hash
290
+ def _to_hash(value)
291
+ if value.is_a?(Array)
292
+ value.compact.map { |v| _to_hash(v) }
293
+ elsif value.is_a?(Hash)
294
+ {}.tap do |hash|
295
+ value.each { |k, v| hash[k] = _to_hash(v) }
296
+ end
297
+ elsif value.respond_to? :to_hash
298
+ value.to_hash
299
+ else
300
+ value
301
+ end
302
+ end
303
+
304
+ end
305
+
306
+ end