groupdocs_comparison_cloud 18.9 → 19.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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_comparison_cloud.rb +28 -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 +169 -0
  7. data/lib/groupdocs_comparison_cloud/api/storage_api.rb +541 -0
  8. data/lib/groupdocs_comparison_cloud/api_client.rb +7 -17
  9. data/lib/groupdocs_comparison_cloud/api_error.rb +5 -3
  10. data/lib/groupdocs_comparison_cloud/configuration.rb +3 -3
  11. data/lib/groupdocs_comparison_cloud/models/{comparison_change.rb → change_info.rb} +57 -49
  12. data/lib/groupdocs_comparison_cloud/models/diagram_master_setting.rb +259 -0
  13. data/lib/groupdocs_comparison_cloud/models/disc_usage.rb +234 -0
  14. data/lib/groupdocs_comparison_cloud/models/error.rb +244 -0
  15. data/lib/groupdocs_comparison_cloud/models/{comparison_file_info.rb → error_details.rb} +39 -36
  16. data/lib/groupdocs_comparison_cloud/models/{style_settings_values.rb → file_info.rb} +51 -38
  17. data/lib/groupdocs_comparison_cloud/models/file_version.rb +289 -0
  18. data/lib/groupdocs_comparison_cloud/models/{value_type.rb → file_versions.rb} +33 -13
  19. data/lib/groupdocs_comparison_cloud/models/{comparison_changes_category_dto.rb → files_list.rb} +28 -30
  20. data/lib/groupdocs_comparison_cloud/models/files_upload_result.rb +228 -0
  21. data/lib/groupdocs_comparison_cloud/models/format.rb +224 -0
  22. data/lib/groupdocs_comparison_cloud/models/{comparison_style_change.rb → formats_result.rb} +29 -19
  23. data/lib/groupdocs_comparison_cloud/models/items_style.rb +289 -0
  24. data/lib/groupdocs_comparison_cloud/models/link.rb +16 -8
  25. data/lib/groupdocs_comparison_cloud/models/{comparison_metadata_values.rb → metadata.rb} +28 -20
  26. data/lib/groupdocs_comparison_cloud/models/object_exist.rb +234 -0
  27. data/lib/groupdocs_comparison_cloud/models/{comparison_request.rb → options.rb} +39 -33
  28. data/lib/groupdocs_comparison_cloud/models/original_size.rb +234 -0
  29. data/lib/groupdocs_comparison_cloud/models/{comparison_request_settings.rb → settings.rb} +98 -70
  30. data/lib/groupdocs_comparison_cloud/models/storage_exist.rb +219 -0
  31. data/lib/groupdocs_comparison_cloud/models/storage_file.rb +264 -0
  32. data/lib/groupdocs_comparison_cloud/models/style_change_info.rb +234 -0
  33. data/lib/groupdocs_comparison_cloud/models/updates_options.rb +258 -0
  34. data/lib/groupdocs_comparison_cloud/version.rb +2 -2
  35. metadata +29 -44
  36. data/lib/groupdocs_comparison_cloud/api/changes_api.rb +0 -470
  37. data/lib/groupdocs_comparison_cloud/api/comparison_api.rb +0 -365
  38. data/lib/groupdocs_comparison_cloud/models/color.rb +0 -1404
  39. data/lib/groupdocs_comparison_cloud/models/requests/comparison_images_request.rb +0 -49
  40. data/lib/groupdocs_comparison_cloud/models/requests/comparison_images_stream_request.rb +0 -45
  41. data/lib/groupdocs_comparison_cloud/models/requests/comparison_request.rb +0 -49
  42. data/lib/groupdocs_comparison_cloud/models/requests/comparison_stream_request.rb +0 -45
  43. data/lib/groupdocs_comparison_cloud/models/requests/post_categories_changes_request.rb +0 -49
  44. data/lib/groupdocs_comparison_cloud/models/requests/post_changes_request.rb +0 -45
  45. data/lib/groupdocs_comparison_cloud/models/requests/put_changes_document_request.rb +0 -49
  46. data/lib/groupdocs_comparison_cloud/models/requests/put_changes_document_stream_request.rb +0 -45
  47. data/lib/groupdocs_comparison_cloud/models/requests/put_changes_images_request.rb +0 -49
  48. 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="style_change_info.rb">
