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,254 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="presentation_load_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 editing documents of all supportable Presentation (PowerPoint-compatible) formats
32
+ class PresentationLoadOptions
33
+
34
+ # File info
35
+ attr_accessor :file_info
36
+
37
+ # The full output path
38
+ attr_accessor :output_path
39
+
40
+ # Allows to specify the slide number, which should be opened for editing
41
+ attr_accessor :slide_number
42
+
43
+ # Specifies whether the hidden slides should be included or not. Default is false - hidden slides are not shown and exception will be thrown while trying to edit
44
+ attr_accessor :show_hidden_slides
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'file_info' => :'FileInfo',
50
+ :'output_path' => :'OutputPath',
51
+ :'slide_number' => :'SlideNumber',
52
+ :'show_hidden_slides' => :'ShowHiddenSlides'
53
+ }
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ {
59
+ :'file_info' => :'FileInfo',
60
+ :'output_path' => :'String',
61
+ :'slide_number' => :'Integer',
62
+ :'show_hidden_slides' => :'BOOLEAN'
63
+ }
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ return unless attributes.is_a?(Hash)
70
+
71
+ # convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
73
+
74
+ if attributes.key?(:'FileInfo')
75
+ self.file_info = attributes[:'FileInfo']
76
+ end
77
+
78
+ if attributes.key?(:'OutputPath')
79
+ self.output_path = attributes[:'OutputPath']
80
+ end
81
+
82
+ if attributes.key?(:'SlideNumber')
83
+ self.slide_number = attributes[:'SlideNumber']
84
+ end
85
+
86
+ if attributes.key?(:'ShowHiddenSlides')
87
+ self.show_hidden_slides = attributes[:'ShowHiddenSlides']
88
+ end
89
+
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properies with the reasons
94
+ def list_invalid_properties
95
+ invalid_properties = []
96
+ if @slide_number.nil?
97
+ invalid_properties.push("invalid value for 'slide_number', slide_number cannot be nil.")
98
+ end
99
+
100
+ if @show_hidden_slides.nil?
101
+ invalid_properties.push("invalid value for 'show_hidden_slides', show_hidden_slides cannot be nil.")
102
+ end
103
+
104
+ return invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ return false if @slide_number.nil?
111
+ return false if @show_hidden_slides.nil?
112
+ return true
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(other)
118
+ return true if self.equal?(other)
119
+ self.class == other.class &&
120
+ file_info == other.file_info &&
121
+ output_path == other.output_path &&
122
+ slide_number == other.slide_number &&
123
+ show_hidden_slides == other.show_hidden_slides
124
+ end
125
+
126
+ # @see the `==` method
127
+ # @param [Object] Object to be compared
128
+ def eql?(other)
129
+ self == other
130
+ end
131
+
132
+ # Calculates hash code according to all attributes.
133
+ # @return [Fixnum] Hash code
134
+ def hash
135
+ [file_info, output_path, slide_number, show_hidden_slides].hash
136
+ end
137
+
138
+ # Downcases first letter.
139
+ # @return downcased string
140
+ def uncap(str)
141
+ str[0, 1].downcase + str[1..-1]
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def build_from_hash(attributes)
148
+ return nil unless attributes.is_a?(Hash)
149
+ self.class.swagger_types.each_pair do |key, type|
150
+ pname = uncap(self.class.attribute_map[key]).intern
151
+ value = attributes[pname]
152
+ if type =~ /\AArray<(.*)>/i
153
+ # check to ensure the input is an array given that the the attribute
154
+ # is documented as an array but the input is not
155
+ if value.is_a?(Array)
156
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
157
+ end
158
+ elsif !value.nil?
159
+ self.send("#{key}=", _deserialize(type, value))
160
+ end
161
+ # or else data not found in attributes(hash), not an issue as the data can be optional
162
+ end
163
+
164
+ self
165
+ end
166
+
167
+ # Deserializes the data based on type
168
+ # @param string type Data type
169
+ # @param string value Value to be deserialized
170
+ # @return [Object] Deserialized data
171
+ def _deserialize(type, value)
172
+ case type.to_sym
173
+ when :DateTime
174
+ Date.parse value
175
+ when :Date
176
+ Date.parse value
177
+ when :String
178
+ value.to_s
179
+ when :Integer
180
+ value.to_i
181
+ when :Float
182
+ value.to_f
183
+ when :BOOLEAN
184
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
185
+ true
186
+ else
187
+ false
188
+ end
189
+ when :Object
190
+ # generic object (usually a Hash), return directly
191
+ value
192
+ when /\AArray<(?<inner_type>.+)>\z/
193
+ inner_type = Regexp.last_match[:inner_type]
194
+ value.map { |v| _deserialize(inner_type, v) }
195
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
196
+ k_type = Regexp.last_match[:k_type]
197
+ v_type = Regexp.last_match[:v_type]
198
+ {}.tap do |hash|
199
+ value.each do |k, v|
200
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
201
+ end
202
+ end
203
+ else
204
+ # model
205
+ temp_model = GroupDocsEditorCloud.const_get(type).new
206
+ temp_model.build_from_hash(value)
207
+ end
208
+ end
209
+
210
+ # Returns the string representation of the object
211
+ # @return [String] String presentation of the object
212
+ def to_s
213
+ to_hash.to_s
214
+ end
215
+
216
+ # to_body is an alias to to_hash (backward compatibility)
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_body
219
+ to_hash
220
+ end
221
+
222
+ # Returns the object in the form of hash
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_hash
225
+ hash = {}
226
+ self.class.attribute_map.each_pair do |attr, param|
227
+ value = self.send(attr)
228
+ next if value.nil?
229
+ hash[param] = _to_hash(value)
230
+ end
231
+ hash
232
+ end
233
+
234
+ # Outputs non-array value in the form of hash
235
+ # For object, use to_hash. Otherwise, just return the value
236
+ # @param [Object] value Any valid value
237
+ # @return [Hash] Returns the value in the form of hash
238
+ def _to_hash(value)
239
+ if value.is_a?(Array)
240
+ value.compact.map { |v| _to_hash(v) }
241
+ elsif value.is_a?(Hash)
242
+ {}.tap do |hash|
243
+ value.each { |k, v| hash[k] = _to_hash(v) }
244
+ end
245
+ elsif value.respond_to? :to_hash
246
+ value.to_hash
247
+ else
248
+ value
249
+ end
250
+ end
251
+
252
+ end
253
+
254
+ end
@@ -0,0 +1,264 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="presentation_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 Presentation (PowerPoint-compatible) documents
32
+ class PresentationSaveOptions
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
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'file_info' => :'FileInfo',
56
+ :'output_path' => :'OutputPath',
57
+ :'html_path' => :'HtmlPath',
58
+ :'resources_path' => :'ResourcesPath',
59
+ :'format' => :'Format',
60
+ :'password' => :'Password'
61
+ }
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.swagger_types
66
+ {
67
+ :'file_info' => :'FileInfo',
68
+ :'output_path' => :'String',
69
+ :'html_path' => :'String',
70
+ :'resources_path' => :'String',
71
+ :'format' => :'String',
72
+ :'password' => :'String'
73
+ }
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ return unless attributes.is_a?(Hash)
80
+
81
+ # convert string to symbol for hash key
82
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
83
+
84
+ if attributes.key?(:'FileInfo')
85
+ self.file_info = attributes[:'FileInfo']
86
+ end
87
+
88
+ if attributes.key?(:'OutputPath')
89
+ self.output_path = attributes[:'OutputPath']
90
+ end
91
+
92
+ if attributes.key?(:'HtmlPath')
93
+ self.html_path = attributes[:'HtmlPath']
94
+ end
95
+
96
+ if attributes.key?(:'ResourcesPath')
97
+ self.resources_path = attributes[:'ResourcesPath']
98
+ end
99
+
100
+ if attributes.key?(:'Format')
101
+ self.format = attributes[:'Format']
102
+ end
103
+
104
+ if attributes.key?(:'Password')
105
+ self.password = attributes[:'Password']
106
+ end
107
+
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properies with the reasons
112
+ def list_invalid_properties
113
+ invalid_properties = []
114
+ return invalid_properties
115
+ end
116
+
117
+ # Check to see if the all the properties in the model are valid
118
+ # @return true if the model is valid
119
+ def valid?
120
+ return true
121
+ end
122
+
123
+ # Checks equality by comparing each attribute.
124
+ # @param [Object] Object to be compared
125
+ def ==(other)
126
+ return true if self.equal?(other)
127
+ self.class == other.class &&
128
+ file_info == other.file_info &&
129
+ output_path == other.output_path &&
130
+ html_path == other.html_path &&
131
+ resources_path == other.resources_path &&
132
+ format == other.format &&
133
+ password == other.password
134
+ end
135
+
136
+ # @see the `==` method
137
+ # @param [Object] Object to be compared
138
+ def eql?(other)
139
+ self == other
140
+ end
141
+
142
+ # Calculates hash code according to all attributes.
143
+ # @return [Fixnum] Hash code
144
+ def hash
145
+ [file_info, output_path, html_path, resources_path, format, password].hash
146
+ end
147
+
148
+ # Downcases first letter.
149
+ # @return downcased string
150
+ def uncap(str)
151
+ str[0, 1].downcase + str[1..-1]
152
+ end
153
+
154
+ # Builds the object from hash
155
+ # @param [Hash] attributes Model attributes in the form of hash
156
+ # @return [Object] Returns the model itself
157
+ def build_from_hash(attributes)
158
+ return nil unless attributes.is_a?(Hash)
159
+ self.class.swagger_types.each_pair do |key, type|
160
+ pname = uncap(self.class.attribute_map[key]).intern
161
+ value = attributes[pname]
162
+ if type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the the attribute
164
+ # is documented as an array but the input is not
165
+ if value.is_a?(Array)
166
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
167
+ end
168
+ elsif !value.nil?
169
+ self.send("#{key}=", _deserialize(type, value))
170
+ end
171
+ # or else data not found in attributes(hash), not an issue as the data can be optional
172
+ end
173
+
174
+ self
175
+ end
176
+
177
+ # Deserializes the data based on type
178
+ # @param string type Data type
179
+ # @param string value Value to be deserialized
180
+ # @return [Object] Deserialized data
181
+ def _deserialize(type, value)
182
+ case type.to_sym
183
+ when :DateTime
184
+ Date.parse value
185
+ when :Date
186
+ Date.parse value
187
+ when :String
188
+ value.to_s
189
+ when :Integer
190
+ value.to_i
191
+ when :Float
192
+ value.to_f
193
+ when :BOOLEAN
194
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
195
+ true
196
+ else
197
+ false
198
+ end
199
+ when :Object
200
+ # generic object (usually a Hash), return directly
201
+ value
202
+ when /\AArray<(?<inner_type>.+)>\z/
203
+ inner_type = Regexp.last_match[:inner_type]
204
+ value.map { |v| _deserialize(inner_type, v) }
205
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
206
+ k_type = Regexp.last_match[:k_type]
207
+ v_type = Regexp.last_match[:v_type]
208
+ {}.tap do |hash|
209
+ value.each do |k, v|
210
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
211
+ end
212
+ end
213
+ else
214
+ # model
215
+ temp_model = GroupDocsEditorCloud.const_get(type).new
216
+ temp_model.build_from_hash(value)
217
+ end
218
+ end
219
+
220
+ # Returns the string representation of the object
221
+ # @return [String] String presentation of the object
222
+ def to_s
223
+ to_hash.to_s
224
+ end
225
+
226
+ # to_body is an alias to to_hash (backward compatibility)
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_body
229
+ to_hash
230
+ end
231
+
232
+ # Returns the object in the form of hash
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_hash
235
+ hash = {}
236
+ self.class.attribute_map.each_pair do |attr, param|
237
+ value = self.send(attr)
238
+ next if value.nil?
239
+ hash[param] = _to_hash(value)
240
+ end
241
+ hash
242
+ end
243
+
244
+ # Outputs non-array value in the form of hash
245
+ # For object, use to_hash. Otherwise, just return the value
246
+ # @param [Object] value Any valid value
247
+ # @return [Hash] Returns the value in the form of hash
248
+ def _to_hash(value)
249
+ if value.is_a?(Array)
250
+ value.compact.map { |v| _to_hash(v) }
251
+ elsif value.is_a?(Hash)
252
+ {}.tap do |hash|
253
+ value.each { |k, v| hash[k] = _to_hash(v) }
254
+ end
255
+ elsif value.respond_to? :to_hash
256
+ value.to_hash
257
+ else
258
+ value
259
+ end
260
+ end
261
+
262
+ end
263
+
264
+ end