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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_comparison_cloud.rb +34 -42
  3. data/lib/groupdocs_comparison_cloud/api/compare_api.rb +411 -0
  4. data/lib/groupdocs_comparison_cloud/api/file_api.rb +729 -0
  5. data/lib/groupdocs_comparison_cloud/api/folder_api.rb +694 -0
  6. data/lib/groupdocs_comparison_cloud/api/info_api.rb +266 -0
  7. data/lib/groupdocs_comparison_cloud/api/review_api.rb +314 -0
  8. data/lib/groupdocs_comparison_cloud/api/storage_api.rb +541 -0
  9. data/lib/groupdocs_comparison_cloud/api_client.rb +7 -17
  10. data/lib/groupdocs_comparison_cloud/api_error.rb +19 -4
  11. data/lib/groupdocs_comparison_cloud/configuration.rb +3 -3
  12. data/lib/groupdocs_comparison_cloud/models/{comparison_change.rb → apply_revisions_options.rb} +65 -64
  13. data/lib/groupdocs_comparison_cloud/models/change_info.rb +371 -0
  14. data/lib/groupdocs_comparison_cloud/models/comparison_options.rb +298 -0
  15. data/lib/groupdocs_comparison_cloud/models/diagram_master_setting.rb +229 -0
  16. data/lib/groupdocs_comparison_cloud/models/disc_usage.rb +234 -0
  17. data/lib/groupdocs_comparison_cloud/models/error.rb +244 -0
  18. data/lib/groupdocs_comparison_cloud/models/{comparison_file_info.rb → error_details.rb} +39 -36
  19. data/lib/groupdocs_comparison_cloud/models/{style_settings_values.rb → file_info.rb} +51 -38
  20. data/lib/groupdocs_comparison_cloud/models/file_version.rb +289 -0
  21. data/lib/groupdocs_comparison_cloud/models/{value_type.rb → file_versions.rb} +33 -13
  22. data/lib/groupdocs_comparison_cloud/models/{comparison_changes_category_dto.rb → files_list.rb} +28 -30
  23. data/lib/groupdocs_comparison_cloud/models/files_upload_result.rb +228 -0
  24. data/lib/groupdocs_comparison_cloud/models/format.rb +224 -0
  25. data/lib/groupdocs_comparison_cloud/models/{comparison_style_change.rb → formats_result.rb} +29 -19
  26. data/lib/groupdocs_comparison_cloud/models/info_result.rb +254 -0
  27. data/lib/groupdocs_comparison_cloud/models/items_style.rb +304 -0
  28. data/lib/groupdocs_comparison_cloud/models/link.rb +16 -8
  29. data/lib/groupdocs_comparison_cloud/models/{comparison_metadata_values.rb → metadata.rb} +28 -20
  30. data/lib/groupdocs_comparison_cloud/models/object_exist.rb +234 -0
  31. data/lib/groupdocs_comparison_cloud/models/{comparison_request.rb → page_info.rb} +56 -47
  32. data/lib/groupdocs_comparison_cloud/models/rectangle.rb +264 -0
  33. data/lib/groupdocs_comparison_cloud/models/revision_info.rb +322 -0
  34. data/lib/groupdocs_comparison_cloud/models/settings.rb +581 -0
  35. data/lib/groupdocs_comparison_cloud/models/size.rb +234 -0
  36. data/lib/groupdocs_comparison_cloud/models/storage_exist.rb +219 -0
  37. data/lib/groupdocs_comparison_cloud/models/storage_file.rb +264 -0
  38. data/lib/groupdocs_comparison_cloud/models/style_change_info.rb +234 -0
  39. data/lib/groupdocs_comparison_cloud/models/updates_options.rb +310 -0
  40. data/lib/groupdocs_comparison_cloud/version.rb +2 -2
  41. metadata +35 -58
  42. data/lib/groupdocs_comparison_cloud/api/changes_api.rb +0 -470
  43. data/lib/groupdocs_comparison_cloud/api/comparison_api.rb +0 -365
  44. data/lib/groupdocs_comparison_cloud/models/color.rb +0 -1404
  45. data/lib/groupdocs_comparison_cloud/models/comparison_request_settings.rb +0 -378
  46. data/lib/groupdocs_comparison_cloud/models/requests/comparison_images_request.rb +0 -49
  47. data/lib/groupdocs_comparison_cloud/models/requests/comparison_images_stream_request.rb +0 -45
  48. data/lib/groupdocs_comparison_cloud/models/requests/comparison_request.rb +0 -49
  49. data/lib/groupdocs_comparison_cloud/models/requests/comparison_stream_request.rb +0 -45
  50. data/lib/groupdocs_comparison_cloud/models/requests/post_categories_changes_request.rb +0 -49
  51. data/lib/groupdocs_comparison_cloud/models/requests/post_changes_request.rb +0 -45
  52. data/lib/groupdocs_comparison_cloud/models/requests/put_changes_document_request.rb +0 -49
  53. data/lib/groupdocs_comparison_cloud/models/requests/put_changes_document_stream_request.rb +0 -45
  54. data/lib/groupdocs_comparison_cloud/models/requests/put_changes_images_request.rb +0 -49
  55. data/lib/groupdocs_comparison_cloud/models/requests/put_changes_images_stream_request.rb +0 -45
