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,279 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="delimited_text_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
+ # Options for loading text-based Spreadsheet documents (CSV, Tab-based etc.), that use a separator (delimiter)
32
+ class DelimitedTextLoadOptions
33
+
34
+ # File info
35
+ attr_accessor :file_info
36
+
37
+ # The full output path
38
+ attr_accessor :output_path
39
+
40
+ # Allows to specify a string separator (delimiter) for text-based Spreadsheet documents
41
+ attr_accessor :separator
42
+
43
+ # Gets or sets a value that indicates whether the string in text-based document is converted to the date data. Default is false.
44
+ attr_accessor :convert_date_time_data
45
+
46
+ # Gets or sets a value that indicates whether the string in text-based document is converted to numeric data. Default is false.
47
+ attr_accessor :convert_numeric_data
48
+
49
+ # Defines whether consecutive delimiters should be treated as one. By default is false.
50
+ attr_accessor :treat_consecutive_delimiters_as_one
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'file_info' => :'FileInfo',
56
+ :'output_path' => :'OutputPath',
57
+ :'separator' => :'Separator',
58
+ :'convert_date_time_data' => :'ConvertDateTimeData',
59
+ :'convert_numeric_data' => :'ConvertNumericData',
60
+ :'treat_consecutive_delimiters_as_one' => :'TreatConsecutiveDelimitersAsOne'
61
+ }
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.swagger_types
66
+ {
67
+ :'file_info' => :'FileInfo',
68
+ :'output_path' => :'String',
69
+ :'separator' => :'String',
70
+ :'convert_date_time_data' => :'BOOLEAN',
71
+ :'convert_numeric_data' => :'BOOLEAN',
72
+ :'treat_consecutive_delimiters_as_one' => :'BOOLEAN'
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?(:'FileInfo')
85
+ self.file_info = attributes[:'FileInfo']
86
+ end
87
+
88
+ if attributes.key?(:'OutputPath')
89
+ self.output_path = attributes[:'OutputPath']
90
+ end
91
+
92
+ if attributes.key?(:'Separator')
93
+ self.separator = attributes[:'Separator']
94
+ end
95
+
96
+ if attributes.key?(:'ConvertDateTimeData')
97
+ self.convert_date_time_data = attributes[:'ConvertDateTimeData']
98
+ end
99
+
100
+ if attributes.key?(:'ConvertNumericData')
101
+ self.convert_numeric_data = attributes[:'ConvertNumericData']
102
+ end
103
+
104
+ if attributes.key?(:'TreatConsecutiveDelimitersAsOne')
105
+ self.treat_consecutive_delimiters_as_one = attributes[:'TreatConsecutiveDelimitersAsOne']
106
+ end
107
+
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properies with the reasons
112
+ def list_invalid_properties
113
+ invalid_properties = []
114
+ if @convert_date_time_data.nil?
115
+ invalid_properties.push("invalid value for 'convert_date_time_data', convert_date_time_data cannot be nil.")
116
+ end
117
+
118
+ if @convert_numeric_data.nil?
119
+ invalid_properties.push("invalid value for 'convert_numeric_data', convert_numeric_data cannot be nil.")
120
+ end
121
+
122
+ if @treat_consecutive_delimiters_as_one.nil?
123
+ invalid_properties.push("invalid value for 'treat_consecutive_delimiters_as_one', treat_consecutive_delimiters_as_one cannot be nil.")
124
+ end
125
+
126
+ return invalid_properties
127
+ end
128
+
129
+ # Check to see if the all the properties in the model are valid
130
+ # @return true if the model is valid
131
+ def valid?
132
+ return false if @convert_date_time_data.nil?
133
+ return false if @convert_numeric_data.nil?
134
+ return false if @treat_consecutive_delimiters_as_one.nil?
135
+ return true
136
+ end
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] Object to be compared
140
+ def ==(other)
141
+ return true if self.equal?(other)
142
+ self.class == other.class &&
143
+ file_info == other.file_info &&
144
+ output_path == other.output_path &&
145
+ separator == other.separator &&
146
+ convert_date_time_data == other.convert_date_time_data &&
147
+ convert_numeric_data == other.convert_numeric_data &&
148
+ treat_consecutive_delimiters_as_one == other.treat_consecutive_delimiters_as_one
149
+ end
150
+
151
+ # @see the `==` method
152
+ # @param [Object] Object to be compared
153
+ def eql?(other)
154
+ self == other
155
+ end
156
+
157
+ # Calculates hash code according to all attributes.
158
+ # @return [Fixnum] Hash code
159
+ def hash
160
+ [file_info, output_path, separator, convert_date_time_data, convert_numeric_data, treat_consecutive_delimiters_as_one].hash
161
+ end
162
+
163
+ # Downcases first letter.
164
+ # @return downcased string
165
+ def uncap(str)
166
+ str[0, 1].downcase + str[1..-1]
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ self.class.swagger_types.each_pair do |key, type|
175
+ pname = uncap(self.class.attribute_map[key]).intern
176
+ value = attributes[pname]
177
+ if type =~ /\AArray<(.*)>/i
178
+ # check to ensure the input is an array given that the the attribute
179
+ # is documented as an array but the input is not
180
+ if value.is_a?(Array)
181
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
182
+ end
183
+ elsif !value.nil?
184
+ self.send("#{key}=", _deserialize(type, value))
185
+ end
186
+ # or else data not found in attributes(hash), not an issue as the data can be optional
187
+ end
188
+
189
+ self
190
+ end
191
+
192
+ # Deserializes the data based on type
193
+ # @param string type Data type
194
+ # @param string value Value to be deserialized
195
+ # @return [Object] Deserialized data
196
+ def _deserialize(type, value)
197
+ case type.to_sym
198
+ when :DateTime
199
+ Date.parse value
200
+ when :Date
201
+ Date.parse value
202
+ when :String
203
+ value.to_s
204
+ when :Integer
205
+ value.to_i
206
+ when :Float
207
+ value.to_f
208
+ when :BOOLEAN
209
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
210
+ true
211
+ else
212
+ false
213
+ end
214
+ when :Object
215
+ # generic object (usually a Hash), return directly
216
+ value
217
+ when /\AArray<(?<inner_type>.+)>\z/
218
+ inner_type = Regexp.last_match[:inner_type]
219
+ value.map { |v| _deserialize(inner_type, v) }
220
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
221
+ k_type = Regexp.last_match[:k_type]
222
+ v_type = Regexp.last_match[:v_type]
223
+ {}.tap do |hash|
224
+ value.each do |k, v|
225
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
226
+ end
227
+ end
228
+ else
229
+ # model
230
+ temp_model = GroupDocsEditorCloud.const_get(type).new
231
+ temp_model.build_from_hash(value)
232
+ end
233
+ end
234
+
235
+ # Returns the string representation of the object
236
+ # @return [String] String presentation of the object
237
+ def to_s
238
+ to_hash.to_s
239
+ end
240
+
241
+ # to_body is an alias to to_hash (backward compatibility)
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_body
244
+ to_hash
245
+ end
246
+
247
+ # Returns the object in the form of hash
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_hash
250
+ hash = {}
251
+ self.class.attribute_map.each_pair do |attr, param|
252
+ value = self.send(attr)
253
+ next if value.nil?
254
+ hash[param] = _to_hash(value)
255
+ end
256
+ hash
257
+ end
258
+
259
+ # Outputs non-array value in the form of hash
260
+ # For object, use to_hash. Otherwise, just return the value
261
+ # @param [Object] value Any valid value
262
+ # @return [Hash] Returns the value in the form of hash
263
+ def _to_hash(value)
264
+ if value.is_a?(Array)
265
+ value.compact.map { |v| _to_hash(v) }
266
+ elsif value.is_a?(Hash)
267
+ {}.tap do |hash|
268
+ value.each { |k, v| hash[k] = _to_hash(v) }
269
+ end
270
+ elsif value.respond_to? :to_hash
271
+ value.to_hash
272
+ else
273
+ value
274
+ end
275
+ end
276
+
277
+ end
278
+
279
+ end
@@ -0,0 +1,304 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="delimited_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
+ # Contains options for generating and saving text-based Spreadsheet documents (CSV, Tab-based etc.), that use a separator (delimiter)
32
+ class DelimitedTextSaveOptions
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
+ # Allows to specify a string separator (delimiter) for text-based Spreadsheet documents
50
+ attr_accessor :separator
51
+
52
+ # Allows to set an encoding for the text-based Spreadsheet document. By default (and if not specified) is UTF-8.
53
+ attr_accessor :encoding
54
+
55
+ # Indicates whether leading blank rows and columns should be trimmed like what MS Excel does
56
+ attr_accessor :trim_leading_blank_row_and_column
57
+
58
+ # Indicates whether separators should be output for blank row. Default value is false which means the content for blank row will be empty.
59
+ attr_accessor :keep_separators_for_blank_row
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'file_info' => :'FileInfo',
65
+ :'output_path' => :'OutputPath',
66
+ :'html_path' => :'HtmlPath',
67
+ :'resources_path' => :'ResourcesPath',
68
+ :'format' => :'Format',
69
+ :'separator' => :'Separator',
70
+ :'encoding' => :'Encoding',
71
+ :'trim_leading_blank_row_and_column' => :'TrimLeadingBlankRowAndColumn',
72
+ :'keep_separators_for_blank_row' => :'KeepSeparatorsForBlankRow'
73
+ }
74
+ end
75
+
76
+ # Attribute type mapping.
77
+ def self.swagger_types
78
+ {
79
+ :'file_info' => :'FileInfo',
80
+ :'output_path' => :'String',
81
+ :'html_path' => :'String',
82
+ :'resources_path' => :'String',
83
+ :'format' => :'String',
84
+ :'separator' => :'String',
85
+ :'encoding' => :'String',
86
+ :'trim_leading_blank_row_and_column' => :'BOOLEAN',
87
+ :'keep_separators_for_blank_row' => :'BOOLEAN'
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.key?(:'FileInfo')
100
+ self.file_info = attributes[:'FileInfo']
101
+ end
102
+
103
+ if attributes.key?(:'OutputPath')
104
+ self.output_path = attributes[:'OutputPath']
105
+ end
106
+
107
+ if attributes.key?(:'HtmlPath')
108
+ self.html_path = attributes[:'HtmlPath']
109
+ end
110
+
111
+ if attributes.key?(:'ResourcesPath')
112
+ self.resources_path = attributes[:'ResourcesPath']
113
+ end
114
+
115
+ if attributes.key?(:'Format')
116
+ self.format = attributes[:'Format']
117
+ end
118
+
119
+ if attributes.key?(:'Separator')
120
+ self.separator = attributes[:'Separator']
121
+ end
122
+
123
+ if attributes.key?(:'Encoding')
124
+ self.encoding = attributes[:'Encoding']
125
+ end
126
+
127
+ if attributes.key?(:'TrimLeadingBlankRowAndColumn')
128
+ self.trim_leading_blank_row_and_column = attributes[:'TrimLeadingBlankRowAndColumn']
129
+ end
130
+
131
+ if attributes.key?(:'KeepSeparatorsForBlankRow')
132
+ self.keep_separators_for_blank_row = attributes[:'KeepSeparatorsForBlankRow']
133
+ end
134
+
135
+ end
136
+
137
+ # Show invalid properties with the reasons. Usually used together with valid?
138
+ # @return Array for valid properies with the reasons
139
+ def list_invalid_properties
140
+ invalid_properties = []
141
+ if @trim_leading_blank_row_and_column.nil?
142
+ invalid_properties.push("invalid value for 'trim_leading_blank_row_and_column', trim_leading_blank_row_and_column cannot be nil.")
143
+ end
144
+
145
+ if @keep_separators_for_blank_row.nil?
146
+ invalid_properties.push("invalid value for 'keep_separators_for_blank_row', keep_separators_for_blank_row cannot be nil.")
147
+ end
148
+
149
+ return invalid_properties
150
+ end
151
+
152
+ # Check to see if the all the properties in the model are valid
153
+ # @return true if the model is valid
154
+ def valid?
155
+ return false if @trim_leading_blank_row_and_column.nil?
156
+ return false if @keep_separators_for_blank_row.nil?
157
+ return true
158
+ end
159
+
160
+ # Checks equality by comparing each attribute.
161
+ # @param [Object] Object to be compared
162
+ def ==(other)
163
+ return true if self.equal?(other)
164
+ self.class == other.class &&
165
+ file_info == other.file_info &&
166
+ output_path == other.output_path &&
167
+ html_path == other.html_path &&
168
+ resources_path == other.resources_path &&
169
+ format == other.format &&
170
+ separator == other.separator &&
171
+ encoding == other.encoding &&
172
+ trim_leading_blank_row_and_column == other.trim_leading_blank_row_and_column &&
173
+ keep_separators_for_blank_row == other.keep_separators_for_blank_row
174
+ end
175
+
176
+ # @see the `==` method
177
+ # @param [Object] Object to be compared
178
+ def eql?(other)
179
+ self == other
180
+ end
181
+
182
+ # Calculates hash code according to all attributes.
183
+ # @return [Fixnum] Hash code
184
+ def hash
185
+ [file_info, output_path, html_path, resources_path, format, separator, encoding, trim_leading_blank_row_and_column, keep_separators_for_blank_row].hash
186
+ end
187
+
188
+ # Downcases first letter.
189
+ # @return downcased string
190
+ def uncap(str)
191
+ str[0, 1].downcase + str[1..-1]
192
+ end
193
+
194
+ # Builds the object from hash
195
+ # @param [Hash] attributes Model attributes in the form of hash
196
+ # @return [Object] Returns the model itself
197
+ def build_from_hash(attributes)
198
+ return nil unless attributes.is_a?(Hash)
199
+ self.class.swagger_types.each_pair do |key, type|
200
+ pname = uncap(self.class.attribute_map[key]).intern
201
+ value = attributes[pname]
202
+ if type =~ /\AArray<(.*)>/i
203
+ # check to ensure the input is an array given that the the attribute
204
+ # is documented as an array but the input is not
205
+ if value.is_a?(Array)
206
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
207
+ end
208
+ elsif !value.nil?
209
+ self.send("#{key}=", _deserialize(type, value))
210
+ end
211
+ # or else data not found in attributes(hash), not an issue as the data can be optional
212
+ end
213
+
214
+ self
215
+ end
216
+
217
+ # Deserializes the data based on type
218
+ # @param string type Data type
219
+ # @param string value Value to be deserialized
220
+ # @return [Object] Deserialized data
221
+ def _deserialize(type, value)
222
+ case type.to_sym
223
+ when :DateTime
224
+ Date.parse value
225
+ when :Date
226
+ Date.parse value
227
+ when :String
228
+ value.to_s
229
+ when :Integer
230
+ value.to_i
231
+ when :Float
232
+ value.to_f
233
+ when :BOOLEAN
234
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
235
+ true
236
+ else
237
+ false
238
+ end
239
+ when :Object
240
+ # generic object (usually a Hash), return directly
241
+ value
242
+ when /\AArray<(?<inner_type>.+)>\z/
243
+ inner_type = Regexp.last_match[:inner_type]
244
+ value.map { |v| _deserialize(inner_type, v) }
245
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
246
+ k_type = Regexp.last_match[:k_type]
247
+ v_type = Regexp.last_match[:v_type]
248
+ {}.tap do |hash|
249
+ value.each do |k, v|
250
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
251
+ end
252
+ end
253
+ else
254
+ # model
255
+ temp_model = GroupDocsEditorCloud.const_get(type).new
256
+ temp_model.build_from_hash(value)
257
+ end
258
+ end
259
+
260
+ # Returns the string representation of the object
261
+ # @return [String] String presentation of the object
262
+ def to_s
263
+ to_hash.to_s
264
+ end
265
+
266
+ # to_body is an alias to to_hash (backward compatibility)
267
+ # @return [Hash] Returns the object in the form of hash
268
+ def to_body
269
+ to_hash
270
+ end
271
+
272
+ # Returns the object in the form of hash
273
+ # @return [Hash] Returns the object in the form of hash
274
+ def to_hash
275
+ hash = {}
276
+ self.class.attribute_map.each_pair do |attr, param|
277
+ value = self.send(attr)
278
+ next if value.nil?
279
+ hash[param] = _to_hash(value)
280
+ end
281
+ hash
282
+ end
283
+
284
+ # Outputs non-array value in the form of hash
285
+ # For object, use to_hash. Otherwise, just return the value
286
+ # @param [Object] value Any valid value
287
+ # @return [Hash] Returns the value in the form of hash
288
+ def _to_hash(value)
289
+ if value.is_a?(Array)
290
+ value.compact.map { |v| _to_hash(v) }
291
+ elsif value.is_a?(Hash)
292
+ {}.tap do |hash|
293
+ value.each { |k, v| hash[k] = _to_hash(v) }
294
+ end
295
+ elsif value.respond_to? :to_hash
296
+ value.to_hash
297
+ else
298
+ value
299
+ end
300
+ end
301
+
302
+ end
303
+
304
+ end