vericred_client 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +225 -0
  3. data/docs/Applicant.md +14 -0
  4. data/docs/Carrier.md +10 -0
  5. data/docs/CarrierSubsidiary.md +9 -0
  6. data/docs/County.md +16 -0
  7. data/docs/Drug.md +10 -0
  8. data/docs/DrugCoverage.md +13 -0
  9. data/docs/DrugCoverageApi.md +60 -0
  10. data/docs/InlineResponse200.md +9 -0
  11. data/docs/InlineResponse2001.md +8 -0
  12. data/docs/InlineResponse2002.md +10 -0
  13. data/docs/Plan.md +53 -0
  14. data/docs/PlanCounty.md +10 -0
  15. data/docs/PlanSearchResult.md +54 -0
  16. data/docs/PlansApi.md +118 -0
  17. data/docs/Pricing.md +12 -0
  18. data/docs/Provider.md +31 -0
  19. data/docs/ProvidersApi.md +135 -0
  20. data/docs/Query.md +15 -0
  21. data/docs/RatingArea.md +9 -0
  22. data/docs/State.md +15 -0
  23. data/docs/ZipCode.md +9 -0
  24. data/docs/ZipCountiesApi.md +63 -0
  25. data/docs/ZipCounty.md +10 -0
  26. data/lib/vericred_client/api/drug_coverage_api.rb +201 -0
  27. data/lib/vericred_client/api/plans_api.rb +317 -0
  28. data/lib/vericred_client/api/providers_api.rb +303 -0
  29. data/lib/vericred_client/api/zip_counties_api.rb +208 -0
  30. data/lib/vericred_client/api_client.rb +474 -0
  31. data/lib/vericred_client/api_error.rb +149 -0
  32. data/lib/vericred_client/configuration.rb +163 -0
  33. data/lib/vericred_client/models/applicant.rb +358 -0
  34. data/lib/vericred_client/models/carrier.rb +318 -0
  35. data/lib/vericred_client/models/carrier_subsidiary.rb +308 -0
  36. data/lib/vericred_client/models/county.rb +360 -0
  37. data/lib/vericred_client/models/drug.rb +318 -0
  38. data/lib/vericred_client/models/drug_coverage.rb +348 -0
  39. data/lib/vericred_client/models/inline_response_200.rb +308 -0
  40. data/lib/vericred_client/models/inline_response_200_1.rb +297 -0
  41. data/lib/vericred_client/models/inline_response_200_2.rb +321 -0
  42. data/lib/vericred_client/models/plan.rb +748 -0
  43. data/lib/vericred_client/models/plan_county.rb +318 -0
  44. data/lib/vericred_client/models/plan_search_result.rb +758 -0
  45. data/lib/vericred_client/models/pricing.rb +338 -0
  46. data/lib/vericred_client/models/provider.rb +528 -0
  47. data/lib/vericred_client/models/query.rb +364 -0
  48. data/lib/vericred_client/models/rating_area.rb +308 -0
  49. data/lib/vericred_client/models/state.rb +368 -0
  50. data/lib/vericred_client/models/zip_code.rb +308 -0
  51. data/lib/vericred_client/models/zip_county.rb +318 -0
  52. data/lib/vericred_client/version.rb +128 -0
  53. data/lib/vericred_client.rb +175 -0
  54. data/spec/api/drug_coverage_api_spec.rb +168 -0
  55. data/spec/api/plans_api_spec.rb +226 -0
  56. data/spec/api/providers_api_spec.rb +202 -0
  57. data/spec/api/zip_counties_api_spec.rb +171 -0
  58. data/vericred_client.gemspec +31 -0
  59. metadata +285 -0
