groupdocs_platform_cloud 1.0.0

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 (52) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +22 -0
  3. data/README.md +160 -0
  4. data/Ruby Mustache Templates/ReadMe.txt +1 -0
  5. data/Ruby Mustache Templates/api_client.mustache +441 -0
  6. data/Swagger Specs File/platform.json +1683 -0
  7. data/groupdocs_platform_cloud.gemspec +26 -0
  8. data/lib/groupdocs_platform_cloud.rb +72 -0
  9. data/lib/groupdocs_platform_cloud/api/app_api.rb +359 -0
  10. data/lib/groupdocs_platform_cloud/api/app_statistics_api.rb +572 -0
  11. data/lib/groupdocs_platform_cloud/api/auth_api.rb +176 -0
  12. data/lib/groupdocs_platform_cloud/api/file_api.rb +282 -0
  13. data/lib/groupdocs_platform_cloud/api/folder_api.rb +267 -0
  14. data/lib/groupdocs_platform_cloud/api/heroku_api.rb +241 -0
  15. data/lib/groupdocs_platform_cloud/api/storage_api.rb +249 -0
  16. data/lib/groupdocs_platform_cloud/api/usage_api.rb +233 -0
  17. data/lib/groupdocs_platform_cloud/api_client.rb +446 -0
  18. data/lib/groupdocs_platform_cloud/api_error.rb +38 -0
  19. data/lib/groupdocs_platform_cloud/configuration.rb +216 -0
  20. data/lib/groupdocs_platform_cloud/groupdocs_app.rb +20 -0
  21. data/lib/groupdocs_platform_cloud/models/access_token_list_response.rb +213 -0
  22. data/lib/groupdocs_platform_cloud/models/access_token_response.rb +211 -0
  23. data/lib/groupdocs_platform_cloud/models/app.rb +243 -0
  24. data/lib/groupdocs_platform_cloud/models/app_usage.rb +235 -0
  25. data/lib/groupdocs_platform_cloud/models/application_usage_response.rb +202 -0
  26. data/lib/groupdocs_platform_cloud/models/disc_usage.rb +207 -0
  27. data/lib/groupdocs_platform_cloud/models/disc_usage_response.rb +211 -0
  28. data/lib/groupdocs_platform_cloud/models/file.rb +253 -0
  29. data/lib/groupdocs_platform_cloud/models/file_exist.rb +207 -0
  30. data/lib/groupdocs_platform_cloud/models/file_exist_response.rb +211 -0
  31. data/lib/groupdocs_platform_cloud/models/file_response.rb +224 -0
  32. data/lib/groupdocs_platform_cloud/models/file_version.rb +276 -0
  33. data/lib/groupdocs_platform_cloud/models/file_versions_response.rb +213 -0
  34. data/lib/groupdocs_platform_cloud/models/folder_response.rb +208 -0
  35. data/lib/groupdocs_platform_cloud/models/heroku_request.rb +233 -0
  36. data/lib/groupdocs_platform_cloud/models/heroku_request_options.rb +188 -0
  37. data/lib/groupdocs_platform_cloud/models/move_file_response.rb +202 -0
  38. data/lib/groupdocs_platform_cloud/models/move_folder_response.rb +202 -0
  39. data/lib/groupdocs_platform_cloud/models/remove_file_response.rb +202 -0
  40. data/lib/groupdocs_platform_cloud/models/remove_folder_response.rb +202 -0
  41. data/lib/groupdocs_platform_cloud/models/saa_spose_response.rb +202 -0
  42. data/lib/groupdocs_platform_cloud/models/storage_exist_response.rb +216 -0
  43. data/lib/groupdocs_platform_cloud/models/user_usage_summary_response.rb +211 -0
  44. data/lib/groupdocs_platform_cloud/models/user_usage_summary_statistics.rb +291 -0
  45. data/lib/groupdocs_platform_cloud/version.rb +15 -0
  46. data/test/data/SampleExecuteTemplate.doc +0 -0
  47. data/test/data/SampleExecuteTemplateData.txt +49 -0
  48. data/test/data/SampleWordDocument.docx +0 -0
  49. data/test/data/buzz.png +0 -0
  50. data/test/data/testfile.txt +1 -0
  51. data/test/platform_tests.rb +144 -0
  52. metadata +156 -0
