groupdocs_comparison_cloud 19.5 → 20.5

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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_comparison_cloud.rb +6 -3
  3. data/lib/groupdocs_comparison_cloud/api/compare_api.rb +11 -11
  4. data/lib/groupdocs_comparison_cloud/api/file_api.rb +7 -7
  5. data/lib/groupdocs_comparison_cloud/api/folder_api.rb +7 -7
  6. data/lib/groupdocs_comparison_cloud/api/info_api.rb +98 -1
  7. data/lib/groupdocs_comparison_cloud/api/storage_api.rb +5 -5
  8. data/lib/groupdocs_comparison_cloud/api_client.rb +1 -1
  9. data/lib/groupdocs_comparison_cloud/api_error.rb +7 -4
  10. data/lib/groupdocs_comparison_cloud/configuration.rb +1 -1
  11. data/lib/groupdocs_comparison_cloud/models/change_info.rb +109 -11
  12. data/lib/groupdocs_comparison_cloud/models/comparison_options.rb +298 -0
  13. data/lib/groupdocs_comparison_cloud/models/diagram_master_setting.rb +5 -35
  14. data/lib/groupdocs_comparison_cloud/models/disc_usage.rb +1 -1
  15. data/lib/groupdocs_comparison_cloud/models/error.rb +1 -1
  16. data/lib/groupdocs_comparison_cloud/models/error_details.rb +1 -1
  17. data/lib/groupdocs_comparison_cloud/models/file_info.rb +1 -1
  18. data/lib/groupdocs_comparison_cloud/models/file_version.rb +1 -1
  19. data/lib/groupdocs_comparison_cloud/models/file_versions.rb +1 -1
  20. data/lib/groupdocs_comparison_cloud/models/files_list.rb +1 -1
  21. data/lib/groupdocs_comparison_cloud/models/files_upload_result.rb +1 -1
  22. data/lib/groupdocs_comparison_cloud/models/format.rb +1 -1
  23. data/lib/groupdocs_comparison_cloud/models/formats_result.rb +1 -1
  24. data/lib/groupdocs_comparison_cloud/models/info_result.rb +254 -0
  25. data/lib/groupdocs_comparison_cloud/models/items_style.rb +21 -6
  26. data/lib/groupdocs_comparison_cloud/models/link.rb +1 -1
  27. data/lib/groupdocs_comparison_cloud/models/metadata.rb +1 -1
  28. data/lib/groupdocs_comparison_cloud/models/object_exist.rb +1 -1
  29. data/lib/groupdocs_comparison_cloud/models/{options.rb → page_info.rb} +41 -38
  30. data/lib/groupdocs_comparison_cloud/models/rectangle.rb +264 -0
  31. data/lib/groupdocs_comparison_cloud/models/settings.rb +203 -28
  32. data/lib/groupdocs_comparison_cloud/models/{original_size.rb → size.rb} +6 -6
  33. data/lib/groupdocs_comparison_cloud/models/storage_exist.rb +1 -1
  34. data/lib/groupdocs_comparison_cloud/models/storage_file.rb +1 -1
  35. data/lib/groupdocs_comparison_cloud/models/style_change_info.rb +1 -1
  36. data/lib/groupdocs_comparison_cloud/models/updates_options.rb +55 -3
  37. data/lib/groupdocs_comparison_cloud/version.rb +2 -2
  38. metadata +7 -4