@@ -0,0 +1,234 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="object_exist.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
+ # Object exists
32
+ class ObjectExist
33
+
34
+ # Indicates that the file or folder exists.
35
+ attr_accessor :exists
36
+
37
+ # True if it is a folder, false if it is a file.
38
+ attr_accessor :is_folder
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'exists' => :'Exists',
44
+ :'is_folder' => :'IsFolder'
45
+ }
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.swagger_types
50
+ {
51
+ :'exists' => :'BOOLEAN',
52
+ :'is_folder' => :'BOOLEAN'
53
+ }
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ return unless attributes.is_a?(Hash)
60
+
61
+ # convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
63
+
64
+ if attributes.key?(:'Exists')
65
+ self.exists = attributes[:'Exists']
66
+ end
67
+
68
+ if attributes.key?(:'IsFolder')
69
+ self.is_folder = attributes[:'IsFolder']
70
+ end
71
+
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properies with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = []
78
+ if @exists.nil?
79
+ invalid_properties.push("invalid value for 'exists', exists cannot be nil.")
80
+ end
81
+
82
+ if @is_folder.nil?
83
+ invalid_properties.push("invalid value for 'is_folder', is_folder cannot be nil.")
84
+ end
85
+
86
+ return invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ return false if @exists.nil?
93
+ return false if @is_folder.nil?
94
+ return true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(other)
100
+ return true if self.equal?(other)
101
+ self.class == other.class &&
102
+ exists == other.exists &&
103
+ is_folder == other.is_folder
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(other)
109
+ self == other
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Fixnum] Hash code
114
+ def hash
115
+ [exists, is_folder].hash
116
+ end
117
+
118
+ # Downcases first letter.
119
+ # @return downcased string
120
+ def uncap(str)
121
+ str[0, 1].downcase + str[1..-1]
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ self.class.swagger_types.each_pair do |key, type|
130
+ pname = uncap(self.class.attribute_map[key]).intern
131
+ value = attributes[pname]
132
+ if type =~ /\AArray<(.*)>/i
133
+ # check to ensure the input is an array given that the the attribute
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) })
137
+ end
138
+ elsif !value.nil?
139
+ self.send("#{key}=", _deserialize(type, value))
140
+ end
141
+ # or else data not found in attributes(hash), not an issue as the data can be optional
142
+ end
143
+
144
+ self
145
+ end
146
+
147
+ # Deserializes the data based on type
148
+ # @param string type Data type
149
+ # @param string value Value to be deserialized
150
+ # @return [Object] Deserialized data
151
+ def _deserialize(type, value)
152
+ case type.to_sym
153
+ when :DateTime
154
+ Date.parse value
155
+ when :Date
156
+ Date.parse value
157
+ when :String
158
+ value.to_s
159
+ when :Integer
160
+ value.to_i
161
+ when :Float
162
+ value.to_f
163
+ when :BOOLEAN
164
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
165
+ true
166
+ else
167
+ false
168
+ end
169
+ when :Object
170
+ # generic object (usually a Hash), return directly
171
+ value
172
+ when /\AArray<(?<inner_type>.+)>\z/
173
+ inner_type = Regexp.last_match[:inner_type]
174
+ value.map { |v| _deserialize(inner_type, v) }
175
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
176
+ k_type = Regexp.last_match[:k_type]
177
+ v_type = Regexp.last_match[:v_type]
178
+ {}.tap do |hash|
179
+ value.each do |k, v|
180
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
181
+ end
182
+ end
183
+ else
184
+ # model
185
+ temp_model = GroupDocsComparisonCloud.const_get(type).new
186
+ temp_model.build_from_hash(value)
187
+ end
188
+ end
189
+
190
+ # Returns the string representation of the object
191
+ # @return [String] String presentation of the object
192
+ def to_s
193
+ to_hash.to_s
194
+ end
195
+
196
+ # to_body is an alias to to_hash (backward compatibility)
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_body
199
+ to_hash
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ next if value.nil?
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ # Outputs non-array value in the form of hash
215
+ # For object, use to_hash. Otherwise, just return the value
216
+ # @param [Object] value Any valid value
217
+ # @return [Hash] Returns the value in the form of hash
218
+ def _to_hash(value)
219
+ if value.is_a?(Array)
220
+ value.compact.map { |v| _to_hash(v) }
221
+ elsif value.is_a?(Hash)
222
+ {}.tap do |hash|
223
+ value.each { |k, v| hash[k] = _to_hash(v) }
224
+ end
225
+ elsif value.respond_to? :to_hash
226
+ value.to_hash
227
+ else
228
+ value
229
+ end
230
+ end
231
+
232
+ end
233
+
234
+ end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="comparison_request.rb">
4
- # Copyright (c) 2003-2018 Aspose Pty Ltd
3
+ # <copyright company="Aspose Pty Ltd" file="page_info.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,38 +28,33 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsComparisonCloud
31
- # ComparisonRequest
32
- class ComparisonRequest
31
+ # Represents information about page
32
+ class PageInfo
33
33
 
