groupdocs_platform_cloud 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
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,216 @@
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 'uri'
14
+
15
+ module GroupDocsPlatformCloud
16
+ class Configuration
17
+ # Defines url scheme
18
+ attr_accessor :scheme
19
+
20
+ # Defines url host
21
+ attr_accessor :host
22
+
23
+ # Defines url base path
24
+ attr_accessor :base_path
25
+
26
+ # Defines API keys used with API Key authentications.
27
+ #
28
+ # @return [Hash] key: parameter name, value: parameter value (API key)
29
+ #
30
+ # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
31
+ # config.api_key['api_key'] = 'xxx'
32
+ attr_accessor :api_key
33
+
34
+ # Defines API key prefixes used with API Key authentications.
35
+ #
36
+ # @return [Hash] key: parameter name, value: API key prefix
37
+ #
38
+ # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
39
+ # config.api_key_prefix['api_key'] = 'Token'
40
+ attr_accessor :api_key_prefix
41
+
42
+ # Defines the username used with HTTP basic authentication.
43
+ #
44
+ # @return [String]
45
+ attr_accessor :username
46
+
47
+ # Defines the password used with HTTP basic authentication.
48
+ #
49
+ # @return [String]
50
+ attr_accessor :password
51
+
52
+ # Defines the access token (Bearer) used with OAuth2.
53
+ attr_accessor :access_token
54
+
55
+ # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
56
+ # details will be logged with `logger.debug` (see the `logger` attribute).
57
+ # Default to false.
58
+ #
59
+ # @return [true, false]
60
+ attr_accessor :debugging
61
+
62
+ # Defines the logger used for debugging.
63
+ # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
64
+ #
65
+ # @return [#debug]
66
+ attr_accessor :logger
67
+
68
+ # Defines the temporary folder to store downloaded files
69
+ # (for API endpoints that have file response).
70
+ # Default to use `Tempfile`.
71
+ #
72
+ # @return [String]
73
+ attr_accessor :temp_folder_path
74
+
75
+ # The time limit for HTTP request in seconds.
76
+ # Default to 0 (never times out).
77
+ attr_accessor :timeout
78
+
79
+ # Set this to false to skip client side validation in the operation.
80
+ # Default to true.
81
+ # @return [true, false]
82
+ attr_accessor :client_side_validation
83
+
84
+ ### TLS/SSL setting
85
+ # Set this to false to skip verifying SSL certificate when calling API from https server.
86
+ # Default to true.
87
+ #
88
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
89
+ #
90
+ # @return [true, false]
91
+ attr_accessor :verify_ssl
92
+
93
+ ### TLS/SSL setting
94
+ # Set this to false to skip verifying SSL host name
95
+ # Default to true.
96
+ #
97
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
98
+ #
99
+ # @return [true, false]
100
+ attr_accessor :verify_ssl_host
101
+
102
+ ### TLS/SSL setting
103
+ # Set this to customize the certificate file to verify the peer.
104
+ #
105
+ # @return [String] the path to the certificate file
106
+ #
107
+ # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
108
+ # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
109
+ attr_accessor :ssl_ca_cert
110
+
111
+ ### TLS/SSL setting
112
+ # Client certificate file (for client certificate)
113
+ attr_accessor :cert_file
114
+
115
+ ### TLS/SSL setting
116
+ # Client private key file (for client certificate)
117
+ attr_accessor :key_file
118
+
119
+ # Set this to customize parameters encoding of array parameter with multi collectionFormat.
120
+ # Default to nil.
121
+ #
122
+ # @see The params_encoding option of Ethon. Related source code:
123
+ # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
124
+ attr_accessor :params_encoding
125
+
126
+ attr_accessor :inject_format
127
+
128
+ attr_accessor :force_ending_format
129
+
130
+ def initialize
131
+ @scheme = 'http'
132
+ @host = 'api-qa.groupdocs.cloud'
133
+ @base_path = '/v1/'
134
+ @api_key = {}
135
+ @api_key_prefix = {}
136
+ @timeout = 0
137
+ @client_side_validation = true
138
+ @verify_ssl = true
139
+ @verify_ssl_host = true
140
+ @params_encoding = nil
141
+ @cert_file = nil
142
+ @key_file = nil
143
+ @debugging = true
144
+ @inject_format = false
145
+ @force_ending_format = false
146
+ @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
147
+
148
+ yield(self) if block_given?
149
+ end
150
+
151
+ # The default Configuration object.
152
+ def self.default
153
+ @@default ||= Configuration.new
154
+ end
155
+
156
+ def configure
157
+ yield(self) if block_given?
158
+ end
159
+
160
+ def scheme=(scheme)
161
+ # remove :// from scheme
162
+ @scheme = scheme.sub(/:\/\//, '')
163
+ end
164
+
165
+ def host=(host)
166
+ # remove http(s):// and anything after a slash
167
+ @host = host.sub(/https?:\/\//, '').split('/').first
168
+ end
169
+
170
+ def base_path=(base_path)
171
+ # Add leading and trailing slashes to base_path
172
+ @base_path = "/#{base_path}".gsub(/\/+/, '/')
173
+ @base_path = "" if @base_path == "/"
174
+ end
175
+
176
+ def base_url
177
+ url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
178
+ URI.encode(url)
179
+ end
180
+
181
+ # Gets API key (with prefix if set).
182
+ # @param [String] param_name the parameter name of API key auth
183
+ def api_key_with_prefix(param_name)
184
+ if @api_key_prefix[param_name]
185
+ "#{@api_key_prefix[param_name]} #{@api_key[param_name]}"
186
+ else
187
+ @api_key[param_name]
188
+ end
189
+ end
190
+
191
+ # Gets Basic Auth token string
192
+ def basic_auth_token
193
+ 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
194
+ end
195
+
196
+ # Returns Auth Settings hash for api client.
197
+ def auth_settings
198
+ {
199
+ 'appsid' =>
200
+ {
201
+ type: 'api_key',
202
+ in: 'query',
203
+ key: 'appsid',
204
+ value: api_key_with_prefix('appsid')
205
+ },
206
+ 'signature' =>
207
+ {
208
+ type: 'api_key',
209
+ in: 'query',
210
+ key: 'signature',
211
+ value: api_key_with_prefix('signature')
212
+ },
213
+ }
214
+ end
215
+ end
216
+ end
@@ -0,0 +1,20 @@
1
+ module GroupDocsPlatformCloud
2
+ class GroupDocsApp
3
+
4
+ @@app_key = nil
5
+ @app_sid = nil
6
+
7
+ def GroupDocsApp.app_key_and_sid(app_key, app_sid)
8
+ @@app_key = app_key
9
+ @@app_sid = app_sid
10
+ end
11
+
12
+ def GroupDocsApp.app_key
13
+ @@app_key
14
+ end
15
+
16
+ def GroupDocsApp.app_sid
17
+ @@app_sid
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,213 @@
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 AccessTokenListResponse
18
+ attr_accessor :code
19
+
20
+ attr_accessor :status
21
+
22
+ attr_accessor :access_tokens
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_tokens' => :'accessTokens'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ :'code' => :'Integer',
38
+ :'status' => :'String',
39
+ :'access_tokens' => :'Array<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?(:'accessTokens')
60
+ if (value = attributes[:'accessTokens']).is_a?(Array)
61
+ self.access_tokens = value
62
+ end
63
+ end
64
+
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properies with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ if @code.nil?
72
+ invalid_properties.push("invalid value for 'code', code cannot be nil.")
73
+ end
74
+
75
+ return invalid_properties
76
+ end
77
+
78
+ # Check to see if the all the properties in the model are valid
79
+ # @return true if the model is valid
80
+ def valid?
81
+ return false if @code.nil?
82
+ return true
83
+ end
84
+
85
+ # Checks equality by comparing each attribute.
86
+ # @param [Object] Object to be compared
87
+ def ==(o)
88
+ return true if self.equal?(o)
89
+ self.class == o.class &&
90
+ code == o.code &&
91
+ status == o.status &&
92
+ access_tokens == o.access_tokens
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Fixnum] Hash code
103
+ def hash
104
+ [code, status, access_tokens].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ self.class.swagger_types.each_pair do |key, type|
113
+ if type =~ /\AArray<(.*)>/i
114
+ # check to ensure the input is an array given that the the attribute
115
+ # is documented as an array but the input is not
116
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
117
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
118
+ end
119
+ elsif !attributes[self.class.attribute_map[key]].nil?
120
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
121
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
122
+ end
123
+
124
+ self
125
+ end
126
+
127
+ # Deserializes the data based on type
128
+ # @param string type Data type
129
+ # @param string value Value to be deserialized
130
+ # @return [Object] Deserialized data
131
+ def _deserialize(type, value)
132
+ case type.to_sym
133
+ when :DateTime
134
+ DateTime.parse(value)
135
+ when :Date
136
+ Date.parse(value)
137
+ when :String
138
+ value.to_s
139
+ when :Integer
140
+ value.to_i
141
+ when :Float
142
+ value.to_f
143
+ when :BOOLEAN
144
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
145
+ true
146
+ else
147
+ false
148
+ end
149
+ when :Object
150
+ # generic object (usually a Hash), return directly
151
+ value
152
+ when /\AArray<(?<inner_type>.+)>\z/
153
+ inner_type = Regexp.last_match[:inner_type]
154
+ value.map { |v| _deserialize(inner_type, v) }
155
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
156
+ k_type = Regexp.last_match[:k_type]
157
+ v_type = Regexp.last_match[:v_type]
158
+ {}.tap do |hash|
159
+ value.each do |k, v|
160
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
+ end
162
+ end
163
+ else # model
164
+ temp_model = GroupDocsPlatformCloud.const_get(type).new
165
+ temp_model.build_from_hash(value)
166
+ end
167
+ end
168
+
169
+ # Returns the string representation of the object
170
+ # @return [String] String presentation of the object
171
+ def to_s
172
+ to_hash.to_s
173
+ end
174
+
175
+ # to_body is an alias to to_hash (backward compatibility)
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_body
178
+ to_hash
179
+ end
180
+
181
+ # Returns the object in the form of hash
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_hash
184
+ hash = {}
185
+ self.class.attribute_map.each_pair do |attr, param|
186
+ value = self.send(attr)
187
+ next if value.nil?
188
+ hash[param] = _to_hash(value)
189
+ end
190
+ hash
191
+ end
192
+
193
+ # Outputs non-array value in the form of hash
194
+ # For object, use to_hash. Otherwise, just return the value
195
+ # @param [Object] value Any valid value
196
+ # @return [Hash] Returns the value in the form of hash
197
+ def _to_hash(value)
198
+ if value.is_a?(Array)
199
+ value.compact.map{ |v| _to_hash(v) }
200
+ elsif value.is_a?(Hash)
201
+ {}.tap do |hash|
202
+ value.each { |k, v| hash[k] = _to_hash(v) }
203
+ end
204
+ elsif value.respond_to? :to_hash
205
+ value.to_hash
206
+ else
207
+ value
208
+ end
209
+ end
210
+
211
+ end
212
+
213
+ end