vericred_client 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +225 -0
- data/docs/Applicant.md +14 -0
- data/docs/Carrier.md +10 -0
- data/docs/CarrierSubsidiary.md +9 -0
- data/docs/County.md +16 -0
- data/docs/Drug.md +10 -0
- data/docs/DrugCoverage.md +13 -0
- data/docs/DrugCoverageApi.md +60 -0
- data/docs/InlineResponse200.md +9 -0
- data/docs/InlineResponse2001.md +8 -0
- data/docs/InlineResponse2002.md +10 -0
- data/docs/Plan.md +53 -0
- data/docs/PlanCounty.md +10 -0
- data/docs/PlanSearchResult.md +54 -0
- data/docs/PlansApi.md +118 -0
- data/docs/Pricing.md +12 -0
- data/docs/Provider.md +31 -0
- data/docs/ProvidersApi.md +135 -0
- data/docs/Query.md +15 -0
- data/docs/RatingArea.md +9 -0
- data/docs/State.md +15 -0
- data/docs/ZipCode.md +9 -0
- data/docs/ZipCountiesApi.md +63 -0
- data/docs/ZipCounty.md +10 -0
- data/lib/vericred_client/api/drug_coverage_api.rb +201 -0
- data/lib/vericred_client/api/plans_api.rb +317 -0
- data/lib/vericred_client/api/providers_api.rb +303 -0
- data/lib/vericred_client/api/zip_counties_api.rb +208 -0
- data/lib/vericred_client/api_client.rb +474 -0
- data/lib/vericred_client/api_error.rb +149 -0
- data/lib/vericred_client/configuration.rb +163 -0
- data/lib/vericred_client/models/applicant.rb +358 -0
- data/lib/vericred_client/models/carrier.rb +318 -0
- data/lib/vericred_client/models/carrier_subsidiary.rb +308 -0
- data/lib/vericred_client/models/county.rb +360 -0
- data/lib/vericred_client/models/drug.rb +318 -0
- data/lib/vericred_client/models/drug_coverage.rb +348 -0
- data/lib/vericred_client/models/inline_response_200.rb +308 -0
- data/lib/vericred_client/models/inline_response_200_1.rb +297 -0
- data/lib/vericred_client/models/inline_response_200_2.rb +321 -0
- data/lib/vericred_client/models/plan.rb +748 -0
- data/lib/vericred_client/models/plan_county.rb +318 -0
- data/lib/vericred_client/models/plan_search_result.rb +758 -0
- data/lib/vericred_client/models/pricing.rb +338 -0
- data/lib/vericred_client/models/provider.rb +528 -0
- data/lib/vericred_client/models/query.rb +364 -0
- data/lib/vericred_client/models/rating_area.rb +308 -0
- data/lib/vericred_client/models/state.rb +368 -0
- data/lib/vericred_client/models/zip_code.rb +308 -0
- data/lib/vericred_client/models/zip_county.rb +318 -0
- data/lib/vericred_client/version.rb +128 -0
- data/lib/vericred_client.rb +175 -0
- data/spec/api/drug_coverage_api_spec.rb +168 -0
- data/spec/api/plans_api_spec.rb +226 -0
- data/spec/api/providers_api_spec.rb +202 -0
- data/spec/api/zip_counties_api_spec.rb +171 -0
- data/vericred_client.gemspec +31 -0
- metadata +285 -0
@@ -0,0 +1,528 @@
|
|
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 Provider
|
130
|
+
# Is this provider accepting patients with a change of insurance?
|
131
|
+
attr_accessor :accepting_change_of_payor_patients
|
132
|
+
|
133
|
+
# Is this provider accepting new Medicaid patients?
|
134
|
+
attr_accessor :accepting_medicaid_patients
|
135
|
+
|
136
|
+
# Is this provider accepting new Medicare patients?
|
137
|
+
attr_accessor :accepting_medicare_patients
|
138
|
+
|
139
|
+
# Is this provider accepting new patients with private insurance?
|
140
|
+
attr_accessor :accepting_private_patients
|
141
|
+
|
142
|
+
# Is this provider accepting new patients via referrals?
|
143
|
+
attr_accessor :accepting_referral_patients
|
144
|
+
|
145
|
+
# City name (e.g. Springfield).
|
146
|
+
attr_accessor :city
|
147
|
+
|
148
|
+
# Primary email address to contact the provider.
|
149
|
+
attr_accessor :email
|
150
|
+
|
151
|
+
# Provider's gender (M or F)
|
152
|
+
attr_accessor :gender
|
153
|
+
|
154
|
+
# Given name for the provider.
|
155
|
+
attr_accessor :first_name
|
156
|
+
|
157
|
+
# National Provider Index (NPI) number
|
158
|
+
attr_accessor :id
|
159
|
+
|
160
|
+
# Family name for the provider.
|
161
|
+
attr_accessor :last_name
|
162
|
+
|
163
|
+
# Middle name for the provider.
|
164
|
+
attr_accessor :middle_name
|
165
|
+
|
166
|
+
# Personal contact phone for the provider.
|
167
|
+
attr_accessor :personal_phone
|
168
|
+
|
169
|
+
# Office phone for the provider
|
170
|
+
attr_accessor :phone
|
171
|
+
|
172
|
+
# Preferred name for display (e.g. Dr. Francis White may prefer Dr. Frank White)
|
173
|
+
attr_accessor :presentation_name
|
174
|
+
|
175
|
+
# Name of the primary Specialty
|
176
|
+
attr_accessor :specialty
|
177
|
+
|
178
|
+
# State code for the provider's address (e.g. NY).
|
179
|
+
attr_accessor :state
|
180
|
+
|
181
|
+
# Foreign key to States
|
182
|
+
attr_accessor :state_id
|
183
|
+
|
184
|
+
# First line of the provider's street address.
|
185
|
+
attr_accessor :street_line_1
|
186
|
+
|
187
|
+
# Second line of the provider's street address.
|
188
|
+
attr_accessor :street_line_2
|
189
|
+
|
190
|
+
# Suffix for the provider's name (e.g. Jr)
|
191
|
+
attr_accessor :suffix
|
192
|
+
|
193
|
+
# Professional title for the provider (e.g. Dr).
|
194
|
+
attr_accessor :title
|
195
|
+
|
196
|
+
# Type of NPI number (individual provider vs organization).
|
197
|
+
attr_accessor :type
|
198
|
+
|
199
|
+
# Postal code for the provider's address (e.g. 11215)
|
200
|
+
attr_accessor :zip_code
|
201
|
+
|
202
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
203
|
+
def self.attribute_map
|
204
|
+
{
|
205
|
+
:'accepting_change_of_payor_patients' => :'accepting_change_of_payor_patients',
|
206
|
+
:'accepting_medicaid_patients' => :'accepting_medicaid_patients',
|
207
|
+
:'accepting_medicare_patients' => :'accepting_medicare_patients',
|
208
|
+
:'accepting_private_patients' => :'accepting_private_patients',
|
209
|
+
:'accepting_referral_patients' => :'accepting_referral_patients',
|
210
|
+
:'city' => :'city',
|
211
|
+
:'email' => :'email',
|
212
|
+
:'gender' => :'gender',
|
213
|
+
:'first_name' => :'first_name',
|
214
|
+
:'id' => :'id',
|
215
|
+
:'last_name' => :'last_name',
|
216
|
+
:'middle_name' => :'middle_name',
|
217
|
+
:'personal_phone' => :'personal_phone',
|
218
|
+
:'phone' => :'phone',
|
219
|
+
:'presentation_name' => :'presentation_name',
|
220
|
+
:'specialty' => :'specialty',
|
221
|
+
:'state' => :'state',
|
222
|
+
:'state_id' => :'state_id',
|
223
|
+
:'street_line_1' => :'street_line_1',
|
224
|
+
:'street_line_2' => :'street_line_2',
|
225
|
+
:'suffix' => :'suffix',
|
226
|
+
:'title' => :'title',
|
227
|
+
:'type' => :'type',
|
228
|
+
:'zip_code' => :'zip_code'
|
229
|
+
}
|
230
|
+
end
|
231
|
+
|
232
|
+
# Attribute type mapping.
|
233
|
+
def self.swagger_types
|
234
|
+
{
|
235
|
+
:'accepting_change_of_payor_patients' => :'BOOLEAN',
|
236
|
+
:'accepting_medicaid_patients' => :'BOOLEAN',
|
237
|
+
:'accepting_medicare_patients' => :'BOOLEAN',
|
238
|
+
:'accepting_private_patients' => :'BOOLEAN',
|
239
|
+
:'accepting_referral_patients' => :'BOOLEAN',
|
240
|
+
:'city' => :'String',
|
241
|
+
:'email' => :'String',
|
242
|
+
:'gender' => :'String',
|
243
|
+
:'first_name' => :'String',
|
244
|
+
:'id' => :'Integer',
|
245
|
+
:'last_name' => :'String',
|
246
|
+
:'middle_name' => :'String',
|
247
|
+
:'personal_phone' => :'String',
|
248
|
+
:'phone' => :'String',
|
249
|
+
:'presentation_name' => :'String',
|
250
|
+
:'specialty' => :'String',
|
251
|
+
:'state' => :'String',
|
252
|
+
:'state_id' => :'Integer',
|
253
|
+
:'street_line_1' => :'String',
|
254
|
+
:'street_line_2' => :'String',
|
255
|
+
:'suffix' => :'String',
|
256
|
+
:'title' => :'String',
|
257
|
+
:'type' => :'String',
|
258
|
+
:'zip_code' => :'String'
|
259
|
+
}
|
260
|
+
end
|
261
|
+
|
262
|
+
# Initializes the object
|
263
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
264
|
+
def initialize(attributes = {})
|
265
|
+
return unless attributes.is_a?(Hash)
|
266
|
+
|
267
|
+
# convert string to symbol for hash key
|
268
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
269
|
+
|
270
|
+
if attributes.has_key?(:'accepting_change_of_payor_patients')
|
271
|
+
self.accepting_change_of_payor_patients = attributes[:'accepting_change_of_payor_patients']
|
272
|
+
end
|
273
|
+
|
274
|
+
if attributes.has_key?(:'accepting_medicaid_patients')
|
275
|
+
self.accepting_medicaid_patients = attributes[:'accepting_medicaid_patients']
|
276
|
+
end
|
277
|
+
|
278
|
+
if attributes.has_key?(:'accepting_medicare_patients')
|
279
|
+
self.accepting_medicare_patients = attributes[:'accepting_medicare_patients']
|
280
|
+
end
|
281
|
+
|
282
|
+
if attributes.has_key?(:'accepting_private_patients')
|
283
|
+
self.accepting_private_patients = attributes[:'accepting_private_patients']
|
284
|
+
end
|
285
|
+
|
286
|
+
if attributes.has_key?(:'accepting_referral_patients')
|
287
|
+
self.accepting_referral_patients = attributes[:'accepting_referral_patients']
|
288
|
+
end
|
289
|
+
|
290
|
+
if attributes.has_key?(:'city')
|
291
|
+
self.city = attributes[:'city']
|
292
|
+
end
|
293
|
+
|
294
|
+
if attributes.has_key?(:'email')
|
295
|
+
self.email = attributes[:'email']
|
296
|
+
end
|
297
|
+
|
298
|
+
if attributes.has_key?(:'gender')
|
299
|
+
self.gender = attributes[:'gender']
|
300
|
+
end
|
301
|
+
|
302
|
+
if attributes.has_key?(:'first_name')
|
303
|
+
self.first_name = attributes[:'first_name']
|
304
|
+
end
|
305
|
+
|
306
|
+
if attributes.has_key?(:'id')
|
307
|
+
self.id = attributes[:'id']
|
308
|
+
end
|
309
|
+
|
310
|
+
if attributes.has_key?(:'last_name')
|
311
|
+
self.last_name = attributes[:'last_name']
|
312
|
+
end
|
313
|
+
|
314
|
+
if attributes.has_key?(:'middle_name')
|
315
|
+
self.middle_name = attributes[:'middle_name']
|
316
|
+
end
|
317
|
+
|
318
|
+
if attributes.has_key?(:'personal_phone')
|
319
|
+
self.personal_phone = attributes[:'personal_phone']
|
320
|
+
end
|
321
|
+
|
322
|
+
if attributes.has_key?(:'phone')
|
323
|
+
self.phone = attributes[:'phone']
|
324
|
+
end
|
325
|
+
|
326
|
+
if attributes.has_key?(:'presentation_name')
|
327
|
+
self.presentation_name = attributes[:'presentation_name']
|
328
|
+
end
|
329
|
+
|
330
|
+
if attributes.has_key?(:'specialty')
|
331
|
+
self.specialty = attributes[:'specialty']
|
332
|
+
end
|
333
|
+
|
334
|
+
if attributes.has_key?(:'state')
|
335
|
+
self.state = attributes[:'state']
|
336
|
+
end
|
337
|
+
|
338
|
+
if attributes.has_key?(:'state_id')
|
339
|
+
self.state_id = attributes[:'state_id']
|
340
|
+
end
|
341
|
+
|
342
|
+
if attributes.has_key?(:'street_line_1')
|
343
|
+
self.street_line_1 = attributes[:'street_line_1']
|
344
|
+
end
|
345
|
+
|
346
|
+
if attributes.has_key?(:'street_line_2')
|
347
|
+
self.street_line_2 = attributes[:'street_line_2']
|
348
|
+
end
|
349
|
+
|
350
|
+
if attributes.has_key?(:'suffix')
|
351
|
+
self.suffix = attributes[:'suffix']
|
352
|
+
end
|
353
|
+
|
354
|
+
if attributes.has_key?(:'title')
|
355
|
+
self.title = attributes[:'title']
|
356
|
+
end
|
357
|
+
|
358
|
+
if attributes.has_key?(:'type')
|
359
|
+
self.type = attributes[:'type']
|
360
|
+
end
|
361
|
+
|
362
|
+
if attributes.has_key?(:'zip_code')
|
363
|
+
self.zip_code = attributes[:'zip_code']
|
364
|
+
end
|
365
|
+
|
366
|
+
end
|
367
|
+
|
368
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
369
|
+
# @return Array for valid properies with the reasons
|
370
|
+
def list_invalid_properties
|
371
|
+
invalid_properties = Array.new
|
372
|
+
return invalid_properties
|
373
|
+
end
|
374
|
+
|
375
|
+
# Check to see if the all the properties in the model are valid
|
376
|
+
# @return true if the model is valid
|
377
|
+
def valid?
|
378
|
+
end
|
379
|
+
|
380
|
+
# Checks equality by comparing each attribute.
|
381
|
+
# @param [Object] Object to be compared
|
382
|
+
def ==(o)
|
383
|
+
return true if self.equal?(o)
|
384
|
+
self.class == o.class &&
|
385
|
+
accepting_change_of_payor_patients == o.accepting_change_of_payor_patients &&
|
386
|
+
accepting_medicaid_patients == o.accepting_medicaid_patients &&
|
387
|
+
accepting_medicare_patients == o.accepting_medicare_patients &&
|
388
|
+
accepting_private_patients == o.accepting_private_patients &&
|
389
|
+
accepting_referral_patients == o.accepting_referral_patients &&
|
390
|
+
city == o.city &&
|
391
|
+
email == o.email &&
|
392
|
+
gender == o.gender &&
|
393
|
+
first_name == o.first_name &&
|
394
|
+
id == o.id &&
|
395
|
+
last_name == o.last_name &&
|
396
|
+
middle_name == o.middle_name &&
|
397
|
+
personal_phone == o.personal_phone &&
|
398
|
+
phone == o.phone &&
|
399
|
+
presentation_name == o.presentation_name &&
|
400
|
+
specialty == o.specialty &&
|
401
|
+
state == o.state &&
|
402
|
+
state_id == o.state_id &&
|
403
|
+
street_line_1 == o.street_line_1 &&
|
404
|
+
street_line_2 == o.street_line_2 &&
|
405
|
+
suffix == o.suffix &&
|
406
|
+
title == o.title &&
|
407
|
+
type == o.type &&
|
408
|
+
zip_code == o.zip_code
|
409
|
+
end
|
410
|
+
|
411
|
+
# @see the `==` method
|
412
|
+
# @param [Object] Object to be compared
|
413
|
+
def eql?(o)
|
414
|
+
self == o
|
415
|
+
end
|
416
|
+
|
417
|
+
# Calculates hash code according to all attributes.
|
418
|
+
# @return [Fixnum] Hash code
|
419
|
+
def hash
|
420
|
+
[accepting_change_of_payor_patients, accepting_medicaid_patients, accepting_medicare_patients, accepting_private_patients, accepting_referral_patients, city, email, gender, first_name, id, last_name, middle_name, personal_phone, phone, presentation_name, specialty, state, state_id, street_line_1, street_line_2, suffix, title, type, zip_code].hash
|
421
|
+
end
|
422
|
+
|
423
|
+
# Builds the object from hash
|
424
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
425
|
+
# @return [Object] Returns the model itself
|
426
|
+
def build_from_hash(attributes)
|
427
|
+
return nil unless attributes.is_a?(Hash)
|
428
|
+
self.class.swagger_types.each_pair do |key, type|
|
429
|
+
if type =~ /^Array<(.*)>/i
|
430
|
+
# check to ensure the input is an array given that the the attribute
|
431
|
+
# is documented as an array but the input is not
|
432
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
433
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
434
|
+
end
|
435
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
436
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
437
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
438
|
+
end
|
439
|
+
|
440
|
+
self
|
441
|
+
end
|
442
|
+
|
443
|
+
# Deserializes the data based on type
|
444
|
+
# @param string type Data type
|
445
|
+
# @param string value Value to be deserialized
|
446
|
+
# @return [Object] Deserialized data
|
447
|
+
def _deserialize(type, value)
|
448
|
+
case type.to_sym
|
449
|
+
when :DateTime
|
450
|
+
DateTime.parse(value)
|
451
|
+
when :Date
|
452
|
+
Date.parse(value)
|
453
|
+
when :String
|
454
|
+
value.to_s
|
455
|
+
when :Integer
|
456
|
+
value.to_i
|
457
|
+
when :Float
|
458
|
+
value.to_f
|
459
|
+
when :BOOLEAN
|
460
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
461
|
+
true
|
462
|
+
else
|
463
|
+
false
|
464
|
+
end
|
465
|
+
when :Object
|
466
|
+
# generic object (usually a Hash), return directly
|
467
|
+
value
|
468
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
469
|
+
inner_type = Regexp.last_match[:inner_type]
|
470
|
+
value.map { |v| _deserialize(inner_type, v) }
|
471
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
472
|
+
k_type = Regexp.last_match[:k_type]
|
473
|
+
v_type = Regexp.last_match[:v_type]
|
474
|
+
{}.tap do |hash|
|
475
|
+
value.each do |k, v|
|
476
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
477
|
+
end
|
478
|
+
end
|
479
|
+
else # model
|
480
|
+
temp_model = VericredClient.const_get(type).new
|
481
|
+
temp_model.build_from_hash(value)
|
482
|
+
end
|
483
|
+
end
|
484
|
+
|
485
|
+
# Returns the string representation of the object
|
486
|
+
# @return [String] String presentation of the object
|
487
|
+
def to_s
|
488
|
+
to_hash.to_s
|
489
|
+
end
|
490
|
+
|
491
|
+
# to_body is an alias to to_hash (backward compatibility)
|
492
|
+
# @return [Hash] Returns the object in the form of hash
|
493
|
+
def to_body
|
494
|
+
to_hash
|
495
|
+
end
|
496
|
+
|
497
|
+
# Returns the object in the form of hash
|
498
|
+
# @return [Hash] Returns the object in the form of hash
|
499
|
+
def to_hash
|
500
|
+
hash = {}
|
501
|
+
self.class.attribute_map.each_pair do |attr, param|
|
502
|
+
value = self.send(attr)
|
503
|
+
next if value.nil?
|
504
|
+
hash[param] = _to_hash(value)
|
505
|
+
end
|
506
|
+
hash
|
507
|
+
end
|
508
|
+
|
509
|
+
# Outputs non-array value in the form of hash
|
510
|
+
# For object, use to_hash. Otherwise, just return the value
|
511
|
+
# @param [Object] value Any valid value
|
512
|
+
# @return [Hash] Returns the value in the form of hash
|
513
|
+
def _to_hash(value)
|
514
|
+
if value.is_a?(Array)
|
515
|
+
value.compact.map{ |v| _to_hash(v) }
|
516
|
+
elsif value.is_a?(Hash)
|
517
|
+
{}.tap do |hash|
|
518
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
519
|
+
end
|
520
|
+
elsif value.respond_to? :to_hash
|
521
|
+
value.to_hash
|
522
|
+
else
|
523
|
+
value
|
524
|
+
end
|
525
|
+
end
|
526
|
+
|
527
|
+
end
|
528
|
+
end
|