4
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
5
+ # </copyright>
6
+ # <summary>
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in all
15
+ # copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
24
+ # </summary>
25
+ # --------------------------------------------------------------------------------------------------------------------
26
+ #
27
+
28
+ require 'date'
29
+
30
+ module GroupDocsComparisonCloud
31
+ # StyleChangeInfo Object fields
32
+ class StyleChangeInfo
33
+
34
+ # Name of changed style
35
+ attr_accessor :changed_property
36
+
37
+ # Value of changed style from source document
38
+ attr_accessor :old_value
39
+
40
+ # Value of changed style from target document
41
+ attr_accessor :new_value
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'changed_property' => :'ChangedProperty',
47
+ :'old_value' => :'OldValue',
48
+ :'new_value' => :'NewValue'
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.swagger_types
54
+ {
55
+ :'changed_property' => :'String',
56
+ :'old_value' => :'String',
57
+ :'new_value' => :'String'
58
+ }
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ return unless attributes.is_a?(Hash)
65
+
66
+ # convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
68
+
69
+ if attributes.key?(:'ChangedProperty')
70
+ self.changed_property = attributes[:'ChangedProperty']
71
+ end
72
+
73
+ if attributes.key?(:'OldValue')
74
+ self.old_value = attributes[:'OldValue']
75
+ end
76
+
77
+ if attributes.key?(:'NewValue')
78
+ self.new_value = attributes[:'NewValue']
79
+ end
80
+
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properies with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = []
87
+ return invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ return true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(other)
99
+ return true if self.equal?(other)
100
+ self.class == other.class &&
101
+ changed_property == other.changed_property &&
102
+ old_value == other.old_value &&
103
+ new_value == other.new_value
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
+ [changed_property, old_value, new_value].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
@@ -0,0 +1,258 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="updates_options.rb">
4
+ # Copyright (c) 2003-2019 Aspose Pty Ltd
5
+ # </copyright>
6
+ # <summary>
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in all
15
+ # copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
24
+ # </summary>
25
+ # --------------------------------------------------------------------------------------------------------------------
26
+ #
27
+
28
+ require 'date'
29
+
30
+ module GroupDocsComparisonCloud
31
+ # Comparison option class for updates endpoint
32
+ class UpdatesOptions
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
+ # Path to the resultant document (if not specified the document will not be saved)
44
+ attr_accessor :output_path
45
+
46
+ # Changes to apply or reject. Used only for Changes resourse (/comparison/updates)
47
+ attr_accessor :changes
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'source_file' => :'SourceFile',
53
+ :'target_files' => :'TargetFiles',
54
+ :'settings' => :'Settings',
55
+ :'output_path' => :'OutputPath',
56
+ :'changes' => :'Changes'
57
+ }
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.swagger_types
62
+ {
63
+ :'source_file' => :'FileInfo',
64
+ :'target_files' => :'Array<FileInfo>',
65
+ :'settings' => :'Settings',
66
+ :'output_path' => :'String',
67
+ :'changes' => :'Array<ChangeInfo>'
68
+ }
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ return unless attributes.is_a?(Hash)
75
+
76
+ # convert string to symbol for hash key
77
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
78
+
79
+ if attributes.key?(:'SourceFile')
80
+ self.source_file = attributes[:'SourceFile']
81
+ end
82
+
83
+ if attributes.key?(:'TargetFiles')
84
+ if (value = attributes[:'TargetFiles']).is_a?(Array)
85
+ self.target_files = value
86
+ end
87
+ end
88
+
89
+ if attributes.key?(:'Settings')
90
+ self.settings = attributes[:'Settings']
91
+ end
92
+
93
+ if attributes.key?(:'OutputPath')
94
+ self.output_path = attributes[:'OutputPath']
95
+ end
96
+
97
+ if attributes.key?(:'Changes')
98
+ if (value = attributes[:'Changes']).is_a?(Array)
99
+ self.changes = value
100
+ end
101
+ end
102
+
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properies with the reasons
107
+ def list_invalid_properties
108
+ invalid_properties = []
109
+ return invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ return true
116
+ end
117
+
118
+ # Checks equality by comparing each attribute.
119
+ # @param [Object] Object to be compared
120
+ def ==(other)
121
+ return true if self.equal?(other)
122
+ self.class == other.class &&
123
+ source_file == other.source_file &&
124
+ target_files == other.target_files &&
125
+ settings == other.settings &&
126
+ output_path == other.output_path &&
127
+ changes == other.changes
128
+ end
129
+
130
+ # @see the `==` method
131
+ # @param [Object] Object to be compared
132
+ def eql?(other)
133
+ self == other
134
+ end
135
+
136
+ # Calculates hash code according to all attributes.
137
+ # @return [Fixnum] Hash code
138
+ def hash
139
+ [source_file, target_files, settings, output_path, changes].hash
140
+ end
141
+
142
+ # Downcases first letter.
143
+ # @return downcased string
144
+ def uncap(str)
145
+ str[0, 1].downcase + str[1..-1]
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def build_from_hash(attributes)
152
+ return nil unless attributes.is_a?(Hash)
153
+ self.class.swagger_types.each_pair do |key, type|
154
+ pname = uncap(self.class.attribute_map[key]).intern
155
+ value = attributes[pname]
156
+ if type =~ /\AArray<(.*)>/i
157
+ # check to ensure the input is an array given that the the attribute
158
+ # is documented as an array but the input is not
159
+ if value.is_a?(Array)
160
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
161
+ end
162
+ elsif !value.nil?
163
+ self.send("#{key}=", _deserialize(type, value))
164
+ end
165
+ # or else data not found in attributes(hash), not an issue as the data can be optional
166
+ end
167
+
168
+ self
169
+ end
170
+
171
+ # Deserializes the data based on type
172
+ # @param string type Data type
173
+ # @param string value Value to be deserialized
174
+ # @return [Object] Deserialized data
175
+ def _deserialize(type, value)
176
+ case type.to_sym
177
+ when :DateTime
178
+ Date.parse value
179
+ when :Date
180
+ Date.parse value
181
+ when :String
182
+ value.to_s
183
+ when :Integer
184
+ value.to_i
185
+ when :Float
186
+ value.to_f
187
+ when :BOOLEAN
188
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
189
+ true
190
+ else
191
+ false
192
+ end
193
+ when :Object
194
+ # generic object (usually a Hash), return directly
195
+ value
196
+ when /\AArray<(?<inner_type>.+)>\z/
197
+ inner_type = Regexp.last_match[:inner_type]
198
+ value.map { |v| _deserialize(inner_type, v) }
199
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
200
+ k_type = Regexp.last_match[:k_type]
201
+ v_type = Regexp.last_match[:v_type]
202
+ {}.tap do |hash|
203
+ value.each do |k, v|
204
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
205
+ end
206
+ end
207
+ else
208
+ # model
209
+ temp_model = GroupDocsComparisonCloud.const_get(type).new
210
+ temp_model.build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ next if value.nil?
233
+ hash[param] = _to_hash(value)
234
+ end
235
+ hash
236
+ end
237
+
238
+ # Outputs non-array value in the form of hash
239
+ # For object, use to_hash. Otherwise, just return the value
240
+ # @param [Object] value Any valid value
241
+ # @return [Hash] Returns the value in the form of hash
242
+ def _to_hash(value)
243
+ if value.is_a?(Array)
244
+ value.compact.map { |v| _to_hash(v) }
245
+ elsif value.is_a?(Hash)
246
+ {}.tap do |hash|
247
+ value.each { |k, v| hash[k] = _to_hash(v) }
248
+ end
249
+ elsif value.respond_to? :to_hash
250
+ value.to_hash
251
+ else
252
+ value
253
+ end
254
+ end
255
+
256
+ end
257
+
258
+ end