groupdocs_editor_cloud 19.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +7 -0
  2. data/lib/groupdocs_editor_cloud.rb +70 -0
  3. data/lib/groupdocs_editor_cloud/api/edit_api.rb +314 -0
  4. data/lib/groupdocs_editor_cloud/api/file_api.rb +729 -0
  5. data/lib/groupdocs_editor_cloud/api/folder_api.rb +694 -0
  6. data/lib/groupdocs_editor_cloud/api/info_api.rb +266 -0
  7. data/lib/groupdocs_editor_cloud/api/storage_api.rb +541 -0
  8. data/lib/groupdocs_editor_cloud/api_client.rb +380 -0
  9. data/lib/groupdocs_editor_cloud/api_error.rb +58 -0
  10. data/lib/groupdocs_editor_cloud/configuration.rb +95 -0
  11. data/lib/groupdocs_editor_cloud/models/delimited_text_load_options.rb +279 -0
  12. data/lib/groupdocs_editor_cloud/models/delimited_text_save_options.rb +304 -0
  13. data/lib/groupdocs_editor_cloud/models/disc_usage.rb +234 -0
  14. data/lib/groupdocs_editor_cloud/models/document_result.rb +214 -0
  15. data/lib/groupdocs_editor_cloud/models/error.rb +244 -0
  16. data/lib/groupdocs_editor_cloud/models/error_details.rb +229 -0
  17. data/lib/groupdocs_editor_cloud/models/file_info.rb +244 -0
  18. data/lib/groupdocs_editor_cloud/models/file_version.rb +289 -0
  19. data/lib/groupdocs_editor_cloud/models/file_versions.rb +216 -0
  20. data/lib/groupdocs_editor_cloud/models/files_list.rb +216 -0
  21. data/lib/groupdocs_editor_cloud/models/files_upload_result.rb +228 -0
  22. data/lib/groupdocs_editor_cloud/models/format.rb +224 -0
  23. data/lib/groupdocs_editor_cloud/models/formats_result.rb +216 -0
  24. data/lib/groupdocs_editor_cloud/models/info_result.rb +269 -0
  25. data/lib/groupdocs_editor_cloud/models/load_options.rb +224 -0
  26. data/lib/groupdocs_editor_cloud/models/load_result.rb +224 -0
  27. data/lib/groupdocs_editor_cloud/models/object_exist.rb +234 -0
  28. data/lib/groupdocs_editor_cloud/models/options.rb +224 -0
  29. data/lib/groupdocs_editor_cloud/models/pdf_save_options.rb +316 -0
  30. data/lib/groupdocs_editor_cloud/models/presentation_load_options.rb +254 -0
  31. data/lib/groupdocs_editor_cloud/models/presentation_save_options.rb +264 -0
  32. data/lib/groupdocs_editor_cloud/models/save_options.rb +254 -0
  33. data/lib/groupdocs_editor_cloud/models/spreadsheet_load_options.rb +254 -0
  34. data/lib/groupdocs_editor_cloud/models/spreadsheet_save_options.rb +326 -0
  35. data/lib/groupdocs_editor_cloud/models/storage_exist.rb +219 -0
  36. data/lib/groupdocs_editor_cloud/models/storage_file.rb +264 -0
  37. data/lib/groupdocs_editor_cloud/models/text_load_options.rb +347 -0
  38. data/lib/groupdocs_editor_cloud/models/text_save_options.rb +294 -0
  39. data/lib/groupdocs_editor_cloud/models/word_processing_load_options.rb +306 -0
  40. data/lib/groupdocs_editor_cloud/models/word_processing_save_options.rb +371 -0
  41. data/lib/groupdocs_editor_cloud/models/xml_load_options.rb +346 -0
  42. data/lib/groupdocs_editor_cloud/version.rb +29 -0
  43. metadata +153 -0
