pharmaobservatory 0.1.21 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +40 -4
  3. data/docs/BiomarkersApi.md +80 -0
  4. data/docs/InvestigatorsApi.md +80 -0
  5. data/docs/ProviderBiomarkerCapabilityRow.md +9 -9
  6. data/docs/ProviderBiomarkerCapabilitySummaryResponse.md +58 -0
  7. data/docs/ProviderBiomarkerCapabilitySummaryRow.md +70 -0
  8. data/docs/ProviderCliaLicensureRow.md +1 -1
  9. data/docs/ProviderRwdDeliveryResponse.md +58 -0
  10. data/docs/ProviderRwdDeliveryRow.md +76 -0
  11. data/docs/ProviderRwdDeliveryStudyResponse.md +58 -0
  12. data/docs/ProviderRwdDeliveryStudyRow.md +60 -0
  13. data/docs/ProviderRwdFootprintResponse.md +58 -0
  14. data/docs/ProviderRwdFootprintRow.md +74 -0
  15. data/docs/RwdConductorsApi.md +160 -0
  16. data/docs/RwdInstitutionsApi.md +80 -0
  17. data/docs/RwdSourcesRow.md +1 -1
  18. data/docs/RwdStudiesApi.md +80 -0
  19. data/docs/RwdUsNetworkMembershipsResponse.md +58 -0
  20. data/docs/RwdUsNetworkMembershipsRow.md +98 -0
  21. data/docs/RwdUsNetworkProjectsResponse.md +58 -0
  22. data/docs/RwdUsNetworkProjectsRow.md +80 -0
  23. data/docs/RwdUsNetworksApi.md +313 -0
  24. data/docs/RwdUsNetworksRecord.md +38 -0
  25. data/docs/RwdUsNetworksResponse.md +58 -0
  26. data/docs/RwdUsNetworksRow.md +60 -0
  27. data/docs/SupplierRwdDeclarationsResponse.md +58 -0
  28. data/docs/SupplierRwdDeclarationsRow.md +74 -0
  29. data/docs/SuppliersApi.md +480 -0
  30. data/docs/TrialPublicationsResponse.md +58 -0
  31. data/docs/TrialPublicationsRow.md +34 -0
  32. data/docs/TrialsApi.md +80 -0
  33. data/lib/pharmaobservatory/api/biomarkers_api.rb +84 -0
  34. data/lib/pharmaobservatory/api/investigators_api.rb +84 -0
  35. data/lib/pharmaobservatory/api/rwd_conductors_api.rb +168 -0
  36. data/lib/pharmaobservatory/api/rwd_institutions_api.rb +84 -0
  37. data/lib/pharmaobservatory/api/rwd_studies_api.rb +84 -0
  38. data/lib/pharmaobservatory/api/rwd_us_networks_api.rb +329 -0
  39. data/lib/pharmaobservatory/api/suppliers_api.rb +504 -0
  40. data/lib/pharmaobservatory/api/trials_api.rb +84 -0
  41. data/lib/pharmaobservatory/models/provider_biomarker_capability_row.rb +9 -9
  42. data/lib/pharmaobservatory/models/provider_biomarker_capability_summary_response.rb +478 -0
  43. data/lib/pharmaobservatory/models/provider_biomarker_capability_summary_row.rb +509 -0
  44. data/lib/pharmaobservatory/models/provider_clia_licensure_row.rb +1 -1
  45. data/lib/pharmaobservatory/models/provider_rwd_delivery_response.rb +478 -0
  46. data/lib/pharmaobservatory/models/provider_rwd_delivery_row.rb +546 -0
  47. data/lib/pharmaobservatory/models/provider_rwd_delivery_study_response.rb +478 -0
  48. data/lib/pharmaobservatory/models/provider_rwd_delivery_study_row.rb +454 -0
  49. data/lib/pharmaobservatory/models/provider_rwd_footprint_response.rb +478 -0
  50. data/lib/pharmaobservatory/models/provider_rwd_footprint_row.rb +539 -0
  51. data/lib/pharmaobservatory/models/rwd_sources_row.rb +1 -1
  52. data/lib/pharmaobservatory/models/rwd_us_network_memberships_response.rb +478 -0
  53. data/lib/pharmaobservatory/models/rwd_us_network_memberships_row.rb +663 -0
  54. data/lib/pharmaobservatory/models/rwd_us_network_projects_response.rb +478 -0
  55. data/lib/pharmaobservatory/models/rwd_us_network_projects_row.rb +564 -0
  56. data/lib/pharmaobservatory/models/rwd_us_networks_record.rb +385 -0
  57. data/lib/pharmaobservatory/models/rwd_us_networks_response.rb +478 -0
  58. data/lib/pharmaobservatory/models/rwd_us_networks_row.rb +454 -0
  59. data/lib/pharmaobservatory/models/supplier_rwd_declarations_response.rb +478 -0
  60. data/lib/pharmaobservatory/models/supplier_rwd_declarations_row.rb +539 -0
  61. data/lib/pharmaobservatory/models/trial_publications_response.rb +478 -0
  62. data/lib/pharmaobservatory/models/trial_publications_row.rb +313 -0
  63. data/lib/pharmaobservatory/version.rb +1 -1
  64. data/lib/pharmaobservatory.rb +20 -0
  65. metadata +42 -2