@@ -0,0 +1,338 @@
1
+ =begin
2
+ Vericred API
3
+
4
+ Vericred's API allows you to search for Health Plans that a specific doctor
5
+ accepts.
6
+
7
+ ## Getting Started
8
+
9
+ Visit our [Developer Portal](https://vericred.3scale.net/access_code?access_code=vericred&cms_token=3545ca52af07bde85b7c0c3aa9d1985e) to
10
+ create an account.
11
+
12
+ Once you have created an account, you can create one Application for
13
+ Production and another for our Sandbox (select the appropriate Plan when
14
+ you create the Application).
15
+
16
+ ## Authentication
17
+
18
+ To authenticate, pass the API Key you created in the Developer Portal as
19
+ a `Vericred-Api-Key` header.
20
+
21
+ `curl -H 'Vericred-Api-Key: YOUR_KEY' "https://api.vericred.com/providers?search_term=Foo&zip_code=11215"`
22
+
23
+ ## Versioning
24
+
25
+ Vericred's API default to the latest version. However, if you need a specific
26
+ version, you can request it with an `Accept-Version` header.
27
+
28
+ The current version is `v3`. Previous versions are `v1` and `v2`.
29
+
30
+ `curl -H 'Vericred-Api-Key: YOUR_KEY' -H 'Accept-Version: v2' "https://api.vericred.com/providers?search_term=Foo&zip_code=11215"`
31
+
32
+ ## Pagination
33
+
34
+ Most endpoints are not paginated. It will be noted in the documentation if/when
35
+ an endpoint is paginated.
36
+
37
+ When pagination is present, a `meta` stanza will be present in the response
38
+ with the total number of records
39
+
40
+ ```
41
+ {
42
+ things: [{ id: 1 }, { id: 2 }],
43
+ meta: { total: 500 }
44
+ }
45
+ ```
46
+
47
+ ## Sideloading
48
+
49
+ When we return multiple levels of an object graph (e.g. `Provider`s and their `State`s
50
+ we sideload the associated data. In this example, we would provide an Array of
51
+ `State`s and a `state_id` for each provider. This is done primarily to reduce the
52
+ payload size since many of the `Provider`s will share a `State`
53
+
54
+ ```
55
+ {
56
+ providers: [{ id: 1, state_id: 1}, { id: 2, state_id: 1 }],
57
+ states: [{ id: 1, code: 'NY' }]
58
+ }
59
+ ```
60
+
61
+ If you need the second level of the object graph, you can just match the
62
+ corresponding id.
63
+
64
+ ## Selecting specific data
65
+
66
+ All endpoints allow you to specify which fields you would like to return.
67
+ This allows you to limit the response to contain only the data you need.
68
+
69
+ For example, let's take a request that returns the following JSON by default
70
+
71
+ ```
72
+ {
73
+ provider: {
74
+ id: 1,
75
+ name: 'John',
76
+ phone: '1234567890',
77
+ field_we_dont_care_about: 'value_we_dont_care_about'
78
+ },
79
+ states: [{
80
+ id: 1,
81
+ name: 'New York',
82
+ code: 'NY',
83
+ field_we_dont_care_about: 'value_we_dont_care_about'
84
+ }]
85
+ }
86
+ ```
87
+
88
+ To limit our results to only return the fields we care about, we specify the
89
+ `select` query string parameter for the corresponding fields in the JSON
90
+ document.
91
+
92
+ In this case, we want to select `name` and `phone` from the `provider` key,
93
+ so we would add the parameters `select=provider.name,provider.phone`.
94
+ We also want the `name` and `code` from the `states` key, so we would
95
+ add the parameters `select=states.name,staes.code`. The id field of
96
+ each document is always returned whether or not it is requested.
97
+
98
+ Our final request would be `GET /providers/12345?select=provider.name,provider.phone,states.name,states.code`
99
+
100
+ The response would be
101
+
102
+ ```
103
+ {
104
+ provider: {
105
+ id: 1,
106
+ name: 'John',
107
+ phone: '1234567890'
108
+ },
109
+ states: [{
110
+ id: 1,
111
+ name: 'New York',
112
+ code: 'NY'
113
+ }]
114
+ }
115
+ ```
116
+
117
+
118
+
119
+ OpenAPI spec version:
120
+
121
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
122
+
123
+
124
+ =end
125
+
126
+ require 'date'
127
+
128
+ module VericredClient
129
+ class Pricing
130
+ # Age of applicant
131
+ attr_accessor :age
132
+
133
+ # Effective date of plan
134
+ attr_accessor :effective_date
135
+
136
+ # Plan expiration date
137
+ attr_accessor :expiration_date
138
+
139
+ # Foreign key to plans
140
+ attr_accessor :plan_id
141
+
142
+ # Foreign key to rating areas
143
+ attr_accessor :rating_area_id
144
+
145
+ # Attribute mapping from ruby-style variable name to JSON key.
146
+ def self.attribute_map
147
+ {
148
+ :'age' => :'age',
149
+ :'effective_date' => :'effective_date',
150
+ :'expiration_date' => :'expiration_date',
151
+ :'plan_id' => :'plan_id',
152
+ :'rating_area_id' => :'rating_area_id'
153
+ }
154
+ end
155
+
156
+ # Attribute type mapping.
157
+ def self.swagger_types
158
+ {
159
+ :'age' => :'Integer',
160
+ :'effective_date' => :'Date',
161
+ :'expiration_date' => :'Date',
162
+ :'plan_id' => :'Integer',
163
+ :'rating_area_id' => :'Integer'
164
+ }
165
+ end
166
+
167
+ # Initializes the object
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ def initialize(attributes = {})
170
+ return unless attributes.is_a?(Hash)
171
+
172
+ # convert string to symbol for hash key
173
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
174
+
175
+ if attributes.has_key?(:'age')
176
+ self.age = attributes[:'age']
177
+ end
178
+
179
+ if attributes.has_key?(:'effective_date')
180
+ self.effective_date = attributes[:'effective_date']
181
+ end
182
+
183
+ if attributes.has_key?(:'expiration_date')
184
+ self.expiration_date = attributes[:'expiration_date']
185
+ end
186
+
187
+ if attributes.has_key?(:'plan_id')
188
+ self.plan_id = attributes[:'plan_id']
189
+ end
190
+
191
+ if attributes.has_key?(:'rating_area_id')
192
+ self.rating_area_id = attributes[:'rating_area_id']
193
+ end
194
+
195
+ end
196
+
197
+ # Show invalid properties with the reasons. Usually used together with valid?
198
+ # @return Array for valid properies with the reasons
199
+ def list_invalid_properties
200
+ invalid_properties = Array.new
201
+ return invalid_properties
202
+ end
203
+
204
+ # Check to see if the all the properties in the model are valid
205
+ # @return true if the model is valid
206
+ def valid?
207
+ end
208
+
209
+ # Checks equality by comparing each attribute.
210
+ # @param [Object] Object to be compared
211
+ def ==(o)
212
+ return true if self.equal?(o)
213
+ self.class == o.class &&
214
+ age == o.age &&
215
+ effective_date == o.effective_date &&
216
+ expiration_date == o.expiration_date &&
217
+ plan_id == o.plan_id &&
218
+ rating_area_id == o.rating_area_id
219
+ end
220
+
221
+ # @see the `==` method
222
+ # @param [Object] Object to be compared
223
+ def eql?(o)
224
+ self == o
225
+ end
226
+
227
+ # Calculates hash code according to all attributes.
228
+ # @return [Fixnum] Hash code
229
+ def hash
230
+ [age, effective_date, expiration_date, plan_id, rating_area_id].hash
231
+ end
232
+
233
+ # Builds the object from hash
234
+ # @param [Hash] attributes Model attributes in the form of hash
235
+ # @return [Object] Returns the model itself
236
+ def build_from_hash(attributes)
237
+ return nil unless attributes.is_a?(Hash)
238
+ self.class.swagger_types.each_pair do |key, type|
239
+ if type =~ /^Array<(.*)>/i
240
+ # check to ensure the input is an array given that the the attribute
241
+ # is documented as an array but the input is not
242
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
243
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
244
+ end
245
+ elsif !attributes[self.class.attribute_map[key]].nil?
246
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
247
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
248
+ end
249
+
250
+ self
251
+ end
252
+
253
+ # Deserializes the data based on type
254
+ # @param string type Data type
255
+ # @param string value Value to be deserialized
256
+ # @return [Object] Deserialized data
257
+ def _deserialize(type, value)
258
+ case type.to_sym
259
+ when :DateTime
260
+ DateTime.parse(value)
261
+ when :Date
262
+ Date.parse(value)
263
+ when :String
264
+ value.to_s
265
+ when :Integer
266
+ value.to_i
267
+ when :Float
268
+ value.to_f
269
+ when :BOOLEAN
270
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
271
+ true
272
+ else
273
+ false
274
+ end
275
+ when :Object
276
+ # generic object (usually a Hash), return directly
277
+ value
278
+ when /\AArray<(?<inner_type>.+)>\z/
279
+ inner_type = Regexp.last_match[:inner_type]
280
+ value.map { |v| _deserialize(inner_type, v) }
281
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
282
+ k_type = Regexp.last_match[:k_type]
283
+ v_type = Regexp.last_match[:v_type]
284
+ {}.tap do |hash|
285
+ value.each do |k, v|
286
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
287
+ end
288
+ end
289
+ else # model
290
+ temp_model = VericredClient.const_get(type).new
291
+ temp_model.build_from_hash(value)
292
+ end
293
+ end
294
+
295
+ # Returns the string representation of the object
296
+ # @return [String] String presentation of the object
297
+ def to_s
298
+ to_hash.to_s
299
+ end
300
+
301
+ # to_body is an alias to to_hash (backward compatibility)
302
+ # @return [Hash] Returns the object in the form of hash
303
+ def to_body
304
+ to_hash
305
+ end
306
+
307
+ # Returns the object in the form of hash
308
+ # @return [Hash] Returns the object in the form of hash
309
+ def to_hash
310
+ hash = {}
311
+ self.class.attribute_map.each_pair do |attr, param|
312
+ value = self.send(attr)
313
+ next if value.nil?
314
+ hash[param] = _to_hash(value)
315
+ end
316
+ hash
317
+ end
318
+
319
+ # Outputs non-array value in the form of hash
320
+ # For object, use to_hash. Otherwise, just return the value
321
+ # @param [Object] value Any valid value
322
+ # @return [Hash] Returns the value in the form of hash
323
+ def _to_hash(value)
324
+ if value.is_a?(Array)
325
+ value.compact.map{ |v| _to_hash(v) }
326
+ elsif value.is_a?(Hash)
327
+ {}.tap do |hash|
328
+ value.each { |k, v| hash[k] = _to_hash(v) }
329
+ end
330
+ elsif value.respond_to? :to_hash
331
+ value.to_hash
332
+ else
333
+ value
334
+ end
335
+ end
336
+
337
+ end
338
+ end