groupdocs_assembly_cloud 20.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +7 -0
  2. data/lib/groupdocs_assembly_cloud.rb +68 -0
  3. data/lib/groupdocs_assembly_cloud/api/assembly_api.rb +1074 -0
  4. data/lib/groupdocs_assembly_cloud/api_client.rb +405 -0
  5. data/lib/groupdocs_assembly_cloud/api_error.rb +54 -0
  6. data/lib/groupdocs_assembly_cloud/configuration.rb +182 -0
  7. data/lib/groupdocs_assembly_cloud/models/assemble_options.rb +237 -0
  8. data/lib/groupdocs_assembly_cloud/models/assembly_api_error_response.rb +217 -0
  9. data/lib/groupdocs_assembly_cloud/models/assembly_response.rb +207 -0
  10. data/lib/groupdocs_assembly_cloud/models/error.rb +237 -0
  11. data/lib/groupdocs_assembly_cloud/models/error_details.rb +222 -0
  12. data/lib/groupdocs_assembly_cloud/models/file_formats_response.rb +237 -0
  13. data/lib/groupdocs_assembly_cloud/models/file_response.rb +197 -0
  14. data/lib/groupdocs_assembly_cloud/models/files_list.rb +209 -0
  15. data/lib/groupdocs_assembly_cloud/models/files_upload_result.rb +221 -0
  16. data/lib/groupdocs_assembly_cloud/models/format.rb +217 -0
  17. data/lib/groupdocs_assembly_cloud/models/format_collection.rb +209 -0
  18. data/lib/groupdocs_assembly_cloud/models/requests/AssembleDocumentRequest.rb +45 -0
  19. data/lib/groupdocs_assembly_cloud/models/requests/CopyFileRequest.rb +61 -0
  20. data/lib/groupdocs_assembly_cloud/models/requests/CopyFolderRequest.rb +57 -0
  21. data/lib/groupdocs_assembly_cloud/models/requests/CreateFolderRequest.rb +49 -0
  22. data/lib/groupdocs_assembly_cloud/models/requests/DeleteFileRequest.rb +53 -0
  23. data/lib/groupdocs_assembly_cloud/models/requests/DeleteFolderRequest.rb +53 -0
  24. data/lib/groupdocs_assembly_cloud/models/requests/DownloadFileRequest.rb +53 -0
  25. data/lib/groupdocs_assembly_cloud/models/requests/GetFilesListRequest.rb +49 -0
  26. data/lib/groupdocs_assembly_cloud/models/requests/GetSupportedFileFormatsRequest.rb +36 -0
  27. data/lib/groupdocs_assembly_cloud/models/requests/MoveFileRequest.rb +61 -0
  28. data/lib/groupdocs_assembly_cloud/models/requests/MoveFolderRequest.rb +57 -0
  29. data/lib/groupdocs_assembly_cloud/models/requests/UploadFileRequest.rb +53 -0
  30. data/lib/groupdocs_assembly_cloud/models/response_error.rb +247 -0
  31. data/lib/groupdocs_assembly_cloud/models/storage_file.rb +257 -0
  32. data/lib/groupdocs_assembly_cloud/models/template_file_info.rb +237 -0
  33. data/lib/groupdocs_assembly_cloud/version.rb +29 -0
  34. metadata +124 -0