@@ -43,19 +43,19 @@ module PharmaObservatory
43
43
  # The biomarker's display name.
44
44
  attr_accessor :biomarker_display_name
45
45
 
46
- # The source path of the row: ladder_trial and ladder_clinvar (the evidence ladder), fda_cdx (FDA companion diagnostic list), fda_bqp (FDA Biomarker Qualification Program), literature_assay (assay providers named in PubMed full text) and supplier_survey (the supplier's own declaration). Nothing is merged across lanes.
46
+ # The source path of the row: ladder_trial and ladder_clinvar (the evidence ladder), fda_cdx (FDA companion diagnostic list), fda_bqp (FDA Biomarker Qualification Program), literature_assay (assay providers named in PubMed full text), supplier_survey (the supplier's own declaration) clinvar_submission (ClinVar clinical-testing submissions by a laboratory the supplier carries by name, one row per ClinVar record, tier null) and supplier_service_listing (a Scientist.com marketplace catalogue service the supplier listed, whose name names the gene; tier null, no evidence sense). Nothing is merged across lanes.
47
47
  attr_accessor :evidence_lane
48
48
 
49
- # The source's own evidence vocabulary: the ladder evidence_type on a ladder lane, literature_assay_provider on the literature lane, supplier_survey_declaration on the survey lane.
49
+ # The source's own evidence vocabulary: the ladder evidence_type on a ladder lane, literature_assay_provider on the literature lane, supplier_survey_declaration on the survey lane, rx_service_listing on the service listing lane.
50
50
  attr_accessor :evidence_type
51
51
 
52
- # The supplier's role on the evidence: the ladder role on a ladder lane, the ledger provider role on the literature lane, or respondent on the survey lane.
52
+ # The supplier's role on the evidence: the ladder role on a ladder lane, the ledger provider role on the literature lane, respondent on the survey lane, or marketplace_listing on the service listing lane.
53
53
  attr_accessor :org_role
54
54
 
55
55
  # Sense 1, literature_assay lane only: the source's own label for how the assay is evidenced, never a number. literature_reported is a paper naming the assay, never validation.
56
56
  attr_accessor :analytical_validation_evidence
57
57
 
58
- # Sense 2: the ladder rung's name on a ladder lane, literature_reported on the literature lane (a literature mention, never validation).
58
+ # Sense 2: the ladder rung's name on a ladder lane, literature_reported on the literature lane (a literature mention, never validation), and ClinVar's own review status verbatim on the clinvar_submission lane.
59
59
  attr_accessor :clinical_use_evidence
60
60
 
61
61
  # Sense 3, fda_bqp lane only: fda_qualified, the FDA Biomarker Qualification Program qualified the biomarker.
@@ -64,10 +64,10 @@ module PharmaObservatory
64
64
  # Sense 4, fda_cdx lane only: fda_authorized_companion_diagnostic, the FDA companion diagnostic list names the supplier's device for the biomarker.
65
65
  attr_accessor :companion_diagnostic
66
66
 
67
- # supplier_survey lane only: the supplier's own declared assay status, verbatim. A declaration by the supplier, never mapped into the four evidence kinds.
67
+ # The supplier's own declaration, never mapped into the four evidence kinds: the survey's assay status verbatim on the supplier_survey lane, supplier_declared_service_listed on the supplier_service_listing lane (the supplier listed a catalogue service naming the gene).
68
68
  attr_accessor :supplier_declared_status
69
69
 
