groupdocs_storage_cloud 18.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +7 -0
  2. data/lib/GroupDocs/Storage/api/storage_api.rb +982 -0
  3. data/lib/GroupDocs/Storage/api_client.rb +408 -0
  4. data/lib/GroupDocs/Storage/api_error.rb +54 -0
  5. data/lib/GroupDocs/Storage/configuration.rb +203 -0
  6. data/lib/GroupDocs/Storage/models/copy_file_response.rb +214 -0
  7. data/lib/GroupDocs/Storage/models/create_folder_response.rb +214 -0
  8. data/lib/GroupDocs/Storage/models/disc_usage.rb +219 -0
  9. data/lib/GroupDocs/Storage/models/disc_usage_response.rb +223 -0
  10. data/lib/GroupDocs/Storage/models/file_exist.rb +219 -0
  11. data/lib/GroupDocs/Storage/models/file_exist_response.rb +223 -0
  12. data/lib/GroupDocs/Storage/models/file_response.rb +265 -0
  13. data/lib/GroupDocs/Storage/models/file_version.rb +283 -0
  14. data/lib/GroupDocs/Storage/models/file_versions_response.rb +225 -0
  15. data/lib/GroupDocs/Storage/models/files_response.rb +225 -0
  16. data/lib/GroupDocs/Storage/models/group_docs_response.rb +214 -0
  17. data/lib/GroupDocs/Storage/models/move_file_response.rb +214 -0
  18. data/lib/GroupDocs/Storage/models/move_folder_response.rb +214 -0
  19. data/lib/GroupDocs/Storage/models/remove_file_response.rb +214 -0
  20. data/lib/GroupDocs/Storage/models/remove_folder_response.rb +214 -0
  21. data/lib/GroupDocs/Storage/models/requests/delete_file_request.rb +57 -0
  22. data/lib/GroupDocs/Storage/models/requests/delete_folder_request.rb +57 -0
  23. data/lib/GroupDocs/Storage/models/requests/get_disc_usage_request.rb +47 -0
  24. data/lib/GroupDocs/Storage/models/requests/get_download_request.rb +57 -0
  25. data/lib/GroupDocs/Storage/models/requests/get_is_exist_request.rb +57 -0
  26. data/lib/GroupDocs/Storage/models/requests/get_is_storage_exist_request.rb +47 -0
  27. data/lib/GroupDocs/Storage/models/requests/get_list_file_versions_request.rb +52 -0
  28. data/lib/GroupDocs/Storage/models/requests/get_list_files_request.rb +52 -0
  29. data/lib/GroupDocs/Storage/models/requests/post_move_file_request.rb +67 -0
  30. data/lib/GroupDocs/Storage/models/requests/post_move_folder_request.rb +62 -0
  31. data/lib/GroupDocs/Storage/models/requests/put_copy_folder_request.rb +62 -0
  32. data/lib/GroupDocs/Storage/models/requests/put_copy_request.rb +67 -0
  33. data/lib/GroupDocs/Storage/models/requests/put_create_folder_request.rb +57 -0
  34. data/lib/GroupDocs/Storage/models/requests/put_create_request.rb +62 -0
  35. data/lib/GroupDocs/Storage/models/storage_exist_response.rb +223 -0
  36. data/lib/GroupDocs/Storage/models/upload_response.rb +214 -0
  37. data/lib/GroupDocs/Storage/version.rb +29 -0
  38. data/lib/groupdocs_storage_cloud.rb +71 -0
  39. metadata +129 -0
