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,62 @@
1
+
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="post_move_folder_request.rb">
4
+ # Copyright (c) 2018 GroupDocs.Storage 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 GroupDocsStorageCloud
29
+
30
+ #
31
+ # Request model for PostMoveFolder operation.
32
+ #
33
+ class PostMoveFolderRequest
34
+
35
+ # Source folder path e.g. /Folder1
36
+ attr_accessor :src
37
+
38
+ # Destination folder path e.g. /Folder2
39
+ attr_accessor :dest
40
+
41
+ # User's source storage name
42
+ attr_accessor :storage
43
+
44
+ # User's destination storage name
45
+ attr_accessor :dest_storage
46
+
47
+ #
48
+ # Initializes a new instance.
49
+ # @param src Source folder path e.g. /Folder1
50
+ # @param dest Destination folder path e.g. /Folder2
51
+ # @param storage User's source storage name
52
+ # @param dest_storage User's destination storage name
53
+ def initialize(src, dest, storage=nil, dest_storage=nil)
54
+ self.src=src
55
+ self.dest=dest
56
+ self.storage=storage
57
+ self.dest_storage=dest_storage
58
+ end
59
+
60
+ end
61
+ end
62
+ #
@@ -0,0 +1,62 @@
1
+
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="put_copy_folder_request.rb">
4
+ # Copyright (c) 2018 GroupDocs.Storage 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 GroupDocsStorageCloud
29
+
30
+ #
31
+ # Request model for PutCopyFolder operation.
32
+ #
33
+ class PutCopyFolderRequest
34
+
35
+ # Source folder path e.g. /Folder1
36
+ attr_accessor :path
37
+
38
+ # Destination folder path e.g. /Folder2
39
+ attr_accessor :newdest
40
+
41
+ # User's source storage name
42
+ attr_accessor :storage
43
+
44
+ # User's destination storage name
45
+ attr_accessor :dest_storage
46
+
47
+ #
48
+ # Initializes a new instance.
49
+ # @param path Source folder path e.g. /Folder1
50
+ # @param newdest Destination folder path e.g. /Folder2
51
+ # @param storage User's source storage name
52
+ # @param dest_storage User's destination storage name
53
+ def initialize(path, newdest, storage=nil, dest_storage=nil)
54
+ self.path=path
55
+ self.newdest=newdest
56
+ self.storage=storage
57
+ self.dest_storage=dest_storage
58
+ end
59
+
60
+ end
61
+ end
62
+
@@ -0,0 +1,67 @@
1
+
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="put_copy_request.rb">
4
+ # Copyright (c) 2018 GroupDocs.Storage 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 GroupDocsStorageCloud
29
+
30
+ #
31
+ # Request model for PutCopy operation.
32
+ #
33
+ class PutCopyRequest
34
+
35
+ # Source file's path. Sample: '/Folder 1/file.ext' or '/Bucket/Folder 1/file.ext'
36
+ attr_accessor :path
37
+
38
+ # Destination file path
39
+ attr_accessor :newdest
40
+
41
+ # Source file's version
42
+ attr_accessor :version_id
43
+
44
+ # User's source storage name
45
+ attr_accessor :storage
46
+
47
+ # User's destination storage name
48
+ attr_accessor :dest_storage
49
+
50
+ #
51
+ # Initializes a new instance.
52
+ # @param path Source file's path. Sample: '/Folder 1/file.ext' or '/Bucket/Folder 1/file.ext'
53
+ # @param newdest Destination file path
54
+ # @param version_id Source file's version
55
+ # @param storage User's source storage name
56
+ # @param dest_storage User's destination storage name
57
+ def initialize(path, newdest, version_id=nil, storage=nil, dest_storage=nil)
58
+ self.path=path
59
+ self.newdest=newdest
60
+ self.version_id=version_id
61
+ self.storage=storage
62
+ self.dest_storage=dest_storage
63
+ end
64
+
65
+ end
66
+ end
67
+ #
@@ -0,0 +1,57 @@
1
+
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="put_create_folder_request.rb">
4
+ # Copyright (c) 2018 GroupDocs.Storage 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 GroupDocsStorageCloud
29
+
30
+ #
31
+ # Request model for PutCreateFolder operation.
32
+ #
33
+ class PutCreateFolderRequest
34
+
35
+ # Target folder's path e.g. Folder1/Folder2/. The folders will be created recursively
36
+ attr_accessor :path
37
+
38
+ # User's source storage name
39
+ attr_accessor :storage
40
+
41
+ # User's destination storage name
42
+ attr_accessor :dest_storage
43
+
44
+ #
45
+ # Initializes a new instance.
46
+ # @param path Target folder's path e.g. Folder1/Folder2/. The folders will be created recursively
47
+ # @param storage User's source storage name
48
+ # @param dest_storage User's destination storage name
49
+ def initialize(path, storage=nil, dest_storage=nil)
50
+ self.path=path
51
+ self.storage=storage
52
+ self.dest_storage=dest_storage
53
+ end
54
+
55
+ end
56
+ end
57
+
@@ -0,0 +1,62 @@
1
+
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="put_create_request.rb">
4
+ # Copyright (c) 2018 GroupDocs.Storage 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 GroupDocsStorageCloud
29
+
30
+ #
31
+ # Request model for PutCreate operation.
32
+ #
33
+ class PutCreateRequest
34
+
35
+ # Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext
36
+ attr_accessor :path
37
+
38
+ # File to upload
39
+ attr_accessor :file
40
+
41
+ # Source file's version
42
+ attr_accessor :version_id
43
+
44
+ # User's storage name
45
+ attr_accessor :storage
46
+
47
+ #
48
+ # Initializes a new instance.
49
+ # @param path Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext
50
+ # @param file File to upload
51
+ # @param version_id Source file's version
52
+ # @param storage User's storage name
53
+ def initialize(path, file, version_id=nil, storage=nil)
54
+ self.path=path
55
+ self.file=file
56
+ self.version_id=version_id
57
+ self.storage=storage
58
+ end
59
+
60
+ end
61
+ end
62
+
@@ -0,0 +1,223 @@
1
+ module GroupDocsStorageCloud
2
+ #
3
+ # --------------------------------------------------------------------------------------------------------------------
4
+ # <copyright company="Aspose Pty Ltd" file="StorageExistResponse.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 StorageExistResponse
31
+ attr_accessor :code
32
+
33
+ attr_accessor :status
34
+
35
+ attr_accessor :is_exist
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
+ :'is_exist' => :'IsExist'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.swagger_types
49
+ {
50
+ :'code' => :'Integer',
51
+ :'status' => :'String',
52
+ :'is_exist' => :'BOOLEAN'
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?(:'IsExist')
73
+ self.is_exist = attributes[:'IsExist']
74
+ end
75
+
76
+ end
77
+
78
+ # Show invalid properties with the reasons. Usually used together with valid?
79
+ # @return Array for valid properies with the reasons
80
+ def list_invalid_properties
81
+ invalid_properties = Array.new
82
+ if @code.nil?
83
+ invalid_properties.push("invalid value for 'code', code cannot be nil.")
84
+ end
85
+
86
+ return invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ return false if @code.nil?
93
+ return true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ code == o.code &&
102
+ status == o.status &&
103
+ is_exist == o.is_exist
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Fixnum] Hash code
114
+ def hash
115
+ [code, status, is_exist].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.swagger_types.each_pair do |key, type|
124
+ key_attr = self.class.attribute_map[key].to_s
125
+ key_attr[0] = key_attr[0].downcase
126
+ if type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[key_attr.to_sym].is_a?(Array)
130
+ self.send("#{key}=", attributes[key_attr.to_sym].map{ |v| _deserialize($1, v) } )
131
+ end
132
+ elsif !attributes[key_attr.to_sym].nil?
133
+ self.send("#{key}=", _deserialize(type, attributes[key_attr.to_sym]))
134
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
135
+ end
136
+ self
137
+ end
138
+
139
+ # Deserializes the data based on type
140
+ # @param string type Data type
141
+ # @param string value Value to be deserialized
142
+ # @return [Object] Deserialized data
143
+ def _deserialize(type, value)
144
+ case type.to_sym
145
+ when :DateTime
146
+ DateTime.parse value
147
+ when :Date
148
+ Date.parse value
149
+ when :String
150
+ value.to_s
151
+ when :Integer
152
+ value.to_i
153
+ when :Float
154
+ value.to_f
155
+ when :BOOLEAN
156
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
+ true
158
+ else
159
+ false
160
+ end
161
+ when :Object
162
+ # generic object (usually a Hash), return directly
163
+ value
164
+ when /\AArray<(?<inner_type>.+)>\z/
165
+ inner_type = Regexp.last_match[:inner_type]
166
+ value.map { |v| _deserialize(inner_type, v) }
167
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
+ k_type = Regexp.last_match[:k_type]
169
+ v_type = Regexp.last_match[:v_type]
170
+ {}.tap do |hash|
171
+ value.each do |k, v|
172
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
+ end
174
+ end
175
+ else # model
176
+ temp_model = GroupDocsStorageCloud.const_get(type).new
177
+ temp_model.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ next if value.nil?
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map{ |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+ end
223
+ end