groupdocs_merger_cloud 19.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/lib/groupdocs_merger_cloud.rb +72 -0
  3. data/lib/groupdocs_merger_cloud/api/document_api.rb +411 -0
  4. data/lib/groupdocs_merger_cloud/api/file_api.rb +729 -0
  5. data/lib/groupdocs_merger_cloud/api/folder_api.rb +694 -0
  6. data/lib/groupdocs_merger_cloud/api/info_api.rb +266 -0
  7. data/lib/groupdocs_merger_cloud/api/pages_api.rb +702 -0
  8. data/lib/groupdocs_merger_cloud/api/security_api.rb +528 -0
  9. data/lib/groupdocs_merger_cloud/api/storage_api.rb +541 -0
  10. data/lib/groupdocs_merger_cloud/api_client.rb +380 -0
  11. data/lib/groupdocs_merger_cloud/api_error.rb +58 -0
  12. data/lib/groupdocs_merger_cloud/configuration.rb +95 -0
  13. data/lib/groupdocs_merger_cloud/models/disc_usage.rb +234 -0
  14. data/lib/groupdocs_merger_cloud/models/document_result.rb +214 -0
  15. data/lib/groupdocs_merger_cloud/models/error.rb +244 -0
  16. data/lib/groupdocs_merger_cloud/models/error_details.rb +229 -0
  17. data/lib/groupdocs_merger_cloud/models/extract_options.rb +318 -0
  18. data/lib/groupdocs_merger_cloud/models/file_info.rb +244 -0
  19. data/lib/groupdocs_merger_cloud/models/file_version.rb +289 -0
  20. data/lib/groupdocs_merger_cloud/models/file_versions.rb +216 -0
  21. data/lib/groupdocs_merger_cloud/models/files_list.rb +216 -0
  22. data/lib/groupdocs_merger_cloud/models/files_upload_result.rb +228 -0
  23. data/lib/groupdocs_merger_cloud/models/format.rb +224 -0
  24. data/lib/groupdocs_merger_cloud/models/formats_result.rb +216 -0
  25. data/lib/groupdocs_merger_cloud/models/info_result.rb +251 -0
  26. data/lib/groupdocs_merger_cloud/models/join_item.rb +308 -0
  27. data/lib/groupdocs_merger_cloud/models/join_options.rb +226 -0
  28. data/lib/groupdocs_merger_cloud/models/move_options.rb +254 -0
  29. data/lib/groupdocs_merger_cloud/models/multi_document_result.rb +216 -0
  30. data/lib/groupdocs_merger_cloud/models/object_exist.rb +234 -0
  31. data/lib/groupdocs_merger_cloud/models/options.rb +224 -0
  32. data/lib/groupdocs_merger_cloud/models/orientation_options.rb +349 -0
  33. data/lib/groupdocs_merger_cloud/models/page_info.rb +264 -0
  34. data/lib/groupdocs_merger_cloud/models/page_options.rb +318 -0
  35. data/lib/groupdocs_merger_cloud/models/password_result.rb +219 -0
  36. data/lib/groupdocs_merger_cloud/models/preview_options.rb +379 -0
  37. data/lib/groupdocs_merger_cloud/models/remove_options.rb +318 -0
  38. data/lib/groupdocs_merger_cloud/models/rotate_options.rb +349 -0
  39. data/lib/groupdocs_merger_cloud/models/split_options.rb +349 -0
  40. data/lib/groupdocs_merger_cloud/models/storage_exist.rb +219 -0
  41. data/lib/groupdocs_merger_cloud/models/storage_file.rb +264 -0
  42. data/lib/groupdocs_merger_cloud/models/swap_options.rb +254 -0
  43. data/lib/groupdocs_merger_cloud/models/update_password_options.rb +234 -0
  44. data/lib/groupdocs_merger_cloud/version.rb +29 -0
  45. metadata +155 -0
