groupdocs_comparison_cloud 18.9 → 21.3.1
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.
- checksums.yaml +4 -4
- data/lib/groupdocs_comparison_cloud.rb +34 -42
- data/lib/groupdocs_comparison_cloud/api/compare_api.rb +411 -0
- data/lib/groupdocs_comparison_cloud/api/file_api.rb +729 -0
- data/lib/groupdocs_comparison_cloud/api/folder_api.rb +694 -0
- data/lib/groupdocs_comparison_cloud/api/info_api.rb +266 -0
- data/lib/groupdocs_comparison_cloud/api/review_api.rb +314 -0
- data/lib/groupdocs_comparison_cloud/api/storage_api.rb +541 -0
- data/lib/groupdocs_comparison_cloud/api_client.rb +7 -17
- data/lib/groupdocs_comparison_cloud/api_error.rb +19 -4
- data/lib/groupdocs_comparison_cloud/configuration.rb +3 -3
- data/lib/groupdocs_comparison_cloud/models/{comparison_change.rb → apply_revisions_options.rb} +65 -64
- data/lib/groupdocs_comparison_cloud/models/change_info.rb +371 -0
- data/lib/groupdocs_comparison_cloud/models/comparison_options.rb +298 -0
- data/lib/groupdocs_comparison_cloud/models/diagram_master_setting.rb +229 -0
- data/lib/groupdocs_comparison_cloud/models/disc_usage.rb +234 -0
- data/lib/groupdocs_comparison_cloud/models/error.rb +244 -0
- data/lib/groupdocs_comparison_cloud/models/{comparison_file_info.rb → error_details.rb} +39 -36
- data/lib/groupdocs_comparison_cloud/models/{style_settings_values.rb → file_info.rb} +51 -38
- data/lib/groupdocs_comparison_cloud/models/file_version.rb +289 -0
- data/lib/groupdocs_comparison_cloud/models/{value_type.rb → file_versions.rb} +33 -13
- data/lib/groupdocs_comparison_cloud/models/{comparison_changes_category_dto.rb → files_list.rb} +28 -30
- data/lib/groupdocs_comparison_cloud/models/files_upload_result.rb +228 -0
- data/lib/groupdocs_comparison_cloud/models/format.rb +224 -0
- data/lib/groupdocs_comparison_cloud/models/{comparison_style_change.rb → formats_result.rb} +29 -19
- data/lib/groupdocs_comparison_cloud/models/info_result.rb +254 -0
- data/lib/groupdocs_comparison_cloud/models/items_style.rb +304 -0
- data/lib/groupdocs_comparison_cloud/models/link.rb +16 -8
- data/lib/groupdocs_comparison_cloud/models/{comparison_metadata_values.rb → metadata.rb} +28 -20
- data/lib/groupdocs_comparison_cloud/models/object_exist.rb +234 -0
- data/lib/groupdocs_comparison_cloud/models/{comparison_request.rb → page_info.rb} +56 -47
- data/lib/groupdocs_comparison_cloud/models/rectangle.rb +264 -0
- data/lib/groupdocs_comparison_cloud/models/revision_info.rb +322 -0
- data/lib/groupdocs_comparison_cloud/models/settings.rb +581 -0
- data/lib/groupdocs_comparison_cloud/models/size.rb +234 -0
- data/lib/groupdocs_comparison_cloud/models/storage_exist.rb +219 -0
- data/lib/groupdocs_comparison_cloud/models/storage_file.rb +264 -0
- data/lib/groupdocs_comparison_cloud/models/style_change_info.rb +234 -0
- data/lib/groupdocs_comparison_cloud/models/updates_options.rb +310 -0
- data/lib/groupdocs_comparison_cloud/version.rb +2 -2
- metadata +35 -58
- data/lib/groupdocs_comparison_cloud/api/changes_api.rb +0 -470
- data/lib/groupdocs_comparison_cloud/api/comparison_api.rb +0 -365
- data/lib/groupdocs_comparison_cloud/models/color.rb +0 -1404
- data/lib/groupdocs_comparison_cloud/models/comparison_request_settings.rb +0 -378
- data/lib/groupdocs_comparison_cloud/models/requests/comparison_images_request.rb +0 -49
- data/lib/groupdocs_comparison_cloud/models/requests/comparison_images_stream_request.rb +0 -45
- data/lib/groupdocs_comparison_cloud/models/requests/comparison_request.rb +0 -49
- data/lib/groupdocs_comparison_cloud/models/requests/comparison_stream_request.rb +0 -45
- data/lib/groupdocs_comparison_cloud/models/requests/post_categories_changes_request.rb +0 -49
- data/lib/groupdocs_comparison_cloud/models/requests/post_changes_request.rb +0 -45
- data/lib/groupdocs_comparison_cloud/models/requests/put_changes_document_request.rb +0 -49
- data/lib/groupdocs_comparison_cloud/models/requests/put_changes_document_stream_request.rb +0 -45
- data/lib/groupdocs_comparison_cloud/models/requests/put_changes_images_request.rb +0 -49
- data/lib/groupdocs_comparison_cloud/models/requests/put_changes_images_stream_request.rb +0 -45
@@ -0,0 +1,304 @@
|
|
1
|
+
#
|
2
|
+
# --------------------------------------------------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="items_style.rb">
|
4
|
+
# Copyright (c) 2003-2021 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 GroupDocsComparisonCloud
|
31
|
+
# ItemsStyle Object fields
|
32
|
+
class ItemsStyle
|
33
|
+
|
34
|
+
# Font color for changed components
|
35
|
+
attr_accessor :font_color
|
36
|
+
|
37
|
+
# Highlight color for changed components
|
38
|
+
attr_accessor :highlight_color
|
39
|
+
|
40
|
+
# Start tag for changed components
|
41
|
+
attr_accessor :begin_separator_string
|
42
|
+
|
43
|
+
# End tag for changed components
|
44
|
+
attr_accessor :end_separator_string
|
45
|
+
|
46
|
+
# Bold style for changed components
|
47
|
+
attr_accessor :bold
|
48
|
+
|
49
|
+
# Italic style for changed components
|
50
|
+
attr_accessor :italic
|
51
|
+
|
52
|
+
# Strike through style for changed components
|
53
|
+
attr_accessor :strike_through
|
54
|
+
|
55
|
+
# Underline style for changed components
|
56
|
+
attr_accessor :underline
|
57
|
+
|
58
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
59
|
+
def self.attribute_map
|
60
|
+
{
|
61
|
+
:'font_color' => :'FontColor',
|
62
|
+
:'highlight_color' => :'HighlightColor',
|
63
|
+
:'begin_separator_string' => :'BeginSeparatorString',
|
64
|
+
:'end_separator_string' => :'EndSeparatorString',
|
65
|
+
:'bold' => :'Bold',
|
66
|
+
:'italic' => :'Italic',
|
67
|
+
:'strike_through' => :'StrikeThrough',
|
68
|
+
:'underline' => :'Underline'
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
# Attribute type mapping.
|
73
|
+
def self.swagger_types
|
74
|
+
{
|
75
|
+
:'font_color' => :'String',
|
76
|
+
:'highlight_color' => :'String',
|
77
|
+
:'begin_separator_string' => :'String',
|
78
|
+
:'end_separator_string' => :'String',
|
79
|
+
:'bold' => :'BOOLEAN',
|
80
|
+
:'italic' => :'BOOLEAN',
|
81
|
+
:'strike_through' => :'BOOLEAN',
|
82
|
+
:'underline' => :'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?(:'FontColor')
|
95
|
+
self.font_color = attributes[:'FontColor']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:'HighlightColor')
|
99
|
+
self.highlight_color = attributes[:'HighlightColor']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:'BeginSeparatorString')
|
103
|
+
self.begin_separator_string = attributes[:'BeginSeparatorString']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.key?(:'EndSeparatorString')
|
107
|
+
self.end_separator_string = attributes[:'EndSeparatorString']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.key?(:'Bold')
|
111
|
+
self.bold = attributes[:'Bold']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.key?(:'Italic')
|
115
|
+
self.italic = attributes[:'Italic']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'StrikeThrough')
|
119
|
+
self.strike_through = attributes[:'StrikeThrough']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.key?(:'Underline')
|
123
|
+
self.underline = attributes[:'Underline']
|
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 @bold.nil?
|
133
|
+
invalid_properties.push("invalid value for 'bold', bold cannot be nil.")
|
134
|
+
end
|
135
|
+
|
136
|
+
if @italic.nil?
|
137
|
+
invalid_properties.push("invalid value for 'italic', italic cannot be nil.")
|
138
|
+
end
|
139
|
+
|
140
|
+
if @strike_through.nil?
|
141
|
+
invalid_properties.push("invalid value for 'strike_through', strike_through cannot be nil.")
|
142
|
+
end
|
143
|
+
|
144
|
+
if @underline.nil?
|
145
|
+
invalid_properties.push("invalid value for 'underline', underline cannot be nil.")
|
146
|
+
end
|
147
|
+
|
148
|
+
return invalid_properties
|
149
|
+
end
|
150
|
+
|
151
|
+
# Check to see if the all the properties in the model are valid
|
152
|
+
# @return true if the model is valid
|
153
|
+
def valid?
|
154
|
+
return false if @bold.nil?
|
155
|
+
return false if @italic.nil?
|
156
|
+
return false if @strike_through.nil?
|
157
|
+
return false if @underline.nil?
|
158
|
+
return true
|
159
|
+
end
|
160
|
+
|
161
|
+
# Checks equality by comparing each attribute.
|
162
|
+
# @param [Object] Object to be compared
|
163
|
+
def ==(other)
|
164
|
+
return true if self.equal?(other)
|
165
|
+
self.class == other.class &&
|
166
|
+
font_color == other.font_color &&
|
167
|
+
highlight_color == other.highlight_color &&
|
168
|
+
begin_separator_string == other.begin_separator_string &&
|
169
|
+
end_separator_string == other.end_separator_string &&
|
170
|
+
bold == other.bold &&
|
171
|
+
italic == other.italic &&
|
172
|
+
strike_through == other.strike_through &&
|
173
|
+
underline == other.underline
|
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
|
+
[font_color, highlight_color, begin_separator_string, end_separator_string, bold, italic, strike_through, underline].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 = GroupDocsComparisonCloud.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
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# --------------------------------------------------------------------------------------------------------------------
|
3
3
|
# <copyright company="Aspose Pty Ltd" file="link.rb">
|
4
|
-
# Copyright (c) 2003-
|
4
|
+
# Copyright (c) 2003-2021 Aspose Pty Ltd
|
5
5
|
# </copyright>
|
6
6
|
# <summary>
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
@@ -125,20 +125,28 @@ module GroupDocsComparisonCloud
|
|
125
125
|
[href, rel, type, title].hash
|
126
126
|
end
|
127
127
|
|
128
|
+
# Downcases first letter.
|
129
|
+
# @return downcased string
|
130
|
+
def uncap(str)
|
131
|
+
str[0, 1].downcase + str[1..-1]
|
132
|
+
end
|
133
|
+
|
128
134
|
# Builds the object from hash
|
129
135
|
# @param [Hash] attributes Model attributes in the form of hash
|
130
136
|
# @return [Object] Returns the model itself
|
131
137
|
def build_from_hash(attributes)
|
132
138
|
return nil unless attributes.is_a?(Hash)
|
133
139
|
self.class.swagger_types.each_pair do |key, type|
|
140
|
+
pname = uncap(self.class.attribute_map[key]).intern
|
141
|
+
value = attributes[pname]
|
134
142
|
if type =~ /\AArray<(.*)>/i
|
135
143
|
# check to ensure the input is an array given that the the attribute
|
136
|
-
# is documented as an array but the input is not
|
137
|
-
if
|
138
|
-
self.send("#{key}=",
|
144
|
+
# is documented as an array but the input is not
|
145
|
+
if value.is_a?(Array)
|
146
|
+
self.send("#{key}=", value.map { |v| _deserialize($1, v) })
|
139
147
|
end
|
140
|
-
elsif !
|
141
|
-
self.send("#{key}=", _deserialize(type,
|
148
|
+
elsif !value.nil?
|
149
|
+
self.send("#{key}=", _deserialize(type, value))
|
142
150
|
end
|
143
151
|
# or else data not found in attributes(hash), not an issue as the data can be optional
|
144
152
|
end
|
@@ -153,9 +161,9 @@ module GroupDocsComparisonCloud
|
|
153
161
|
def _deserialize(type, value)
|
154
162
|
case type.to_sym
|
155
163
|
when :DateTime
|
156
|
-
|
164
|
+
Date.parse value
|
157
165
|
when :Date
|
158
|
-
|
166
|
+
Date.parse value
|
159
167
|
when :String
|
160
168
|
value.to_s
|
161
169
|
when :Integer
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# --------------------------------------------------------------------------------------------------------------------
|
3
|
-
# <copyright company="Aspose Pty Ltd" file="
|
4
|
-
# Copyright (c) 2003-
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="metadata.rb">
|
4
|
+
# Copyright (c) 2003-2021 Aspose Pty Ltd
|
5
5
|
# </copyright>
|
6
6
|
# <summary>
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
@@ -28,16 +28,16 @@
|
|
28
28
|
require 'date'
|
29
29
|
|
30
30
|
module GroupDocsComparisonCloud
|
31
|
-
|
32
|
-
class
|
31
|
+
# MetaData Object fields
|
32
|
+
class Metadata
|
33
33
|
|
34
|
-
#
|
34
|
+
# Value of document Author
|
35
35
|
attr_accessor :author
|
36
36
|
|
37
|
-
#
|
37
|
+
# Value of last save by author of document
|
38
38
|
attr_accessor :last_save_by
|
39
39
|
|
40
|
-
#
|
40
|
+
# Value of Company of document
|
41
41
|
attr_accessor :company
|
42
42
|
|
43
43
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -66,16 +66,16 @@ module GroupDocsComparisonCloud
|
|
66
66
|
# convert string to symbol for hash key
|
67
67
|
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
68
68
|
|
69
|
-
if attributes.key?(:'
|
70
|
-
self.author = attributes[:'
|
69
|
+
if attributes.key?(:'Author')
|
70
|
+
self.author = attributes[:'Author']
|
71
71
|
end
|
72
72
|
|
73
|
-
if attributes.key?(:'
|
74
|
-
self.last_save_by = attributes[:'
|
73
|
+
if attributes.key?(:'LastSaveBy')
|
74
|
+
self.last_save_by = attributes[:'LastSaveBy']
|
75
75
|
end
|
76
76
|
|
77
|
-
if attributes.key?(:'
|
78
|
-
self.company = attributes[:'
|
77
|
+
if attributes.key?(:'Company')
|
78
|
+
self.company = attributes[:'Company']
|
79
79
|
end
|
80
80
|
|
81
81
|
end
|
@@ -115,20 +115,28 @@ module GroupDocsComparisonCloud
|
|
115
115
|
[author, last_save_by, company].hash
|
116
116
|
end
|
117
117
|
|
118
|
+
# Downcases first letter.
|
119
|
+
# @return downcased string
|
120
|
+
def uncap(str)
|
121
|
+
str[0, 1].downcase + str[1..-1]
|
122
|
+
end
|
123
|
+
|
118
124
|
# Builds the object from hash
|
119
125
|
# @param [Hash] attributes Model attributes in the form of hash
|
120
126
|
# @return [Object] Returns the model itself
|
121
127
|
def build_from_hash(attributes)
|
122
128
|
return nil unless attributes.is_a?(Hash)
|
123
129
|
self.class.swagger_types.each_pair do |key, type|
|
130
|
+
pname = uncap(self.class.attribute_map[key]).intern
|
131
|
+
value = attributes[pname]
|
124
132
|
if type =~ /\AArray<(.*)>/i
|
125
133
|
# check to ensure the input is an array given that the the attribute
|
126
|
-
# is documented as an array but the input is not
|
127
|
-
if
|
128
|
-
self.send("#{key}=",
|
134
|
+
# is documented as an array but the input is not
|
135
|
+
if value.is_a?(Array)
|
136
|
+
self.send("#{key}=", value.map { |v| _deserialize($1, v) })
|
129
137
|
end
|
130
|
-
elsif !
|
131
|
-
self.send("#{key}=", _deserialize(type,
|
138
|
+
elsif !value.nil?
|
139
|
+
self.send("#{key}=", _deserialize(type, value))
|
132
140
|
end
|
133
141
|
# or else data not found in attributes(hash), not an issue as the data can be optional
|
134
142
|
end
|
@@ -143,9 +151,9 @@ module GroupDocsComparisonCloud
|
|
143
151
|
def _deserialize(type, value)
|
144
152
|
case type.to_sym
|
145
153
|
when :DateTime
|
146
|
-
|
154
|
+
Date.parse value
|
147
155
|
when :Date
|
148
|
-
|
156
|
+
Date.parse value
|
149
157
|
when :String
|
150
158
|
value.to_s
|
151
159
|
when :Integer
|