allq_rest 1.5.2 → 2.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 (70) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +36 -97
  3. data/lib/allq_rest/client.rb +168 -0
  4. data/lib/allq_rest/configuration.rb +7 -192
  5. data/lib/allq_rest/errors.rb +17 -0
  6. data/lib/allq_rest/job.rb +10 -0
  7. data/lib/allq_rest/version.rb +2 -14
  8. data/lib/allq_rest.rb +21 -46
  9. data/swagger.yaml +706 -0
  10. metadata +32 -116
  11. data/Gemfile +0 -7
  12. data/Gemfile.lock +0 -42
  13. data/Rakefile +0 -8
  14. data/allq_rest-1.2.92.gem +0 -0
  15. data/allq_rest-1.2.93.gem +0 -0
  16. data/allq_rest-1.3.0.gem +0 -0
  17. data/allq_rest-1.4.0.gem +0 -0
  18. data/allq_rest-1.5.0.gem +0 -0
  19. data/allq_rest-1.5.1.gem +0 -0
  20. data/allq_rest.gemspec +0 -28
  21. data/deploy.sh +0 -4
  22. data/docs/ActionsApi.md +0 -544
  23. data/docs/AdminApi.md +0 -98
  24. data/docs/BasicPayload.md +0 -11
  25. data/docs/BasicResponse.md +0 -8
  26. data/docs/JobRef.md +0 -8
  27. data/docs/JobResponse.md +0 -12
  28. data/docs/NewJob.md +0 -13
  29. data/docs/NewParentJob.md +0 -16
  30. data/docs/StatsInfo.md +0 -9
  31. data/docs/StatsResults.md +0 -10
  32. data/docs/StatsTube.md +0 -14
  33. data/docs/Throttle.md +0 -9
  34. data/docs/TubeRef.md +0 -8
  35. data/git_push.sh +0 -55
  36. data/lib/.DS_Store +0 -0
  37. data/lib/allq_rest/.DS_Store +0 -0
  38. data/lib/allq_rest/api/actions_api.rb +0 -763
  39. data/lib/allq_rest/api/admin_api.rb +0 -181
  40. data/lib/allq_rest/api_client.rb +0 -395
  41. data/lib/allq_rest/api_error.rb +0 -38
  42. data/lib/allq_rest/models/basic_payload.rb +0 -218
  43. data/lib/allq_rest/models/basic_response.rb +0 -188
  44. data/lib/allq_rest/models/job_ref.rb +0 -190
  45. data/lib/allq_rest/models/job_response.rb +0 -260
  46. data/lib/allq_rest/models/multiple_job_response.rb +0 -187
  47. data/lib/allq_rest/models/new_job.rb +0 -281
  48. data/lib/allq_rest/models/new_parent_job.rb +0 -312
  49. data/lib/allq_rest/models/stats_info.rb +0 -204
  50. data/lib/allq_rest/models/stats_results.rb +0 -254
  51. data/lib/allq_rest/models/stats_tube.rb +0 -306
  52. data/lib/allq_rest/models/throttle.rb +0 -209
  53. data/lib/allq_rest/models/tube_ref.rb +0 -190
  54. data/spec/.DS_Store +0 -0
  55. data/spec/api/actions_api_spec.rb +0 -600
  56. data/spec/api/admin_api_spec.rb +0 -58
  57. data/spec/api_client_spec.rb +0 -226
  58. data/spec/configuration_spec.rb +0 -42
  59. data/spec/models/basic_payload_spec.rb +0 -60
  60. data/spec/models/basic_response_spec.rb +0 -42
  61. data/spec/models/job_ref_spec.rb +0 -42
  62. data/spec/models/job_response_spec.rb +0 -66
  63. data/spec/models/new_job_spec.rb +0 -72
  64. data/spec/models/new_parent_job_spec.rb +0 -90
  65. data/spec/models/stats_info_spec.rb +0 -48
  66. data/spec/models/stats_results_spec.rb +0 -54
  67. data/spec/models/stats_tube_spec.rb +0 -78
  68. data/spec/models/throttle_spec.rb +0 -48
  69. data/spec/models/tube_ref_spec.rb +0 -42
  70. data/spec/spec_helper.rb +0 -113
