aspose_cad_cloud 19.11 → 20.11

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