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,53 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose" file="ObjectExistsRequest.rb">
4
+ # Copyright (c) 2018 Aspose.CAD Cloud
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
+ module AsposeCadCloud
29
+
30
+ #
31
+ # Request model for object_exists operation.
32
+ #
33
+ class ObjectExistsRequest
34
+
35
+ # File or folder path e.g. '/file.ext' or '/folder'
36
+ attr_accessor :path
37
+ # Storage name
38
+ attr_accessor :storage_name
39
+ # File version ID
40
+ attr_accessor :version_id
41
+
42
+ #
43
+ # Initializes a new instance.
44
+ # @param path File or folder path e.g. '/file.ext' or '/folder'
45
+ # @param storage_name Storage name
46
+ # @param version_id File version ID
47
+ def initialize(path, storage_name = nil, version_id = nil)
48
+ self.path = path
49
+ self.storage_name = storage_name
50
+ self.version_id = version_id
51
+ end
52
+ end
53
+ end
@@ -36,7 +36,7 @@ module AsposeCadCloud
36
36
  attr_accessor :drawing_data
37
37
  # Resulting file format.
38
38
  attr_accessor :output_format
39
- # Rotate/flip operation to apply.
39
+ # Rotate/flip operation to apply. Possible values: RotateNoneFlipNone, Rotate90FlipNone, Rotate180FlipNone, Rotate270FlipNone, RotateNoneFlipX, Rotate90FlipX, Rotate180FlipX, Rotate270FlipX, RotateNoneFlipY, Rotate90FlipY, Rotate180FlipY, Rotate270FlipY, RotateNoneFlipXY, Rotate90FlipXY, Rotate180FlipXY, Rotate270FlipXY
40
40
  attr_accessor :rotate_flip_type
41
41
  # Path to updated file (if this is empty, response contains streamed file).
42
42
  attr_accessor :out_path
@@ -47,7 +47,7 @@ module AsposeCadCloud
47
47
  # Initializes a new instance.
48
48
  # @param drawing_data Input drawing
49
49
  # @param output_format Resulting file format.
50
- # @param rotate_flip_type Rotate/flip operation to apply.
50
+ # @param rotate_flip_type Rotate/flip operation to apply. Possible values: RotateNoneFlipNone, Rotate90FlipNone, Rotate180FlipNone, Rotate270FlipNone, RotateNoneFlipX, Rotate90FlipX, Rotate180FlipX, Rotate270FlipX, RotateNoneFlipY, Rotate90FlipY, Rotate180FlipY, Rotate270FlipY, RotateNoneFlipXY, Rotate90FlipXY, Rotate180FlipXY, Rotate270FlipXY
51
51
  # @param out_path Path to updated file (if this is empty, response contains streamed file).
52
52
  # @param storage Your Aspose Cloud Storage name.
53
53
  def initialize(drawing_data, output_format, rotate_flip_type, out_path = nil, storage = nil)
@@ -0,0 +1,45 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose" file="StorageExistsRequest.rb">
4
+ # Copyright (c) 2018 Aspose.CAD Cloud
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
+ module AsposeCadCloud
29
+
30
+ #
31
+ # Request model for storage_exists operation.
32
+ #
33
+ class StorageExistsRequest
34
+
35
+ # Storage name
36
+ attr_accessor :storage_name
37
+
38
+ #
39
+ # Initializes a new instance.
40
+ # @param storage_name Storage name
41
+ def initialize(storage_name)
42
+ self.storage_name = storage_name
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,53 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose" file="UploadFileRequest.rb">
4
+ # Copyright (c) 2018 Aspose.CAD Cloud
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
+ module AsposeCadCloud
29
+
30
+ #
31
+ # Request model for upload_file operation.
32
+ #
33
+ class UploadFileRequest
34
+
35
+ # Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext If the content is multipart and path does not contains the file name it tries to get them from filename parameter from Content-Disposition header.
36
+ attr_accessor :path
37
+ # File to upload
38
+ attr_accessor :file
39
+ # Storage name
40
+ attr_accessor :storage_name
41
+
42
+ #
43
+ # Initializes a new instance.
44
+ # @param path Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext If the content is multipart and path does not contains the file name it tries to get them from filename parameter from Content-Disposition header.
45
+ # @param file File to upload
46
+ # @param storage_name Storage name
47
+ def initialize(path, file, storage_name = nil)
48
+ self.path = path
49
+ self.file = file
50
+ self.storage_name = storage_name
51
+ end
52
+ end
53
+ end
@@ -29,12 +29,10 @@ module AsposeCadCloud
29
29
  # --------------------------------------------------------------------------------------------------------------------
30
30
  #
31
31
 
