pollster 0.2.3 → 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 (39) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +1 -1
  3. data/README.md +68 -111
  4. data/example.rb +128 -0
  5. data/lib/pollster.rb +46 -4
  6. data/lib/pollster/api.rb +655 -0
  7. data/lib/pollster/api_client.rb +400 -0
  8. data/lib/pollster/api_error.rb +26 -0
  9. data/lib/pollster/configuration.rb +184 -0
  10. data/lib/pollster/models/chart.rb +239 -0
  11. data/lib/pollster/models/chart_estimate.rb +226 -0
  12. data/lib/pollster/models/chart_estimate_lowess_parameters.rb +197 -0
  13. data/lib/pollster/models/chart_pollster_estimate_summary.rb +217 -0
  14. data/lib/pollster/models/chart_pollster_trendlines.rb +41 -0
  15. data/lib/pollster/models/inline_response_200.rb +208 -0
  16. data/lib/pollster/models/inline_response_200_3.rb +206 -0
  17. data/lib/pollster/models/inline_response_200_4.rb +208 -0
  18. data/lib/pollster/models/poll.rb +279 -0
  19. data/lib/pollster/models/poll_question.rb +198 -0
  20. data/lib/pollster/models/poll_question_responses.rb +197 -0
  21. data/lib/pollster/models/poll_question_sample_subpopulations.rb +209 -0
  22. data/lib/pollster/models/pollster_chart_poll_questions.rb +92 -0
  23. data/lib/pollster/models/question.rb +253 -0
  24. data/lib/pollster/models/question_poll_responses_clean.rb +93 -0
  25. data/lib/pollster/models/question_poll_responses_raw.rb +86 -0
  26. data/lib/pollster/models/question_responses.rb +207 -0
  27. data/lib/pollster/models/tag.rb +207 -0
  28. data/lib/pollster/version.rb +1 -1
  29. data/pollster.gemspec +17 -16
  30. metadata +85 -65
  31. data/.gitignore +0 -2
  32. data/Gemfile +0 -3
  33. data/Gemfile.lock +0 -19
  34. data/Rakefile +0 -8
  35. data/lib/pollster/base.rb +0 -45
  36. data/lib/pollster/chart.rb +0 -69
  37. data/lib/pollster/poll.rb +0 -47
  38. data/lib/pollster/question.rb +0 -19
  39. data/test/test_pollster.rb +0 -26
@@ -0,0 +1,400 @@
1
+ require 'date'
2
+ require 'json'
3
+ require 'logger'
4
+ require 'tempfile'
5
+ require 'typhoeus'
6
+ require 'uri'
7
+
8
+ module Pollster
9
+ class ApiClient
10
+ # The Configuration object holding settings to be used in the API client.
11
+ attr_accessor :config
12
+
13
+ # Defines the headers to be used in HTTP requests of all API calls by default.
14
+ #
15
+ # @return [Hash]
16
+ attr_accessor :default_headers
17
+
18
+ # Initializes the ApiClient
19
+ # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
20
+ def initialize(config = Configuration.default)
21
+ @config = config
22
+ @user_agent = "Swagger-Codegen/#{VERSION}/ruby"
23
+ @default_headers = {
24
+ 'Content-Type' => "application/json",
25
+ 'User-Agent' => @user_agent
26
+ }
27
+ end
28
+
29
+ def self.default
30
+ @@default ||= ApiClient.new
31
+ end
32
+
33
+ # Call an API with given options.
34
+ #
35
+ # @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements:
36
+ # the data deserialized from response body (could be nil), response status code and response headers.
37
+ def call_api(http_method, path, opts = {})
38
+ request = build_request(http_method, path, opts)
39
+ response = request.run
40
+
41
+ if @config.debugging
42
+ @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
43
+ end
44
+
45
+ unless response.success?
46
+ if response.timed_out?
47
+ fail ApiError.new('Connection timed out')
48
+ elsif response.code == 0
49
+ # Errors from libcurl will be made visible here
50
+ fail ApiError.new(:code => 0,
51
+ :message => response.return_message)
52
+ else
53
+ fail ApiError.new(:code => response.code,
54
+ :response_headers => response.headers,
55
+ :response_body => response.body),
56
+ response.status_message
57
+ end
58
+ end
59
+
60
+ if opts[:return_type]
61
+ data = deserialize(response, opts[:return_type])
62
+ else
63
+ data = nil
64
+ end
65
+ return data, response.code, response.headers
66
+ end
67
+
68
+ # Call an API with given options, and parse the TSV response.
69
+ #
70
+ # @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements:
71
+ # the data deserialized from response body (could be nil), response status code and response headers.
72
+ def call_api_tsv(http_method, path, opts = {})
73
+ request = build_request(http_method, path, opts)
74
+ response = request.run
75
+
76
+ if @config.debugging
77
+ @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
78
+ end
79
+
80
+ unless response.success?
81
+ if response.timed_out?
82
+ fail ApiError.new('Connection timed out')
83
+ elsif response.code == 0
84
+ # Errors from libcurl will be made visible here
85
+ fail ApiError.new(:code => 0,
86
+ :message => response.return_message)
87
+ else
88
+ fail ApiError.new(:code => response.code,
89
+ :response_headers => response.headers,
90
+ :response_body => response.body),
91
+ response.status_message
92
+ end
93
+ end
94
+
95
+ if opts[:return_type]
96
+ return_type = Pollster.const_get(opts[:return_type])
97
+ data = return_type.from_tsv(response.body)
98
+ else
99
+ data = nil
100
+ end
101
+ return data, response.code, response.headers
102
+ end
103
+
104
+ # Builds the HTTP request
105
+ #
106
+ # @param [String] http_method HTTP method/verb (e.g. POST)
107
+ # @param [String] path URL path (e.g. /account/new)
108
+ # @option opts [Hash] :header_params Header parameters
109
+ # @option opts [Hash] :query_params Query parameters
110
+ # @option opts [Hash] :form_params Query parameters
111
+ # @option opts [Object] :body HTTP body (JSON/XML)
112
+ # @return [Typhoeus::Request] A Typhoeus Request
113
+ def build_request(http_method, path, opts = {})
114
+ url = build_request_url(path)
115
+ http_method = http_method.to_sym.downcase
116
+
117
+ header_params = @default_headers.merge(opts[:header_params] || {})
118
+ query_params = opts[:query_params] || {}
119
+ form_params = opts[:form_params] || {}
120
+
121
+
122
+ # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
123
+ _verify_ssl_host = @config.verify_ssl_host ? 2 : 0
124
+
125
+ req_opts = {
126
+ :method => http_method,
127
+ :headers => header_params,
128
+ :params => query_params,
129
+ :params_encoding => @config.params_encoding,
130
+ :timeout => @config.timeout,
131
+ :ssl_verifypeer => @config.verify_ssl,
132
+ :ssl_verifyhost => _verify_ssl_host,
133
+ :sslcert => @config.cert_file,
134
+ :sslkey => @config.key_file,
135
+ :verbose => @config.debugging
136
+ }
137
+
138
+ # set custom cert, if provided
139
+ req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
140
+
141
+ if [:post, :patch, :put, :delete].include?(http_method)
142
+ req_body = build_request_body(header_params, form_params, opts[:body])
143
+ req_opts.update :body => req_body
144
+ if @config.debugging
145
+ @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
146
+ end
147
+ end
148
+
149
+ Typhoeus::Request.new(url, req_opts)
150
+ end
151
+
152
+ # Check if the given MIME is a JSON MIME.
153
+ # JSON MIME examples:
154
+ # application/json
155
+ # application/json; charset=UTF8
156
+ # APPLICATION/JSON
157
+ # */*
158
+ # @param [String] mime MIME
159
+ # @return [Boolean] True if the MIME is application/json
160
+ def json_mime?(mime)
161
+ (mime == "*/*") || !(mime =~ /\Aapplication\/json(;.*)?\z/i).nil?
162
+ end
163
+
164
+ # Deserialize the response to the given return type.
165
+ #
166
+ # @param [Response] response HTTP response
167
+ # @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]"
168
+ def deserialize(response, return_type)
169
+ body = response.body
170
+ return nil if body.nil? || body.empty?
171
+
172
+ # return response body directly for String return type
173
+ return body if return_type == 'String'
174
+
175
+ # handle file downloading - save response body into a tmp file and return the File instance
176
+ return download_file(response) if return_type == 'File'
177
+
178
+ # ensuring a default content type
179
+ content_type = response.headers['Content-Type'] || 'application/json'
180
+
181
+ fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
182
+
183
+ begin
184
+ data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
185
+ rescue JSON::ParserError => e
186
+ if %w(String Date DateTime).include?(return_type)
187
+ data = body
188
+ else
189
+ raise e
190
+ end
191
+ end
192
+
193
+ convert_to_type data, return_type
194
+ end
195
+
196
+ # Convert data to the given return type.
197
+ # @param [Object] data Data to be converted
198
+ # @param [String] return_type Return type
199
+ # @return [Mixed] Data in a particular type
200
+ def convert_to_type(data, return_type)
201
+ return nil if data.nil?
202
+ case return_type
203
+ when 'String'
204
+ data.to_s
205
+ when 'Integer'
206
+ data.to_i
207
+ when 'Float'
208
+ data.to_f
209
+ when 'BOOLEAN'
210
+ data == true
211
+ when 'DateTime'
212
+ # parse date time (expecting ISO 8601 format)
213
+ DateTime.parse data
214
+ when 'Date'
215
+ # parse date time (expecting ISO 8601 format)
216
+ Date.parse data
217
+ when 'Object'
218
+ # generic object (usually a Hash), return directly
219
+ data
220
+ when /\AArray<(.+)>\z/
221
+ # e.g. Array<Pet>
222
+ sub_type = $1
223
+ data.map {|item| convert_to_type(item, sub_type) }
224
+ when /\AHash\<String, (.+)\>\z/
225
+ # e.g. Hash<String, Integer>
226
+ sub_type = $1
227
+ {}.tap do |hash|
228
+ data.each {|k, v| hash[k] = convert_to_type(v, sub_type) }
229
+ end
230
+ else
231
+ # models, e.g. Pet
232
+ Pollster.const_get(return_type).new.tap do |model|
233
+ model.build_from_hash data
234
+ end
235
+ end
236
+ end
237
+
238
+ # Save response body into a file in (the defined) temporary folder, using the filename
239
+ # from the "Content-Disposition" header if provided, otherwise a random filename.
240
+ #
241
+ # @see Configuration#temp_folder_path
242
+ # @return [Tempfile] the file downloaded
243
+ def download_file(response)
244
+ content_disposition = response.headers['Content-Disposition']
245
+ if content_disposition and content_disposition =~ /filename=/i
246
+ filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
247
+ prefix = sanitize_filename(filename)
248
+ else
249
+ prefix = 'download-'
250
+ end
251
+ prefix = prefix + '-' unless prefix.end_with?('-')
252
+
253
+ tempfile = nil
254
+ encoding = response.body.encoding
255
+ Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) do |file|
256
+ file.write(response.body)
257
+ tempfile = file
258
+ end
259
+ @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
260
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
261
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
262
+ "explicitly with `tempfile.delete`"
263
+ tempfile
264
+ end
265
+
266
+ # Sanitize filename by removing path.
267
+ # e.g. ../../sun.gif becomes sun.gif
268
+ #
269
+ # @param [String] filename the filename to be sanitized
270
+ # @return [String] the sanitized filename
271
+ def sanitize_filename(filename)
272
+ filename.gsub(/.*[\/\\]/, '')
273
+ end
274
+
275
+ def build_request_url(path)
276
+ # Add leading and trailing slashes to path
277
+ path = "/#{path}".gsub(/\/+/, '/')
278
+ URI.encode(@config.base_url + path)
279
+ end
280
+
281
+ # Builds the HTTP request body
282
+ #
283
+ # @param [Hash] header_params Header parameters
284
+ # @param [Hash] form_params Query parameters
285
+ # @param [Object] body HTTP body (JSON/XML)
286
+ # @return [String] HTTP body data in the form of string
287
+ def build_request_body(header_params, form_params, body)
288
+ # http form
289
+ if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
290
+ header_params['Content-Type'] == 'multipart/form-data'
291
+ data = {}
292
+ form_params.each do |key, value|
293
+ case value
294
+ when File, Array, nil
295
+ # let typhoeus handle File, Array and nil parameters
296
+ data[key] = value
297
+ else
298
+ data[key] = value.to_s
299
+ end
300
+ end
301
+ elsif body
302
+ data = body.is_a?(String) ? body : body.to_json
303
+ else
304
+ data = nil
305
+ end
306
+ data
307
+ end
308
+
309
+ # Update hearder and query params based on authentication settings.
310
+ #
311
+ # @param [Hash] header_params Header parameters
312
+ # @param [Hash] query_params Query parameters
313
+ # @param [String] auth_names Authentication scheme name
314
+ def update_params_for_auth!(header_params, query_params, auth_names)
315
+ Array(auth_names).each do |auth_name|
316
+ auth_setting = @config.auth_settings[auth_name]
317
+ next unless auth_setting
318
+ case auth_setting[:in]
319
+ when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
320
+ when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
321
+ else fail ArgumentError, 'Authentication token must be in `query` of `header`'
322
+ end
323
+ end
324
+ end
325
+
326
+ # Sets user agent in HTTP header
327
+ #
328
+ # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0)
329
+ def user_agent=(user_agent)
330
+ @user_agent = user_agent
331
+ @default_headers['User-Agent'] = @user_agent
332
+ end
333
+
334
+ # Return Accept header based on an array of accepts provided.
335
+ # @param [Array] accepts array for Accept
336
+ # @return [String] the Accept header (e.g. application/json)
337
+ def select_header_accept(accepts)
338
+ return nil if accepts.nil? || accepts.empty?
339
+ # use JSON when present, otherwise use all of the provided
340
+ json_accept = accepts.find { |s| json_mime?(s) }
341
+ return json_accept || accepts.join(',')
342
+ end
343
+
344
+ # Return Content-Type header based on an array of content types provided.
345
+ # @param [Array] content_types array for Content-Type
346
+ # @return [String] the Content-Type header (e.g. application/json)
347
+ def select_header_content_type(content_types)
348
+ # use application/json by default
349
+ return 'application/json' if content_types.nil? || content_types.empty?
350
+ # use JSON when present, otherwise use the first one
351
+ json_content_type = content_types.find { |s| json_mime?(s) }
352
+ return json_content_type || content_types.first
353
+ end
354
+
355
+ # Convert object (array, hash, object, etc) to JSON string.
356
+ # @param [Object] model object to be converted into JSON string
357
+ # @return [String] JSON string representation of the object
358
+ def object_to_http_body(model)
359
+ return model if model.nil? || model.is_a?(String)
360
+ local_body = nil
361
+ if model.is_a?(Array)
362
+ local_body = model.map{|m| object_to_hash(m) }
363
+ else
364
+ local_body = object_to_hash(model)
365
+ end
366
+ local_body.to_json
367
+ end
368
+
369
+ # Convert object(non-array) to hash.
370
+ # @param [Object] obj object to be converted into JSON string
371
+ # @return [String] JSON string representation of the object
372
+ def object_to_hash(obj)
373
+ if obj.respond_to?(:to_hash)
374
+ obj.to_hash
375
+ else
376
+ obj
377
+ end
378
+ end
379
+
380
+ # Build parameter value according to the given collection format.
381
+ # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
382
+ def build_collection_param(param, collection_format)
383
+ case collection_format
384
+ when :csv
385
+ param.join(',')
386
+ when :ssv
387
+ param.join(' ')
388
+ when :tsv
389
+ param.join("\t")
390
+ when :pipes
391
+ param.join('|')
392
+ when :multi
393
+ # return the array directly as typhoeus will handle it as expected
394
+ param
395
+ else
396
+ fail "unknown collection format: #{collection_format.inspect}"
397
+ end
398
+ end
399
+ end
400
+ end
@@ -0,0 +1,26 @@
1
+ module Pollster
2
+ class ApiError < StandardError
3
+ attr_reader :code, :response_headers, :response_body
4
+
5
+ # Usage examples:
6
+ # ApiError.new
7
+ # ApiError.new("message")
8
+ # ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
9
+ # ApiError.new(:code => 404, :message => "Not Found")
10
+ def initialize(arg = nil)
11
+ if arg.is_a? Hash
12
+ if arg.key?(:message) || arg.key?('message')
13
+ super(arg[:message] || arg['message'])
14
+ else
15
+ super arg
16
+ end
17
+
18
+ arg.each do |k, v|
19
+ instance_variable_set "@#{k}", v
20
+ end
21
+ else
22
+ super arg
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,184 @@
1
+ require 'uri'
2
+
3
+ module Pollster
4
+ class Configuration
5
+ # Defines url scheme
6
+ attr_accessor :scheme
7
+
8
+ # Defines url host
9
+ attr_accessor :host
10
+
11
+ # Defines url base path
12
+ attr_accessor :base_path
13
+
14
+ # Defines API keys used with API Key authentications.
15
+ #
16
+ # @return [Hash] key: parameter name, value: parameter value (API key)
17
+ #
18
+ # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
19
+ # config.api_key['api_key'] = 'xxx'
20
+ attr_accessor :api_key
21
+
22
+ # Defines API key prefixes used with API Key authentications.
23
+ #
24
+ # @return [Hash] key: parameter name, value: API key prefix
25
+ #
26
+ # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
27
+ # config.api_key_prefix['api_key'] = 'Token'
28
+ attr_accessor :api_key_prefix
29
+
30
+ # Defines the username used with HTTP basic authentication.
31
+ #
32
+ # @return [String]
33
+ attr_accessor :username
34
+
35
+ # Defines the password used with HTTP basic authentication.
36
+ #
37
+ # @return [String]
38
+ attr_accessor :password
39
+
40
+ # Defines the access token (Bearer) used with OAuth2.
41
+ attr_accessor :access_token
42
+
43
+ # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
44
+ # details will be logged with `logger.debug` (see the `logger` attribute).
45
+ # Default to false.
46
+ #
47
+ # @return [true, false]
48
+ attr_accessor :debugging
49
+
50
+ # Defines the logger used for debugging.
51
+ # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
52
+ #
53
+ # @return [#debug]
54
+ attr_accessor :logger
55
+
56
+ # Defines the temporary folder to store downloaded files
57
+ # (for API endpoints that have file response).
58
+ # Default to use `Tempfile`.
59
+ #
60
+ # @return [String]
61
+ attr_accessor :temp_folder_path
62
+
63
+ # The time limit for HTTP request in seconds.
64
+ # Default to 0 (never times out).
65
+ attr_accessor :timeout
66
+
67
+ ### TLS/SSL setting
68
+ # Set this to false to skip verifying SSL certificate when calling API from https server.
69
+ # Default to true.
70
+ #
71
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
72
+ #
73
+ # @return [true, false]
74
+ attr_accessor :verify_ssl
75
+
76
+ ### TLS/SSL setting
77
+ # Set this to false to skip verifying SSL host name
78
+ # Default to true.
79
+ #
80
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
81
+ #
82
+ # @return [true, false]
83
+ attr_accessor :verify_ssl_host
84
+
85
+ ### TLS/SSL setting
86
+ # Set this to customize the certificate file to verify the peer.
87
+ #
88
+ # @return [String] the path to the certificate file
89
+ #
90
+ # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
91
+ # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
92
+ attr_accessor :ssl_ca_cert
93
+
94
+ ### TLS/SSL setting
95
+ # Client certificate file (for client certificate)
96
+ attr_accessor :cert_file
97
+
98
+ ### TLS/SSL setting
99
+ # Client private key file (for client certificate)
100
+ attr_accessor :key_file
101
+
102
+ # Set this to customize parameters encoding of array parameter with multi collectionFormat.
103
+ # Default to nil.
104
+ #
105
+ # @see The params_encoding option of Ethon. Related source code:
106
+ # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
107
+ attr_accessor :params_encoding
108
+
109
+ attr_accessor :inject_format
110
+
111
+ attr_accessor :force_ending_format
112
+
113
+ def initialize
114
+ @scheme = 'http'
115
+ @host = 'elections.huffingtonpost.com'
116
+ @base_path = '/pollster/api/v2'
117
+ @api_key = {}
118
+ @api_key_prefix = {}
119
+ @timeout = 0
120
+ @verify_ssl = true
121
+ @verify_ssl_host = true
122
+ @params_encoding = nil
123
+ @cert_file = nil
124
+ @key_file = nil
125
+ @debugging = false
126
+ @inject_format = false
127
+ @force_ending_format = false
128
+ @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
129
+
130
+ yield(self) if block_given?
131
+ end
132
+
133
+ # The default Configuration object.
134
+ def self.default
135
+ @@default ||= Configuration.new
136
+ end
137
+
138
+ def configure
139
+ yield(self) if block_given?
140
+ end
141
+
142
+ def scheme=(scheme)
143
+ # remove :// from scheme
144
+ @scheme = scheme.sub(/:\/\//, '')
145
+ end
146
+
147
+ def host=(host)
148
+ # remove http(s):// and anything after a slash
149
+ @host = host.sub(/https?:\/\//, '').split('/').first
150
+ end
151
+
152
+ def base_path=(base_path)
153
+ # Add leading and trailing slashes to base_path
154
+ @base_path = "/#{base_path}".gsub(/\/+/, '/')
155
+ @base_path = "" if @base_path == "/"
156
+ end
157
+
158
+ def base_url
159
+ url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
160
+ URI.encode(url)
161
+ end
162
+
163
+ # Gets API key (with prefix if set).
164
+ # @param [String] param_name the parameter name of API key auth
165
+ def api_key_with_prefix(param_name)
166
+ if @api_key_prefix[param_name]
167
+ "#{@api_key_prefix[param_name]} #{@api_key[param_name]}"
168
+ else
169
+ @api_key[param_name]
170
+ end
171
+ end
172
+
173
+ # Gets Basic Auth token string
174
+ def basic_auth_token
175
+ 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
176
+ end
177
+
178
+ # Returns Auth Settings hash for api client.
179
+ def auth_settings
180
+ {
181
+ }
182
+ end
183
+ end
184
+ end