change_healthcare-professional_claims 0.1.0

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