@@ -0,0 +1,298 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="comparison_options.rb">
4
+ # Copyright (c) 2003-2020 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 options
32
+ class ComparisonOptions
33
+
34
+ # Information about source file
35
+ attr_accessor :source_file
36
+
37
+ # Information about target file(s)
38
+ attr_accessor :target_files
39
+
40
+ # Comparison settings
41
+ attr_accessor :settings
42
+
43
+ # Changes type. Used only for Changes resource(/comparison/changes)
44
+ attr_accessor :change_type
45
+
46
+ # Path to the resultant document (if not specified the document will not be saved)
47
+ attr_accessor :output_path
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
+ :'source_file' => :'SourceFile',
74
+ :'target_files' => :'TargetFiles',
75
+ :'settings' => :'Settings',
76
+ :'change_type' => :'ChangeType',
77
+ :'output_path' => :'OutputPath'
78
+ }
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.swagger_types
83
+ {
84
+ :'source_file' => :'FileInfo',
85
+ :'target_files' => :'Array<FileInfo>',
86
+ :'settings' => :'Settings',
87
+ :'change_type' => :'String',
88
+ :'output_path' => :'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?(:'SourceFile')
101
+ self.source_file = attributes[:'SourceFile']
102
+ end
103
+
104
+ if attributes.key?(:'TargetFiles')
105
+ if (value = attributes[:'TargetFiles']).is_a?(Array)
106
+ self.target_files = value
107
+ end
108
+ end
109
+
110
+ if attributes.key?(:'Settings')
111
+ self.settings = attributes[:'Settings']
112
+ end
113
+
114
+ if attributes.key?(:'ChangeType')
115
+ self.change_type = attributes[:'ChangeType']
116
+ end
117
+
118
+ if attributes.key?(:'OutputPath')
119
+ self.output_path = attributes[:'OutputPath']
120
+ end
121
+
122
+ end
123
+
124
+ # Show invalid properties with the reasons. Usually used together with valid?
125
+ # @return Array for valid properies with the reasons
126
+ def list_invalid_properties
127
+ invalid_properties = []
128
+ if @change_type.nil?
129
+ invalid_properties.push("invalid value for 'change_type', change_type cannot be nil.")
130
+ end
131
+
132
+ return invalid_properties
133
+ end
134
+
135
+ # Check to see if the all the properties in the model are valid
136
+ # @return true if the model is valid
137
+ def valid?
138
+ return false if @change_type.nil?
139
+ change_type_validator = EnumAttributeValidator.new('String', ["None", "Modified", "Inserted", "Deleted", "Added", "NotModified", "StyleChanged", "Resized", "Moved", "MovedAndResized", "ShiftedAndResized"])
140
+ return false unless change_type_validator.valid?(@change_type)
141
+ return true
142
+ end
143
+
144
+ # Custom attribute writer method checking allowed values (enum).
145
+ # @param [Object] change_type Object to be assigned
146
+ def change_type=(change_type)
147
+ validator = EnumAttributeValidator.new('String', ["None", "Modified", "Inserted", "Deleted", "Added", "NotModified", "StyleChanged", "Resized", "Moved", "MovedAndResized", "ShiftedAndResized"])
148
+ if change_type.to_i == 0
149
+ unless validator.valid?(change_type)
150
+ raise ArgumentError, "invalid value for 'change_type', must be one of #{validator.allowable_values}."
151
+ end
152
+ @change_type = change_type
153
+ else
154
+ @change_type = validator.allowable_values[change_type.to_i]
155
+ end
156
+ end
157
+
158
+ # Checks equality by comparing each attribute.
159
+ # @param [Object] Object to be compared
160
+ def ==(other)
161
+ return true if self.equal?(other)
162
+ self.class == other.class &&
163
+ source_file == other.source_file &&
164
+ target_files == other.target_files &&
165
+ settings == other.settings &&
166
+ change_type == other.change_type &&
167
+ output_path == other.output_path
168
+ end
169
+
170
+ # @see the `==` method
171
+ # @param [Object] Object to be compared
172
+ def eql?(other)
173
+ self == other
174
+ end
175
+
176
+ # Calculates hash code according to all attributes.
177
+ # @return [Fixnum] Hash code
178
+ def hash
179
+ [source_file, target_files, settings, change_type, output_path].hash
180
+ end
181
+
182
+ # Downcases first letter.
183
+ # @return downcased string
184
+ def uncap(str)
185
+ str[0, 1].downcase + str[1..-1]
186
+ end
187
+
188
+ # Builds the object from hash
189
+ # @param [Hash] attributes Model attributes in the form of hash
190
+ # @return [Object] Returns the model itself
191
+ def build_from_hash(attributes)
192
+ return nil unless attributes.is_a?(Hash)
193
+ self.class.swagger_types.each_pair do |key, type|
194
+ pname = uncap(self.class.attribute_map[key]).intern
195
+ value = attributes[pname]
196
+ if type =~ /\AArray<(.*)>/i
197
+ # check to ensure the input is an array given that the the attribute
198
+ # is documented as an array but the input is not
199
+ if value.is_a?(Array)
200
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
201
+ end
202
+ elsif !value.nil?
203
+ self.send("#{key}=", _deserialize(type, value))
204
+ end
205
+ # or else data not found in attributes(hash), not an issue as the data can be optional
206
+ end
207
+
208
+ self
209
+ end
210
+
211
+ # Deserializes the data based on type
212
+ # @param string type Data type
213
+ # @param string value Value to be deserialized
214
+ # @return [Object] Deserialized data
215
+ def _deserialize(type, value)
216
+ case type.to_sym
217
+ when :DateTime
218
+ Date.parse value
219
+ when :Date
220
+ Date.parse value
221
+ when :String
222
+ value.to_s
223
+ when :Integer
224
+ value.to_i
225
+ when :Float
226
+ value.to_f
227
+ when :BOOLEAN
228
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
229
+ true
230
+ else
231
+ false
232
+ end
233
+ when :Object
234
+ # generic object (usually a Hash), return directly
235
+ value
236
+ when /\AArray<(?<inner_type>.+)>\z/
237
+ inner_type = Regexp.last_match[:inner_type]
238
+ value.map { |v| _deserialize(inner_type, v) }
239
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
240
+ k_type = Regexp.last_match[:k_type]
241
+ v_type = Regexp.last_match[:v_type]
242
+ {}.tap do |hash|
243
+ value.each do |k, v|
244
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
245
+ end
246
+ end
247
+ else
248
+ # model
249
+ temp_model = GroupDocsComparisonCloud.const_get(type).new
250
+ temp_model.build_from_hash(value)
251
+ end
252
+ end
253
+
254
+ # Returns the string representation of the object
255
+ # @return [String] String presentation of the object
256
+ def to_s
257
+ to_hash.to_s
258
+ end
259
+
260
+ # to_body is an alias to to_hash (backward compatibility)
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_body
263
+ to_hash
264
+ end
265
+
266
+ # Returns the object in the form of hash
267
+ # @return [Hash] Returns the object in the form of hash
268
+ def to_hash
269
+ hash = {}
270
+ self.class.attribute_map.each_pair do |attr, param|
271
+ value = self.send(attr)
272
+ next if value.nil?
273
+ hash[param] = _to_hash(value)
274
+ end
275
+ hash
276
+ end
277
+
278
+ # Outputs non-array value in the form of hash
279
+ # For object, use to_hash. Otherwise, just return the value
280
+ # @param [Object] value Any valid value
281
+ # @return [Hash] Returns the value in the form of hash
282
+ def _to_hash(value)
283
+ if value.is_a?(Array)
284
+ value.compact.map { |v| _to_hash(v) }
285
+ elsif value.is_a?(Hash)
286
+ {}.tap do |hash|
287
+ value.each { |k, v| hash[k] = _to_hash(v) }
288
+ end
289
+ elsif value.respond_to? :to_hash
290
+ value.to_hash
291
+ else
292
+ value
293
+ end
294
+ end
295
+
296
+ end
297
+
298
+ end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="diagram_master_setting.rb">
4
- # Copyright (c) 2003-2019 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2020 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -37,19 +37,11 @@ module GroupDocsComparisonCloud
37
37
  # Value of using master from source and target document together
38
38
  attr_accessor :use_source_master
39
39
 
40
- # Width of original document
41
- attr_accessor :width
42
-
43
- # Height of original document
44
- attr_accessor :height
45
-
46
40
  # Attribute mapping from ruby-style variable name to JSON key.
47
41
  def self.attribute_map
48
42
  {
49
43
  :'master_path' => :'MasterPath',
50
- :'use_source_master' => :'UseSourceMaster',
51
- :'width' => :'Width',
52
- :'height' => :'Height'
44
+ :'use_source_master' => :'UseSourceMaster'
53
45
  }
54
46
  end
55
47
 
@@ -57,9 +49,7 @@ module GroupDocsComparisonCloud
57
49
  def self.swagger_types
58
50
  {
59
51
  :'master_path' => :'String',
60
- :'use_source_master' => :'BOOLEAN',
61
- :'width' => :'Integer',
62
- :'height' => :'Integer'
52
+ :'use_source_master' => :'BOOLEAN'
63
53
  }
64
54
  end
65
55
 
@@ -79,14 +69,6 @@ module GroupDocsComparisonCloud
79
69
  self.use_source_master = attributes[:'UseSourceMaster']
80
70
  end
81
71
 
82
- if attributes.key?(:'Width')
83
- self.width = attributes[:'Width']
84
- end
85
-
86
- if attributes.key?(:'Height')
87
- self.height = attributes[:'Height']
88
- end
89
-
90
72
  end
91
73
 
92
74
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -97,14 +79,6 @@ module GroupDocsComparisonCloud
97
79
  invalid_properties.push("invalid value for 'use_source_master', use_source_master cannot be nil.")
98
80
  end
99
81
 
100
- if @width.nil?
101
- invalid_properties.push("invalid value for 'width', width cannot be nil.")
102
- end
103
-
104
- if @height.nil?
105
- invalid_properties.push("invalid value for 'height', height cannot be nil.")
106
- end
107
-
108
82
  return invalid_properties
109
83
  end
110
84
 
@@ -112,8 +86,6 @@ module GroupDocsComparisonCloud
112
86
  # @return true if the model is valid
113
87
  def valid?
114
88
  return false if @use_source_master.nil?
115
- return false if @width.nil?
116
- return false if @height.nil?
117
89
  return true
118
90
  end
119
91
 
@@ -123,9 +95,7 @@ module GroupDocsComparisonCloud
123
95
  return true if self.equal?(other)
124
96
  self.class == other.class &&
125
97
  master_path == other.master_path &&
126
- use_source_master == other.use_source_master &&
127
- width == other.width &&
128
- height == other.height
98
+ use_source_master == other.use_source_master
129
99
  end
130
100
 
131
101
  # @see the `==` method
@@ -137,7 +107,7 @@ module GroupDocsComparisonCloud
137
107
  # Calculates hash code according to all attributes.
138
108
  # @return [Fixnum] Hash code
139
109
  def hash
140
- [master_path, use_source_master, width, height].hash
110
+ [master_path, use_source_master].hash
141
111
  end
142
112
 
143
113
  # Downcases first letter.
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="disc_usage.rb">
4
- # Copyright (c) 2003-2019 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2020 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="error.rb">
4
- # Copyright (c) 2003-2019 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2020 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="error_details.rb">
4
- # Copyright (c) 2003-2019 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2020 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="file_info.rb">
4
- # Copyright (c) 2003-2019 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2020 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="file_version.rb">
4
- # Copyright (c) 2003-2019 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2020 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
3
  # <copyright company="Aspose Pty Ltd" file="file_versions.rb">
4
- # Copyright (c) 2003-2019 Aspose Pty Ltd
4
+ # Copyright (c) 2003-2020 Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy