vericred_client 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -6
- data/docs/CountyBulk.md +2 -0
- data/docs/Plan.md +3 -0
- data/docs/PlanSearchResult.md +3 -0
- data/docs/PlanShowResponse.md +8 -0
- data/docs/PlansApi.md +56 -0
- data/docs/ProvidersApi.md +8 -2
- data/docs/RequestPlanFind.md +2 -1
- data/docs/RequestPlanFindDrugPackage.md +8 -0
- data/docs/RequestProvidersSearch.md +1 -0
- data/docs/ServiceArea.md +10 -0
- data/docs/ServiceAreaZipCounty.md +10 -0
- data/lib/vericred_client/api/plans_api.rb +56 -0
- data/lib/vericred_client/api/providers_api.rb +6 -0
- data/lib/vericred_client/api_client.rb +9 -3
- data/lib/vericred_client/configuration.rb +22 -1
- data/lib/vericred_client/models/county_bulk.rb +24 -4
- data/lib/vericred_client/models/plan.rb +31 -1
- data/lib/vericred_client/models/plan_search_result.rb +31 -1
- data/lib/vericred_client/models/plan_show_response.rb +307 -0
- data/lib/vericred_client/models/request_plan_find.rb +14 -2
- data/lib/vericred_client/models/request_plan_find_drug_package.rb +307 -0
- data/lib/vericred_client/models/request_providers_search.rb +11 -1
- data/lib/vericred_client/models/service_area.rb +327 -0
- data/lib/vericred_client/models/{plan_zip_county.rb → service_area_zip_county.rb} +14 -14
- data/lib/vericred_client/version.rb +1 -1
- data/lib/vericred_client.rb +4 -1
- data/spec/api/plans_api_spec.rb +12 -0
- data/spec/api/providers_api_spec.rb +2 -0
- data/spec/api_client_spec.rb +20 -79
- data/spec/configuration_spec.rb +11 -6
- data/spec/models/county_bulk_spec.rb +12 -0
- data/spec/models/plan_search_result_spec.rb +18 -0
- data/spec/models/plan_show_response_spec.rb +160 -0
- data/spec/models/plan_spec.rb +18 -0
- data/spec/models/request_plan_find_drug_package_spec.rb +160 -0
- data/spec/models/request_plan_find_spec.rb +6 -0
- data/spec/models/request_providers_search_spec.rb +6 -0
- data/spec/models/service_area_spec.rb +172 -0
- data/spec/models/{plan_zip_county_spec.rb → service_area_zip_county_spec.rb} +8 -8
- metadata +18 -6
- data/docs/PlanZipCounty.md +0 -10
@@ -169,6 +169,9 @@ module VericredClient
|
|
169
169
|
# Diagnostic tests benefit summary
|
170
170
|
attr_accessor :diagnostic_test
|
171
171
|
|
172
|
+
# Alternate name for the Plan
|
173
|
+
attr_accessor :display_name
|
174
|
+
|
172
175
|
# Is this a domestic plan?
|
173
176
|
attr_accessor :dp_rider
|
174
177
|
|
@@ -214,6 +217,9 @@ module VericredClient
|
|
214
217
|
# Hospice service benefits summary
|
215
218
|
attr_accessor :hospice_service
|
216
219
|
|
220
|
+
# Is the plan HSA eligible?
|
221
|
+
attr_accessor :hsa_eligible
|
222
|
+
|
217
223
|
# Government-issued HIOS plan ID
|
218
224
|
attr_accessor :id
|
219
225
|
|
@@ -316,6 +322,9 @@ module VericredClient
|
|
316
322
|
# Benefits summary for rehabilitation services
|
317
323
|
attr_accessor :rehabilitation_services
|
318
324
|
|
325
|
+
# Foreign key for service area
|
326
|
+
attr_accessor :service_area_id
|
327
|
+
|
319
328
|
# Benefits summary for skilled nursing services
|
320
329
|
attr_accessor :skilled_nursing
|
321
330
|
|
@@ -344,6 +353,7 @@ module VericredClient
|
|
344
353
|
:'customer_service_phone_number' => :'customer_service_phone_number',
|
345
354
|
:'durable_medical_equipment' => :'durable_medical_equipment',
|
346
355
|
:'diagnostic_test' => :'diagnostic_test',
|
356
|
+
:'display_name' => :'display_name',
|
347
357
|
:'dp_rider' => :'dp_rider',
|
348
358
|
:'drug_formulary_url' => :'drug_formulary_url',
|
349
359
|
:'effective_date' => :'effective_date',
|
@@ -359,6 +369,7 @@ module VericredClient
|
|
359
369
|
:'hios_issuer_id' => :'hios_issuer_id',
|
360
370
|
:'home_health_care' => :'home_health_care',
|
361
371
|
:'hospice_service' => :'hospice_service',
|
372
|
+
:'hsa_eligible' => :'hsa_eligible',
|
362
373
|
:'id' => :'id',
|
363
374
|
:'imaging' => :'imaging',
|
364
375
|
:'in_network_ids' => :'in_network_ids',
|
@@ -393,6 +404,7 @@ module VericredClient
|
|
393
404
|
:'premium' => :'premium',
|
394
405
|
:'primary_care_physician' => :'primary_care_physician',
|
395
406
|
:'rehabilitation_services' => :'rehabilitation_services',
|
407
|
+
:'service_area_id' => :'service_area_id',
|
396
408
|
:'skilled_nursing' => :'skilled_nursing',
|
397
409
|
:'specialist' => :'specialist',
|
398
410
|
:'specialty_drugs' => :'specialty_drugs',
|
@@ -415,6 +427,7 @@ module VericredClient
|
|
415
427
|
:'customer_service_phone_number' => :'String',
|
416
428
|
:'durable_medical_equipment' => :'String',
|
417
429
|
:'diagnostic_test' => :'String',
|
430
|
+
:'display_name' => :'String',
|
418
431
|
:'dp_rider' => :'BOOLEAN',
|
419
432
|
:'drug_formulary_url' => :'String',
|
420
433
|
:'effective_date' => :'String',
|
@@ -430,6 +443,7 @@ module VericredClient
|
|
430
443
|
:'hios_issuer_id' => :'String',
|
431
444
|
:'home_health_care' => :'String',
|
432
445
|
:'hospice_service' => :'String',
|
446
|
+
:'hsa_eligible' => :'BOOLEAN',
|
433
447
|
:'id' => :'String',
|
434
448
|
:'imaging' => :'String',
|
435
449
|
:'in_network_ids' => :'Array<Integer>',
|
@@ -464,6 +478,7 @@ module VericredClient
|
|
464
478
|
:'premium' => :'Float',
|
465
479
|
:'primary_care_physician' => :'String',
|
466
480
|
:'rehabilitation_services' => :'String',
|
481
|
+
:'service_area_id' => :'String',
|
467
482
|
:'skilled_nursing' => :'String',
|
468
483
|
:'specialist' => :'String',
|
469
484
|
:'specialty_drugs' => :'String',
|
@@ -527,6 +542,10 @@ module VericredClient
|
|
527
542
|
self.diagnostic_test = attributes[:'diagnostic_test']
|
528
543
|
end
|
529
544
|
|
545
|
+
if attributes.has_key?(:'display_name')
|
546
|
+
self.display_name = attributes[:'display_name']
|
547
|
+
end
|
548
|
+
|
530
549
|
if attributes.has_key?(:'dp_rider')
|
531
550
|
self.dp_rider = attributes[:'dp_rider']
|
532
551
|
end
|
@@ -587,6 +606,10 @@ module VericredClient
|
|
587
606
|
self.hospice_service = attributes[:'hospice_service']
|
588
607
|
end
|
589
608
|
|
609
|
+
if attributes.has_key?(:'hsa_eligible')
|
610
|
+
self.hsa_eligible = attributes[:'hsa_eligible']
|
611
|
+
end
|
612
|
+
|
590
613
|
if attributes.has_key?(:'id')
|
591
614
|
self.id = attributes[:'id']
|
592
615
|
end
|
@@ -727,6 +750,10 @@ module VericredClient
|
|
727
750
|
self.rehabilitation_services = attributes[:'rehabilitation_services']
|
728
751
|
end
|
729
752
|
|
753
|
+
if attributes.has_key?(:'service_area_id')
|
754
|
+
self.service_area_id = attributes[:'service_area_id']
|
755
|
+
end
|
756
|
+
|
730
757
|
if attributes.has_key?(:'skilled_nursing')
|
731
758
|
self.skilled_nursing = attributes[:'skilled_nursing']
|
732
759
|
end
|
@@ -775,6 +802,7 @@ module VericredClient
|
|
775
802
|
customer_service_phone_number == o.customer_service_phone_number &&
|
776
803
|
durable_medical_equipment == o.durable_medical_equipment &&
|
777
804
|
diagnostic_test == o.diagnostic_test &&
|
805
|
+
display_name == o.display_name &&
|
778
806
|
dp_rider == o.dp_rider &&
|
779
807
|
drug_formulary_url == o.drug_formulary_url &&
|
780
808
|
effective_date == o.effective_date &&
|
@@ -790,6 +818,7 @@ module VericredClient
|
|
790
818
|
hios_issuer_id == o.hios_issuer_id &&
|
791
819
|
home_health_care == o.home_health_care &&
|
792
820
|
hospice_service == o.hospice_service &&
|
821
|
+
hsa_eligible == o.hsa_eligible &&
|
793
822
|
id == o.id &&
|
794
823
|
imaging == o.imaging &&
|
795
824
|
in_network_ids == o.in_network_ids &&
|
@@ -824,6 +853,7 @@ module VericredClient
|
|
824
853
|
premium == o.premium &&
|
825
854
|
primary_care_physician == o.primary_care_physician &&
|
826
855
|
rehabilitation_services == o.rehabilitation_services &&
|
856
|
+
service_area_id == o.service_area_id &&
|
827
857
|
skilled_nursing == o.skilled_nursing &&
|
828
858
|
specialist == o.specialist &&
|
829
859
|
specialty_drugs == o.specialty_drugs &&
|
@@ -839,7 +869,7 @@ module VericredClient
|
|
839
869
|
# Calculates hash code according to all attributes.
|
840
870
|
# @return [Fixnum] Hash code
|
841
871
|
def hash
|
842
|
-
[adult_dental, age29_rider, ambulance, benefits_summary_url, buy_link, carrier_name, child_dental, child_eyewear, child_eye_exam, customer_service_phone_number, durable_medical_equipment, diagnostic_test, dp_rider, drug_formulary_url, effective_date, expiration_date, emergency_room, family_drug_deductible, family_drug_moop, family_medical_deductible, family_medical_moop, fp_rider, generic_drugs, habilitation_services, hios_issuer_id, home_health_care, hospice_service, id, imaging, in_network_ids, individual_drug_deductible, individual_drug_moop, individual_medical_deductible, individual_medical_moop, inpatient_birth, inpatient_facility, inpatient_mental_health, inpatient_physician, inpatient_substance, level, logo_url, name, network_size, non_preferred_brand_drugs, on_market, off_market, out_of_network_coverage, out_of_network_ids, outpatient_facility, outpatient_mental_health, outpatient_physician, outpatient_substance, plan_market, plan_type, preferred_brand_drugs, prenatal_postnatal_care, preventative_care, premium_subsidized, premium, primary_care_physician, rehabilitation_services, skilled_nursing, specialist, specialty_drugs, urgent_care].hash
|
872
|
+
[adult_dental, age29_rider, ambulance, benefits_summary_url, buy_link, carrier_name, child_dental, child_eyewear, child_eye_exam, customer_service_phone_number, durable_medical_equipment, diagnostic_test, display_name, dp_rider, drug_formulary_url, effective_date, expiration_date, emergency_room, family_drug_deductible, family_drug_moop, family_medical_deductible, family_medical_moop, fp_rider, generic_drugs, habilitation_services, hios_issuer_id, home_health_care, hospice_service, hsa_eligible, id, imaging, in_network_ids, individual_drug_deductible, individual_drug_moop, individual_medical_deductible, individual_medical_moop, inpatient_birth, inpatient_facility, inpatient_mental_health, inpatient_physician, inpatient_substance, level, logo_url, name, network_size, non_preferred_brand_drugs, on_market, off_market, out_of_network_coverage, out_of_network_ids, outpatient_facility, outpatient_mental_health, outpatient_physician, outpatient_substance, plan_market, plan_type, preferred_brand_drugs, prenatal_postnatal_care, preventative_care, premium_subsidized, premium, primary_care_physician, rehabilitation_services, service_area_id, skilled_nursing, specialist, specialty_drugs, urgent_care].hash
|
843
873
|
end
|
844
874
|
|
845
875
|
# Builds the object from hash
|
@@ -169,6 +169,9 @@ module VericredClient
|
|
169
169
|
# Diagnostic tests benefit summary
|
170
170
|
attr_accessor :diagnostic_test
|
171
171
|
|
172
|
+
# Alternate name for the Plan
|
173
|
+
attr_accessor :display_name
|
174
|
+
|
172
175
|
# Is this a domestic plan?
|
173
176
|
attr_accessor :dp_rider
|
174
177
|
|
@@ -214,6 +217,9 @@ module VericredClient
|
|
214
217
|
# Hospice service benefits summary
|
215
218
|
attr_accessor :hospice_service
|
216
219
|
|
220
|
+
# Is the plan HSA eligible?
|
221
|
+
attr_accessor :hsa_eligible
|
222
|
+
|
217
223
|
# Government-issued HIOS plan ID
|
218
224
|
attr_accessor :id
|
219
225
|
|
@@ -313,6 +319,9 @@ module VericredClient
|
|
313
319
|
# Benefits summary for rehabilitation services
|
314
320
|
attr_accessor :rehabilitation_services
|
315
321
|
|
322
|
+
# Foreign key for service area
|
323
|
+
attr_accessor :service_area_id
|
324
|
+
|
316
325
|
# Benefits summary for skilled nursing services
|
317
326
|
attr_accessor :skilled_nursing
|
318
327
|
|
@@ -353,6 +362,7 @@ module VericredClient
|
|
353
362
|
:'customer_service_phone_number' => :'customer_service_phone_number',
|
354
363
|
:'durable_medical_equipment' => :'durable_medical_equipment',
|
355
364
|
:'diagnostic_test' => :'diagnostic_test',
|
365
|
+
:'display_name' => :'display_name',
|
356
366
|
:'dp_rider' => :'dp_rider',
|
357
367
|
:'drug_formulary_url' => :'drug_formulary_url',
|
358
368
|
:'effective_date' => :'effective_date',
|
@@ -368,6 +378,7 @@ module VericredClient
|
|
368
378
|
:'hios_issuer_id' => :'hios_issuer_id',
|
369
379
|
:'home_health_care' => :'home_health_care',
|
370
380
|
:'hospice_service' => :'hospice_service',
|
381
|
+
:'hsa_eligible' => :'hsa_eligible',
|
371
382
|
:'id' => :'id',
|
372
383
|
:'imaging' => :'imaging',
|
373
384
|
:'in_network_ids' => :'in_network_ids',
|
@@ -401,6 +412,7 @@ module VericredClient
|
|
401
412
|
:'premium' => :'premium',
|
402
413
|
:'primary_care_physician' => :'primary_care_physician',
|
403
414
|
:'rehabilitation_services' => :'rehabilitation_services',
|
415
|
+
:'service_area_id' => :'service_area_id',
|
404
416
|
:'skilled_nursing' => :'skilled_nursing',
|
405
417
|
:'specialist' => :'specialist',
|
406
418
|
:'specialty_drugs' => :'specialty_drugs',
|
@@ -427,6 +439,7 @@ module VericredClient
|
|
427
439
|
:'customer_service_phone_number' => :'String',
|
428
440
|
:'durable_medical_equipment' => :'String',
|
429
441
|
:'diagnostic_test' => :'String',
|
442
|
+
:'display_name' => :'String',
|
430
443
|
:'dp_rider' => :'BOOLEAN',
|
431
444
|
:'drug_formulary_url' => :'String',
|
432
445
|
:'effective_date' => :'String',
|
@@ -442,6 +455,7 @@ module VericredClient
|
|
442
455
|
:'hios_issuer_id' => :'String',
|
443
456
|
:'home_health_care' => :'String',
|
444
457
|
:'hospice_service' => :'String',
|
458
|
+
:'hsa_eligible' => :'BOOLEAN',
|
445
459
|
:'id' => :'String',
|
446
460
|
:'imaging' => :'String',
|
447
461
|
:'in_network_ids' => :'Array<Integer>',
|
@@ -475,6 +489,7 @@ module VericredClient
|
|
475
489
|
:'premium' => :'Float',
|
476
490
|
:'primary_care_physician' => :'String',
|
477
491
|
:'rehabilitation_services' => :'String',
|
492
|
+
:'service_area_id' => :'String',
|
478
493
|
:'skilled_nursing' => :'String',
|
479
494
|
:'specialist' => :'String',
|
480
495
|
:'specialty_drugs' => :'String',
|
@@ -542,6 +557,10 @@ module VericredClient
|
|
542
557
|
self.diagnostic_test = attributes[:'diagnostic_test']
|
543
558
|
end
|
544
559
|
|
560
|
+
if attributes.has_key?(:'display_name')
|
561
|
+
self.display_name = attributes[:'display_name']
|
562
|
+
end
|
563
|
+
|
545
564
|
if attributes.has_key?(:'dp_rider')
|
546
565
|
self.dp_rider = attributes[:'dp_rider']
|
547
566
|
end
|
@@ -602,6 +621,10 @@ module VericredClient
|
|
602
621
|
self.hospice_service = attributes[:'hospice_service']
|
603
622
|
end
|
604
623
|
|
624
|
+
if attributes.has_key?(:'hsa_eligible')
|
625
|
+
self.hsa_eligible = attributes[:'hsa_eligible']
|
626
|
+
end
|
627
|
+
|
605
628
|
if attributes.has_key?(:'id')
|
606
629
|
self.id = attributes[:'id']
|
607
630
|
end
|
@@ -738,6 +761,10 @@ module VericredClient
|
|
738
761
|
self.rehabilitation_services = attributes[:'rehabilitation_services']
|
739
762
|
end
|
740
763
|
|
764
|
+
if attributes.has_key?(:'service_area_id')
|
765
|
+
self.service_area_id = attributes[:'service_area_id']
|
766
|
+
end
|
767
|
+
|
741
768
|
if attributes.has_key?(:'skilled_nursing')
|
742
769
|
self.skilled_nursing = attributes[:'skilled_nursing']
|
743
770
|
end
|
@@ -802,6 +829,7 @@ module VericredClient
|
|
802
829
|
customer_service_phone_number == o.customer_service_phone_number &&
|
803
830
|
durable_medical_equipment == o.durable_medical_equipment &&
|
804
831
|
diagnostic_test == o.diagnostic_test &&
|
832
|
+
display_name == o.display_name &&
|
805
833
|
dp_rider == o.dp_rider &&
|
806
834
|
drug_formulary_url == o.drug_formulary_url &&
|
807
835
|
effective_date == o.effective_date &&
|
@@ -817,6 +845,7 @@ module VericredClient
|
|
817
845
|
hios_issuer_id == o.hios_issuer_id &&
|
818
846
|
home_health_care == o.home_health_care &&
|
819
847
|
hospice_service == o.hospice_service &&
|
848
|
+
hsa_eligible == o.hsa_eligible &&
|
820
849
|
id == o.id &&
|
821
850
|
imaging == o.imaging &&
|
822
851
|
in_network_ids == o.in_network_ids &&
|
@@ -850,6 +879,7 @@ module VericredClient
|
|
850
879
|
premium == o.premium &&
|
851
880
|
primary_care_physician == o.primary_care_physician &&
|
852
881
|
rehabilitation_services == o.rehabilitation_services &&
|
882
|
+
service_area_id == o.service_area_id &&
|
853
883
|
skilled_nursing == o.skilled_nursing &&
|
854
884
|
specialist == o.specialist &&
|
855
885
|
specialty_drugs == o.specialty_drugs &&
|
@@ -869,7 +899,7 @@ module VericredClient
|
|
869
899
|
# Calculates hash code according to all attributes.
|
870
900
|
# @return [Fixnum] Hash code
|
871
901
|
def hash
|
872
|
-
[adult_dental, age29_rider, ambulance, benefits_summary_url, buy_link, carrier_name, child_dental, child_eyewear, child_eye_exam, customer_service_phone_number, durable_medical_equipment, diagnostic_test, dp_rider, drug_formulary_url, effective_date, expiration_date, emergency_room, family_drug_deductible, family_drug_moop, family_medical_deductible, family_medical_moop, fp_rider, generic_drugs, habilitation_services, hios_issuer_id, home_health_care, hospice_service, id, imaging, in_network_ids, individual_drug_deductible, individual_drug_moop, individual_medical_deductible, individual_medical_moop, inpatient_birth, inpatient_facility, inpatient_mental_health, inpatient_physician, inpatient_substance, level, logo_url, name, non_preferred_brand_drugs, on_market, off_market, out_of_network_coverage, out_of_network_ids, outpatient_facility, outpatient_mental_health, outpatient_physician, outpatient_substance, plan_market, plan_type, preferred_brand_drugs, prenatal_postnatal_care, preventative_care, premium_subsidized, premium, primary_care_physician, rehabilitation_services, skilled_nursing, specialist, specialty_drugs, urgent_care, match_percentage, perfect_match_percentage, employee_premium, dependent_premium].hash
|
902
|
+
[adult_dental, age29_rider, ambulance, benefits_summary_url, buy_link, carrier_name, child_dental, child_eyewear, child_eye_exam, customer_service_phone_number, durable_medical_equipment, diagnostic_test, display_name, dp_rider, drug_formulary_url, effective_date, expiration_date, emergency_room, family_drug_deductible, family_drug_moop, family_medical_deductible, family_medical_moop, fp_rider, generic_drugs, habilitation_services, hios_issuer_id, home_health_care, hospice_service, hsa_eligible, id, imaging, in_network_ids, individual_drug_deductible, individual_drug_moop, individual_medical_deductible, individual_medical_moop, inpatient_birth, inpatient_facility, inpatient_mental_health, inpatient_physician, inpatient_substance, level, logo_url, name, non_preferred_brand_drugs, on_market, off_market, out_of_network_coverage, out_of_network_ids, outpatient_facility, outpatient_mental_health, outpatient_physician, outpatient_substance, plan_market, plan_type, preferred_brand_drugs, prenatal_postnatal_care, preventative_care, premium_subsidized, premium, primary_care_physician, rehabilitation_services, service_area_id, skilled_nursing, specialist, specialty_drugs, urgent_care, match_percentage, perfect_match_percentage, employee_premium, dependent_premium].hash
|
873
903
|
end
|
874
904
|
|
875
905
|
# Builds the object from hash
|
@@ -0,0 +1,307 @@
|
|
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) 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
|
+
Endpoints that accept `page` and `per_page` parameters are paginated. They expose
|
35
|
+
four additional fields that contain data about your position in the response,
|
36
|
+
namely `Total`, `Per-Page`, `Link`, and `Page` as described in [RFC-5988](https://tools.ietf.org/html/rfc5988).
|
37
|
+
|
38
|
+
For example, to display 5 results per page and view the second page of a
|
39
|
+
`GET` to `/networks`, your final request would be `GET /networks?....page=2&per_page=5`.
|
40
|
+
|
41
|
+
## Sideloading
|
42
|
+
|
43
|
+
When we return multiple levels of an object graph (e.g. `Provider`s and their `State`s
|
44
|
+
we sideload the associated data. In this example, we would provide an Array of
|
45
|
+
`State`s and a `state_id` for each provider. This is done primarily to reduce the
|
46
|
+
payload size since many of the `Provider`s will share a `State`
|
47
|
+
|
48
|
+
```
|
49
|
+
{
|
50
|
+
providers: [{ id: 1, state_id: 1}, { id: 2, state_id: 1 }],
|
51
|
+
states: [{ id: 1, code: 'NY' }]
|
52
|
+
}
|
53
|
+
```
|
54
|
+
|
55
|
+
If you need the second level of the object graph, you can just match the
|
56
|
+
corresponding id.
|
57
|
+
|
58
|
+
## Selecting specific data
|
59
|
+
|
60
|
+
All endpoints allow you to specify which fields you would like to return.
|
61
|
+
This allows you to limit the response to contain only the data you need.
|
62
|
+
|
63
|
+
For example, let's take a request that returns the following JSON by default
|
64
|
+
|
65
|
+
```
|
66
|
+
{
|
67
|
+
provider: {
|
68
|
+
id: 1,
|
69
|
+
name: 'John',
|
70
|
+
phone: '1234567890',
|
71
|
+
field_we_dont_care_about: 'value_we_dont_care_about'
|
72
|
+
},
|
73
|
+
states: [{
|
74
|
+
id: 1,
|
75
|
+
name: 'New York',
|
76
|
+
code: 'NY',
|
77
|
+
field_we_dont_care_about: 'value_we_dont_care_about'
|
78
|
+
}]
|
79
|
+
}
|
80
|
+
```
|
81
|
+
|
82
|
+
To limit our results to only return the fields we care about, we specify the
|
83
|
+
`select` query string parameter for the corresponding fields in the JSON
|
84
|
+
document.
|
85
|
+
|
86
|
+
In this case, we want to select `name` and `phone` from the `provider` key,
|
87
|
+
so we would add the parameters `select=provider.name,provider.phone`.
|
88
|
+
We also want the `name` and `code` from the `states` key, so we would
|
89
|
+
add the parameters `select=states.name,staes.code`. The id field of
|
90
|
+
each document is always returned whether or not it is requested.
|
91
|
+
|
92
|
+
Our final request would be `GET /providers/12345?select=provider.name,provider.phone,states.name,states.code`
|
93
|
+
|
94
|
+
The response would be
|
95
|
+
|
96
|
+
```
|
97
|
+
{
|
98
|
+
provider: {
|
99
|
+
id: 1,
|
100
|
+
name: 'John',
|
101
|
+
phone: '1234567890'
|
102
|
+
},
|
103
|
+
states: [{
|
104
|
+
id: 1,
|
105
|
+
name: 'New York',
|
106
|
+
code: 'NY'
|
107
|
+
}]
|
108
|
+
}
|
109
|
+
```
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
OpenAPI spec version: 1.0.0
|
114
|
+
|
115
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
116
|
+
|
117
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
118
|
+
you may not use this file except in compliance with the License.
|
119
|
+
You may obtain a copy of the License at
|
120
|
+
|
121
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
122
|
+
|
123
|
+
Unless required by applicable law or agreed to in writing, software
|
124
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
125
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
126
|
+
See the License for the specific language governing permissions and
|
127
|
+
limitations under the License.
|
128
|
+
|
129
|
+
=end
|
130
|
+
|
131
|
+
require 'date'
|
132
|
+
|
133
|
+
module VericredClient
|
134
|
+
|
135
|
+
class PlanShowResponse
|
136
|
+
# Plan response
|
137
|
+
attr_accessor :plan
|
138
|
+
|
139
|
+
|
140
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
141
|
+
def self.attribute_map
|
142
|
+
{
|
143
|
+
:'plan' => :'plan'
|
144
|
+
}
|
145
|
+
end
|
146
|
+
|
147
|
+
# Attribute type mapping.
|
148
|
+
def self.swagger_types
|
149
|
+
{
|
150
|
+
:'plan' => :'Plan'
|
151
|
+
}
|
152
|
+
end
|
153
|
+
|
154
|
+
# Initializes the object
|
155
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
156
|
+
def initialize(attributes = {})
|
157
|
+
return unless attributes.is_a?(Hash)
|
158
|
+
|
159
|
+
# convert string to symbol for hash key
|
160
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
161
|
+
|
162
|
+
if attributes.has_key?(:'plan')
|
163
|
+
self.plan = attributes[:'plan']
|
164
|
+
end
|
165
|
+
|
166
|
+
end
|
167
|
+
|
168
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
169
|
+
# @return Array for valid properies with the reasons
|
170
|
+
def list_invalid_properties
|
171
|
+
invalid_properties = Array.new
|
172
|
+
return invalid_properties
|
173
|
+
end
|
174
|
+
|
175
|
+
# Check to see if the all the properties in the model are valid
|
176
|
+
# @return true if the model is valid
|
177
|
+
def valid?
|
178
|
+
return true
|
179
|
+
end
|
180
|
+
|
181
|
+
# Checks equality by comparing each attribute.
|
182
|
+
# @param [Object] Object to be compared
|
183
|
+
def ==(o)
|
184
|
+
return true if self.equal?(o)
|
185
|
+
self.class == o.class &&
|
186
|
+
plan == o.plan
|
187
|
+
end
|
188
|
+
|
189
|
+
# @see the `==` method
|
190
|
+
# @param [Object] Object to be compared
|
191
|
+
def eql?(o)
|
192
|
+
self == o
|
193
|
+
end
|
194
|
+
|
195
|
+
# Calculates hash code according to all attributes.
|
196
|
+
# @return [Fixnum] Hash code
|
197
|
+
def hash
|
198
|
+
[plan].hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# Builds the object from hash
|
202
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
203
|
+
# @return [Object] Returns the model itself
|
204
|
+
def build_from_hash(attributes)
|
205
|
+
return nil unless attributes.is_a?(Hash)
|
206
|
+
self.class.swagger_types.each_pair do |key, type|
|
207
|
+
if type =~ /^Array<(.*)>/i
|
208
|
+
# check to ensure the input is an array given that the the attribute
|
209
|
+
# is documented as an array but the input is not
|
210
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
211
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
212
|
+
end
|
213
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
214
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
215
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
216
|
+
end
|
217
|
+
|
218
|
+
self
|
219
|
+
end
|
220
|
+
|
221
|
+
# Deserializes the data based on type
|
222
|
+
# @param string type Data type
|
223
|
+
# @param string value Value to be deserialized
|
224
|
+
# @return [Object] Deserialized data
|
225
|
+
def _deserialize(type, value)
|
226
|
+
case type.to_sym
|
227
|
+
when :DateTime
|
228
|
+
DateTime.parse(value)
|
229
|
+
when :Date
|
230
|
+
Date.parse(value)
|
231
|
+
when :String
|
232
|
+
value.to_s
|
233
|
+
when :Integer
|
234
|
+
value.to_i
|
235
|
+
when :Float
|
236
|
+
value.to_f
|
237
|
+
when :BOOLEAN
|
238
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
239
|
+
true
|
240
|
+
else
|
241
|
+
false
|
242
|
+
end
|
243
|
+
when :Object
|
244
|
+
# generic object (usually a Hash), return directly
|
245
|
+
value
|
246
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
247
|
+
inner_type = Regexp.last_match[:inner_type]
|
248
|
+
value.map { |v| _deserialize(inner_type, v) }
|
249
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
250
|
+
k_type = Regexp.last_match[:k_type]
|
251
|
+
v_type = Regexp.last_match[:v_type]
|
252
|
+
{}.tap do |hash|
|
253
|
+
value.each do |k, v|
|
254
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
255
|
+
end
|
256
|
+
end
|
257
|
+
else # model
|
258
|
+
temp_model = VericredClient.const_get(type).new
|
259
|
+
temp_model.build_from_hash(value)
|
260
|
+
end
|
261
|
+
end
|
262
|
+
|
263
|
+
# Returns the string representation of the object
|
264
|
+
# @return [String] String presentation of the object
|
265
|
+
def to_s
|
266
|
+
to_hash.to_s
|
267
|
+
end
|
268
|
+
|
269
|
+
# to_body is an alias to to_hash (backward compatibility)
|
270
|
+
# @return [Hash] Returns the object in the form of hash
|
271
|
+
def to_body
|
272
|
+
to_hash
|
273
|
+
end
|
274
|
+
|
275
|
+
# Returns the object in the form of hash
|
276
|
+
# @return [Hash] Returns the object in the form of hash
|
277
|
+
def to_hash
|
278
|
+
hash = {}
|
279
|
+
self.class.attribute_map.each_pair do |attr, param|
|
280
|
+
value = self.send(attr)
|
281
|
+
next if value.nil?
|
282
|
+
hash[param] = _to_hash(value)
|
283
|
+
end
|
284
|
+
hash
|
285
|
+
end
|
286
|
+
|
287
|
+
# Outputs non-array value in the form of hash
|
288
|
+
# For object, use to_hash. Otherwise, just return the value
|
289
|
+
# @param [Object] value Any valid value
|
290
|
+
# @return [Hash] Returns the value in the form of hash
|
291
|
+
def _to_hash(value)
|
292
|
+
if value.is_a?(Array)
|
293
|
+
value.compact.map{ |v| _to_hash(v) }
|
294
|
+
elsif value.is_a?(Hash)
|
295
|
+
{}.tap do |hash|
|
296
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
297
|
+
end
|
298
|
+
elsif value.respond_to? :to_hash
|
299
|
+
value.to_hash
|
300
|
+
else
|
301
|
+
value
|
302
|
+
end
|
303
|
+
end
|
304
|
+
|
305
|
+
end
|
306
|
+
|
307
|
+
end
|
@@ -151,6 +151,9 @@ module VericredClient
|
|
151
151
|
# Number of people living in household.
|
152
152
|
attr_accessor :household_size
|
153
153
|
|
154
|
+
# List of plan IDs to filter by
|
155
|
+
attr_accessor :ids
|
156
|
+
|
154
157
|
# Type of plan to search for.
|
155
158
|
attr_accessor :market
|
156
159
|
|
@@ -179,6 +182,7 @@ module VericredClient
|
|
179
182
|
:'fips_code' => :'fips_code',
|
180
183
|
:'household_income' => :'household_income',
|
181
184
|
:'household_size' => :'household_size',
|
185
|
+
:'ids' => :'ids',
|
182
186
|
:'market' => :'market',
|
183
187
|
:'providers' => :'providers',
|
184
188
|
:'page' => :'page',
|
@@ -193,10 +197,11 @@ module VericredClient
|
|
193
197
|
{
|
194
198
|
:'applicants' => :'Array<RequestPlanFindApplicant>',
|
195
199
|
:'enrollment_date' => :'String',
|
196
|
-
:'drug_packages' => :'Array<
|
200
|
+
:'drug_packages' => :'Array<RequestPlanFindDrugPackage>',
|
197
201
|
:'fips_code' => :'String',
|
198
202
|
:'household_income' => :'Integer',
|
199
203
|
:'household_size' => :'Integer',
|
204
|
+
:'ids' => :'Array<Integer>',
|
200
205
|
:'market' => :'String',
|
201
206
|
:'providers' => :'Array<RequestPlanFindProvider>',
|
202
207
|
:'page' => :'Integer',
|
@@ -242,6 +247,12 @@ module VericredClient
|
|
242
247
|
self.household_size = attributes[:'household_size']
|
243
248
|
end
|
244
249
|
|
250
|
+
if attributes.has_key?(:'ids')
|
251
|
+
if (value = attributes[:'ids']).is_a?(Array)
|
252
|
+
self.ids = value
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
245
256
|
if attributes.has_key?(:'market')
|
246
257
|
self.market = attributes[:'market']
|
247
258
|
end
|
@@ -294,6 +305,7 @@ module VericredClient
|
|
294
305
|
fips_code == o.fips_code &&
|
295
306
|
household_income == o.household_income &&
|
296
307
|
household_size == o.household_size &&
|
308
|
+
ids == o.ids &&
|
297
309
|
market == o.market &&
|
298
310
|
providers == o.providers &&
|
299
311
|
page == o.page &&
|
@@ -311,7 +323,7 @@ module VericredClient
|
|
311
323
|
# Calculates hash code according to all attributes.
|
312
324
|
# @return [Fixnum] Hash code
|
313
325
|
def hash
|
314
|
-
[applicants, enrollment_date, drug_packages, fips_code, household_income, household_size, market, providers, page, per_page, sort, zip_code].hash
|
326
|
+
[applicants, enrollment_date, drug_packages, fips_code, household_income, household_size, ids, market, providers, page, per_page, sort, zip_code].hash
|
315
327
|
end
|
316
328
|
|
317
329
|
# Builds the object from hash
|