@@ -0,0 +1,326 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="spreadsheet_save_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 GroupDocsEditorCloud
31
+ # Allows to specify custom options for generating and saving Spreadsheet (Excel-compliant) documents
32
+ class SpreadsheetSaveOptions
33
+
34
+ # File info
35
+ attr_accessor :file_info
36
+
37
+ # The full output path
38
+ attr_accessor :output_path
39
+
40
+ # The Html document path
41
+ attr_accessor :html_path
42
+
43
+ # Resources path
44
+ attr_accessor :resources_path
45
+
46
+ # Document format
47
+ attr_accessor :format
48
+
49
+ # Allows to specify document password
50
+ attr_accessor :password
51
+
52
+ # Write-protection type. Default value is None.
53
+ attr_accessor :protection_type
54
+
55
+ # Write-protection password. Used when protection type is specified.
56
+ attr_accessor :protection_password
57
+ class EnumAttributeValidator
58
+ attr_reader :datatype
59
+ attr_reader :allowable_values
60
+
61
+ def initialize(datatype, allowable_values)
62
+ @allowable_values = allowable_values.map do |value|
63
+ case datatype.to_s
64
+ when /Integer/i
65
+ value.to_i
66
+ when /Float/i
67
+ value.to_f
68
+ else
69
+ value
70
+ end
71
+ end
72
+ end
73
+
74
+ def valid?(value)
75
+ !value || allowable_values.include?(value)
76
+ end
77
+ end
78
+
79
+ # Attribute mapping from ruby-style variable name to JSON key.
80
+ def self.attribute_map
81
+ {
82
+ :'file_info' => :'FileInfo',
83
+ :'output_path' => :'OutputPath',
84
+ :'html_path' => :'HtmlPath',
85
+ :'resources_path' => :'ResourcesPath',
86
+ :'format' => :'Format',
87
+ :'password' => :'Password',
88
+ :'protection_type' => :'ProtectionType',
89
+ :'protection_password' => :'ProtectionPassword'
90
+ }
91
+ end
92
+
93
+ # Attribute type mapping.
94
+ def self.swagger_types
95
+ {
96
+ :'file_info' => :'FileInfo',
97
+ :'output_path' => :'String',
98
+ :'html_path' => :'String',
99
+ :'resources_path' => :'String',
100
+ :'format' => :'String',
101
+ :'password' => :'String',
102
+ :'protection_type' => :'String',
103
+ :'protection_password' => :'String'
104
+ }
105
+ end
106
+
107
+ # Initializes the object
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ def initialize(attributes = {})
110
+ return unless attributes.is_a?(Hash)
111
+
112
+ # convert string to symbol for hash key
113
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
114
+
115
+ if attributes.key?(:'FileInfo')
116
+ self.file_info = attributes[:'FileInfo']
117
+ end
118
+
119
+ if attributes.key?(:'OutputPath')
120
+ self.output_path = attributes[:'OutputPath']
121
+ end
122
+
123
+ if attributes.key?(:'HtmlPath')
124
+ self.html_path = attributes[:'HtmlPath']
125
+ end
126
+
127
+ if attributes.key?(:'ResourcesPath')
128
+ self.resources_path = attributes[:'ResourcesPath']
129
+ end
130
+
131
+ if attributes.key?(:'Format')
132
+ self.format = attributes[:'Format']
133
+ end
134
+
135
+ if attributes.key?(:'Password')
136
+ self.password = attributes[:'Password']
137
+ end
138
+
139
+ if attributes.key?(:'ProtectionType')
140
+ self.protection_type = attributes[:'ProtectionType']
141
+ end
142
+
143
+ if attributes.key?(:'ProtectionPassword')
144
+ self.protection_password = attributes[:'ProtectionPassword']
145
+ end
146
+
147
+ end
148
+
149
+ # Show invalid properties with the reasons. Usually used together with valid?
150
+ # @return Array for valid properies with the reasons
151
+ def list_invalid_properties
152
+ invalid_properties = []
153
+ if @protection_type.nil?
154
+ invalid_properties.push("invalid value for 'protection_type', protection_type cannot be nil.")
155
+ end
156
+
157
+ return invalid_properties
158
+ end
159
+
160
+ # Check to see if the all the properties in the model are valid
161
+ # @return true if the model is valid
162
+ def valid?
163
+ return false if @protection_type.nil?
164
+ protection_type_validator = EnumAttributeValidator.new('String', ["None", "All", "Contents", "Objects", "Scenarios", "Structure", "Window"])
165
+ return false unless protection_type_validator.valid?(@protection_type)
166
+ return true
167
+ end
168
+
169
+ # Custom attribute writer method checking allowed values (enum).
170
+ # @param [Object] protection_type Object to be assigned
171
+ def protection_type=(protection_type)
172
+ validator = EnumAttributeValidator.new('String', ["None", "All", "Contents", "Objects", "Scenarios", "Structure", "Window"])
173
+ if protection_type.to_i == 0
174
+ unless validator.valid?(protection_type)
175
+ raise ArgumentError, "invalid value for 'protection_type', must be one of #{validator.allowable_values}."
176
+ end
177
+ @protection_type = protection_type
178
+ else
179
+ @protection_type = validator.allowable_values[protection_type.to_i]
180
+ end
181
+ end
182
+
183
+ # Checks equality by comparing each attribute.
184
+ # @param [Object] Object to be compared
185
+ def ==(other)
186
+ return true if self.equal?(other)
187
+ self.class == other.class &&
188
+ file_info == other.file_info &&
189
+ output_path == other.output_path &&
190
+ html_path == other.html_path &&
191
+ resources_path == other.resources_path &&
192
+ format == other.format &&
193
+ password == other.password &&
194
+ protection_type == other.protection_type &&
195
+ protection_password == other.protection_password
196
+ end
197
+
198
+ # @see the `==` method
199
+ # @param [Object] Object to be compared
200
+ def eql?(other)
201
+ self == other
202
+ end
203
+
204
+ # Calculates hash code according to all attributes.
205
+ # @return [Fixnum] Hash code
206
+ def hash
207
+ [file_info, output_path, html_path, resources_path, format, password, protection_type, protection_password].hash
208
+ end
209
+
210
+ # Downcases first letter.
211
+ # @return downcased string
212
+ def uncap(str)
213
+ str[0, 1].downcase + str[1..-1]
214
+ end
215
+
216
+ # Builds the object from hash
217
+ # @param [Hash] attributes Model attributes in the form of hash
218
+ # @return [Object] Returns the model itself
219
+ def build_from_hash(attributes)
220
+ return nil unless attributes.is_a?(Hash)
221
+ self.class.swagger_types.each_pair do |key, type|
222
+ pname = uncap(self.class.attribute_map[key]).intern
223
+ value = attributes[pname]
224
+ if type =~ /\AArray<(.*)>/i
225
+ # check to ensure the input is an array given that the the attribute
226
+ # is documented as an array but the input is not
227
+ if value.is_a?(Array)
228
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
229
+ end
230
+ elsif !value.nil?
231
+ self.send("#{key}=", _deserialize(type, value))
232
+ end
233
+ # or else data not found in attributes(hash), not an issue as the data can be optional
234
+ end
235
+
236
+ self
237
+ end
238
+
239
+ # Deserializes the data based on type
240
+ # @param string type Data type
241
+ # @param string value Value to be deserialized
242
+ # @return [Object] Deserialized data
243
+ def _deserialize(type, value)
244
+ case type.to_sym
245
+ when :DateTime
246
+ Date.parse value
247
+ when :Date
248
+ Date.parse value
249
+ when :String
250
+ value.to_s
251
+ when :Integer
252
+ value.to_i
253
+ when :Float
254
+ value.to_f
255
+ when :BOOLEAN
256
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
257
+ true
258
+ else
259
+ false
260
+ end
261
+ when :Object
262
+ # generic object (usually a Hash), return directly
263
+ value
264
+ when /\AArray<(?<inner_type>.+)>\z/
265
+ inner_type = Regexp.last_match[:inner_type]
266
+ value.map { |v| _deserialize(inner_type, v) }
267
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
268
+ k_type = Regexp.last_match[:k_type]
269
+ v_type = Regexp.last_match[:v_type]
270
+ {}.tap do |hash|
271
+ value.each do |k, v|
272
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
273
+ end
274
+ end
275
+ else
276
+ # model
277
+ temp_model = GroupDocsEditorCloud.const_get(type).new
278
+ temp_model.build_from_hash(value)
279
+ end
280
+ end
281
+
282
+ # Returns the string representation of the object
283
+ # @return [String] String presentation of the object
284
+ def to_s
285
+ to_hash.to_s
286
+ end
287
+
288
+ # to_body is an alias to to_hash (backward compatibility)
289
+ # @return [Hash] Returns the object in the form of hash
290
+ def to_body
291
+ to_hash
292
+ end
293
+
294
+ # Returns the object in the form of hash
295
+ # @return [Hash] Returns the object in the form of hash
296
+ def to_hash
297
+ hash = {}
298
+ self.class.attribute_map.each_pair do |attr, param|
299
+ value = self.send(attr)
300
+ next if value.nil?
301
+ hash[param] = _to_hash(value)
302
+ end
303
+ hash
304
+ end
305
+
306
+ # Outputs non-array value in the form of hash
307
+ # For object, use to_hash. Otherwise, just return the value
308
+ # @param [Object] value Any valid value
309
+ # @return [Hash] Returns the value in the form of hash
310
+ def _to_hash(value)
311
+ if value.is_a?(Array)
312
+ value.compact.map { |v| _to_hash(v) }
313
+ elsif value.is_a?(Hash)
314
+ {}.tap do |hash|
315
+ value.each { |k, v| hash[k] = _to_hash(v) }
316
+ end
317
+ elsif value.respond_to? :to_hash
318
+ value.to_hash
319
+ else
320
+ value
321
+ end
322
+ end
323
+
324
+ end
325
+
326
+ end
@@ -0,0 +1,219 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="storage_exist.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 GroupDocsEditorCloud
31
+ # Storage exists
32
+ class StorageExist
33
+
34
+ # Shows that the storage exists.
35
+ attr_accessor :exists
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'exists' => :'Exists'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+ :'exists' => :'BOOLEAN'
48
+ }
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ return unless attributes.is_a?(Hash)
55
+
56
+ # convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
58
+
59
+ if attributes.key?(:'Exists')
60
+ self.exists = attributes[:'Exists']
61
+ end
62
+
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properies with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = []
69
+ if @exists.nil?
70
+ invalid_properties.push("invalid value for 'exists', exists cannot be nil.")
71
+ end
72
+
73
+ return invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return false if @exists.nil?
80
+ return true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(other)
86
+ return true if self.equal?(other)
87
+ self.class == other.class &&
88
+ exists == other.exists
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(other)
94
+ self == other
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Fixnum] Hash code
99
+ def hash
100
+ [exists].hash
101
+ end
102
+
103
+ # Downcases first letter.
104
+ # @return downcased string
105
+ def uncap(str)
106
+ str[0, 1].downcase + str[1..-1]
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ self.class.swagger_types.each_pair do |key, type|
115
+ pname = uncap(self.class.attribute_map[key]).intern
116
+ value = attributes[pname]
117
+ if type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the the attribute
119
+ # is documented as an array but the input is not
120
+ if value.is_a?(Array)
121
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
122
+ end
123
+ elsif !value.nil?
124
+ self.send("#{key}=", _deserialize(type, value))
125
+ end
126
+ # or else data not found in attributes(hash), not an issue as the data can be optional
127
+ end
128
+
129
+ self
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def _deserialize(type, value)
137
+ case type.to_sym
138
+ when :DateTime
139
+ Date.parse value
140
+ when :Date
141
+ Date.parse value
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :BOOLEAN
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else
169
+ # model
170
+ temp_model = GroupDocsEditorCloud.const_get(type).new
171
+ temp_model.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ next if value.nil?
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+
217
+ end
218
+
219
+ end