pharmaobservatory 0.1.3 → 0.1.4

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 (175) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +101 -4
  3. data/docs/BiomarkerBqpAssertionsRow.md +1 -1
  4. data/docs/BiomarkerEvidenceRow.md +1 -1
  5. data/docs/BiomarkerLiteratureRow.md +1 -1
  6. data/docs/BiomarkerRelationsResponse.md +58 -0
  7. data/docs/BiomarkerRelationsRow.md +54 -0
  8. data/docs/BiomarkerSampleCoverageResponse.md +58 -0
  9. data/docs/BiomarkerSampleCoverageRow.md +36 -0
  10. data/docs/BiomarkerSamplePrevalenceResponse.md +58 -0
  11. data/docs/BiomarkerSamplePrevalenceRow.md +56 -0
  12. data/docs/BiomarkerValidationResponse.md +58 -0
  13. data/docs/BiomarkerValidationRow.md +70 -0
  14. data/docs/BiomarkersApi.md +320 -0
  15. data/docs/BiomarkersRow.md +2 -2
  16. data/docs/CellLinesRow.md +1 -1
  17. data/docs/CompaniesApi.md +410 -0
  18. data/docs/CompaniesRecord.md +1 -1
  19. data/docs/CompaniesRecordAttributes.md +18 -0
  20. data/docs/CompaniesRow.md +7 -3
  21. data/docs/CompanyAssetsResponse.md +58 -0
  22. data/docs/CompanyAssetsRow.md +42 -0
  23. data/docs/CompanyFundingEventsResponse.md +58 -0
  24. data/docs/CompanyFundingEventsRow.md +62 -0
  25. data/docs/CompanyFundingSummaryResponse.md +58 -0
  26. data/docs/CompanyFundingSummaryRow.md +46 -0
  27. data/docs/CompanyProgramsRow.md +2 -2
  28. data/docs/ConditionAdverseEventsResponse.md +58 -0
  29. data/docs/ConditionAdverseEventsRow.md +24 -0
  30. data/docs/ConditionBurdenResponse.md +58 -0
  31. data/docs/ConditionBurdenRow.md +32 -0
  32. data/docs/ConditionDeliveryResponse.md +58 -0
  33. data/docs/ConditionDeliveryRow.md +44 -0
  34. data/docs/ConditionDrugsResponse.md +58 -0
  35. data/docs/ConditionDrugsRow.md +26 -0
  36. data/docs/ConditionPrevalenceResponse.md +58 -0
  37. data/docs/ConditionPrevalenceRow.md +62 -0
  38. data/docs/ConditionPublicationsResponse.md +58 -0
  39. data/docs/ConditionPublicationsRow.md +32 -0
  40. data/docs/ConditionSitesResponse.md +58 -0
  41. data/docs/ConditionSitesRow.md +28 -0
  42. data/docs/ConditionTrialsResponse.md +58 -0
  43. data/docs/ConditionTrialsRow.md +58 -0
  44. data/docs/ConditionsApi.md +953 -0
  45. data/docs/ConditionsRecord.md +38 -0
  46. data/docs/ConditionsRecordAttributes.md +20 -0
  47. data/docs/ConditionsResponse.md +58 -0
  48. data/docs/ConditionsRow.md +32 -0
  49. data/docs/DrugPatentCliffRow.md +1 -1
  50. data/docs/InstitutionalHoldingsRow.md +3 -1
  51. data/docs/LegalEntitiesApi.md +160 -0
  52. data/docs/LegalEntitiesRow.md +1 -1
  53. data/docs/OwnershipPositionsResponse.md +58 -0
  54. data/docs/OwnershipPositionsRow.md +100 -0
  55. data/docs/PdufaDatesRow.md +2 -2
  56. data/docs/SiteCroTrialsRow.md +1 -1
  57. data/docs/SiteTrialConditionsRow.md +1 -1
  58. data/docs/SiteTrialDrugsRow.md +1 -1
  59. data/docs/SiteTrialsRow.md +1 -1
  60. data/docs/SponsorRecruitmentByPhaseRow.md +2 -2
  61. data/docs/SponsorRecruitmentDurationRow.md +1 -1
  62. data/docs/SponsorTrialsRow.md +2 -2
  63. data/docs/TrialAdverseEventsResponse.md +58 -0
  64. data/docs/TrialAdverseEventsRow.md +28 -0
  65. data/docs/TrialChangesResponse.md +58 -0
  66. data/docs/TrialChangesRow.md +36 -0
  67. data/docs/TrialDeliveryResponse.md +58 -0
  68. data/docs/TrialDeliveryRow.md +64 -0
  69. data/docs/TrialDemographicsResponse.md +58 -0
  70. data/docs/TrialDemographicsRow.md +32 -0
  71. data/docs/TrialDrugsResponse.md +58 -0
  72. data/docs/TrialDrugsRow.md +30 -0
  73. data/docs/TrialEnrollmentHistoryResponse.md +58 -0
  74. data/docs/TrialEnrollmentHistoryRow.md +36 -0
  75. data/docs/TrialEnrollmentRateResponse.md +58 -0
  76. data/docs/TrialEnrollmentRateRow.md +58 -0
  77. data/docs/TrialExtractedEndpointsResponse.md +58 -0
  78. data/docs/TrialExtractedEndpointsRow.md +40 -0
  79. data/docs/TrialOutcomeMeasuresResponse.md +58 -0
  80. data/docs/TrialOutcomeMeasuresRow.md +28 -0
  81. data/docs/TrialSitesResponse.md +58 -0
  82. data/docs/TrialSitesRow.md +46 -0
  83. data/docs/TrialsApi.md +1033 -0
  84. data/docs/TrialsRecord.md +38 -0
  85. data/docs/TrialsRecordAttributes.md +24 -0
  86. data/docs/TrialsResponse.md +58 -0
  87. data/docs/TrialsRow.md +116 -0
  88. data/lib/pharmaobservatory/api/biomarkers_api.rb +336 -0
  89. data/lib/pharmaobservatory/api/companies_api.rb +455 -0
  90. data/lib/pharmaobservatory/api/conditions_api.rb +1001 -0
  91. data/lib/pharmaobservatory/api/legal_entities_api.rb +168 -0
  92. data/lib/pharmaobservatory/api/trials_api.rb +1085 -0
  93. data/lib/pharmaobservatory/models/biomarker_bqp_assertions_row.rb +1 -1
  94. data/lib/pharmaobservatory/models/biomarker_evidence_row.rb +1 -1
  95. data/lib/pharmaobservatory/models/biomarker_literature_row.rb +1 -1
  96. data/lib/pharmaobservatory/models/biomarker_relations_response.rb +478 -0
  97. data/lib/pharmaobservatory/models/biomarker_relations_row.rb +421 -0
  98. data/lib/pharmaobservatory/models/biomarker_sample_coverage_response.rb +478 -0
  99. data/lib/pharmaobservatory/models/biomarker_sample_coverage_row.rb +322 -0
  100. data/lib/pharmaobservatory/models/biomarker_sample_prevalence_response.rb +478 -0
  101. data/lib/pharmaobservatory/models/biomarker_sample_prevalence_row.rb +436 -0
  102. data/lib/pharmaobservatory/models/biomarker_validation_response.rb +478 -0
  103. data/lib/pharmaobservatory/models/biomarker_validation_row.rb +509 -0
  104. data/lib/pharmaobservatory/models/biomarkers_row.rb +2 -2
  105. data/lib/pharmaobservatory/models/cell_lines_row.rb +1 -1
  106. data/lib/pharmaobservatory/models/companies_record.rb +1 -1
  107. data/lib/pharmaobservatory/models/companies_record_attributes.rb +220 -0
  108. data/lib/pharmaobservatory/models/companies_row.rb +29 -7
  109. data/lib/pharmaobservatory/models/company_assets_response.rb +478 -0
  110. data/lib/pharmaobservatory/models/company_assets_row.rb +355 -0
  111. data/lib/pharmaobservatory/models/company_funding_events_response.rb +478 -0
  112. data/lib/pharmaobservatory/models/company_funding_events_row.rb +465 -0
  113. data/lib/pharmaobservatory/models/company_funding_summary_response.rb +478 -0
  114. data/lib/pharmaobservatory/models/company_funding_summary_row.rb +377 -0
  115. data/lib/pharmaobservatory/models/company_programs_row.rb +2 -2
  116. data/lib/pharmaobservatory/models/condition_adverse_events_response.rb +478 -0
  117. data/lib/pharmaobservatory/models/condition_adverse_events_row.rb +256 -0
  118. data/lib/pharmaobservatory/models/condition_burden_response.rb +478 -0
  119. data/lib/pharmaobservatory/models/condition_burden_row.rb +300 -0
  120. data/lib/pharmaobservatory/models/condition_delivery_response.rb +478 -0
  121. data/lib/pharmaobservatory/models/condition_delivery_row.rb +366 -0
  122. data/lib/pharmaobservatory/models/condition_drugs_response.rb +478 -0
  123. data/lib/pharmaobservatory/models/condition_drugs_row.rb +267 -0
  124. data/lib/pharmaobservatory/models/condition_prevalence_response.rb +478 -0
  125. data/lib/pharmaobservatory/models/condition_prevalence_row.rb +465 -0
  126. data/lib/pharmaobservatory/models/condition_publications_response.rb +478 -0
  127. data/lib/pharmaobservatory/models/condition_publications_row.rb +300 -0
  128. data/lib/pharmaobservatory/models/condition_sites_response.rb +478 -0
  129. data/lib/pharmaobservatory/models/condition_sites_row.rb +278 -0
  130. data/lib/pharmaobservatory/models/condition_trials_response.rb +478 -0
  131. data/lib/pharmaobservatory/models/condition_trials_row.rb +443 -0
  132. data/lib/pharmaobservatory/models/conditions_record.rb +385 -0
  133. data/lib/pharmaobservatory/models/conditions_record_attributes.rb +229 -0
  134. data/lib/pharmaobservatory/models/conditions_response.rb +478 -0
  135. data/lib/pharmaobservatory/models/conditions_row.rb +304 -0
  136. data/lib/pharmaobservatory/models/drug_patent_cliff_row.rb +1 -1
  137. data/lib/pharmaobservatory/models/institutional_holdings_row.rb +13 -2
  138. data/lib/pharmaobservatory/models/legal_entities_row.rb +1 -1
  139. data/lib/pharmaobservatory/models/ownership_positions_response.rb +478 -0
  140. data/lib/pharmaobservatory/models/ownership_positions_row.rb +674 -0
  141. data/lib/pharmaobservatory/models/pdufa_dates_row.rb +2 -2
  142. data/lib/pharmaobservatory/models/site_cro_trials_row.rb +1 -1
  143. data/lib/pharmaobservatory/models/site_trial_conditions_row.rb +1 -1
  144. data/lib/pharmaobservatory/models/site_trial_drugs_row.rb +1 -1
  145. data/lib/pharmaobservatory/models/site_trials_row.rb +1 -1
  146. data/lib/pharmaobservatory/models/sponsor_recruitment_by_phase_row.rb +2 -2
  147. data/lib/pharmaobservatory/models/sponsor_recruitment_duration_row.rb +1 -1
  148. data/lib/pharmaobservatory/models/sponsor_trials_row.rb +2 -2
  149. data/lib/pharmaobservatory/models/trial_adverse_events_response.rb +478 -0
  150. data/lib/pharmaobservatory/models/trial_adverse_events_row.rb +278 -0
  151. data/lib/pharmaobservatory/models/trial_changes_response.rb +478 -0
  152. data/lib/pharmaobservatory/models/trial_changes_row.rb +328 -0
  153. data/lib/pharmaobservatory/models/trial_delivery_response.rb +478 -0
  154. data/lib/pharmaobservatory/models/trial_delivery_row.rb +476 -0
  155. data/lib/pharmaobservatory/models/trial_demographics_response.rb +478 -0
  156. data/lib/pharmaobservatory/models/trial_demographics_row.rb +300 -0
  157. data/lib/pharmaobservatory/models/trial_drugs_response.rb +478 -0
  158. data/lib/pharmaobservatory/models/trial_drugs_row.rb +291 -0
  159. data/lib/pharmaobservatory/models/trial_enrollment_history_response.rb +478 -0
  160. data/lib/pharmaobservatory/models/trial_enrollment_history_row.rb +322 -0
  161. data/lib/pharmaobservatory/models/trial_enrollment_rate_response.rb +478 -0
  162. data/lib/pharmaobservatory/models/trial_enrollment_rate_row.rb +443 -0
  163. data/lib/pharmaobservatory/models/trial_extracted_endpoints_response.rb +478 -0
  164. data/lib/pharmaobservatory/models/trial_extracted_endpoints_row.rb +346 -0
  165. data/lib/pharmaobservatory/models/trial_outcome_measures_response.rb +478 -0
  166. data/lib/pharmaobservatory/models/trial_outcome_measures_row.rb +278 -0
  167. data/lib/pharmaobservatory/models/trial_sites_response.rb +478 -0
  168. data/lib/pharmaobservatory/models/trial_sites_row.rb +377 -0
  169. data/lib/pharmaobservatory/models/trials_record.rb +385 -0
  170. data/lib/pharmaobservatory/models/trials_record_attributes.rb +247 -0
  171. data/lib/pharmaobservatory/models/trials_response.rb +478 -0
  172. data/lib/pharmaobservatory/models/trials_row.rb +784 -0
  173. data/lib/pharmaobservatory/version.rb +1 -1
  174. data/lib/pharmaobservatory.rb +63 -0
  175. metadata +127 -1
@@ -0,0 +1,385 @@
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 ConditionsRecord
18
+ attr_accessor :object_type
19
+
20
+ attr_accessor :id
21
+
22
+ attr_accessor :record
23
+
24
+ attr_accessor :attributes
25
+
26
+ attr_accessor :datasets
27
+
28
+ attr_accessor :attribution
29
+
30
+ attr_accessor :source_credit
31
+
32
+ attr_accessor :freshness
33
+
34
+ attr_accessor :build
35
+
36
+ attr_accessor :build_state
37
+
38
+ attr_accessor :restriction
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'object_type' => :'object_type',
44
+ :'id' => :'id',
45
+ :'record' => :'record',
46
+ :'attributes' => :'attributes',
47
+ :'datasets' => :'datasets',
48
+ :'attribution' => :'attribution',
49
+ :'source_credit' => :'source_credit',
50
+ :'freshness' => :'freshness',
51
+ :'build' => :'build',
52
+ :'build_state' => :'build_state',
53
+ :'restriction' => :'restriction'
54
+ }
55
+ end
56
+
57
+ # Returns attribute mapping this model knows about
58
+ def self.acceptable_attribute_map
59
+ attribute_map
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ acceptable_attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'object_type' => :'String',
71
+ :'id' => :'String',
72
+ :'record' => :'ConditionsRow',
73
+ :'attributes' => :'ConditionsRecordAttributes',
74
+ :'datasets' => :'Array<DatasetListing>',
75
+ :'attribution' => :'Array<DatasetAttribution>',
76
+ :'source_credit' => :'String',
77
+ :'freshness' => :'BiomarkerCdxAssertionsResponseFreshness',
78
+ :'build' => :'BiomarkerCdxAssertionsResponseBuild',
79
+ :'build_state' => :'DatasetBuildState',
80
+ :'restriction' => :'Hash<String, Object>'
81
+ }
82
+ end
83
+
84
+ # List of attributes with nullable: true
85
+ def self.openapi_nullable
86
+ Set.new([
87
+ :'restriction'
88
+ ])
89
+ end
90
+
91
+ # Initializes the object
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ def initialize(attributes = {})
94
+ if (!attributes.is_a?(Hash))
95
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PharmaObservatory::ConditionsRecord` initialize method"
96
+ end
97
+
98
+ # check to see if the attribute exists and convert string to symbol for hash key
99
+ acceptable_attribute_map = self.class.acceptable_attribute_map
100
+ attributes = attributes.each_with_object({}) { |(k, v), h|
101
+ if (!acceptable_attribute_map.key?(k.to_sym))
102
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PharmaObservatory::ConditionsRecord`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
103
+ end
104
+ h[k.to_sym] = v
105
+ }
106
+
107
+ if attributes.key?(:'object_type')
108
+ self.object_type = attributes[:'object_type']
109
+ else
110
+ self.object_type = nil
111
+ end
112
+
113
+ if attributes.key?(:'id')
114
+ self.id = attributes[:'id']
115
+ else
116
+ self.id = nil
117
+ end
118
+
119
+ if attributes.key?(:'record')
120
+ self.record = attributes[:'record']
121
+ else
122
+ self.record = nil
123
+ end
124
+
125
+ if attributes.key?(:'attributes')
126
+ self.attributes = attributes[:'attributes']
127
+ end
128
+
129
+ if attributes.key?(:'datasets')
130
+ if (value = attributes[:'datasets']).is_a?(Array)
131
+ self.datasets = value
132
+ end
133
+ else
134
+ self.datasets = nil
135
+ end
136
+
137
+ if attributes.key?(:'attribution')
138
+ if (value = attributes[:'attribution']).is_a?(Array)
139
+ self.attribution = value
140
+ end
141
+ end
142
+
143
+ if attributes.key?(:'source_credit')
144
+ self.source_credit = attributes[:'source_credit']
145
+ end
146
+
147
+ if attributes.key?(:'freshness')
148
+ self.freshness = attributes[:'freshness']
149
+ end
150
+
151
+ if attributes.key?(:'build')
152
+ self.build = attributes[:'build']
153
+ end
154
+
155
+ if attributes.key?(:'build_state')
156
+ self.build_state = attributes[:'build_state']
157
+ end
158
+
159
+ if attributes.key?(:'restriction')
160
+ if (value = attributes[:'restriction']).is_a?(Hash)
161
+ self.restriction = value
162
+ end
163
+ end
164
+ end
165
+
166
+ # Show invalid properties with the reasons. Usually used together with valid?
167
+ # @return Array for valid properties with the reasons
168
+ def list_invalid_properties
169
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
170
+ invalid_properties = Array.new
171
+ if @object_type.nil?
172
+ invalid_properties.push('invalid value for "object_type", object_type cannot be nil.')
173
+ end
174
+
175
+ if @id.nil?
176
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
177
+ end
178
+
179
+ if @record.nil?
180
+ invalid_properties.push('invalid value for "record", record cannot be nil.')
181
+ end
182
+
183
+ if @datasets.nil?
184
+ invalid_properties.push('invalid value for "datasets", datasets cannot be nil.')
185
+ end
186
+
187
+ invalid_properties
188
+ end
189
+
190
+ # Check to see if the all the properties in the model are valid
191
+ # @return true if the model is valid
192
+ def valid?
193
+ warn '[DEPRECATED] the `valid?` method is obsolete'
194
+ return false if @object_type.nil?
195
+ return false if @id.nil?
196
+ return false if @record.nil?
197
+ return false if @datasets.nil?
198
+ true
199
+ end
200
+
201
+ # Custom attribute writer method with validation
202
+ # @param [Object] object_type Value to be assigned
203
+ def object_type=(object_type)
204
+ if object_type.nil?
205
+ fail ArgumentError, 'object_type cannot be nil'
206
+ end
207
+
208
+ @object_type = object_type
209
+ end
210
+
211
+ # Custom attribute writer method with validation
212
+ # @param [Object] id Value to be assigned
213
+ def id=(id)
214
+ if id.nil?
215
+ fail ArgumentError, 'id cannot be nil'
216
+ end
217
+
218
+ @id = id
219
+ end
220
+
221
+ # Custom attribute writer method with validation
222
+ # @param [Object] record Value to be assigned
223
+ def record=(record)
224
+ if record.nil?
225
+ fail ArgumentError, 'record cannot be nil'
226
+ end
227
+
228
+ @record = record
229
+ end
230
+
231
+ # Custom attribute writer method with validation
232
+ # @param [Object] datasets Value to be assigned
233
+ def datasets=(datasets)
234
+ if datasets.nil?
235
+ fail ArgumentError, 'datasets cannot be nil'
236
+ end
237
+
238
+ @datasets = datasets
239
+ end
240
+
241
+ # Checks equality by comparing each attribute.
242
+ # @param [Object] Object to be compared
243
+ def ==(o)
244
+ return true if self.equal?(o)
245
+ self.class == o.class &&
246
+ object_type == o.object_type &&
247
+ id == o.id &&
248
+ record == o.record &&
249
+ attributes == o.attributes &&
250
+ datasets == o.datasets &&
251
+ attribution == o.attribution &&
252
+ source_credit == o.source_credit &&
253
+ freshness == o.freshness &&
254
+ build == o.build &&
255
+ build_state == o.build_state &&
256
+ restriction == o.restriction
257
+ end
258
+
259
+ # @see the `==` method
260
+ # @param [Object] Object to be compared
261
+ def eql?(o)
262
+ self == o
263
+ end
264
+
265
+ # Calculates hash code according to all attributes.
266
+ # @return [Integer] Hash code
267
+ def hash
268
+ [object_type, id, record, attributes, datasets, attribution, source_credit, freshness, build, build_state, restriction].hash
269
+ end
270
+
271
+ # Builds the object from hash
272
+ # @param [Hash] attributes Model attributes in the form of hash
273
+ # @return [Object] Returns the model itself
274
+ def self.build_from_hash(attributes)
275
+ return nil unless attributes.is_a?(Hash)
276
+ attributes = attributes.transform_keys(&:to_sym)
277
+ transformed_hash = {}
278
+ openapi_types.each_pair do |key, type|
279
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
280
+ transformed_hash["#{key}"] = nil
281
+ elsif type =~ /\AArray<(.*)>/i
282
+ # check to ensure the input is an array given that the attribute
283
+ # is documented as an array but the input is not
284
+ if attributes[attribute_map[key]].is_a?(Array)
285
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
286
+ end
287
+ elsif !attributes[attribute_map[key]].nil?
288
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
289
+ end
290
+ end
291
+ new(transformed_hash)
292
+ end
293
+
294
+ # Deserializes the data based on type
295
+ # @param string type Data type
296
+ # @param string value Value to be deserialized
297
+ # @return [Object] Deserialized data
298
+ def self._deserialize(type, value)
299
+ case type.to_sym
300
+ when :Time
301
+ Time.parse(value)
302
+ when :Date
303
+ Date.parse(value)
304
+ when :String
305
+ value.to_s
306
+ when :Integer
307
+ value.to_i
308
+ when :Float
309
+ value.to_f
310
+ when :Boolean
311
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
312
+ true
313
+ else
314
+ false
315
+ end
316
+ when :Object
317
+ # generic object (usually a Hash), return directly
318
+ value
319
+ when /\AArray<(?<inner_type>.+)>\z/
320
+ inner_type = Regexp.last_match[:inner_type]
321
+ value.map { |v| _deserialize(inner_type, v) }
322
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
323
+ k_type = Regexp.last_match[:k_type]
324
+ v_type = Regexp.last_match[:v_type]
325
+ {}.tap do |hash|
326
+ value.each do |k, v|
327
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
328
+ end
329
+ end
330
+ else # model
331
+ # models (e.g. Pet) or oneOf
332
+ klass = PharmaObservatory.const_get(type)
333
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
334
+ end
335
+ end
336
+
337
+ # Returns the string representation of the object
338
+ # @return [String] String presentation of the object
339
+ def to_s
340
+ to_hash.to_s
341
+ end
342
+
343
+ # to_body is an alias to to_hash (backward compatibility)
344
+ # @return [Hash] Returns the object in the form of hash
345
+ def to_body
346
+ to_hash
347
+ end
348
+
349
+ # Returns the object in the form of hash
350
+ # @return [Hash] Returns the object in the form of hash
351
+ def to_hash
352
+ hash = {}
353
+ self.class.attribute_map.each_pair do |attr, param|
354
+ value = self.send(attr)
355
+ if value.nil?
356
+ is_nullable = self.class.openapi_nullable.include?(attr)
357
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
358
+ end
359
+
360
+ hash[param] = _to_hash(value)
361
+ end
362
+ hash
363
+ end
364
+
365
+ # Outputs non-array value in the form of hash
366
+ # For object, use to_hash. Otherwise, just return the value
367
+ # @param [Object] value Any valid value
368
+ # @return [Hash] Returns the value in the form of hash
369
+ def _to_hash(value)
370
+ if value.is_a?(Array)
371
+ value.compact.map { |v| _to_hash(v) }
372
+ elsif value.is_a?(Hash)
373
+ {}.tap do |hash|
374
+ value.each { |k, v| hash[k] = _to_hash(v) }
375
+ end
376
+ elsif value.respond_to? :to_hash
377
+ value.to_hash
378
+ else
379
+ value
380
+ end
381
+ end
382
+
383
+ end
384
+
385
+ end
@@ -0,0 +1,229 @@
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 ConditionsRecordAttributes
18
+ attr_accessor :condition_burden
19
+
20
+ attr_accessor :condition_delivery
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'condition_burden' => :'condition_burden',
26
+ :'condition_delivery' => :'condition_delivery'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'condition_burden' => :'ConditionBurdenRow',
44
+ :'condition_delivery' => :'ConditionDeliveryRow'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PharmaObservatory::ConditionsRecordAttributes` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PharmaObservatory::ConditionsRecordAttributes`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'condition_burden')
71
+ self.condition_burden = attributes[:'condition_burden']
72
+ end
73
+
74
+ if attributes.key?(:'condition_delivery')
75
+ self.condition_delivery = attributes[:'condition_delivery']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ condition_burden == o.condition_burden &&
100
+ condition_delivery == o.condition_delivery
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [condition_burden, condition_delivery].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ attributes = attributes.transform_keys(&:to_sym)
121
+ transformed_hash = {}
122
+ openapi_types.each_pair do |key, type|
123
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = nil
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[attribute_map[key]].is_a?(Array)
129
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
130
+ end
131
+ elsif !attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
133
+ end
134
+ end
135
+ new(transformed_hash)
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def self._deserialize(type, value)
143
+ case type.to_sym
144
+ when :Time
145
+ Time.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :Boolean
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ # models (e.g. Pet) or oneOf
176
+ klass = PharmaObservatory.const_get(type)
177
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+
227
+ end
228
+
229
+ end