70
- # The ladder rung of this row, 1 to 4, a kind of evidence and never a score; set on the ladder_trial, ladder_clinvar, fda_cdx and fda_bqp lanes, null on literature_assay and supplier_survey. Not rolled up: see the example query for the maximum within the ladder lanes.
70
+ # The ladder rung of this row, 1 to 4, a kind of evidence and never a score; set on the ladder_trial, ladder_clinvar, fda_cdx and fda_bqp lanes, null on literature_assay, supplier_survey, clinvar_submission and supplier_service_listing. Not rolled up: see the example query for the maximum within the ladder lanes.
71
71
  attr_accessor :tier
72
72
 
73
73
  # The ladder rule that set the tier of this row; null where tier is null.
@@ -94,16 +94,16 @@ module PharmaObservatory
94
94
  # The source URL the evidence row carries, where it has one.
95
95
  attr_accessor :source_url
96
96
 
97
- # A resolvable citation: the trial page, the ClinVar variation page, the FDA device page or list, or the PubMed page. Null where the source offers none.
97
+ # A resolvable citation: the trial page, the ClinVar variation page, the FDA device page or list, the PubMed page, or the supplier's marketplace page on a service listing. Null where the source offers none.
98
98
  attr_accessor :citation_url
99
99
 
100
- # A short evidence text (at most 500 characters) or the paper title, where the source has one.
100
+ # A short evidence text (at most 500 characters), the paper title, or the catalogue service name on a service listing row, where the source has one.
101
101
  attr_accessor :evidence_snippet
102
102
 
103
103
  # literature_assay lane only: the publication date of the most recent cited paper.
104
104
  attr_accessor :most_recent_evidence_date
105
105
 
106
- # How the evidence reached the supplier: org_member_exact (the organization record of a member of the supplier) or rx_name_key_exact (an exact name-key match of a source name to the supplier). A name match is not a verified identity.
106
+ # How the evidence reached the supplier: org_member_exact (the organization record of a member of the supplier), rx_name_key_exact (an exact name-key match of a source name to the supplier) or rx_provider_direct (the supplier's own marketplace listing, no name matched). A name match is not a verified identity.
107
107
  attr_accessor :match_method
108
108
 
109
109
  # The confidence of the upstream match rung where that rung defines one; null otherwise, never invented.