34
- # The source name
35
- attr_accessor :source_file
34
+ # Page width
35
+ attr_accessor :width
36
36
 
37
- # The files names
38
- attr_accessor :target_files
37
+ # Page height
38
+ attr_accessor :height
39
39
 
40
- # The settings
41
- attr_accessor :settings
42
-
43
- # The changes
44
- attr_accessor :changes
40
+ # Page number
41
+ attr_accessor :page_number
45
42
 
46
43
  # Attribute mapping from ruby-style variable name to JSON key.
47
44
  def self.attribute_map
48
45
  {
49
- :'source_file' => :'SourceFile',
50
- :'target_files' => :'TargetFiles',
51
- :'settings' => :'Settings',
52
- :'changes' => :'Changes'
46
+ :'width' => :'Width',
47
+ :'height' => :'Height',
48
+ :'page_number' => :'PageNumber'
53
49
  }
54
50
  end
55
51
 
56
52
  # Attribute type mapping.
57
53
  def self.swagger_types
58
54
  {
59
- :'source_file' => :'ComparisonFileInfo',
60
- :'target_files' => :'Array<ComparisonFileInfo>',
61
- :'settings' => :'ComparisonRequestSettings',
62
- :'changes' => :'Array<ComparisonChange>'
55
+ :'width' => :'Integer',
56
+ :'height' => :'Integer',
57
+ :'page_number' => :'Integer'
63
58
  }
64
59
  end
65
60
 
@@ -71,24 +66,16 @@ module GroupDocsComparisonCloud
71
66
  # convert string to symbol for hash key
72
67
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
73
68
 
74
- if attributes.key?(:'sourceFile')
75
- self.source_file = attributes[:'sourceFile']
69
+ if attributes.key?(:'Width')
70
+ self.width = attributes[:'Width']
76
71
  end
77
72
 
78
- if attributes.key?(:'targetFiles')
79
- if (value = attributes[:'targetFiles']).is_a?(Array)
80
- self.target_files = value
81
- end
73
+ if attributes.key?(:'Height')
74
+ self.height = attributes[:'Height']
82
75
  end
83
76
 
84
- if attributes.key?(:'settings')
85
- self.settings = attributes[:'settings']
86
- end
87
-
88
- if attributes.key?(:'changes')
89
- if (value = attributes[:'changes']).is_a?(Array)
90
- self.changes = value
91
- end
77
+ if attributes.key?(:'PageNumber')
78
+ self.page_number = attributes[:'PageNumber']
92
79
  end
93
80
 
94
81
  end
@@ -97,12 +84,27 @@ module GroupDocsComparisonCloud
97
84
  # @return Array for valid properies with the reasons
98
85
  def list_invalid_properties
99
86
  invalid_properties = []
87
+ if @width.nil?
88
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
89
+ end
90
+
91
+ if @height.nil?
92
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
93
+ end
94
+
95
+ if @page_number.nil?
96
+ invalid_properties.push("invalid value for 'page_number', page_number cannot be nil.")
97
+ end
98
+
100
99
  return invalid_properties
101
100
  end
102
101
 
103
102
  # Check to see if the all the properties in the model are valid