@@ -0,0 +1,61 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose" file="MoveFileRequest.rb">
4
+ # Copyright (c) 2020 GroupDocs.Assembly for 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 GroupDocsAssemblyCloud
29
+
30
+ #
31
+ # Request model for move_file operation.
32
+ #
33
+ class MoveFileRequest
34
+
35
+ # Destination file path e.g. '/dest.ext'
36
+ attr_accessor :dest_path
37
+ # Source file's path e.g. '/Folder 1/file.ext' or '/Bucket/Folder 1/file.ext'
38
+ attr_accessor :src_path
39
+ # Source storage name
40
+ attr_accessor :src_storage_name
41
+ # Destination storage name
42
+ attr_accessor :dest_storage_name
43
+ # File version ID to move
44
+ attr_accessor :version_id
45
+
46
+ #
47
+ # Initializes a new instance.
48
+ # @param dest_path Destination file path e.g. '/dest.ext'
49
+ # @param src_path Source file's path e.g. '/Folder 1/file.ext' or '/Bucket/Folder 1/file.ext'
50
+ # @param src_storage_name Source storage name
51
+ # @param dest_storage_name Destination storage name
52
+ # @param version_id File version ID to move
53
+ def initialize(dest_path, src_path, src_storage_name = nil, dest_storage_name = nil, version_id = nil)
54
+ self.dest_path = dest_path
55
+ self.src_path = src_path
56
+ self.src_storage_name = src_storage_name
57
+ self.dest_storage_name = dest_storage_name
58
+ self.version_id = version_id
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,57 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose" file="MoveFolderRequest.rb">
4
+ # Copyright (c) 2020 GroupDocs.Assembly for 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 GroupDocsAssemblyCloud
29
+
30
+ #
31
+ # Request model for move_folder operation.
32
+ #
33
+ class MoveFolderRequest
34
+
35
+ # Destination folder path to move to e.g '/dst'
36
+ attr_accessor :dest_path
37
+ # Source folder path e.g. /Folder1
38
+ attr_accessor :src_path
39
+ # Source storage name
40
+ attr_accessor :src_storage_name
41
+ # Destination storage name
42
+ attr_accessor :dest_storage_name
43
+
44
+ #
45
+ # Initializes a new instance.
46
+ # @param dest_path Destination folder path to move to e.g '/dst'
47
+ # @param src_path Source folder path e.g. /Folder1
48
+ # @param src_storage_name Source storage name
49
+ # @param dest_storage_name Destination storage name
50
+ def initialize(dest_path, src_path, src_storage_name = nil, dest_storage_name = nil)
51
+ self.dest_path = dest_path
52
+ self.src_path = src_path
53
+ self.src_storage_name = src_storage_name
54
+ self.dest_storage_name = dest_storage_name
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,53 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose" file="UploadFileRequest.rb">
4
+ # Copyright (c) 2020 GroupDocs.Assembly for 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 GroupDocsAssemblyCloud
29
+
30
+ #
31
+ # Request model for upload_file operation.
32
+ #
33
+ class UploadFileRequest
34
+
35
+ # File to upload
36
+ attr_accessor :file
37
+ # 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.
38
+ attr_accessor :path
39
+ # Storage name
40
+ attr_accessor :storage_name
41
+
42
+ #
43
+ # Initializes a new instance.
44
+ # @param file File to upload
45
+ # @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.
46
+ # @param storage_name Storage name
47
+ def initialize(file, path, storage_name = nil)
48
+ self.file = file
49
+ self.path = path
50
+ self.storage_name = storage_name
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,247 @@
1
+
2
+ require 'date'
3
+
4
+ module GroupDocsAssemblyCloud
5
+ #
6
+ # --------------------------------------------------------------------------------------------------------------------
7
+ # <copyright company="GroupDocs" file="ResponseError.rb">
8
+ # Copyright (c) 2019 GroupDocs.Assembly for 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
+ # Error class.
33
+ class ResponseError
34
+ # Gets or sets api error code.
35
+ attr_accessor :code
36
+
37
+ # Gets or sets error message.
38
+ attr_accessor :message
39
+
40
+ # Gets or sets error description.
41
+ attr_accessor :description
42
+
43
+ # Gets or sets server datetime.
44
+ attr_accessor :date_time
45
+
46
+ # Gets or sets inner error.
47
+ attr_accessor :inner_response_error
48
+
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'code' => :'Code',
54
+ :'message' => :'Message',
55
+ :'description' => :'Description',
56
+ :'date_time' => :'DateTime',
57
+ :'inner_response_error' => :'InnerResponseError'
58
+ }
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.swagger_types
63
+ {
64
+ :'code' => :'String',
65
+ :'message' => :'String',
66
+ :'description' => :'String',
67
+ :'date_time' => :'DateTime',
68
+ :'inner_response_error' => :'ResponseError'
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?(:'Code')
81
+ self.code = attributes[:'Code']
82
+ end
83
+
84
+ if attributes.key?(:'Message')
85
+ self.message = attributes[:'Message']
86
+ end
87
+
88
+ if attributes.key?(:'Description')
89
+ self.description = attributes[:'Description']
90
+ end
91
+
92
+ if attributes.key?(:'DateTime')
93
+ self.date_time = attributes[:'DateTime']
94
+ end
95
+
96
+ if attributes.key?(:'InnerResponseError')
97
+ self.inner_response_error = attributes[:'InnerResponseError']
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
+ return invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
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
+ code == other.code &&
121
+ message == other.message &&
122
+ description == other.description &&
123
+ date_time == other.date_time &&
124
+ inner_response_error == other.inner_response_error
125
+ end
126
+
127
+ # @see the `==` method
128
+ # @param [Object] Object to be compared
129
+ def eql?(other)
130
+ self == other
131
+ end
132
+
133
+ # Calculates hash code according to all attributes.
134
+ # @return [Fixnum] Hash code
135
+ def hash
136
+ [code, message, description, date_time, inner_response_error].hash
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def build_from_hash(attributes)
143
+ return nil unless attributes.is_a?(Hash)
144
+ self.class.swagger_types.each_pair do |key, type|
145
+ if type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
149
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
150
+ end
151
+ elsif !attributes[self.class.attribute_map[key]].nil?
152
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ end
154
+ # or else data not found in attributes(hash), not an issue as the data can be optional
155
+ end
156
+
157
+ self
158
+ end
159
+
160
+ # Deserializes the data based on type
161
+ # @param string type Data type
162
+ # @param string value Value to be deserialized
163
+ # @return [Object] Deserialized data
164
+ def _deserialize(type, value)
165
+ case type.to_sym
166
+ when :DateTime
167
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
168
+ when :Date
169
+ Time.at(/\d/.match(value)[0].to_f).to_date
170
+ when :String
171
+ value.to_s
172
+ when :Integer
173
+ value.to_i
174
+ when :Float
175
+ value.to_f
176
+ when :BOOLEAN
177
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
+ true
179
+ else
180
+ false
181
+ end
182
+ when :Object
183
+ # generic object (usually a Hash), return directly
184
+ value
185
+ when /\AArray<(?<inner_type>.+)>\z/
186
+ inner_type = Regexp.last_match[:inner_type]
187
+ value.map { |v| _deserialize(inner_type, v) }
188
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
+ k_type = Regexp.last_match[:k_type]
190
+ v_type = Regexp.last_match[:v_type]
191
+ {}.tap do |hash|
192
+ value.each do |k, v|
193
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
+ end
195
+ end
196
+ else
197
+ # model
198
+ temp_model = GroupDocsAssemblyCloud.const_get(type).new
199
+ temp_model.build_from_hash(value)
200
+ end
201
+ end
202
+
203
+ # Returns the string representation of the object
204
+ # @return [String] String presentation of the object
205
+ def to_s
206
+ to_hash.to_s
207
+ end
208
+
209
+ # to_body is an alias to to_hash (backward compatibility)
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_body
212
+ to_hash
213
+ end
214
+
215
+ # Returns the object in the form of hash
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_hash
218
+ hash = {}
219
+ self.class.attribute_map.each_pair do |attr, param|
220
+ value = self.send(attr)
221
+ next if value.nil?
222
+ hash[param] = _to_hash(value)
223
+ end
224
+ hash
225
+ end
226
+
227
+ # Outputs non-array value in the form of hash
228
+ # For object, use to_hash. Otherwise, just return the value
229
+ # @param [Object] value Any valid value
230
+ # @return [Hash] Returns the value in the form of hash
231
+ def _to_hash(value)
232
+ if value.is_a?(Array)
233
+ value.compact.map { |v| _to_hash(v) }
234
+ elsif value.is_a?(Hash)
235
+ {}.tap do |hash|
236
+ value.each { |k, v| hash[k] = _to_hash(v) }
237
+ end
238
+ elsif value.respond_to? :to_hash
239
+ value.to_hash
240
+ else
241
+ value
242
+ end
243
+ end
244
+
245
+ end
246
+
247
+ end
@@ -0,0 +1,257 @@
1
+
2
+ require 'date'
3
+
4
+ module GroupDocsAssemblyCloud
5
+ #
6
+ # --------------------------------------------------------------------------------------------------------------------
7
+ # <copyright company="GroupDocs" file="StorageFile.rb">
8
+ # Copyright (c) 2019 GroupDocs.Assembly for 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 .
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 = GroupDocsAssemblyCloud.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