@@ -0,0 +1,349 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="orientation_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 GroupDocsMergerCloud
31
+ # Options for changing document page orientation
32
+ class OrientationOptions
33
+
34
+ # File info
35
+ attr_accessor :file_info
36
+
37
+ # The output path.
38
+ attr_accessor :output_path
39
+
40
+ # List of page numbers to use in a specific API method. NOTE: page numbering starts from 1.
41
+ attr_accessor :pages
42
+
43
+ # Start page number. Ignored if Pages collection is not empty.
44
+ attr_accessor :start_page_number
45
+
46
+ # End page number. Ignored if Pages collection is not empty.
47
+ attr_accessor :end_page_number
48
+
49
+ # Range mode. Ignored if Pages collection is not empty. Default value is AllPages.
50
+ attr_accessor :range_mode
51
+
52
+ # Orientation mode
53
+ attr_accessor :mode
54
+ class EnumAttributeValidator
55
+ attr_reader :datatype
56
+ attr_reader :allowable_values
57
+
58
+ def initialize(datatype, allowable_values)
59
+ @allowable_values = allowable_values.map do |value|
60
+ case datatype.to_s
61
+ when /Integer/i
62
+ value.to_i
63
+ when /Float/i
64
+ value.to_f
65
+ else
66
+ value
67
+ end
68
+ end
69
+ end
70
+
71
+ def valid?(value)
72
+ !value || allowable_values.include?(value)
73
+ end
74
+ end
75
+
76
+ # Attribute mapping from ruby-style variable name to JSON key.
77
+ def self.attribute_map
78
+ {
79
+ :'file_info' => :'FileInfo',
80
+ :'output_path' => :'OutputPath',
81
+ :'pages' => :'Pages',
82
+ :'start_page_number' => :'StartPageNumber',
83
+ :'end_page_number' => :'EndPageNumber',
84
+ :'range_mode' => :'RangeMode',
85
+ :'mode' => :'Mode'
86
+ }
87
+ end
88
+
89
+ # Attribute type mapping.
90
+ def self.swagger_types
91
+ {
92
+ :'file_info' => :'FileInfo',
93
+ :'output_path' => :'String',
94
+ :'pages' => :'Array<Integer>',
95
+ :'start_page_number' => :'Integer',
96
+ :'end_page_number' => :'Integer',
97
+ :'range_mode' => :'String',
98
+ :'mode' => :'String'
99
+ }
100
+ end
101
+
102
+ # Initializes the object
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ def initialize(attributes = {})
105
+ return unless attributes.is_a?(Hash)
106
+
107
+ # convert string to symbol for hash key
108
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
109
+
110
+ if attributes.key?(:'FileInfo')
111
+ self.file_info = attributes[:'FileInfo']
112
+ end
113
+
114
+ if attributes.key?(:'OutputPath')
115
+ self.output_path = attributes[:'OutputPath']
116
+ end
117
+
118
+ if attributes.key?(:'Pages')
119
+ if (value = attributes[:'Pages']).is_a?(Array)
120
+ self.pages = value
121
+ end
122
+ end
123
+
124
+ if attributes.key?(:'StartPageNumber')
125
+ self.start_page_number = attributes[:'StartPageNumber']
126
+ end
127
+
128
+ if attributes.key?(:'EndPageNumber')
129
+ self.end_page_number = attributes[:'EndPageNumber']
130
+ end
131
+
132
+ if attributes.key?(:'RangeMode')
133
+ self.range_mode = attributes[:'RangeMode']
134
+ end
135
+
136
+ if attributes.key?(:'Mode')
137
+ self.mode = attributes[:'Mode']
138
+ end
139
+
140
+ end
141
+
142
+ # Show invalid properties with the reasons. Usually used together with valid?
143
+ # @return Array for valid properies with the reasons
144
+ def list_invalid_properties
145
+ invalid_properties = []
146
+ if @start_page_number.nil?
147
+ invalid_properties.push("invalid value for 'start_page_number', start_page_number cannot be nil.")
148
+ end
149
+
150
+ if @end_page_number.nil?
151
+ invalid_properties.push("invalid value for 'end_page_number', end_page_number cannot be nil.")
152
+ end
153
+
154
+ if @range_mode.nil?
155
+ invalid_properties.push("invalid value for 'range_mode', range_mode cannot be nil.")
156
+ end
157
+
158
+ if @mode.nil?
159
+ invalid_properties.push("invalid value for 'mode', mode cannot be nil.")
160
+ end
161
+
162
+ return invalid_properties
163
+ end
164
+
165
+ # Check to see if the all the properties in the model are valid
166
+ # @return true if the model is valid
167
+ def valid?
168
+ return false if @start_page_number.nil?
169
+ return false if @end_page_number.nil?
170
+ return false if @range_mode.nil?
171
+ range_mode_validator = EnumAttributeValidator.new('String', ["AllPages", "OddPages", "EvenPages"])
172
+ return false unless range_mode_validator.valid?(@range_mode)
173
+ return false if @mode.nil?
174
+ mode_validator = EnumAttributeValidator.new('String', ["Portrait", "Landscape"])
175
+ return false unless mode_validator.valid?(@mode)
176
+ return true
177
+ end
178
+
179
+ # Custom attribute writer method checking allowed values (enum).
180
+ # @param [Object] range_mode Object to be assigned
181
+ def range_mode=(range_mode)
182
+ validator = EnumAttributeValidator.new('String', ["AllPages", "OddPages", "EvenPages"])
183
+ if range_mode.to_i == 0
184
+ unless validator.valid?(range_mode)
185
+ raise ArgumentError, "invalid value for 'range_mode', must be one of #{validator.allowable_values}."
186
+ end
187
+ @range_mode = range_mode
188
+ else
189
+ @range_mode = validator.allowable_values[range_mode.to_i]
190
+ end
191
+ end
192
+
193
+ # Custom attribute writer method checking allowed values (enum).
194
+ # @param [Object] mode Object to be assigned
195
+ def mode=(mode)
196
+ validator = EnumAttributeValidator.new('String', ["Portrait", "Landscape"])
197
+ if mode.to_i == 0
198
+ unless validator.valid?(mode)
199
+ raise ArgumentError, "invalid value for 'mode', must be one of #{validator.allowable_values}."
200
+ end
201
+ @mode = mode
202
+ else
203
+ @mode = validator.allowable_values[mode.to_i]
204
+ end
205
+ end
206
+
207
+ # Checks equality by comparing each attribute.
208
+ # @param [Object] Object to be compared
209
+ def ==(other)
210
+ return true if self.equal?(other)
211
+ self.class == other.class &&
212
+ file_info == other.file_info &&
213
+ output_path == other.output_path &&
214
+ pages == other.pages &&
215
+ start_page_number == other.start_page_number &&
216
+ end_page_number == other.end_page_number &&
217
+ range_mode == other.range_mode &&
218
+ mode == other.mode
219
+ end
220
+
221
+ # @see the `==` method
222
+ # @param [Object] Object to be compared
223
+ def eql?(other)
224
+ self == other
225
+ end
226
+
227
+ # Calculates hash code according to all attributes.
228
+ # @return [Fixnum] Hash code
229
+ def hash
230
+ [file_info, output_path, pages, start_page_number, end_page_number, range_mode, mode].hash
231
+ end
232
+
233
+ # Downcases first letter.
234
+ # @return downcased string
235
+ def uncap(str)
236
+ str[0, 1].downcase + str[1..-1]
237
+ end
238
+
239
+ # Builds the object from hash
240
+ # @param [Hash] attributes Model attributes in the form of hash
241
+ # @return [Object] Returns the model itself
242
+ def build_from_hash(attributes)
243
+ return nil unless attributes.is_a?(Hash)
244
+ self.class.swagger_types.each_pair do |key, type|
245
+ pname = uncap(self.class.attribute_map[key]).intern
246
+ value = attributes[pname]
247
+ if type =~ /\AArray<(.*)>/i
248
+ # check to ensure the input is an array given that the the attribute
249
+ # is documented as an array but the input is not
250
+ if value.is_a?(Array)
251
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
252
+ end
253
+ elsif !value.nil?
254
+ self.send("#{key}=", _deserialize(type, value))
255
+ end
256
+ # or else data not found in attributes(hash), not an issue as the data can be optional
257
+ end
258
+
259
+ self
260
+ end
261
+
262
+ # Deserializes the data based on type
263
+ # @param string type Data type
264
+ # @param string value Value to be deserialized
265
+ # @return [Object] Deserialized data
266
+ def _deserialize(type, value)
267
+ case type.to_sym
268
+ when :DateTime
269
+ Date.parse value
270
+ when :Date
271
+ Date.parse value
272
+ when :String
273
+ value.to_s
274
+ when :Integer
275
+ value.to_i
276
+ when :Float
277
+ value.to_f
278
+ when :BOOLEAN
279
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
280
+ true
281
+ else
282
+ false
283
+ end
284
+ when :Object
285
+ # generic object (usually a Hash), return directly
286
+ value
287
+ when /\AArray<(?<inner_type>.+)>\z/
288
+ inner_type = Regexp.last_match[:inner_type]
289
+ value.map { |v| _deserialize(inner_type, v) }
290
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
291
+ k_type = Regexp.last_match[:k_type]
292
+ v_type = Regexp.last_match[:v_type]
293
+ {}.tap do |hash|
294
+ value.each do |k, v|
295
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
296
+ end
297
+ end
298
+ else
299
+ # model
300
+ temp_model = GroupDocsMergerCloud.const_get(type).new
301
+ temp_model.build_from_hash(value)
302
+ end
303
+ end
304
+
305
+ # Returns the string representation of the object
306
+ # @return [String] String presentation of the object
307
+ def to_s
308
+ to_hash.to_s
309
+ end
310
+
311
+ # to_body is an alias to to_hash (backward compatibility)
312
+ # @return [Hash] Returns the object in the form of hash
313
+ def to_body
314
+ to_hash
315
+ end
316
+
317
+ # Returns the object in the form of hash
318
+ # @return [Hash] Returns the object in the form of hash
319
+ def to_hash
320
+ hash = {}
321
+ self.class.attribute_map.each_pair do |attr, param|
322
+ value = self.send(attr)
323
+ next if value.nil?
324
+ hash[param] = _to_hash(value)
325
+ end
326
+ hash
327
+ end
328
+
329
+ # Outputs non-array value in the form of hash
330
+ # For object, use to_hash. Otherwise, just return the value
331
+ # @param [Object] value Any valid value
332
+ # @return [Hash] Returns the value in the form of hash
333
+ def _to_hash(value)
334
+ if value.is_a?(Array)
335
+ value.compact.map { |v| _to_hash(v) }
336
+ elsif value.is_a?(Hash)
337
+ {}.tap do |hash|
338
+ value.each { |k, v| hash[k] = _to_hash(v) }
339
+ end
340
+ elsif value.respond_to? :to_hash
341
+ value.to_hash
342
+ else
343
+ value
344
+ end
345
+ end
346
+
347
+ end
348
+
349
+ end
@@ -0,0 +1,264 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="page_info.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 GroupDocsMergerCloud
31
+ # Describes page properties
32
+ class PageInfo
33
+
34
+ # Page width in pixels when converted to image
35
+ attr_accessor :width
36
+
37
+ # Page height in pixels when converted to image
38
+ attr_accessor :height
39
+
40
+ # Document page number
41
+ attr_accessor :page_number
42
+
43
+ # Indicates whether page is visible or not
44
+ attr_accessor :visible
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'width' => :'Width',
50
+ :'height' => :'Height',
51
+ :'page_number' => :'PageNumber',
52
+ :'visible' => :'Visible'
53
+ }
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ {
59
+ :'width' => :'Integer',
60
+ :'height' => :'Integer',
61
+ :'page_number' => :'Integer',
62
+ :'visible' => :'BOOLEAN'
63
+ }
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ return unless attributes.is_a?(Hash)
70
+
71
+ # convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
73
+
74
+ if attributes.key?(:'Width')
75
+ self.width = attributes[:'Width']
76
+ end
77
+
78
+ if attributes.key?(:'Height')
79
+ self.height = attributes[:'Height']
80
+ end
81
+
82
+ if attributes.key?(:'PageNumber')
83
+ self.page_number = attributes[:'PageNumber']
84
+ end
85
+
86
+ if attributes.key?(:'Visible')
87
+ self.visible = attributes[:'Visible']
88
+ end
89
+
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properies with the reasons
94
+ def list_invalid_properties
95
+ invalid_properties = []
96
+ if @width.nil?
97
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
98
+ end
99
+
100
+ if @height.nil?
101
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
102
+ end
103
+
104
+ if @page_number.nil?
105
+ invalid_properties.push("invalid value for 'page_number', page_number cannot be nil.")
106
+ end
107
+
108
+ if @visible.nil?
109
+ invalid_properties.push("invalid value for 'visible', visible cannot be nil.")
110
+ end
111
+
112
+ return invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ return false if @width.nil?
119
+ return false if @height.nil?
120
+ return false if @page_number.nil?
121
+ return false if @visible.nil?
122
+ return true
123
+ end
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] Object to be compared
127
+ def ==(other)
128
+ return true if self.equal?(other)
129
+ self.class == other.class &&
130
+ width == other.width &&
131
+ height == other.height &&
132
+ page_number == other.page_number &&
133
+ visible == other.visible
134
+ end
135
+
136
+ # @see the `==` method
137
+ # @param [Object] Object to be compared
138
+ def eql?(other)
139
+ self == other
140
+ end
141
+
142
+ # Calculates hash code according to all attributes.
143
+ # @return [Fixnum] Hash code
144
+ def hash
145
+ [width, height, page_number, visible].hash
146
+ end
147
+
148
+ # Downcases first letter.
149
+ # @return downcased string
150
+ def uncap(str)
151
+ str[0, 1].downcase + str[1..-1]
152
+ end
153
+
154
+ # Builds the object from hash
155
+ # @param [Hash] attributes Model attributes in the form of hash
156
+ # @return [Object] Returns the model itself
157
+ def build_from_hash(attributes)
158
+ return nil unless attributes.is_a?(Hash)
159
+ self.class.swagger_types.each_pair do |key, type|
160
+ pname = uncap(self.class.attribute_map[key]).intern
161
+ value = attributes[pname]
162
+ if type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the the attribute
164
+ # is documented as an array but the input is not
165
+ if value.is_a?(Array)
166
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
167
+ end
168
+ elsif !value.nil?
169
+ self.send("#{key}=", _deserialize(type, value))
170
+ end
171
+ # or else data not found in attributes(hash), not an issue as the data can be optional
172
+ end
173
+
174
+ self
175
+ end
176
+
177
+ # Deserializes the data based on type
178
+ # @param string type Data type
179
+ # @param string value Value to be deserialized
180
+ # @return [Object] Deserialized data
181
+ def _deserialize(type, value)
182
+ case type.to_sym
183
+ when :DateTime
184
+ Date.parse value
185
+ when :Date
186
+ Date.parse value
187
+ when :String
188
+ value.to_s
189
+ when :Integer
190
+ value.to_i
191
+ when :Float
192
+ value.to_f
193
+ when :BOOLEAN
194
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
195
+ true
196
+ else
197
+ false
198
+ end
199
+ when :Object
200
+ # generic object (usually a Hash), return directly
201
+ value
202
+ when /\AArray<(?<inner_type>.+)>\z/
203
+ inner_type = Regexp.last_match[:inner_type]
204
+ value.map { |v| _deserialize(inner_type, v) }
205
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
206
+ k_type = Regexp.last_match[:k_type]
207
+ v_type = Regexp.last_match[:v_type]
208
+ {}.tap do |hash|
209
+ value.each do |k, v|
210
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
211
+ end
212
+ end
213
+ else
214
+ # model
215
+ temp_model = GroupDocsMergerCloud.const_get(type).new
216
+ temp_model.build_from_hash(value)
217
+ end
218
+ end
219
+
220
+ # Returns the string representation of the object
221
+ # @return [String] String presentation of the object
222
+ def to_s
223
+ to_hash.to_s
224
+ end
225
+
226
+ # to_body is an alias to to_hash (backward compatibility)
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_body
229
+ to_hash
230
+ end
231
+
232
+ # Returns the object in the form of hash
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_hash
235
+ hash = {}
236
+ self.class.attribute_map.each_pair do |attr, param|
237
+ value = self.send(attr)
238
+ next if value.nil?
239
+ hash[param] = _to_hash(value)
240
+ end
241
+ hash
242
+ end
243
+
244
+ # Outputs non-array value in the form of hash
245
+ # For object, use to_hash. Otherwise, just return the value
246
+ # @param [Object] value Any valid value
247
+ # @return [Hash] Returns the value in the form of hash
248
+ def _to_hash(value)
249
+ if value.is_a?(Array)
250
+ value.compact.map { |v| _to_hash(v) }
251
+ elsif value.is_a?(Hash)
252
+ {}.tap do |hash|
253
+ value.each { |k, v| hash[k] = _to_hash(v) }
254
+ end
255
+ elsif value.respond_to? :to_hash
256
+ value.to_hash
257
+ else
258
+ value
259
+ end
260
+ end
261
+
262
+ end
263
+
264
+ end