@@ -1,181 +0,0 @@
1
- =begin
2
- #AllQ
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.4.2
10
-
11
- =end
12
-
13
- require 'uri'
14
-
15
- module Allq
16
- class AdminApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # Drain tube and delete it
23
- # Drain Server
24
- # @param server_id Server URL or ID
25
- # @param [Hash] opts the optional parameters
26
- # @return [BasicResponse]
27
- def drain_server(server_id, opts = {})
28
- data, _status_code, _headers = drain_server_with_http_info(server_id, opts)
29
- data
30
- end
31
-
32
- # Drain tube and delete it
33
- # Drain Server
34
- # @param server_id Server URL or ID
35
- # @param [Hash] opts the optional parameters
36
- # @return [Array<(BasicResponse, Fixnum, Hash)>] BasicResponse data, response status code and response headers
37
- def drain_server_with_http_info(server_id, opts = {})
38
- if @api_client.config.debugging
39
- @api_client.config.logger.debug 'Calling API: AdminApi.drain_server ...'
40
- end
41
- # verify the required parameter 'server_id' is set
42
- if @api_client.config.client_side_validation && server_id.nil?
43
- fail ArgumentError, "Missing the required parameter 'server_id' when calling AdminApi.drain_server"
44
- end
45
- # resource path
46
- local_var_path = '/drain'
47
-
48
- # query parameters
49
- query_params = {}
50
- query_params[:'server_id'] = server_id
51
-
52
- # header parameters
53
- header_params = {}
54
- # HTTP header 'Accept' (if needed)
55
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
56
- # HTTP header 'Content-Type'
57
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
58
-
59
- # form parameters
60
- form_params = {}
61
-
62
- # http body (model)
63
- post_body = nil
64
- auth_names = []
65
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
66
- :header_params => header_params,
67
- :query_params => query_params,
68
- :form_params => form_params,
69
- :body => post_body,
70
- :auth_names => auth_names,
71
- :return_type => 'BasicResponse')
72
- if @api_client.config.debugging
73
- @api_client.config.logger.debug "API called: AdminApi#drain_server\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
74
- end
75
- return data, status_code, headers
76
- end
77
- # Stats
78
- # Get Stats
79
- # @param [Hash] opts the optional parameters
80
- # @return [Array<StatsResults>]
81
- def stats_get(opts = {})
82
- data, _status_code, _headers = stats_get_with_http_info(opts)
83
- data
84
- end
85
-
86
- # Stats
87
- # Get Stats
88
- # @param [Hash] opts the optional parameters
89
- # @return [Array<(Array<StatsResults>, Fixnum, Hash)>] Array<StatsResults> data, response status code and response headers
90
- def stats_get_with_http_info(opts = {})
91
- if @api_client.config.debugging
92
- @api_client.config.logger.debug 'Calling API: AdminApi.stats_get ...'
93
- end
94
- # resource path
95
- local_var_path = '/stats'
96
-
97
- # query parameters
98
- query_params = {}
99
-
100
- # header parameters
101
- header_params = {}
102
- # HTTP header 'Accept' (if needed)
103
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
104
- # HTTP header 'Content-Type'
105
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
106
-
107
- # form parameters
108
- form_params = {}
109
-
110
- # http body (model)
111
- post_body = nil
112
- auth_names = []
113
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
114
- :header_params => header_params,
115
- :query_params => query_params,
116
- :form_params => form_params,
117
- :body => post_body,
118
- :auth_names => auth_names,
119
- :return_type => 'Array<StatsResults>')
120
- if @api_client.config.debugging
121
- @api_client.config.logger.debug "API called: AdminApi#stats_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
122
- end
123
- return data, status_code, headers
124
- end
125
- # Reset Server Urls
126
- # Change server URLs
127
- # @param server_urls Comma Separated List URL String
128
- # @param [Hash] opts the optional parameters
129
- # @return [BasicResponse]
130
- def update_servers_put(server_urls, opts = {})
131
- data, _status_code, _headers = update_servers_put_with_http_info(server_urls, opts)
132
- data
133
- end
134
-
135
- # Reset Server Urls
136
- # Change server URLs
137
- # @param server_urls Comma Separated List URL String
138
- # @param [Hash] opts the optional parameters
139
- # @return [Array<(BasicResponse, Fixnum, Hash)>] BasicResponse data, response status code and response headers
140
- def update_servers_put_with_http_info(server_urls, opts = {})
141
- if @api_client.config.debugging
142
- @api_client.config.logger.debug 'Calling API: AdminApi.update_servers_put ...'
143
- end
144
- # verify the required parameter 'server_urls' is set
145
- if @api_client.config.client_side_validation && server_urls.nil?
146
- fail ArgumentError, "Missing the required parameter 'server_urls' when calling AdminApi.update_servers_put"
147
- end
148
- # resource path
149
- local_var_path = '/update_servers'
150
-
151
- # query parameters
152
- query_params = {}
153
- query_params[:'server_urls'] = server_urls
154
-
155
- # header parameters
156
- header_params = {}
157
- # HTTP header 'Accept' (if needed)
158
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
159
- # HTTP header 'Content-Type'
160
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
161
-
162
- # form parameters
163
- form_params = {}
164
-
165
- # http body (model)
166
- post_body = nil
167
- auth_names = []
168
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
169
- :header_params => header_params,
170
- :query_params => query_params,
171
- :form_params => form_params,
172
- :body => post_body,
173
- :auth_names => auth_names,
174
- :return_type => 'BasicResponse')
175
- if @api_client.config.debugging
176
- @api_client.config.logger.debug "API called: AdminApi#update_servers_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
177
- end
178
- return data, status_code, headers
179
- end
180
- end
181
- end
@@ -1,395 +0,0 @@
1
- =begin
2
- #AllQ
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.4.2
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'json'
15
- require 'logger'
16
- require 'tempfile'
17
- require 'typhoeus'
18
- require 'uri'
19
-
20
- module Allq
21
- class ApiClient
22
- # The Configuration object holding settings to be used in the API client.
23
- attr_accessor :config
24
-
25
- # Defines the headers to be used in HTTP requests of all API calls by default.
26
- #
27
- # @return [Hash]
28
- attr_accessor :default_headers
29
-
30
- # Initializes the ApiClient
31
- # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
32
- def initialize(config = Configuration.default)
33
- Ethon.logger = Logger.new(nil)
34
- @config = config
35
- @user_agent = "Swagger-Codegen/#{VERSION}/ruby"
36
- @default_headers = {
37
- 'Content-Type' => 'application/json',
38
- 'User-Agent' => @user_agent
39
- }
40
- end
41
-
42
- def self.default
43
- @@default ||= ApiClient.new
44
- end
45
-
46
- # Call an API with given options.
47
- #
48
- # @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements:
49
- # the data deserialized from response body (could be nil), response status code and response headers.
50
- def call_api(http_method, path, opts = {})
51
- request = build_request(http_method, path, opts)
52
- response = request.run
53
-
54
- if @config.debugging
55
- @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
56
- end
57
-
58
- if !response.success? # Retry
59
- sleep(5)
60
- request = build_request(http_method, path, opts)
61
- response = request.run
62
- end
63
-
64
- unless response.success?
65
- if response.timed_out?
66
- fail ApiError.new('Connection timed out')
67
- elsif response.code == 0
68
- # Errors from libcurl will be made visible here
69
- fail ApiError.new(:code => 0,
70
- :message => response.return_message)
71
- else
72
- fail ApiError.new(:code => response.code,
73
- :response_headers => response.headers,
74
- :response_body => response.body),
75
- response.status_message
76
- end
77
- end
78
-
79
- if opts[:return_type]
80
- data = deserialize(response, opts[:return_type])
81
- else
82
- data = nil
83
- end
84
- return data, response.code, response.headers
85
- end
86
-
87
- # Builds the HTTP request
88
- #
89
- # @param [String] http_method HTTP method/verb (e.g. POST)
90
- # @param [String] path URL path (e.g. /account/new)
91
- # @option opts [Hash] :header_params Header parameters
92
- # @option opts [Hash] :query_params Query parameters
93
- # @option opts [Hash] :form_params Query parameters
94
- # @option opts [Object] :body HTTP body (JSON/XML)
95
- # @return [Typhoeus::Request] A Typhoeus Request
96
- def build_request(http_method, path, opts = {})
97
- url = build_request_url(path)
98
- http_method = http_method.to_sym.downcase
99
-
100
- header_params = @default_headers.merge(opts[:header_params] || {})
101
- query_params = opts[:query_params] || {}
102
- form_params = opts[:form_params] || {}
103
-
104
-
105
- # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
106
- _verify_ssl_host = @config.verify_ssl_host ? 2 : 0
107
-
108
- req_opts = {
109
- :method => http_method,
110
- :headers => header_params,
111
- :params => query_params,
112
- :params_encoding => @config.params_encoding,
113
- :timeout => @config.timeout,
114
- :ssl_verifypeer => @config.verify_ssl,
115
- :ssl_verifyhost => _verify_ssl_host,
116
- :sslcert => @config.cert_file,
117
- :sslkey => @config.key_file,
118
- :verbose => @config.debugging
119
- }
120
-
121
- # set custom cert, if provided
122
- req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
123
-
124
- if [:post, :patch, :put, :delete].include?(http_method)
125
- req_body = build_request_body(header_params, form_params, opts[:body])
126
- req_opts.update :body => req_body
127
- if @config.debugging
128
- @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
129
- end
130
- end
131
-
132
- request = Typhoeus::Request.new(url, req_opts)
133
- download_file(request) if opts[:return_type] == 'File'
134
- request
135
- end
136
-
137
- # Check if the given MIME is a JSON MIME.
138
- # JSON MIME examples:
139
- # application/json
140
- # application/json; charset=UTF8
141
- # APPLICATION/JSON
142
- # */*
143
- # @param [String] mime MIME
144
- # @return [Boolean] True if the MIME is application/json
145
- def json_mime?(mime)
146
- (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
147
- end
148
-
149
- # Deserialize the response to the given return type.
150
- #
151
- # @param [Response] response HTTP response
152
- # @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]"
153
- def deserialize(response, return_type)
154
- body = response.body
155
-
156
- # handle file downloading - return the File instance processed in request callbacks
157
- # note that response body is empty when the file is written in chunks in request on_body callback
158
- return @tempfile if return_type == 'File'
159
-
160
- return nil if body.nil? || body.empty?
161
-
162
- # return response body directly for String return type
163
- return body if return_type == 'String'
164
-
165
- # ensuring a default content type
166
- content_type = response.headers['Content-Type'] || 'application/json'
167
-
168
- fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
169
-
170
- begin
171
- data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
172
- rescue JSON::ParserError => e
173
- if %w(String Date DateTime).include?(return_type)
174
- data = body
175
- else
176
- raise e
177
- end
178
- end
179
-
180
- convert_to_type data, return_type
181
- end
182
-
183
- # Convert data to the given return type.
184
- # @param [Object] data Data to be converted
185
- # @param [String] return_type Return type
186
- # @return [Mixed] Data in a particular type
187
- def convert_to_type(data, return_type)
188
- return nil if data.nil?
189
- case return_type
190
- when 'String'
191
- data.to_s
192
- when 'Integer'
193
- data.to_i
194
- when 'Float'
195
- data.to_f
196
- when 'BOOLEAN'
197
- data == true
198
- when 'DateTime'
199
- # parse date time (expecting ISO 8601 format)
200
- DateTime.parse data
201
- when 'Date'
202
- # parse date time (expecting ISO 8601 format)
203
- Date.parse data
204
- when 'Object'
205
- # generic object (usually a Hash), return directly
206
- data
207
- when /\AArray<(.+)>\z/
208
- # e.g. Array<Pet>
209
- sub_type = $1
210
- data.map { |item| convert_to_type(item, sub_type) }
211
- when /\AHash\<String, (.+)\>\z/
212
- # e.g. Hash<String, Integer>
213
- sub_type = $1
214
- {}.tap do |hash|
215
- data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
216
- end
217
- else
218
- # models, e.g. Pet
219
- Allq.const_get(return_type).new.tap do |model|
220
- model.build_from_hash data
221
- end
222
- end
223
- end
224
-
225
- # Save response body into a file in (the defined) temporary folder, using the filename
226
- # from the "Content-Disposition" header if provided, otherwise a random filename.
227
- # The response body is written to the file in chunks in order to handle files which
228
- # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
229
- # process can use.
230
- #
231
- # @see Configuration#temp_folder_path
232
- def download_file(request)
233
- tempfile = nil
234
- encoding = nil
235
- request.on_headers do |response|
236
- content_disposition = response.headers['Content-Disposition']
237
- if content_disposition && content_disposition =~ /filename=/i
238
- filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
239
- prefix = sanitize_filename(filename)
240
- else
241
- prefix = 'download-'
242
- end
243
- prefix = prefix + '-' unless prefix.end_with?('-')
244
- encoding = response.body.encoding
245
- tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
246
- @tempfile = tempfile
247
- end
248
- request.on_body do |chunk|
249
- chunk.force_encoding(encoding)
250
- tempfile.write(chunk)
251
- end
252
- request.on_complete do |response|
253
- tempfile.close
254
- @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
255
- "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
256
- "will be deleted automatically with GC. It's also recommended to delete the temp file "\
257
- "explicitly with `tempfile.delete`"
258
- end
259
- end
260
-
261
- # Sanitize filename by removing path.
262
- # e.g. ../../sun.gif becomes sun.gif
263
- #
264
- # @param [String] filename the filename to be sanitized
265
- # @return [String] the sanitized filename
266
- def sanitize_filename(filename)
267
- filename.gsub(/.*[\/\\]/, '')
268
- end
269
-
270
- def build_request_url(path)
271
- # Add leading and trailing slashes to path
272
- path = "/#{path}".gsub(/\/+/, '/')
273
- @config.base_url + path
274
- end
275
-
276
- # Builds the HTTP request body
277
- #
278
- # @param [Hash] header_params Header parameters
279
- # @param [Hash] form_params Query parameters
280
- # @param [Object] body HTTP body (JSON/XML)
281
- # @return [String] HTTP body data in the form of string
282
- def build_request_body(header_params, form_params, body)
283
- # http form
284
- if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
285
- header_params['Content-Type'] == 'multipart/form-data'
286
- data = {}
287
- form_params.each do |key, value|
288
- case value
289
- when ::File, ::Array, nil
290
- # let typhoeus handle File, Array and nil parameters
291
- data[key] = value
292
- else
293
- data[key] = value.to_s
294
- end
295
- end
296
- elsif body
297
- data = body.is_a?(String) ? body : body.to_json
298
- else
299
- data = nil
300
- end
301
- data
302
- end
303
-
304
- # Update hearder and query params based on authentication settings.
305
- #
306
- # @param [Hash] header_params Header parameters
307
- # @param [Hash] query_params Query parameters
308
- # @param [String] auth_names Authentication scheme name
309
- def update_params_for_auth!(header_params, query_params, auth_names)
310
- Array(auth_names).each do |auth_name|
311
- auth_setting = @config.auth_settings[auth_name]
312
- next unless auth_setting
313
- case auth_setting[:in]
314
- when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
315
- when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
316
- else fail ArgumentError, 'Authentication token must be in `query` of `header`'
317
- end
318
- end
319
- end
320
-
321
- # Sets user agent in HTTP header
322
- #
323
- # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0)
324
- def user_agent=(user_agent)
325
- @user_agent = user_agent
326
- @default_headers['User-Agent'] = @user_agent
327
- end
328
-
329
- # Return Accept header based on an array of accepts provided.
330
- # @param [Array] accepts array for Accept
331
- # @return [String] the Accept header (e.g. application/json)
332
- def select_header_accept(accepts)
333
- return nil if accepts.nil? || accepts.empty?
334
- # use JSON when present, otherwise use all of the provided
335
- json_accept = accepts.find { |s| json_mime?(s) }
336
- json_accept || accepts.join(',')
337
- end
338
-
339
- # Return Content-Type header based on an array of content types provided.
340
- # @param [Array] content_types array for Content-Type
341
- # @return [String] the Content-Type header (e.g. application/json)
342
- def select_header_content_type(content_types)
343
- # use application/json by default
344
- return 'application/json' if content_types.nil? || content_types.empty?
345
- # use JSON when present, otherwise use the first one
346
- json_content_type = content_types.find { |s| json_mime?(s) }
347
- json_content_type || content_types.first
348
- end
349
-
350
- # Convert object (array, hash, object, etc) to JSON string.
351
- # @param [Object] model object to be converted into JSON string
352
- # @return [String] JSON string representation of the object
353
- def object_to_http_body(model)
354
- return model if model.nil? || model.is_a?(String)
355
- local_body = nil
356
- if model.is_a?(Array)
357
- local_body = model.map { |m| object_to_hash(m) }
358
- else
359
- local_body = object_to_hash(model)
360
- end
361
- local_body.to_json
362
- end
363
-
364
- # Convert object(non-array) to hash.
365
- # @param [Object] obj object to be converted into JSON string
366
- # @return [String] JSON string representation of the object
367
- def object_to_hash(obj)
368
- if obj.respond_to?(:to_hash)
369
- obj.to_hash
370
- else
371
- obj
372
- end
373
- end
374
-
375
- # Build parameter value according to the given collection format.
376
- # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
377
- def build_collection_param(param, collection_format)
378
- case collection_format
379
- when :csv
380
- param.join(',')
381
- when :ssv
382
- param.join(' ')
383
- when :tsv
384
- param.join("\t")
385
- when :pipes
386
- param.join('|')
387
- when :multi
388
- # return the array directly as typhoeus will handle it as expected
389
- param
390
- else
391
- fail "unknown collection format: #{collection_format.inspect}"
392
- end
393
- end
394
- end
395
- end
@@ -1,38 +0,0 @@
1
- =begin
2
- #AllQ
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.4.2
10
-
11
- =end
12
-
13
- module Allq
14
- class ApiError < StandardError
15
- attr_reader :code, :response_headers, :response_body
16
-
17
- # Usage examples:
18
- # ApiError.new
19
- # ApiError.new("message")
20
- # ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
21
- # ApiError.new(:code => 404, :message => "Not Found")
22
- def initialize(arg = nil)
23
- if arg.is_a? Hash
24
- if arg.key?(:message) || arg.key?('message')
25
- super(arg[:message] || arg['message'])
26
- else
27
- super arg
28
- end
29
-
30
- arg.each do |k, v|
31
- instance_variable_set "@#{k}", v
32
- end
33
- else
34
- super arg
35
- end
36
- end
37
- end
38
- end