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,322 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="revision_info.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
+ # Provides information about one revision.
32
+ class RevisionInfo
33
+
34
+ # Id of revision
35
+ attr_accessor :id
36
+
37
+ # Action (accept or reject). This field allows you to influence the display of the revision.
38
+ attr_accessor :action
39
+
40
+ # The text that is in revision.
41
+ attr_accessor :text
42
+
43
+ # Author.
44
+ attr_accessor :author
45
+
46
+ # RevisionHandler type, depending on the type the Action (accept or reject) logic changes.
47
+ attr_accessor :type
48
+ class EnumAttributeValidator
49
+ attr_reader :datatype
50
+ attr_reader :allowable_values
51
+
52
+ def initialize(datatype, allowable_values)
53
+ @allowable_values = allowable_values.map do |value|
54
+ case datatype.to_s
55
+ when /Integer/i
56
+ value.to_i
57
+ when /Float/i
58
+ value.to_f
59
+ else
60
+ value
61
+ end
62
+ end
63
+ end
64
+
65
+ def valid?(value)
66
+ !value || allowable_values.include?(value)
67
+ end
68
+ end
69
+
70
+ # Attribute mapping from ruby-style variable name to JSON key.
71
+ def self.attribute_map
72
+ {
73
+ :'id' => :'Id',
74
+ :'action' => :'Action',
75
+ :'text' => :'Text',
76
+ :'author' => :'Author',
77
+ :'type' => :'Type'
78
+ }
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.swagger_types
83
+ {
84
+ :'id' => :'Integer',
85
+ :'action' => :'String',
86
+ :'text' => :'String',
87
+ :'author' => :'String',
88
+ :'type' => :'String'
89
+ }
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ return unless attributes.is_a?(Hash)
96
+
97
+ # convert string to symbol for hash key
98
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
99
+
100
+ if attributes.key?(:'Id')
101
+ self.id = attributes[:'Id']
102
+ end
103
+
104
+ if attributes.key?(:'Action')
105
+ self.action = attributes[:'Action']
106
+ end
107
+
108
+ if attributes.key?(:'Text')
109
+ self.text = attributes[:'Text']
110
+ end
111
+
112
+ if attributes.key?(:'Author')
113
+ self.author = attributes[:'Author']
114
+ end
115
+
116
+ if attributes.key?(:'Type')
117
+ self.type = attributes[:'Type']
118
+ end
119
+
120
+ end
121
+
122
+ # Show invalid properties with the reasons. Usually used together with valid?
123
+ # @return Array for valid properies with the reasons
124
+ def list_invalid_properties
125
+ invalid_properties = []
126
+ if @id.nil?
127
+ invalid_properties.push("invalid value for 'id', id cannot be nil.")
128
+ end
129
+
130
+ if @action.nil?
131
+ invalid_properties.push("invalid value for 'action', action cannot be nil.")
132
+ end
133
+
134
+ if @type.nil?
135
+ invalid_properties.push("invalid value for 'type', type cannot be nil.")
136
+ end
137
+
138
+ return invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+ return false if @id.nil?
145
+ return false if @action.nil?
146
+ action_validator = EnumAttributeValidator.new('String', ["None", "Accept", "Reject"])
147
+ return false unless action_validator.valid?(@action)
148
+ return false if @type.nil?
149
+ type_validator = EnumAttributeValidator.new('String', ["Insertion", "Deletion", "FormatChange", "StyleDefinitionChange", "Moving"])
150
+ return false unless type_validator.valid?(@type)
151
+ return true
152
+ end
153
+
154
+ # Custom attribute writer method checking allowed values (enum).
155
+ # @param [Object] action Object to be assigned
156
+ def action=(action)
157
+ validator = EnumAttributeValidator.new('String', ["None", "Accept", "Reject"])
158
+ if action.to_i == 0
159
+ unless validator.valid?(action)
160
+ raise ArgumentError, "invalid value for 'action', must be one of #{validator.allowable_values}."
161
+ end
162
+ @action = action
163
+ else
164
+ @action = validator.allowable_values[action.to_i]
165
+ end
166
+ end
167
+
168
+ # Custom attribute writer method checking allowed values (enum).
169
+ # @param [Object] type Object to be assigned
170
+ def type=(type)
171
+ validator = EnumAttributeValidator.new('String', ["Insertion", "Deletion", "FormatChange", "StyleDefinitionChange", "Moving"])
172
+ if type.to_i == 0
173
+ unless validator.valid?(type)
174
+ raise ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
175
+ end
176
+ @type = type
177
+ else
178
+ @type = validator.allowable_values[type.to_i]
179
+ end
180
+ end
181
+
182
+ # Checks equality by comparing each attribute.
183
+ # @param [Object] Object to be compared
184
+ def ==(other)
185
+ return true if self.equal?(other)
186
+ self.class == other.class &&
187
+ id == other.id &&
188
+ action == other.action &&
189
+ text == other.text &&
190
+ author == other.author &&
191
+ type == other.type
192
+ end
193
+
194
+ # @see the `==` method
195
+ # @param [Object] Object to be compared
196
+ def eql?(other)
197
+ self == other
198
+ end
199
+
200
+ # Calculates hash code according to all attributes.
201
+ # @return [Fixnum] Hash code
202
+ def hash
203
+ [id, action, text, author, type].hash
204
+ end
205
+
206
+ # Downcases first letter.
207
+ # @return downcased string
208
+ def uncap(str)
209
+ str[0, 1].downcase + str[1..-1]
210
+ end
211
+
212
+ # Builds the object from hash
213
+ # @param [Hash] attributes Model attributes in the form of hash
214
+ # @return [Object] Returns the model itself
215
+ def build_from_hash(attributes)
216
+ return nil unless attributes.is_a?(Hash)
217
+ self.class.swagger_types.each_pair do |key, type|
218
+ pname = uncap(self.class.attribute_map[key]).intern
219
+ value = attributes[pname]
220
+ if type =~ /\AArray<(.*)>/i
221
+ # check to ensure the input is an array given that the the attribute
222
+ # is documented as an array but the input is not
223
+ if value.is_a?(Array)
224
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
225
+ end
226
+ elsif !value.nil?
227
+ self.send("#{key}=", _deserialize(type, value))
228
+ end
229
+ # or else data not found in attributes(hash), not an issue as the data can be optional
230
+ end
231
+
232
+ self
233
+ end
234
+
235
+ # Deserializes the data based on type
236
+ # @param string type Data type
237
+ # @param string value Value to be deserialized
238
+ # @return [Object] Deserialized data
239
+ def _deserialize(type, value)
240
+ case type.to_sym
241
+ when :DateTime
242
+ Date.parse value
243
+ when :Date
244
+ Date.parse value
245
+ when :String
246
+ value.to_s
247
+ when :Integer
248
+ value.to_i
249
+ when :Float
250
+ value.to_f
251
+ when :BOOLEAN
252
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
253
+ true
254
+ else
255
+ false
256
+ end
257
+ when :Object
258
+ # generic object (usually a Hash), return directly
259
+ value
260
+ when /\AArray<(?<inner_type>.+)>\z/
261
+ inner_type = Regexp.last_match[:inner_type]
262
+ value.map { |v| _deserialize(inner_type, v) }
263
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
264
+ k_type = Regexp.last_match[:k_type]
265
+ v_type = Regexp.last_match[:v_type]
266
+ {}.tap do |hash|
267
+ value.each do |k, v|
268
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
269
+ end
270
+ end
271
+ else
272
+ # model
273
+ temp_model = GroupDocsComparisonCloud.const_get(type).new
274
+ temp_model.build_from_hash(value)
275
+ end
276
+ end
277
+
278
+ # Returns the string representation of the object
279
+ # @return [String] String presentation of the object
280
+ def to_s
281
+ to_hash.to_s
282
+ end
283
+
284
+ # to_body is an alias to to_hash (backward compatibility)
285
+ # @return [Hash] Returns the object in the form of hash
286
+ def to_body
287
+ to_hash
288
+ end
289
+
290
+ # Returns the object in the form of hash
291
+ # @return [Hash] Returns the object in the form of hash
292
+ def to_hash
293
+ hash = {}
294
+ self.class.attribute_map.each_pair do |attr, param|
295
+ value = self.send(attr)
296
+ next if value.nil?
297
+ hash[param] = _to_hash(value)
298
+ end
299
+ hash
300
+ end
301
+
302
+ # Outputs non-array value in the form of hash
303
+ # For object, use to_hash. Otherwise, just return the value
304
+ # @param [Object] value Any valid value
305
+ # @return [Hash] Returns the value in the form of hash
306
+ def _to_hash(value)
307
+ if value.is_a?(Array)
308
+ value.compact.map { |v| _to_hash(v) }
309
+ elsif value.is_a?(Hash)
310
+ {}.tap do |hash|
311
+ value.each { |k, v| hash[k] = _to_hash(v) }
312
+ end
313
+ elsif value.respond_to? :to_hash
314
+ value.to_hash
315
+ else
316
+ value
317
+ end
318
+ end
319
+
320
+ end
321
+
322
+ end
@@ -0,0 +1,581 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="settings.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
+ # Defines comparison process additional settings
32
+ class Settings
33
+
34
+ # Indicates whether to add summary page to resultant document or not
35
+ attr_accessor :generate_summary_page
36
+
37
+ # Indicates whether to show deleted components in resultant document or not
38
+ attr_accessor :show_deleted_content
39
+
40
+ # Indicates whether to show inserted components in resultant document or not
41
+ attr_accessor :show_inserted_content
42
+
43
+ # Indicates whether to detect style changes or not
44
+ attr_accessor :style_change_detection
45
+
46
+ # Style for inserted components
47
+ attr_accessor :inserted_items_style
48
+
49
+ # Style for deleted components
50
+ attr_accessor :deleted_items_style
51
+
52
+ # Style for components with changed style
53
+ attr_accessor :changed_items_style
54
+
55
+ # An array of delimiters to split text into words
56
+ attr_accessor :words_separator_chars
57
+
58
+ # Gets of sets the comparison details level
59
+ attr_accessor :details_level
60
+
61
+ # Indicates whether to use frames for shapes in Word Processing and for rectangles in Image documents
62
+ attr_accessor :use_frames_for_del_ins_elements
63
+
64
+ # Indicates whether to calculate coordinates for changed components
65
+ attr_accessor :calculate_component_coordinates
66
+
67
+ # Indicates whether to use frames for shapes in Word Processing and for rectangles in Image documents
68
+ attr_accessor :mark_changed_content
69
+
70
+ # Gets or sets a value indicating whether to mark the children of the deleted or inserted element as deleted or inserted
71
+ attr_accessor :mark_nested_content
72
+
73
+ # Gets or sets type of metadata to clone
74
+ attr_accessor :clone_metadata
75
+
76
+ # Gets or sets user metadata
77
+ attr_accessor :meta_data
78
+
79
+ # Gets or sets type of password saving
80
+ attr_accessor :password_save_option
81
+
82
+ # Gets or sets user password to resultant document
83
+ attr_accessor :password
84
+
85
+ # Gets or sets master for Diagram document
86
+ attr_accessor :diagram_master_setting
87
+
88
+ # Gets or sets original document size when picture is compared with other different formats
89
+ attr_accessor :original_size
90
+
91
+ # Control to turn on comparison of header/footer contents
92
+ attr_accessor :header_footers_comparison
93
+
94
+ # Gets or sets the result document paper size
95
+ attr_accessor :paper_size
96
+
97
+ # Gets or sets a sensitivity of comparison. Default is 75
98
+ attr_accessor :sensitivity_of_comparison
99
+ class EnumAttributeValidator
100
+ attr_reader :datatype
101
+ attr_reader :allowable_values
102
+
103
+ def initialize(datatype, allowable_values)
104
+ @allowable_values = allowable_values.map do |value|
105
+ case datatype.to_s
106
+ when /Integer/i
107
+ value.to_i
108
+ when /Float/i
109
+ value.to_f
110
+ else
111
+ value
112
+ end
113
+ end
114
+ end
115
+
116
+ def valid?(value)
117
+ !value || allowable_values.include?(value)
118
+ end
119
+ end
120
+
121
+ # Attribute mapping from ruby-style variable name to JSON key.
122
+ def self.attribute_map
123
+ {
124
+ :'generate_summary_page' => :'GenerateSummaryPage',
125
+ :'show_deleted_content' => :'ShowDeletedContent',
126
+ :'show_inserted_content' => :'ShowInsertedContent',
127
+ :'style_change_detection' => :'StyleChangeDetection',
128
+ :'inserted_items_style' => :'InsertedItemsStyle',
129
+ :'deleted_items_style' => :'DeletedItemsStyle',
130
+ :'changed_items_style' => :'ChangedItemsStyle',
131
+ :'words_separator_chars' => :'WordsSeparatorChars',
132
+ :'details_level' => :'DetailsLevel',
133
+ :'use_frames_for_del_ins_elements' => :'UseFramesForDelInsElements',
134
+ :'calculate_component_coordinates' => :'CalculateComponentCoordinates',
135
+ :'mark_changed_content' => :'MarkChangedContent',
136
+ :'mark_nested_content' => :'MarkNestedContent',
137
+ :'clone_metadata' => :'CloneMetadata',
138
+ :'meta_data' => :'MetaData',
139
+ :'password_save_option' => :'PasswordSaveOption',
140
+ :'password' => :'Password',
141
+ :'diagram_master_setting' => :'DiagramMasterSetting',
142
+ :'original_size' => :'OriginalSize',
143
+ :'header_footers_comparison' => :'HeaderFootersComparison',
144
+ :'paper_size' => :'PaperSize',
145
+ :'sensitivity_of_comparison' => :'SensitivityOfComparison'
146
+ }
147
+ end
148
+
149
+ # Attribute type mapping.
150
+ def self.swagger_types
151
+ {
152
+ :'generate_summary_page' => :'BOOLEAN',
153
+ :'show_deleted_content' => :'BOOLEAN',
154
+ :'show_inserted_content' => :'BOOLEAN',
155
+ :'style_change_detection' => :'BOOLEAN',
156
+ :'inserted_items_style' => :'ItemsStyle',
157
+ :'deleted_items_style' => :'ItemsStyle',
158
+ :'changed_items_style' => :'ItemsStyle',
159
+ :'words_separator_chars' => :'Array<String>',
160
+ :'details_level' => :'String',
161
+ :'use_frames_for_del_ins_elements' => :'BOOLEAN',
162
+ :'calculate_component_coordinates' => :'BOOLEAN',
163
+ :'mark_changed_content' => :'BOOLEAN',
164
+ :'mark_nested_content' => :'BOOLEAN',
165
+ :'clone_metadata' => :'String',
166
+ :'meta_data' => :'Metadata',
167
+ :'password_save_option' => :'String',
168
+ :'password' => :'String',
169
+ :'diagram_master_setting' => :'DiagramMasterSetting',
170
+ :'original_size' => :'Size',
171
+ :'header_footers_comparison' => :'BOOLEAN',
172
+ :'paper_size' => :'String',
173
+ :'sensitivity_of_comparison' => :'Integer'
174
+ }
175
+ end
176
+
177
+ # Initializes the object
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ def initialize(attributes = {})
180
+ return unless attributes.is_a?(Hash)
181
+
182
+ # convert string to symbol for hash key
183
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
184
+
185
+ if attributes.key?(:'GenerateSummaryPage')
186
+ self.generate_summary_page = attributes[:'GenerateSummaryPage']
187
+ end
188
+
189
+ if attributes.key?(:'ShowDeletedContent')
190
+ self.show_deleted_content = attributes[:'ShowDeletedContent']
191
+ end
192
+
193
+ if attributes.key?(:'ShowInsertedContent')
194
+ self.show_inserted_content = attributes[:'ShowInsertedContent']
195
+ end
196
+
197
+ if attributes.key?(:'StyleChangeDetection')
198
+ self.style_change_detection = attributes[:'StyleChangeDetection']
199
+ end
200
+
201
+ if attributes.key?(:'InsertedItemsStyle')
202
+ self.inserted_items_style = attributes[:'InsertedItemsStyle']
203
+ end
204
+
205
+ if attributes.key?(:'DeletedItemsStyle')
206
+ self.deleted_items_style = attributes[:'DeletedItemsStyle']
207
+ end
208
+
209
+ if attributes.key?(:'ChangedItemsStyle')
210
+ self.changed_items_style = attributes[:'ChangedItemsStyle']
211
+ end
212
+
213
+ if attributes.key?(:'WordsSeparatorChars')
214
+ if (value = attributes[:'WordsSeparatorChars']).is_a?(Array)
215
+ self.words_separator_chars = value
216
+ end
217
+ end
218
+
219
+ if attributes.key?(:'DetailsLevel')
220
+ self.details_level = attributes[:'DetailsLevel']
221
+ end
222
+
223
+ if attributes.key?(:'UseFramesForDelInsElements')
224
+ self.use_frames_for_del_ins_elements = attributes[:'UseFramesForDelInsElements']
225
+ end
226
+
227
+ if attributes.key?(:'CalculateComponentCoordinates')
228
+ self.calculate_component_coordinates = attributes[:'CalculateComponentCoordinates']
229
+ end
230
+
231
+ if attributes.key?(:'MarkChangedContent')
232
+ self.mark_changed_content = attributes[:'MarkChangedContent']
233
+ end
234
+
235
+ if attributes.key?(:'MarkNestedContent')
236
+ self.mark_nested_content = attributes[:'MarkNestedContent']
237
+ end
238
+
239
+ if attributes.key?(:'CloneMetadata')
240
+ self.clone_metadata = attributes[:'CloneMetadata']
241
+ end
242
+
243
+ if attributes.key?(:'MetaData')
244
+ self.meta_data = attributes[:'MetaData']
245
+ end
246
+
247
+ if attributes.key?(:'PasswordSaveOption')
248
+ self.password_save_option = attributes[:'PasswordSaveOption']
249
+ end
250
+
251
+ if attributes.key?(:'Password')
252
+ self.password = attributes[:'Password']
253
+ end
254
+
255
+ if attributes.key?(:'DiagramMasterSetting')
256
+ self.diagram_master_setting = attributes[:'DiagramMasterSetting']
257
+ end
258
+
259
+ if attributes.key?(:'OriginalSize')
260
+ self.original_size = attributes[:'OriginalSize']
261
+ end
262
+
263
+ if attributes.key?(:'HeaderFootersComparison')
264
+ self.header_footers_comparison = attributes[:'HeaderFootersComparison']
265
+ end
266
+
267
+ if attributes.key?(:'PaperSize')
268
+ self.paper_size = attributes[:'PaperSize']
269
+ end
270
+
271
+ if attributes.key?(:'SensitivityOfComparison')
272
+ self.sensitivity_of_comparison = attributes[:'SensitivityOfComparison']
273
+ end
274
+
275
+ end
276
+
277
+ # Show invalid properties with the reasons. Usually used together with valid?
278
+ # @return Array for valid properies with the reasons
279
+ def list_invalid_properties
280
+ invalid_properties = []
281
+ if @generate_summary_page.nil?
282
+ invalid_properties.push("invalid value for 'generate_summary_page', generate_summary_page cannot be nil.")
283
+ end
284
+
285
+ if @show_deleted_content.nil?
286
+ invalid_properties.push("invalid value for 'show_deleted_content', show_deleted_content cannot be nil.")
287
+ end
288
+
289
+ if @show_inserted_content.nil?
290
+ invalid_properties.push("invalid value for 'show_inserted_content', show_inserted_content cannot be nil.")
291
+ end
292
+
293
+ if @style_change_detection.nil?
294
+ invalid_properties.push("invalid value for 'style_change_detection', style_change_detection cannot be nil.")
295
+ end
296
+
297
+ if @details_level.nil?
298
+ invalid_properties.push("invalid value for 'details_level', details_level cannot be nil.")
299
+ end
300
+
301
+ if @use_frames_for_del_ins_elements.nil?
302
+ invalid_properties.push("invalid value for 'use_frames_for_del_ins_elements', use_frames_for_del_ins_elements cannot be nil.")
303
+ end
304
+
305
+ if @calculate_component_coordinates.nil?
306
+ invalid_properties.push("invalid value for 'calculate_component_coordinates', calculate_component_coordinates cannot be nil.")
307
+ end
308
+
309
+ if @mark_changed_content.nil?
310
+ invalid_properties.push("invalid value for 'mark_changed_content', mark_changed_content cannot be nil.")
311
+ end
312
+
313
+ if @mark_nested_content.nil?
314
+ invalid_properties.push("invalid value for 'mark_nested_content', mark_nested_content cannot be nil.")
315
+ end
316
+
317
+ if @clone_metadata.nil?
318
+ invalid_properties.push("invalid value for 'clone_metadata', clone_metadata cannot be nil.")
319
+ end
320
+
321
+ if @password_save_option.nil?
322
+ invalid_properties.push("invalid value for 'password_save_option', password_save_option cannot be nil.")
323
+ end
324
+
325
+ if @header_footers_comparison.nil?
326
+ invalid_properties.push("invalid value for 'header_footers_comparison', header_footers_comparison cannot be nil.")
327
+ end
328
+
329
+ if @paper_size.nil?
330
+ invalid_properties.push("invalid value for 'paper_size', paper_size cannot be nil.")
331
+ end
332
+
333
+ if @sensitivity_of_comparison.nil?
334
+ invalid_properties.push("invalid value for 'sensitivity_of_comparison', sensitivity_of_comparison cannot be nil.")
335
+ end
336
+
337
+ return invalid_properties
338
+ end
339
+
340
+ # Check to see if the all the properties in the model are valid
341
+ # @return true if the model is valid
342
+ def valid?
343
+ return false if @generate_summary_page.nil?
344
+ return false if @show_deleted_content.nil?
345
+ return false if @show_inserted_content.nil?
346
+ return false if @style_change_detection.nil?
347
+ return false if @details_level.nil?
348
+ details_level_validator = EnumAttributeValidator.new('String', ["Low", "Middle", "High"])
349
+ return false unless details_level_validator.valid?(@details_level)
350
+ return false if @use_frames_for_del_ins_elements.nil?
351
+ return false if @calculate_component_coordinates.nil?
352
+ return false if @mark_changed_content.nil?
353
+ return false if @mark_nested_content.nil?
354
+ return false if @clone_metadata.nil?
355
+ clone_metadata_validator = EnumAttributeValidator.new('String', ["Default", "Source", "Target", "FileAuthor"])
356
+ return false unless clone_metadata_validator.valid?(@clone_metadata)
357
+ return false if @password_save_option.nil?
358
+ password_save_option_validator = EnumAttributeValidator.new('String', ["None", "Source", "Target", "User"])
359
+ return false unless password_save_option_validator.valid?(@password_save_option)
360
+ return false if @header_footers_comparison.nil?
361
+ return false if @paper_size.nil?
362
+ paper_size_validator = EnumAttributeValidator.new('String', ["Default", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8"])
363
+ return false unless paper_size_validator.valid?(@paper_size)
364
+ return false if @sensitivity_of_comparison.nil?
365
+ return true
366
+ end
367
+
368
+ # Custom attribute writer method checking allowed values (enum).
369
+ # @param [Object] details_level Object to be assigned
370
+ def details_level=(details_level)
371
+ validator = EnumAttributeValidator.new('String', ["Low", "Middle", "High"])
372
+ if details_level.to_i == 0
373
+ unless validator.valid?(details_level)
374
+ raise ArgumentError, "invalid value for 'details_level', must be one of #{validator.allowable_values}."
375
+ end
376
+ @details_level = details_level
377
+ else
378
+ @details_level = validator.allowable_values[details_level.to_i]
379
+ end
380
+ end
381
+
382
+ # Custom attribute writer method checking allowed values (enum).
383
+ # @param [Object] clone_metadata Object to be assigned
384
+ def clone_metadata=(clone_metadata)
385
+ validator = EnumAttributeValidator.new('String', ["Default", "Source", "Target", "FileAuthor"])
386
+ if clone_metadata.to_i == 0
387
+ unless validator.valid?(clone_metadata)
388
+ raise ArgumentError, "invalid value for 'clone_metadata', must be one of #{validator.allowable_values}."
389
+ end
390
+ @clone_metadata = clone_metadata
391
+ else
392
+ @clone_metadata = validator.allowable_values[clone_metadata.to_i]
393
+ end
394
+ end
395
+
396
+ # Custom attribute writer method checking allowed values (enum).
397
+ # @param [Object] password_save_option Object to be assigned
398
+ def password_save_option=(password_save_option)
399
+ validator = EnumAttributeValidator.new('String', ["None", "Source", "Target", "User"])
400
+ if password_save_option.to_i == 0
401
+ unless validator.valid?(password_save_option)
402
+ raise ArgumentError, "invalid value for 'password_save_option', must be one of #{validator.allowable_values}."
403
+ end
404
+ @password_save_option = password_save_option
405
+ else
406
+ @password_save_option = validator.allowable_values[password_save_option.to_i]
407
+ end
408
+ end
409
+
410
+ # Custom attribute writer method checking allowed values (enum).
411
+ # @param [Object] paper_size Object to be assigned
412
+ def paper_size=(paper_size)
413
+ validator = EnumAttributeValidator.new('String', ["Default", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8"])
414
+ if paper_size.to_i == 0
415
+ unless validator.valid?(paper_size)
416
+ raise ArgumentError, "invalid value for 'paper_size', must be one of #{validator.allowable_values}."
417
+ end
418
+ @paper_size = paper_size
419
+ else
420
+ @paper_size = validator.allowable_values[paper_size.to_i]
421
+ end
422
+ end
423
+
424
+ # Checks equality by comparing each attribute.
425
+ # @param [Object] Object to be compared
426
+ def ==(other)
427
+ return true if self.equal?(other)
428
+ self.class == other.class &&
429
+ generate_summary_page == other.generate_summary_page &&
430
+ show_deleted_content == other.show_deleted_content &&
431
+ show_inserted_content == other.show_inserted_content &&
432
+ style_change_detection == other.style_change_detection &&
433
+ inserted_items_style == other.inserted_items_style &&
434
+ deleted_items_style == other.deleted_items_style &&
435
+ changed_items_style == other.changed_items_style &&
436
+ words_separator_chars == other.words_separator_chars &&
437
+ details_level == other.details_level &&
438
+ use_frames_for_del_ins_elements == other.use_frames_for_del_ins_elements &&
439
+ calculate_component_coordinates == other.calculate_component_coordinates &&
440
+ mark_changed_content == other.mark_changed_content &&
441
+ mark_nested_content == other.mark_nested_content &&
442
+ clone_metadata == other.clone_metadata &&
443
+ meta_data == other.meta_data &&
444
+ password_save_option == other.password_save_option &&
445
+ password == other.password &&
446
+ diagram_master_setting == other.diagram_master_setting &&
447
+ original_size == other.original_size &&
448
+ header_footers_comparison == other.header_footers_comparison &&
449
+ paper_size == other.paper_size &&
450
+ sensitivity_of_comparison == other.sensitivity_of_comparison
451
+ end
452
+
453
+ # @see the `==` method
454
+ # @param [Object] Object to be compared
455
+ def eql?(other)
456
+ self == other
457
+ end
458
+
459
+ # Calculates hash code according to all attributes.
460
+ # @return [Fixnum] Hash code
461
+ def hash
462
+ [generate_summary_page, show_deleted_content, show_inserted_content, style_change_detection, inserted_items_style, deleted_items_style, changed_items_style, words_separator_chars, details_level, use_frames_for_del_ins_elements, calculate_component_coordinates, mark_changed_content, mark_nested_content, clone_metadata, meta_data, password_save_option, password, diagram_master_setting, original_size, header_footers_comparison, paper_size, sensitivity_of_comparison].hash
463
+ end
464
+
465
+ # Downcases first letter.
466
+ # @return downcased string
467
+ def uncap(str)
468
+ str[0, 1].downcase + str[1..-1]
469
+ end
470
+
471
+ # Builds the object from hash
472
+ # @param [Hash] attributes Model attributes in the form of hash
473
+ # @return [Object] Returns the model itself
474
+ def build_from_hash(attributes)
475
+ return nil unless attributes.is_a?(Hash)
476
+ self.class.swagger_types.each_pair do |key, type|
477
+ pname = uncap(self.class.attribute_map[key]).intern
478
+ value = attributes[pname]
479
+ if type =~ /\AArray<(.*)>/i
480
+ # check to ensure the input is an array given that the the attribute
481
+ # is documented as an array but the input is not
482
+ if value.is_a?(Array)
483
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
484
+ end
485
+ elsif !value.nil?
486
+ self.send("#{key}=", _deserialize(type, value))
487
+ end
488
+ # or else data not found in attributes(hash), not an issue as the data can be optional
489
+ end
490
+
491
+ self
492
+ end
493
+
494
+ # Deserializes the data based on type
495
+ # @param string type Data type
496
+ # @param string value Value to be deserialized
497
+ # @return [Object] Deserialized data
498
+ def _deserialize(type, value)
499
+ case type.to_sym
500
+ when :DateTime
501
+ Date.parse value
502
+ when :Date
503
+ Date.parse value
504
+ when :String
505
+ value.to_s
506
+ when :Integer
507
+ value.to_i
508
+ when :Float
509
+ value.to_f
510
+ when :BOOLEAN
511
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
512
+ true
513
+ else
514
+ false
515
+ end
516
+ when :Object
517
+ # generic object (usually a Hash), return directly
518
+ value
519
+ when /\AArray<(?<inner_type>.+)>\z/
520
+ inner_type = Regexp.last_match[:inner_type]
521
+ value.map { |v| _deserialize(inner_type, v) }
522
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
523
+ k_type = Regexp.last_match[:k_type]
524
+ v_type = Regexp.last_match[:v_type]
525
+ {}.tap do |hash|
526
+ value.each do |k, v|
527
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
528
+ end
529
+ end
530
+ else
531
+ # model
532
+ temp_model = GroupDocsComparisonCloud.const_get(type).new
533
+ temp_model.build_from_hash(value)
534
+ end
535
+ end
536
+
537
+ # Returns the string representation of the object
538
+ # @return [String] String presentation of the object
539
+ def to_s
540
+ to_hash.to_s
541
+ end
542
+
543
+ # to_body is an alias to to_hash (backward compatibility)
544
+ # @return [Hash] Returns the object in the form of hash
545
+ def to_body
546
+ to_hash
547
+ end
548
+
549
+ # Returns the object in the form of hash
550
+ # @return [Hash] Returns the object in the form of hash
551
+ def to_hash
552
+ hash = {}
553
+ self.class.attribute_map.each_pair do |attr, param|
554
+ value = self.send(attr)
555
+ next if value.nil?
556
+ hash[param] = _to_hash(value)
557
+ end
558
+ hash
559
+ end
560
+
561
+ # Outputs non-array value in the form of hash
562
+ # For object, use to_hash. Otherwise, just return the value
563
+ # @param [Object] value Any valid value
564
+ # @return [Hash] Returns the value in the form of hash
565
+ def _to_hash(value)
566
+ if value.is_a?(Array)
567
+ value.compact.map { |v| _to_hash(v) }
568
+ elsif value.is_a?(Hash)
569
+ {}.tap do |hash|
570
+ value.each { |k, v| hash[k] = _to_hash(v) }
571
+ end
572
+ elsif value.respond_to? :to_hash
573
+ value.to_hash
574
+ else
575
+ value
576
+ end
577
+ end
578
+
579
+ end
580
+
581
+ end