32
- # The resolution setting for image save options.
32
+
33
33
  class ResolutionSetting
34
- # Gets or sets the horizontal resolution.
35
34
  attr_accessor :horizontal_resolution
36
35
 
37
- # Gets or sets the vertical resolution.
38
36
  attr_accessor :vertical_resolution
39
37
 
40
38
 
@@ -0,0 +1,212 @@
1
+
2
+ require 'date'
3
+
4
+ module AsposeCadCloud
5
+ #
6
+ # --------------------------------------------------------------------------------------------------------------------
7
+ # <copyright company="Aspose" file="StorageExist.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
+ # Storage exists
33
+ class StorageExist
34
+ # Shows that the storage exists.
35
+ attr_accessor :exists
36
+
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'exists' => :'Exists'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.swagger_types
47
+ {
48
+ :'exists' => :'BOOLEAN'
49
+ }
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ return unless attributes.is_a?(Hash)
56
+
57
+ # convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
59
+
60
+ if attributes.key?(:'Exists')
61
+ self.exists = attributes[:'Exists']
62
+ end
63
+
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properies with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = []
70
+ if @exists.nil?
71
+ invalid_properties.push("invalid value for 'exists', exists cannot be nil.")
72
+ end
73
+
74
+ return invalid_properties
75
+ end
76
+
77
+ # Check to see if the all the properties in the model are valid
78
+ # @return true if the model is valid
79
+ def valid?
80
+ return false if @exists.nil?
81
+ return true
82
+ end
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] Object to be compared
86
+ def ==(other)
87
+ return true if self.equal?(other)
88
+ self.class == other.class &&
89
+ exists == other.exists
90
+ end
91
+
92
+ # @see the `==` method
93
+ # @param [Object] Object to be compared
94
+ def eql?(other)
95
+ self == other
96
+ end
97
+
98
+ # Calculates hash code according to all attributes.
99
+ # @return [Fixnum] Hash code
100
+ def hash
101
+ [exists].hash
102
+ end
103
+
104
+ # Builds the object from hash
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @return [Object] Returns the model itself
107
+ def build_from_hash(attributes)
108
+ return nil unless attributes.is_a?(Hash)
109
+ self.class.swagger_types.each_pair do |key, type|
110
+ if type =~ /\AArray<(.*)>/i
111
+ # check to ensure the input is an array given that the the attribute
112
+ # is documented as an array but the input is not
113
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
114
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
115
+ end
116
+ elsif !attributes[self.class.attribute_map[key]].nil?
117
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
118
+ end
119
+ # or else data not found in attributes(hash), not an issue as the data can be optional
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def _deserialize(type, value)
130
+ case type.to_sym
131
+ when :DateTime
132
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
133
+ when :Date
134
+ Time.at(/\d/.match(value)[0].to_f).to_date
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :BOOLEAN
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else
162
+ # model
163
+ temp_model = AsposeCadCloud.const_get(type).new
164
+ temp_model.build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ next if value.nil?
187
+ hash[param] = _to_hash(value)
188
+ end
189
+ hash
190
+ end
191
+
192
+ # Outputs non-array value in the form of hash
193
+ # For object, use to_hash. Otherwise, just return the value
194
+ # @param [Object] value Any valid value
195
+ # @return [Hash] Returns the value in the form of hash
196
+ def _to_hash(value)
197
+ if value.is_a?(Array)
198
+ value.compact.map { |v| _to_hash(v) }
199
+ elsif value.is_a?(Hash)
200
+ {}.tap do |hash|
201
+ value.each { |k, v| hash[k] = _to_hash(v) }
202
+ end
203
+ elsif value.respond_to? :to_hash
204
+ value.to_hash
205
+ else
206
+ value
207
+ end
208
+ end
209
+
210
+ end
211
+
212
+ end
@@ -0,0 +1,257 @@
1
+
2
+ require 'date'
3
+
4
+ module AsposeCadCloud
5
+ #
6
+ # --------------------------------------------------------------------------------------------------------------------
7
+ # <copyright company="Aspose" file="StorageFile.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 or folder information
33
+ class StorageFile
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
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'name' => :'Name',
54
+ :'is_folder' => :'IsFolder',
55
+ :'modified_date' => :'ModifiedDate',
56
+ :'size' => :'Size',
57
+ :'path' => :'Path'
58
+ }
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.swagger_types
63
+ {
64
+ :'name' => :'String',
65
+ :'is_folder' => :'BOOLEAN',
66
+ :'modified_date' => :'DateTime',
67
+ :'size' => :'Integer',
68
+ :'path' => :'String'
69
+ }
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ return unless attributes.is_a?(Hash)
76
+
77
+ # convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
79
+
80
+ if attributes.key?(:'Name')
81
+ self.name = attributes[:'Name']
82
+ end
83
+
84
+ if attributes.key?(:'IsFolder')
85
+ self.is_folder = attributes[:'IsFolder']
86
+ end
87
+
88
+ if attributes.key?(:'ModifiedDate')
89
+ self.modified_date = attributes[:'ModifiedDate']
90
+ end
91
+
92
+ if attributes.key?(:'Size')
93
+ self.size = attributes[:'Size']
94
+ end
95
+
96
+ if attributes.key?(:'Path')
97
+ self.path = attributes[:'Path']
98
+ end
99
+
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properies with the reasons
104
+ def list_invalid_properties
105
+ invalid_properties = []
106
+ if @is_folder.nil?
107
+ invalid_properties.push("invalid value for 'is_folder', is_folder cannot be nil.")
108
+ end
109
+
110
+ if @size.nil?
111
+ invalid_properties.push("invalid value for 'size', size cannot be nil.")
112
+ end
113
+
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 false if @is_folder.nil?
121
+ return false if @size.nil?
122
+ return true
123
+ end
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] Object to be compared
127
+ def ==(other)
128
+ return true if self.equal?(other)
129
+ self.class == other.class &&
130
+ name == other.name &&
131
+ is_folder == other.is_folder &&
132
+ modified_date == other.modified_date &&
133
+ size == other.size &&
134
+ path == other.path
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(other)
140
+ self == other
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Fixnum] Hash code
145
+ def hash
146
+ [name, is_folder, modified_date, size, path].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ self.class.swagger_types.each_pair do |key, type|
155
+ if type =~ /\AArray<(.*)>/i
156
+ # check to ensure the input is an array given that the the attribute
157
+ # is documented as an array but the input is not
158
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
159
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
160
+ end
161
+ elsif !attributes[self.class.attribute_map[key]].nil?
162
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
163
+ end
164
+ # or else data not found in attributes(hash), not an issue as the data can be optional
165
+ end
166
+
167
+ self
168
+ end
169
+
170
+ # Deserializes the data based on type
171
+ # @param string type Data type
172
+ # @param string value Value to be deserialized
173
+ # @return [Object] Deserialized data
174
+ def _deserialize(type, value)
175
+ case type.to_sym
176
+ when :DateTime
177
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
178
+ when :Date
179
+ Time.at(/\d/.match(value)[0].to_f).to_date
180
+ when :String
181
+ value.to_s
182
+ when :Integer
183
+ value.to_i
184
+ when :Float
185
+ value.to_f
186
+ when :BOOLEAN
187
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
188
+ true
189
+ else
190
+ false
191
+ end
192
+ when :Object
193
+ # generic object (usually a Hash), return directly
194
+ value
195
+ when /\AArray<(?<inner_type>.+)>\z/
196
+ inner_type = Regexp.last_match[:inner_type]
197
+ value.map { |v| _deserialize(inner_type, v) }
198
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
199
+ k_type = Regexp.last_match[:k_type]
200
+ v_type = Regexp.last_match[:v_type]
201
+ {}.tap do |hash|
202
+ value.each do |k, v|
203
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
204
+ end
205
+ end
206
+ else
207
+ # model
208
+ temp_model = AsposeCadCloud.const_get(type).new
209
+ temp_model.build_from_hash(value)
210
+ end
211
+ end
212
+
213
+ # Returns the string representation of the object
214
+ # @return [String] String presentation of the object
215
+ def to_s
216
+ to_hash.to_s
217
+ end
218
+
219
+ # to_body is an alias to to_hash (backward compatibility)
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_body
222
+ to_hash
223
+ end
224
+
225
+ # Returns the object in the form of hash
226
+ # @return [Hash] Returns the object in the form of hash
227
+ def to_hash
228
+ hash = {}
229
+ self.class.attribute_map.each_pair do |attr, param|
230
+ value = self.send(attr)
231
+ next if value.nil?
232
+ hash[param] = _to_hash(value)
233
+ end
234
+ hash
235
+ end
236
+
237
+ # Outputs non-array value in the form of hash
238
+ # For object, use to_hash. Otherwise, just return the value
239
+ # @param [Object] value Any valid value
240
+ # @return [Hash] Returns the value in the form of hash
241
+ def _to_hash(value)
242
+ if value.is_a?(Array)
243
+ value.compact.map { |v| _to_hash(v) }
244
+ elsif value.is_a?(Hash)
245
+ {}.tap do |hash|
246
+ value.each { |k, v| hash[k] = _to_hash(v) }
247
+ end
248
+ elsif value.respond_to? :to_hash
249
+ value.to_hash
250
+ else
251
+ value
252
+ end
253
+ end
254
+
255
+ end
256
+
257
+ end