@@ -0,0 +1,478 @@
1
+ =begin
2
+ #Pharma Observatory Public REST API
3
+
4
+ #Read-only REST API over the Pharma Observatory biomedical data platform. Reference: https://pharmaobservatory.com/api-reference
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.13.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PharmaObservatory
17
+ class ProviderBiomarkerCapabilitySummaryResponse
18
+ attr_accessor :dataset
19
+
20
+ attr_accessor :grain
21
+
22
+ attr_accessor :object_type
23
+
24
+ attr_accessor :id
25
+
26
+ attr_accessor :scope
27
+
28
+ attr_accessor :columns
29
+
30
+ attr_accessor :rows
31
+
32
+ # The exact count of the filtered rows on an ungrouped read, carried by the cursor; null when grouped.
33
+ attr_accessor :total
34
+
35
+ attr_accessor :next_cursor
36
+
37
+ attr_accessor :sort
38
+
39
+ attr_accessor :filters
40
+
41
+ attr_accessor :group_by
42
+
43
+ attr_accessor :measures
44
+
45
+ attr_accessor :attribution
46
+
47
+ attr_accessor :source_credit
48
+
49
+ attr_accessor :withheld_tiers
50
+
51
+ attr_accessor :withheld_columns
52
+
53
+ attr_accessor :freshness
54
+
55
+ attr_accessor :build
56
+
57
+ attr_accessor :build_state
58
+
59
+ attr_accessor :restriction
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'dataset' => :'dataset',
65
+ :'grain' => :'grain',
66
+ :'object_type' => :'object_type',
67
+ :'id' => :'id',
68
+ :'scope' => :'scope',
69
+ :'columns' => :'columns',
70
+ :'rows' => :'rows',
71
+ :'total' => :'total',
72
+ :'next_cursor' => :'next_cursor',
73
+ :'sort' => :'sort',
74
+ :'filters' => :'filters',
75
+ :'group_by' => :'group_by',
76
+ :'measures' => :'measures',
77
+ :'attribution' => :'attribution',
78
+ :'source_credit' => :'source_credit',
79
+ :'withheld_tiers' => :'withheld_tiers',
80
+ :'withheld_columns' => :'withheld_columns',
81
+ :'freshness' => :'freshness',
82
+ :'build' => :'build',
83
+ :'build_state' => :'build_state',
84
+ :'restriction' => :'restriction'
85
+ }
86
+ end
87
+
88
+ # Returns attribute mapping this model knows about
89
+ def self.acceptable_attribute_map
90
+ attribute_map
91
+ end
92
+
93
+ # Returns all the JSON keys this model knows about
94
+ def self.acceptable_attributes
95
+ acceptable_attribute_map.values
96
+ end
97
+
98
+ # Attribute type mapping.
99
+ def self.openapi_types
100
+ {
101
+ :'dataset' => :'String',
102
+ :'grain' => :'String',
103
+ :'object_type' => :'String',
104
+ :'id' => :'String',
105
+ :'scope' => :'AnimalWelfareAssurancesResponseScope',
106
+ :'columns' => :'Array<DatasetColumn>',
107
+ :'rows' => :'Array<ProviderBiomarkerCapabilitySummaryRow>',
108
+ :'total' => :'Integer',
109
+ :'next_cursor' => :'String',
110
+ :'sort' => :'Array<String>',
111
+ :'filters' => :'Array<Hash<String, Object>>',
112
+ :'group_by' => :'Array<String>',
113
+ :'measures' => :'Array<String>',
114
+ :'attribution' => :'Array<DatasetAttribution>',
115
+ :'source_credit' => :'String',
116
+ :'withheld_tiers' => :'Array<String>',
117
+ :'withheld_columns' => :'Array<String>',
118
+ :'freshness' => :'AnimalWelfareAssurancesResponseFreshness',
119
+ :'build' => :'AnimalWelfareAssurancesResponseBuild',
120
+ :'build_state' => :'DatasetBuildState',
121
+ :'restriction' => :'Hash<String, Object>'
122
+ }
123
+ end
124
+
125
+ # List of attributes with nullable: true
126
+ def self.openapi_nullable
127
+ Set.new([
128
+ :'object_type',
129
+ :'id',
130
+ :'scope',
131
+ :'total',
132
+ :'next_cursor',
133
+ :'restriction'
134
+ ])
135
+ end
136
+
137
+ # Initializes the object
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ def initialize(attributes = {})
140
+ if (!attributes.is_a?(Hash))
141
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PharmaObservatory::ProviderBiomarkerCapabilitySummaryResponse` initialize method"
142
+ end
143
+
144
+ # check to see if the attribute exists and convert string to symbol for hash key
145
+ acceptable_attribute_map = self.class.acceptable_attribute_map
146
+ attributes = attributes.each_with_object({}) { |(k, v), h|
147
+ if (!acceptable_attribute_map.key?(k.to_sym))
148
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PharmaObservatory::ProviderBiomarkerCapabilitySummaryResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
149
+ end
150
+ h[k.to_sym] = v
151
+ }
152
+
153
+ if attributes.key?(:'dataset')
154
+ self.dataset = attributes[:'dataset']
155
+ else
156
+ self.dataset = nil
157
+ end
158
+
159
+ if attributes.key?(:'grain')
160
+ self.grain = attributes[:'grain']
161
+ end
162
+
163
+ if attributes.key?(:'object_type')
164
+ self.object_type = attributes[:'object_type']
165
+ end
166
+
167
+ if attributes.key?(:'id')
168
+ self.id = attributes[:'id']
169
+ end
170
+
171
+ if attributes.key?(:'scope')
172
+ self.scope = attributes[:'scope']
173
+ end
174
+
175
+ if attributes.key?(:'columns')
176
+ if (value = attributes[:'columns']).is_a?(Array)
177
+ self.columns = value
178
+ end
179
+ else
180
+ self.columns = nil
181
+ end
182
+
183
+ if attributes.key?(:'rows')
184
+ if (value = attributes[:'rows']).is_a?(Array)
185
+ self.rows = value
186
+ end
187
+ else
188
+ self.rows = nil
189
+ end
190
+
191
+ if attributes.key?(:'total')
192
+ self.total = attributes[:'total']
193
+ end
194
+
195
+ if attributes.key?(:'next_cursor')
196
+ self.next_cursor = attributes[:'next_cursor']
197
+ end
198
+
199
+ if attributes.key?(:'sort')
200
+ if (value = attributes[:'sort']).is_a?(Array)
201
+ self.sort = value
202
+ end
203
+ end
204
+
205
+ if attributes.key?(:'filters')
206
+ if (value = attributes[:'filters']).is_a?(Array)
207
+ self.filters = value
208
+ end
209
+ end
210
+
211
+ if attributes.key?(:'group_by')
212
+ if (value = attributes[:'group_by']).is_a?(Array)
213
+ self.group_by = value
214
+ end
215
+ end
216
+
217
+ if attributes.key?(:'measures')
218
+ if (value = attributes[:'measures']).is_a?(Array)
219
+ self.measures = value
220
+ end
221
+ end
222
+
223
+ if attributes.key?(:'attribution')
224
+ if (value = attributes[:'attribution']).is_a?(Array)
225
+ self.attribution = value
226
+ end
227
+ end
228
+
229
+ if attributes.key?(:'source_credit')
230
+ self.source_credit = attributes[:'source_credit']
231
+ end
232
+
233
+ if attributes.key?(:'withheld_tiers')
234
+ if (value = attributes[:'withheld_tiers']).is_a?(Array)
235
+ self.withheld_tiers = value
236
+ end
237
+ end
238
+
239
+ if attributes.key?(:'withheld_columns')
240
+ if (value = attributes[:'withheld_columns']).is_a?(Array)
241
+ self.withheld_columns = value
242
+ end
243
+ end
244
+
245
+ if attributes.key?(:'freshness')
246
+ self.freshness = attributes[:'freshness']
247
+ end
248
+
249
+ if attributes.key?(:'build')
250
+ self.build = attributes[:'build']
251
+ end
252
+
253
+ if attributes.key?(:'build_state')
254
+ self.build_state = attributes[:'build_state']
255
+ end
256
+
257
+ if attributes.key?(:'restriction')
258
+ if (value = attributes[:'restriction']).is_a?(Hash)
259
+ self.restriction = value
260
+ end
261
+ end
262
+ end
263
+
264
+ # Show invalid properties with the reasons. Usually used together with valid?
265
+ # @return Array for valid properties with the reasons
266
+ def list_invalid_properties
267
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
268
+ invalid_properties = Array.new
269
+ if @dataset.nil?
270
+ invalid_properties.push('invalid value for "dataset", dataset cannot be nil.')
271
+ end
272
+
273
+ if @columns.nil?
274
+ invalid_properties.push('invalid value for "columns", columns cannot be nil.')
275
+ end
276
+
277
+ if @rows.nil?
278
+ invalid_properties.push('invalid value for "rows", rows cannot be nil.')
279
+ end
280
+
281
+ invalid_properties
282
+ end
283
+
284
+ # Check to see if the all the properties in the model are valid
285
+ # @return true if the model is valid
286
+ def valid?
287
+ warn '[DEPRECATED] the `valid?` method is obsolete'
288
+ return false if @dataset.nil?
289
+ return false if @columns.nil?
290
+ return false if @rows.nil?
291
+ true
292
+ end
293
+
294
+ # Custom attribute writer method with validation
295
+ # @param [Object] dataset Value to be assigned
296
+ def dataset=(dataset)
297
+ if dataset.nil?
298
+ fail ArgumentError, 'dataset cannot be nil'
299
+ end
300
+
301
+ @dataset = dataset
302
+ end
303
+
304
+ # Custom attribute writer method with validation
305
+ # @param [Object] columns Value to be assigned
306
+ def columns=(columns)
307
+ if columns.nil?
308
+ fail ArgumentError, 'columns cannot be nil'
309
+ end
310
+
311
+ @columns = columns
312
+ end
313
+
314
+ # Custom attribute writer method with validation
315
+ # @param [Object] rows Value to be assigned
316
+ def rows=(rows)
317
+ if rows.nil?
318
+ fail ArgumentError, 'rows cannot be nil'
319
+ end
320
+
321
+ @rows = rows
322
+ end
323
+
324
+ # Checks equality by comparing each attribute.
325
+ # @param [Object] Object to be compared
326
+ def ==(o)
327
+ return true if self.equal?(o)
328
+ self.class == o.class &&
329
+ dataset == o.dataset &&
330
+ grain == o.grain &&
331
+ object_type == o.object_type &&
332
+ id == o.id &&
333
+ scope == o.scope &&
334
+ columns == o.columns &&
335
+ rows == o.rows &&
336
+ total == o.total &&
337
+ next_cursor == o.next_cursor &&
338
+ sort == o.sort &&
339
+ filters == o.filters &&
340
+ group_by == o.group_by &&
341
+ measures == o.measures &&
342
+ attribution == o.attribution &&
343
+ source_credit == o.source_credit &&
344
+ withheld_tiers == o.withheld_tiers &&
345
+ withheld_columns == o.withheld_columns &&
346
+ freshness == o.freshness &&
347
+ build == o.build &&
348
+ build_state == o.build_state &&
349
+ restriction == o.restriction
350
+ end
351
+
352
+ # @see the `==` method
353
+ # @param [Object] Object to be compared
354
+ def eql?(o)
355
+ self == o
356
+ end
357
+
358
+ # Calculates hash code according to all attributes.
359
+ # @return [Integer] Hash code
360
+ def hash
361
+ [dataset, grain, object_type, id, scope, columns, rows, total, next_cursor, sort, filters, group_by, measures, attribution, source_credit, withheld_tiers, withheld_columns, freshness, build, build_state, restriction].hash
362
+ end
363
+
364
+ # Builds the object from hash
365
+ # @param [Hash] attributes Model attributes in the form of hash
366
+ # @return [Object] Returns the model itself
367
+ def self.build_from_hash(attributes)
368
+ return nil unless attributes.is_a?(Hash)
369
+ attributes = attributes.transform_keys(&:to_sym)
370
+ transformed_hash = {}
371
+ openapi_types.each_pair do |key, type|
372
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
373
+ transformed_hash["#{key}"] = nil
374
+ elsif type =~ /\AArray<(.*)>/i
375
+ # check to ensure the input is an array given that the attribute
376
+ # is documented as an array but the input is not
377
+ if attributes[attribute_map[key]].is_a?(Array)
378
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
379
+ end
380
+ elsif !attributes[attribute_map[key]].nil?
381
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
382
+ end
383
+ end
384
+ new(transformed_hash)
385
+ end
386
+
387
+ # Deserializes the data based on type
388
+ # @param string type Data type
389
+ # @param string value Value to be deserialized
390
+ # @return [Object] Deserialized data
391
+ def self._deserialize(type, value)
392
+ case type.to_sym
393
+ when :Time
394
+ Time.parse(value)
395
+ when :Date
396
+ Date.parse(value)
397
+ when :String
398
+ value.to_s
399
+ when :Integer
400
+ value.to_i
401
+ when :Float
402
+ value.to_f
403
+ when :Boolean
404
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
405
+ true
406
+ else
407
+ false
408
+ end
409
+ when :Object
410
+ # generic object (usually a Hash), return directly
411
+ value
412
+ when /\AArray<(?<inner_type>.+)>\z/
413
+ inner_type = Regexp.last_match[:inner_type]
414
+ value.map { |v| _deserialize(inner_type, v) }
415
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
416
+ k_type = Regexp.last_match[:k_type]
417
+ v_type = Regexp.last_match[:v_type]
418
+ {}.tap do |hash|
419
+ value.each do |k, v|
420
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
421
+ end
422
+ end
423
+ else # model
424
+ # models (e.g. Pet) or oneOf
425
+ klass = PharmaObservatory.const_get(type)
426
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
427
+ end
428
+ end
429
+
430
+ # Returns the string representation of the object
431
+ # @return [String] String presentation of the object
432
+ def to_s
433
+ to_hash.to_s
434
+ end
435
+
436
+ # to_body is an alias to to_hash (backward compatibility)
437
+ # @return [Hash] Returns the object in the form of hash
438
+ def to_body
439
+ to_hash
440
+ end
441
+
442
+ # Returns the object in the form of hash
443
+ # @return [Hash] Returns the object in the form of hash
444
+ def to_hash
445
+ hash = {}
446
+ self.class.attribute_map.each_pair do |attr, param|
447
+ value = self.send(attr)
448
+ if value.nil?
449
+ is_nullable = self.class.openapi_nullable.include?(attr)
450
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
451
+ end
452
+
453
+ hash[param] = _to_hash(value)
454
+ end
455
+ hash
456
+ end
457
+
458
+ # Outputs non-array value in the form of hash
459
+ # For object, use to_hash. Otherwise, just return the value
460
+ # @param [Object] value Any valid value
461
+ # @return [Hash] Returns the value in the form of hash
462
+ def _to_hash(value)
463
+ if value.is_a?(Array)
464
+ value.compact.map { |v| _to_hash(v) }
465
+ elsif value.is_a?(Hash)
466
+ {}.tap do |hash|
467
+ value.each { |k, v| hash[k] = _to_hash(v) }
468
+ end
469
+ elsif value.respond_to? :to_hash
470
+ value.to_hash
471
+ else
472
+ value
473
+ end
474
+ end
475
+
476
+ end
477
+
478
+ end