@@ -0,0 +1,211 @@
1
+ =begin
2
+ #Web API Swagger specification
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module GroupDocsPlatformCloud
16
+
17
+ class AccessTokenResponse
18
+ attr_accessor :code
19
+
20
+ attr_accessor :status
21
+
22
+ attr_accessor :access_token
23
+
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'code' => :'code',
29
+ :'status' => :'status',
30
+ :'access_token' => :'accessToken'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ :'code' => :'Integer',
38
+ :'status' => :'String',
39
+ :'access_token' => :'String'
40
+ }
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ return unless attributes.is_a?(Hash)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
50
+
51
+ if attributes.has_key?(:'code')
52
+ self.code = attributes[:'code']
53
+ end
54
+
55
+ if attributes.has_key?(:'status')
56
+ self.status = attributes[:'status']
57
+ end
58
+
59
+ if attributes.has_key?(:'accessToken')
60
+ self.access_token = attributes[:'accessToken']
61
+ end
62
+
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properies with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ if @code.nil?
70
+ invalid_properties.push("invalid value for 'code', code cannot be nil.")
71
+ end
72
+
73
+ return invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return false if @code.nil?
80
+ return true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ code == o.code &&
89
+ status == o.status &&
90
+ access_token == o.access_token
91
+ end
92
+
93
+ # @see the `==` method
94
+ # @param [Object] Object to be compared
95
+ def eql?(o)
96
+ self == o
97
+ end
98
+
99
+ # Calculates hash code according to all attributes.
100
+ # @return [Fixnum] Hash code
101
+ def hash
102
+ [code, status, access_token].hash
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.swagger_types.each_pair do |key, type|
111
+ if type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
115
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
116
+ end
117
+ elsif !attributes[self.class.attribute_map[key]].nil?
118
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
119
+ end # 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
+ DateTime.parse(value)
133
+ when :Date
134
+ Date.parse(value)
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 # model
162
+ temp_model = GroupDocsPlatformCloud.const_get(type).new
163
+ temp_model.build_from_hash(value)
164
+ end
165
+ end
166
+
167
+ # Returns the string representation of the object
168
+ # @return [String] String presentation of the object
169
+ def to_s
170
+ to_hash.to_s
171
+ end
172
+
173
+ # to_body is an alias to to_hash (backward compatibility)
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_body
176
+ to_hash
177
+ end
178
+
179
+ # Returns the object in the form of hash
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_hash
182
+ hash = {}
183
+ self.class.attribute_map.each_pair do |attr, param|
184
+ value = self.send(attr)
185
+ next if value.nil?
186
+ hash[param] = _to_hash(value)
187
+ end
188
+ hash
189
+ end
190
+
191
+ # Outputs non-array value in the form of hash
192
+ # For object, use to_hash. Otherwise, just return the value
193
+ # @param [Object] value Any valid value
194
+ # @return [Hash] Returns the value in the form of hash
195
+ def _to_hash(value)
196
+ if value.is_a?(Array)
197
+ value.compact.map{ |v| _to_hash(v) }
198
+ elsif value.is_a?(Hash)
199
+ {}.tap do |hash|
200
+ value.each { |k, v| hash[k] = _to_hash(v) }
201
+ end
202
+ elsif value.respond_to? :to_hash
203
+ value.to_hash
204
+ else
205
+ value
206
+ end
207
+ end
208
+
209
+ end
210
+
211
+ end
@@ -0,0 +1,243 @@
1
+ =begin
2
+ #Web API Swagger specification
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module GroupDocsPlatformCloud
16
+
17
+ class App
18
+ attr_accessor :app_key
19
+
20
+ attr_accessor :app_sid
21
+
22
+ attr_accessor :name
23
+
24
+ attr_accessor :description
25
+
26
+ attr_accessor :is_default
27
+
28
+ attr_accessor :created
29
+
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'app_key' => :'appKey',
35
+ :'app_sid' => :'appSid',
36
+ :'name' => :'name',
37
+ :'description' => :'description',
38
+ :'is_default' => :'isDefault',
39
+ :'created' => :'created'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.swagger_types
45
+ {
46
+ :'app_key' => :'String',
47
+ :'app_sid' => :'String',
48
+ :'name' => :'String',
49
+ :'description' => :'String',
50
+ :'is_default' => :'BOOLEAN',
51
+ :'created' => :'DateTime'
52
+ }
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ return unless attributes.is_a?(Hash)
59
+
60
+ # convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
62
+
63
+ if attributes.has_key?(:'appKey')
64
+ self.app_key = attributes[:'appKey']
65
+ end
66
+
67
+ if attributes.has_key?(:'appSid')
68
+ self.app_sid = attributes[:'appSid']
69
+ end
70
+
71
+ if attributes.has_key?(:'name')
72
+ self.name = attributes[:'name']
73
+ end
74
+
75
+ if attributes.has_key?(:'description')
76
+ self.description = attributes[:'description']
77
+ end
78
+
79
+ if attributes.has_key?(:'isDefault')
80
+ self.is_default = attributes[:'isDefault']
81
+ end
82
+
83
+ if attributes.has_key?(:'created')
84
+ self.created = attributes[:'created']
85
+ end
86
+
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properies with the reasons
91
+ def list_invalid_properties
92
+ invalid_properties = Array.new
93
+ if @is_default.nil?
94
+ invalid_properties.push("invalid value for 'is_default', is_default cannot be nil.")
95
+ end
96
+
97
+ if @created.nil?
98
+ invalid_properties.push("invalid value for 'created', created cannot be nil.")
99
+ end
100
+
101
+ return invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ return false if @is_default.nil?
108
+ return false if @created.nil?
109
+ return true
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ app_key == o.app_key &&
118
+ app_sid == o.app_sid &&
119
+ name == o.name &&
120
+ description == o.description &&
121
+ is_default == o.is_default &&
122
+ created == o.created
123
+ end
124
+
125
+ # @see the `==` method
126
+ # @param [Object] Object to be compared
127
+ def eql?(o)
128
+ self == o
129
+ end
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Fixnum] Hash code
133
+ def hash
134
+ [app_key, app_sid, name, description, is_default, created].hash
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def build_from_hash(attributes)
141
+ return nil unless attributes.is_a?(Hash)
142
+ self.class.swagger_types.each_pair do |key, type|
143
+ if type =~ /\AArray<(.*)>/i
144
+ # check to ensure the input is an array given that the the attribute
145
+ # is documented as an array but the input is not
146
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
147
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
148
+ end
149
+ elsif !attributes[self.class.attribute_map[key]].nil?
150
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
151
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
152
+ end
153
+
154
+ self
155
+ end
156
+
157
+ # Deserializes the data based on type
158
+ # @param string type Data type
159
+ # @param string value Value to be deserialized
160
+ # @return [Object] Deserialized data
161
+ def _deserialize(type, value)
162
+ case type.to_sym
163
+ when :DateTime
164
+ DateTime.parse(value)
165
+ when :Date
166
+ Date.parse(value)
167
+ when :String
168
+ value.to_s
169
+ when :Integer
170
+ value.to_i
171
+ when :Float
172
+ value.to_f
173
+ when :BOOLEAN
174
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
175
+ true
176
+ else
177
+ false
178
+ end
179
+ when :Object
180
+ # generic object (usually a Hash), return directly
181
+ value
182
+ when /\AArray<(?<inner_type>.+)>\z/
183
+ inner_type = Regexp.last_match[:inner_type]
184
+ value.map { |v| _deserialize(inner_type, v) }
185
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
186
+ k_type = Regexp.last_match[:k_type]
187
+ v_type = Regexp.last_match[:v_type]
188
+ {}.tap do |hash|
189
+ value.each do |k, v|
190
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
191
+ end
192
+ end
193
+ else # model
194
+ temp_model = GroupDocsPlatformCloud.const_get(type).new
195
+ temp_model.build_from_hash(value)
196
+ end
197
+ end
198
+
199
+ # Returns the string representation of the object
200
+ # @return [String] String presentation of the object
201
+ def to_s
202
+ to_hash.to_s
203
+ end
204
+
205
+ # to_body is an alias to to_hash (backward compatibility)
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_body
208
+ to_hash
209
+ end
210
+
211
+ # Returns the object in the form of hash
212
+ # @return [Hash] Returns the object in the form of hash
213
+ def to_hash
214
+ hash = {}
215
+ self.class.attribute_map.each_pair do |attr, param|
216
+ value = self.send(attr)
217
+ next if value.nil?
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+
223
+ # Outputs non-array value in the form of hash
224
+ # For object, use to_hash. Otherwise, just return the value
225
+ # @param [Object] value Any valid value
226
+ # @return [Hash] Returns the value in the form of hash
227
+ def _to_hash(value)
228
+ if value.is_a?(Array)
229
+ value.compact.map{ |v| _to_hash(v) }
230
+ elsif value.is_a?(Hash)
231
+ {}.tap do |hash|
232
+ value.each { |k, v| hash[k] = _to_hash(v) }
233
+ end
234
+ elsif value.respond_to? :to_hash
235
+ value.to_hash
236
+ else
237
+ value
238
+ end
239
+ end
240
+
241
+ end
242
+
243
+ end