104
103
  # @return true if the model is valid
105
104
  def valid?
105
+ return false if @width.nil?
106
+ return false if @height.nil?
107
+ return false if @page_number.nil?
106
108
  return true
107
109
  end
108
110
 
@@ -111,10 +113,9 @@ module GroupDocsComparisonCloud
111
113
  def ==(other)
112
114
  return true if self.equal?(other)
113
115
  self.class == other.class &&
114
- source_file == other.source_file &&
115
- target_files == other.target_files &&
116
- settings == other.settings &&
117
- changes == other.changes
116
+ width == other.width &&
117
+ height == other.height &&
118
+ page_number == other.page_number
118
119
  end
119
120
 
120
121
  # @see the `==` method
@@ -126,7 +127,13 @@ module GroupDocsComparisonCloud
126
127
  # Calculates hash code according to all attributes.
127
128
  # @return [Fixnum] Hash code
128
129
  def hash
129
- [source_file, target_files, settings, changes].hash
130
+ [width, height, page_number].hash
131
+ end
132
+
133
+ # Downcases first letter.
134
+ # @return downcased string
135
+ def uncap(str)
136
+ str[0, 1].downcase + str[1..-1]
130
137
  end
131
138
 
132
139
  # Builds the object from hash
@@ -135,14 +142,16 @@ module GroupDocsComparisonCloud
135
142
  def build_from_hash(attributes)
136
143
  return nil unless attributes.is_a?(Hash)
137
144
  self.class.swagger_types.each_pair do |key, type|
145
+ pname = uncap(self.class.attribute_map[key]).intern
146
+ value = attributes[pname]
138
147
  if type =~ /\AArray<(.*)>/i
139
148
  # check to ensure the input is an array given that the the attribute
140
- # is documented as an array but the input is not
141
- if attributes[self.class.attribute_map[key]].is_a?(Array)
142
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
149
+ # is documented as an array but the input is not
150
+ if value.is_a?(Array)
151
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
143
152
  end
144
- elsif !attributes[self.class.attribute_map[key]].nil?
145
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ elsif !value.nil?
154
+ self.send("#{key}=", _deserialize(type, value))
146
155
  end
147
156
  # or else data not found in attributes(hash), not an issue as the data can be optional
148
157
  end
@@ -157,9 +166,9 @@ module GroupDocsComparisonCloud
157
166
  def _deserialize(type, value)
158
167
  case type.to_sym
159
168
  when :DateTime
160
- Time.at(/\d/.match(value)[0].to_f).to_datetime
169
+ Date.parse value
161
170
  when :Date
162
- Time.at(/\d/.match(value)[0].to_f).to_date
171
+ Date.parse value
163
172
  when :String
164
173
  value.to_s
165
174
  when :Integer
@@ -0,0 +1,264 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="rectangle.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
+ # Rectangle model
32
+ class Rectangle
33
+
34
+ # Height
35
+ attr_accessor :height
36
+
37
+ # Width
38
+ attr_accessor :width
39
+
40
+ # X coordinate
41
+ attr_accessor :x
42
+
43
+ # Y coordinate
44
+ attr_accessor :y
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'height' => :'Height',
50
+ :'width' => :'Width',
51
+ :'x' => :'X',
52
+ :'y' => :'Y'
53
+ }
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ {
59
+ :'height' => :'Float',
60
+ :'width' => :'Float',
61
+ :'x' => :'Float',
62
+ :'y' => :'Float'
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?(:'Height')
75
+ self.height = attributes[:'Height']
76
+ end
77
+
78
+ if attributes.key?(:'Width')
79
+ self.width = attributes[:'Width']
80
+ end
81
+
82
+ if attributes.key?(:'X')
83
+ self.x = attributes[:'X']
84
+ end
85
+
86
+ if attributes.key?(:'Y')
87
+ self.y = attributes[:'Y']
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 @height.nil?
97
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
98
+ end
99
+
100
+ if @width.nil?
101
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
102
+ end
103
+
104
+ if @x.nil?
105
+ invalid_properties.push("invalid value for 'x', x cannot be nil.")
106
+ end
107
+
108
+ if @y.nil?
109
+ invalid_properties.push("invalid value for 'y', y 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 @height.nil?
119
+ return false if @width.nil?
120
+ return false if @x.nil?
121
+ return false if @y.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
+ height == other.height &&
131
+ width == other.width &&
132
+ x == other.x &&
133
+ y == other.y
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
+ [height, width, x, y].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 = GroupDocsComparisonCloud.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