@@ -0,0 +1,283 @@
1
+ module GroupDocsStorageCloud
2
+ #
3
+ # --------------------------------------------------------------------------------------------------------------------
4
+ # <copyright company="Aspose Pty Ltd" file="FileVersion.rb">
5
+ # Copyright (c) 2018 GroupDocs.Storage for Cloud
6
+ # </copyright>
7
+ # <summary>
8
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ # of this software and associated documentation files (the "Software"), to deal
10
+ # in the Software without restriction, including without limitation the rights
11
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ # copies of the Software, and to permit persons to whom the Software is
13
+ # furnished to do so, subject to the following conditions:
14
+ #
15
+ # The above copyright notice and this permission notice shall be included in all
16
+ # copies or substantial portions of the Software.
17
+ #
18
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ # SOFTWARE.
25
+ # </summary>
26
+ # --------------------------------------------------------------------------------------------------------------------
27
+ #
28
+
29
+
30
+ class FileVersion
31
+ attr_accessor :name
32
+
33
+ attr_accessor :is_folder
34
+
35
+ attr_accessor :modified_date
36
+
37
+ attr_accessor :size
38
+
39
+ attr_accessor :path
40
+
41
+ attr_accessor :is_directory
42
+
43
+ attr_accessor :version_id
44
+
45
+ attr_accessor :is_latest
46
+
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'name' => :'Name',
52
+ :'is_folder' => :'IsFolder',
53
+ :'modified_date' => :'ModifiedDate',
54
+ :'size' => :'Size',
55
+ :'path' => :'Path',
56
+ :'is_directory' => :'IsDirectory',
57
+ :'version_id' => :'VersionId',
58
+ :'is_latest' => :'IsLatest'
59
+ }
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.swagger_types
64
+ {
65
+ :'name' => :'String',
66
+ :'is_folder' => :'BOOLEAN',
67
+ :'modified_date' => :'DateTime',
68
+ :'size' => :'Integer',
69
+ :'path' => :'String',
70
+ :'is_directory' => :'BOOLEAN',
71
+ :'version_id' => :'String',
72
+ :'is_latest' => :'BOOLEAN'
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.has_key?(:'Name')
85
+ self.name = attributes[:'Name']
86
+ end
87
+
88
+ if attributes.has_key?(:'IsFolder')
89
+ self.is_folder = attributes[:'IsFolder']
90
+ end
91
+
92
+ if attributes.has_key?(:'ModifiedDate')
93
+ self.modified_date = attributes[:'ModifiedDate']
94
+ end
95
+
96
+ if attributes.has_key?(:'Size')
97
+ self.size = attributes[:'Size']
98
+ end
99
+
100
+ if attributes.has_key?(:'Path')
101
+ self.path = attributes[:'Path']
102
+ end
103
+
104
+ if attributes.has_key?(:'IsDirectory')
105
+ self.is_directory = attributes[:'IsDirectory']
106
+ end
107
+
108
+ if attributes.has_key?(:'VersionId')
109
+ self.version_id = attributes[:'VersionId']
110
+ end
111
+
112
+ if attributes.has_key?(:'IsLatest')
113
+ self.is_latest = attributes[:'IsLatest']
114
+ end
115
+
116
+ end
117
+
118
+ # Show invalid properties with the reasons. Usually used together with valid?
119
+ # @return Array for valid properies with the reasons
120
+ def list_invalid_properties
121
+ invalid_properties = Array.new
122
+ if @is_folder.nil?
123
+ invalid_properties.push("invalid value for 'is_folder', is_folder cannot be nil.")
124
+ end
125
+
126
+ if @modified_date.nil?
127
+ invalid_properties.push("invalid value for 'modified_date', modified_date cannot be nil.")
128
+ end
129
+
130
+ if @size.nil?
131
+ invalid_properties.push("invalid value for 'size', size cannot be nil.")
132
+ end
133
+
134
+ if @is_directory.nil?
135
+ invalid_properties.push("invalid value for 'is_directory', is_directory 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 @is_folder.nil?
145
+ return false if @modified_date.nil?
146
+ return false if @size.nil?
147
+ return false if @is_directory.nil?
148
+ return true
149
+ end
150
+
151
+ # Checks equality by comparing each attribute.
152
+ # @param [Object] Object to be compared
153
+ def ==(o)
154
+ return true if self.equal?(o)
155
+ self.class == o.class &&
156
+ name == o.name &&
157
+ is_folder == o.is_folder &&
158
+ modified_date == o.modified_date &&
159
+ size == o.size &&
160
+ path == o.path &&
161
+ is_directory == o.is_directory &&
162
+ version_id == o.version_id &&
163
+ is_latest == o.is_latest
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(o)
169
+ self == o
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Fixnum] Hash code
174
+ def hash
175
+ [name, is_folder, modified_date, size, path, is_directory, version_id, is_latest].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ self.class.swagger_types.each_pair do |key, type|
184
+ key_attr = self.class.attribute_map[key].to_s
185
+ key_attr[0] = key_attr[0].downcase
186
+ if type =~ /\AArray<(.*)>/i
187
+ # check to ensure the input is an array given that the the attribute
188
+ # is documented as an array but the input is not
189
+ if attributes[key_attr.to_sym].is_a?(Array)
190
+ self.send("#{key}=", attributes[key_attr.to_sym].map{ |v| _deserialize($1, v) } )
191
+ end
192
+ elsif !attributes[key_attr.to_sym].nil?
193
+ self.send("#{key}=", _deserialize(type, attributes[key_attr.to_sym]))
194
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
195
+ end
196
+ self
197
+ end
198
+
199
+ # Deserializes the data based on type
200
+ # @param string type Data type
201
+ # @param string value Value to be deserialized
202
+ # @return [Object] Deserialized data
203
+ def _deserialize(type, value)
204
+ case type.to_sym
205
+ when :DateTime
206
+ DateTime.parse value
207
+ when :Date
208
+ Date.parse value
209
+ when :String
210
+ value.to_s
211
+ when :Integer
212
+ value.to_i
213
+ when :Float
214
+ value.to_f
215
+ when :BOOLEAN
216
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
217
+ true
218
+ else
219
+ false
220
+ end
221
+ when :Object
222
+ # generic object (usually a Hash), return directly
223
+ value
224
+ when /\AArray<(?<inner_type>.+)>\z/
225
+ inner_type = Regexp.last_match[:inner_type]
226
+ value.map { |v| _deserialize(inner_type, v) }
227
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
228
+ k_type = Regexp.last_match[:k_type]
229
+ v_type = Regexp.last_match[:v_type]
230
+ {}.tap do |hash|
231
+ value.each do |k, v|
232
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
233
+ end
234
+ end
235
+ else # model
236
+ temp_model = GroupDocsStorageCloud.const_get(type).new
237
+ temp_model.build_from_hash(value)
238
+ end
239
+ end
240
+
241
+ # Returns the string representation of the object
242
+ # @return [String] String presentation of the object
243
+ def to_s
244
+ to_hash.to_s
245
+ end
246
+
247
+ # to_body is an alias to to_hash (backward compatibility)
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_body
250
+ to_hash
251
+ end
252
+
253
+ # Returns the object in the form of hash
254
+ # @return [Hash] Returns the object in the form of hash
255
+ def to_hash
256
+ hash = {}
257
+ self.class.attribute_map.each_pair do |attr, param|
258
+ value = self.send(attr)
259
+ next if value.nil?
260
+ hash[param] = _to_hash(value)
261
+ end
262
+ hash
263
+ end
264
+
265
+ # Outputs non-array value in the form of hash
266
+ # For object, use to_hash. Otherwise, just return the value
267
+ # @param [Object] value Any valid value
268
+ # @return [Hash] Returns the value in the form of hash
269
+ def _to_hash(value)
270
+ if value.is_a?(Array)
271
+ value.compact.map{ |v| _to_hash(v) }
272
+ elsif value.is_a?(Hash)
273
+ {}.tap do |hash|
274
+ value.each { |k, v| hash[k] = _to_hash(v) }
275
+ end
276
+ elsif value.respond_to? :to_hash
277
+ value.to_hash
278
+ else
279
+ value
280
+ end
281
+ end
282
+ end
283
+ end
@@ -0,0 +1,225 @@
1
+ module GroupDocsStorageCloud
2
+ #
3
+ # --------------------------------------------------------------------------------------------------------------------
4
+ # <copyright company="Aspose Pty Ltd" file="FileVersionsResponse.rb">
5
+ # Copyright (c) 2018 GroupDocs.Storage for Cloud
6
+ # </copyright>
7
+ # <summary>
8
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ # of this software and associated documentation files (the "Software"), to deal
10
+ # in the Software without restriction, including without limitation the rights
11
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ # copies of the Software, and to permit persons to whom the Software is
13
+ # furnished to do so, subject to the following conditions:
14
+ #
15
+ # The above copyright notice and this permission notice shall be included in all
16
+ # copies or substantial portions of the Software.
17
+ #
18
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ # SOFTWARE.
25
+ # </summary>
26
+ # --------------------------------------------------------------------------------------------------------------------
27
+ #
28
+
29
+
30
+ class FileVersionsResponse
31
+ attr_accessor :code
32
+
33
+ attr_accessor :status
34
+
35
+ attr_accessor :file_versions
36
+
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'code' => :'Code',
42
+ :'status' => :'Status',
43
+ :'file_versions' => :'FileVersions'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.swagger_types
49
+ {
50
+ :'code' => :'Integer',
51
+ :'status' => :'String',
52
+ :'file_versions' => :'Array<FileVersion>'
53
+ }
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ return unless attributes.is_a?(Hash)
60
+
61
+ # convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
63
+
64
+ if attributes.has_key?(:'Code')
65
+ self.code = attributes[:'Code']
66
+ end
67
+
68
+ if attributes.has_key?(:'Status')
69
+ self.status = attributes[:'Status']
70
+ end
71
+
72
+ if attributes.has_key?(:'FileVersions')
73
+ if (value = attributes[:'FileVersions']).is_a?(Array)
74
+ self.file_versions = value
75
+ end
76
+ end
77
+
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properies with the reasons
82
+ def list_invalid_properties
83
+ invalid_properties = Array.new
84
+ if @code.nil?
85
+ invalid_properties.push("invalid value for 'code', code cannot be nil.")
86
+ end
87
+
88
+ return invalid_properties
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ def valid?
94
+ return false if @code.nil?
95
+ return true
96
+ end
97
+
98
+ # Checks equality by comparing each attribute.
99
+ # @param [Object] Object to be compared
100
+ def ==(o)
101
+ return true if self.equal?(o)
102
+ self.class == o.class &&
103
+ code == o.code &&
104
+ status == o.status &&
105
+ file_versions == o.file_versions
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param [Object] Object to be compared
110
+ def eql?(o)
111
+ self == o
112
+ end
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Fixnum] Hash code
116
+ def hash
117
+ [code, status, file_versions].hash
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ self.class.swagger_types.each_pair do |key, type|
126
+ key_attr = self.class.attribute_map[key].to_s
127
+ key_attr[0] = key_attr[0].downcase
128
+ if type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[key_attr.to_sym].is_a?(Array)
132
+ self.send("#{key}=", attributes[key_attr.to_sym].map{ |v| _deserialize($1, v) } )
133
+ end
134
+ elsif !attributes[key_attr.to_sym].nil?
135
+ self.send("#{key}=", _deserialize(type, attributes[key_attr.to_sym]))
136
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
137
+ end
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :DateTime
148
+ DateTime.parse value
149
+ when :Date
150
+ Date.parse value
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :BOOLEAN
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ temp_model = GroupDocsStorageCloud.const_get(type).new
179
+ temp_model.build_from_hash(value)
180
+ end
181
+ end
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # to_body is an alias to to_hash (backward compatibility)
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_body
192
+ to_hash
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ next if value.nil?
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ # Outputs non-array value in the form of hash
208
+ # For object, use to_hash. Otherwise, just return the value
209
+ # @param [Object] value Any valid value
210
+ # @return [Hash] Returns the value in the form of hash
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map{ |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+ end
225
+ end