pharmaobservatory 0.1.7 → 0.1.8

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 (117) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +83 -4
  3. data/docs/BiomarkerAlleleFrequenciesResponse.md +58 -0
  4. data/docs/BiomarkerAlleleFrequenciesRow.md +62 -0
  5. data/docs/BiomarkerAssayProvidersResponse.md +58 -0
  6. data/docs/BiomarkerAssayProvidersRow.md +72 -0
  7. data/docs/BiomarkerEvidenceByYearResponse.md +58 -0
  8. data/docs/BiomarkerEvidenceByYearRow.md +32 -0
  9. data/docs/BiomarkerTraversalStatusResponse.md +58 -0
  10. data/docs/BiomarkerTraversalStatusRow.md +36 -0
  11. data/docs/BiomarkersApi.md +320 -0
  12. data/docs/CompaniesApi.md +1001 -99
  13. data/docs/CompanyAssetsRow.md +5 -1
  14. data/docs/CompanyBiomarkerCapabilityResponse.md +58 -0
  15. data/docs/CompanyBiomarkerCapabilityRow.md +68 -0
  16. data/docs/CompanyProgramsRow.md +5 -1
  17. data/docs/CompanyRareDiseaseDeclarationsResponse.md +58 -0
  18. data/docs/CompanyRareDiseaseDeclarationsRow.md +52 -0
  19. data/docs/GxpFacilitiesRow.md +22 -0
  20. data/docs/LegalEntitiesApi.md +981 -101
  21. data/docs/LegalEntitiesRecordAttributes.md +6 -0
  22. data/docs/LegalEntitySecFilingsResponse.md +58 -0
  23. data/docs/LegalEntitySecFilingsRow.md +44 -0
  24. data/docs/OrgDisclosureTrendResponse.md +58 -0
  25. data/docs/OrgDisclosureTrendRow.md +62 -0
  26. data/docs/OwnershipSourceCoverageResponse.md +58 -0
  27. data/docs/OwnershipSourceCoverageRow.md +62 -0
  28. data/docs/ProgramLicensingCandidatesRow.md +5 -1
  29. data/docs/ProgramsRow.md +1 -1
  30. data/docs/RwdConductorDeliveryResponse.md +58 -0
  31. data/docs/RwdConductorDeliveryRow.md +74 -0
  32. data/docs/RwdConductorFootprintResponse.md +58 -0
  33. data/docs/RwdConductorFootprintRow.md +40 -0
  34. data/docs/RwdConductorStudiesResponse.md +58 -0
  35. data/docs/RwdConductorStudiesRow.md +42 -0
  36. data/docs/RwdConductorsApi.md +393 -0
  37. data/docs/RwdConductorsRecord.md +38 -0
  38. data/docs/RwdConductorsResponse.md +58 -0
  39. data/docs/RwdConductorsRow.md +72 -0
  40. data/docs/RwdInstitutionsApi.md +153 -0
  41. data/docs/RwdInstitutionsRecord.md +38 -0
  42. data/docs/RwdInstitutionsResponse.md +58 -0
  43. data/docs/RwdInstitutionsRow.md +154 -0
  44. data/docs/RwdNetworksApi.md +153 -0
  45. data/docs/RwdNetworksRecord.md +38 -0
  46. data/docs/RwdNetworksResponse.md +58 -0
  47. data/docs/RwdNetworksRow.md +110 -0
  48. data/docs/RwdStudiesApi.md +80 -0
  49. data/docs/SbtiCrosscheckResponse.md +58 -0
  50. data/docs/SbtiCrosscheckRow.md +48 -0
  51. data/docs/SponsorDeliveryResponse.md +58 -0
  52. data/docs/SponsorDeliveryRow.md +52 -0
  53. data/docs/SponsorPatentMentionsResponse.md +58 -0
  54. data/docs/SponsorPatentMentionsRow.md +42 -0
  55. data/docs/SponsorTrialConditionsResponse.md +58 -0
  56. data/docs/SponsorTrialConditionsRow.md +36 -0
  57. data/docs/SponsorTrialDrugsResponse.md +58 -0
  58. data/docs/SponsorTrialDrugsRow.md +34 -0
  59. data/lib/pharmaobservatory/api/biomarkers_api.rb +336 -0
  60. data/lib/pharmaobservatory/api/companies_api.rb +1131 -130
  61. data/lib/pharmaobservatory/api/legal_entities_api.rb +1047 -123
  62. data/lib/pharmaobservatory/api/rwd_conductors_api.rb +413 -0
  63. data/lib/pharmaobservatory/api/rwd_institutions_api.rb +161 -0
  64. data/lib/pharmaobservatory/api/rwd_networks_api.rb +161 -0
  65. data/lib/pharmaobservatory/api/rwd_studies_api.rb +84 -0
  66. data/lib/pharmaobservatory/models/biomarker_allele_frequencies_response.rb +478 -0
  67. data/lib/pharmaobservatory/models/biomarker_allele_frequencies_row.rb +465 -0
  68. data/lib/pharmaobservatory/models/biomarker_assay_providers_response.rb +478 -0
  69. data/lib/pharmaobservatory/models/biomarker_assay_providers_row.rb +520 -0
  70. data/lib/pharmaobservatory/models/biomarker_evidence_by_year_response.rb +478 -0
  71. data/lib/pharmaobservatory/models/biomarker_evidence_by_year_row.rb +300 -0
  72. data/lib/pharmaobservatory/models/biomarker_traversal_status_response.rb +478 -0
  73. data/lib/pharmaobservatory/models/biomarker_traversal_status_row.rb +322 -0
  74. data/lib/pharmaobservatory/models/company_assets_row.rb +24 -2
  75. data/lib/pharmaobservatory/models/company_biomarker_capability_response.rb +478 -0
  76. data/lib/pharmaobservatory/models/company_biomarker_capability_row.rb +498 -0
  77. data/lib/pharmaobservatory/models/company_programs_row.rb +24 -2
  78. data/lib/pharmaobservatory/models/company_rare_disease_declarations_response.rb +478 -0
  79. data/lib/pharmaobservatory/models/company_rare_disease_declarations_row.rb +410 -0
  80. data/lib/pharmaobservatory/models/gxp_facilities_row.rb +122 -1
  81. data/lib/pharmaobservatory/models/legal_entities_record_attributes.rb +28 -1
  82. data/lib/pharmaobservatory/models/legal_entity_sec_filings_response.rb +478 -0
  83. data/lib/pharmaobservatory/models/legal_entity_sec_filings_row.rb +370 -0
  84. data/lib/pharmaobservatory/models/org_disclosure_trend_response.rb +478 -0
  85. data/lib/pharmaobservatory/models/org_disclosure_trend_row.rb +465 -0
  86. data/lib/pharmaobservatory/models/ownership_source_coverage_response.rb +478 -0
  87. data/lib/pharmaobservatory/models/ownership_source_coverage_row.rb +465 -0
  88. data/lib/pharmaobservatory/models/program_licensing_candidates_row.rb +24 -2
  89. data/lib/pharmaobservatory/models/programs_row.rb +1 -1
  90. data/lib/pharmaobservatory/models/rwd_conductor_delivery_response.rb +478 -0
  91. data/lib/pharmaobservatory/models/rwd_conductor_delivery_row.rb +537 -0
  92. data/lib/pharmaobservatory/models/rwd_conductor_footprint_response.rb +478 -0
  93. data/lib/pharmaobservatory/models/rwd_conductor_footprint_row.rb +346 -0
  94. data/lib/pharmaobservatory/models/rwd_conductor_studies_response.rb +478 -0
  95. data/lib/pharmaobservatory/models/rwd_conductor_studies_row.rb +355 -0
  96. data/lib/pharmaobservatory/models/rwd_conductors_record.rb +385 -0
  97. data/lib/pharmaobservatory/models/rwd_conductors_response.rb +478 -0
  98. data/lib/pharmaobservatory/models/rwd_conductors_row.rb +526 -0
  99. data/lib/pharmaobservatory/models/rwd_institutions_record.rb +385 -0
  100. data/lib/pharmaobservatory/models/rwd_institutions_response.rb +478 -0
  101. data/lib/pharmaobservatory/models/rwd_institutions_row.rb +981 -0
  102. data/lib/pharmaobservatory/models/rwd_networks_record.rb +385 -0
  103. data/lib/pharmaobservatory/models/rwd_networks_response.rb +478 -0
  104. data/lib/pharmaobservatory/models/rwd_networks_row.rb +733 -0
  105. data/lib/pharmaobservatory/models/sbti_crosscheck_response.rb +478 -0
  106. data/lib/pharmaobservatory/models/sbti_crosscheck_row.rb +388 -0
  107. data/lib/pharmaobservatory/models/sponsor_delivery_response.rb +478 -0
  108. data/lib/pharmaobservatory/models/sponsor_delivery_row.rb +410 -0
  109. data/lib/pharmaobservatory/models/sponsor_patent_mentions_response.rb +478 -0
  110. data/lib/pharmaobservatory/models/sponsor_patent_mentions_row.rb +355 -0
  111. data/lib/pharmaobservatory/models/sponsor_trial_conditions_response.rb +478 -0
  112. data/lib/pharmaobservatory/models/sponsor_trial_conditions_row.rb +322 -0
  113. data/lib/pharmaobservatory/models/sponsor_trial_drugs_response.rb +478 -0
  114. data/lib/pharmaobservatory/models/sponsor_trial_drugs_row.rb +311 -0
  115. data/lib/pharmaobservatory/version.rb +1 -1
  116. data/lib/pharmaobservatory.rb +46 -0
  117. metadata +94 -2
@@ -0,0 +1,981 @@
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
+ # One row of the rwd_institutions dataset: one row per register institution entry (Institution ID). A grouped request returns the group columns and the measures instead, as additional properties.
18
+ class RwdInstitutionsRow
19
+ # The register's own Institution ID. The entry key of the rwd_institutions object type. The register can list one name under two ids; counts are per id and are not additive across rows.
20
+ attr_accessor :institution_id
21
+
22
+ # The institution's name as the register spells it; an institution here can be registered under a person's name.
23
+ attr_accessor :institution_name
24
+
25
+ # The legal entity (organization record id) the institution resolved to; null when it did not resolve. An unresolved institution keeps its row with null ids.
26
+ attr_accessor :institution_org_id
27
+
28
+ # The company the institution's legal entity belongs to; null when unresolved.
29
+ attr_accessor :institution_company_id
30
+
31
+ # The company's name.
32
+ attr_accessor :institution_company_name
33
+
34
+ # The current ultimate parent company of the institution's company.
35
+ attr_accessor :institution_group_id
36
+
37
+ # The group's name.
38
+ attr_accessor :institution_group_name
39
+
40
+ # How the institution name resolved to a legal entity (the resolution rung); null when unresolved.
41
+ attr_accessor :org_match_rung
42
+
43
+ # The confidence tier of that resolution; null when unresolved.
44
+ attr_accessor :org_match_tier
45
+
46
+ # The legal entity the register's parent institution claim resolved to. Most parent claims are claims between register entries, not between organizations: read it with is_org_to_org.
47
+ attr_accessor :parent_org_id
48
+
49
+ # True when the parent claim is a claim between two resolved legal entities, false when it only links register entries.
50
+ attr_accessor :is_org_to_org
51
+
52
+ # The normalised name key the study, membership and holder edges join on.
53
+ attr_accessor :institution_name_key
54
+
55
+ # The parent institution's name as the register spells it.
56
+ attr_accessor :parent_name
57
+
58
+ # The normalised key of the parent name.
59
+ attr_accessor :parent_name_key
60
+
61
+ # self_registered_profile when the entry carries at least one descriptive field, catalogue_name_entry when it is a name and an id only (a catalogue pick-list entry nobody registered a profile for). The declaration columns are null on a catalogue name entry.
62
+ attr_accessor :registration_state
63
+
64
+ # True when registration_state is self_registered_profile.
65
+ attr_accessor :is_self_registered_profile
66
+
67
+ # How many of the declarable profile fields the entry answered.
68
+ attr_accessor :declared_profile_fields
69
+
70
+ # How many profile fields the register offers; the denominator of declared_profile_fields.
71
+ attr_accessor :declarable_profile_fields
72
+
73
+ # The type of institution the entry declares, as typed.
74
+ attr_accessor :type_of_institution
75
+
76
+ # The role the entry declares for the institution, as typed.
77
+ attr_accessor :institution_role
78
+
79
+ # The country text the entry declares, as typed.
80
+ attr_accessor :institution_countries
81
+
82
+ # The declared countries split by the register's country list, one element per country.
83
+ attr_accessor :institution_country_names
84
+
85
+ # How many countries institution_country_names holds.
86
+ attr_accessor :institution_country_count
87
+
88
+ # Country text items the country vocabulary of this build does not hold.
89
+ attr_accessor :unmatched_country_fragments
90
+
91
+ # The ISO 3166-1 alpha-2 code when the entry declares exactly one country, null otherwise.
92
+ attr_accessor :single_declared_country_iso2
93
+
94
+ # The institution's website as the register holds it.
95
+ attr_accessor :institution_website
96
+
97
+ # The address of this entry on the HMA-EMA catalogue site (the register's URL LINK).
98
+ attr_accessor :catalogue_url
99
+
100
+ # Whether the institution declares it is open to industry-funded research; null on a catalogue name entry, where the export writes a default No that is not an answer.
101
+ attr_accessor :open_to_industry_funded_research
102
+
103
+ # Whether the institution declares it collects data directly from patients; null on a catalogue name entry.
104
+ attr_accessor :collects_data_directly_from_patients
105
+
106
+ # Whether the entry declares an ENCePP partnership; null on a catalogue name entry, where the export writes a default No that is not an answer.
107
+ attr_accessor :is_encepp_partner
108
+
109
+ # When the registrant last edited this catalogue entry. A different clock from last_refreshed_on: it dates the web form, not the database.
110
+ attr_accessor :record_updated_at
111
+
112
+ # True when the record's last update date is a mass-edit date: one shared by an outsized part of the register, so it dates a migration and not the registrant.
113
+ attr_accessor :record_updated_is_mass_edit
114
+
115
+ # record_updated_at with the mass-edit dates removed (null for a mass-edit date or no timestamp): the column to sort a freshness question on.
116
+ attr_accessor :record_updated_at_attested
117
+
118
+ # The share of the register whose last update carries the same date, on every row so a mass-edit date is visible.
119
+ attr_accessor :record_updated_date_share
120
+
121
+ # When the catalogue entry was first published.
122
+ attr_accessor :record_first_published_at
123
+
124
+ # EMA's own Outdated flag, carried through untouched; the register flags none of the data sources, so read false as EMA's answer and not as a currency finding.
125
+ attr_accessor :is_outdated
126
+
127
+ # Distinct registered studies the institution's name conducted. Four separate activity numbers; never added together.
128
+ attr_accessor :conducting_studies_lifetime
129
+
130
+ # Conducting studies that started within five years of the snapshot.
131
+ attr_accessor :conducting_studies_last_5_years
132
+
133
+ # Conducting studies whose status is Ongoing.
134
+ attr_accessor :conducting_studies_ongoing
135
+
136
+ # Conducting studies whose status is Planned.
137
+ attr_accessor :conducting_studies_planned
138
+
139
+ # Distinct registered studies the conductor is named on as an additional institution; a different claim from conducting, never added to it.
140
+ attr_accessor :additional_role_studies
141
+
142
+ # The latest actual start date among the studies it conducted (or delivered, for a network).
143
+ attr_accessor :most_recent_study_start_on
144
+
145
+ # How many registered data sources name this institution as their data holder; zero is no source naming it, not a finding about the institution.
146
+ attr_accessor :held_source_count
147
+
148
+ # The register Data source IDs of those sources.
149
+ attr_accessor :held_source_ids
150
+
151
+ # The sum of the active populations the held sources declare.
152
+ attr_accessor :held_active_population
153
+
154
+ # The largest active population any held source declares.
155
+ attr_accessor :held_max_active_population
156
+
157
+ # How many held sources declare an active population.
158
+ attr_accessor :held_sources_declaring_active_population
159
+
160
+ # How many held sources declare a data source qualification.
161
+ attr_accessor :held_qualified_source_count
162
+
163
+ # How many held sources are DARWIN EU data partners.
164
+ attr_accessor :held_darwin_partner_source_count
165
+
166
+ # How many networks' own member lists name this institution; zero is the network's silence, not a property of the institution.
167
+ attr_accessor :network_membership_count
168
+
169
+ # The register Network IDs of those networks.
170
+ attr_accessor :network_ids
171
+
172
+ # The names of those networks.
173
+ attr_accessor :network_names
174
+
175
+ # The number of institutions in the whole institution register at the snapshot.
176
+ attr_accessor :institution_register_total
177
+
178
+ # How many register entries are self-registered profiles.
179
+ attr_accessor :self_registered_profile_total
180
+
181
+ # How many register entries are catalogue name entries.
182
+ attr_accessor :catalogue_name_entry_total
183
+
184
+ # How many register institutions declare a country.
185
+ attr_accessor :institutions_declaring_a_country
186
+
187
+ # How many register institutions at least one network member list names.
188
+ attr_accessor :institutions_in_any_member_list
189
+
190
+ # How many distinct institution name keys the register holds.
191
+ attr_accessor :institution_name_key_total
192
+
193
+ # How many register institutions hold a registered data source.
194
+ attr_accessor :institutions_holding_a_source
195
+
196
+ # How many distinct data holder names the data source register declares.
197
+ attr_accessor :declared_holder_name_total
198
+
199
+ # How many of those holder names match a register institution.
200
+ attr_accessor :declared_holder_name_matched
201
+
202
+ # The number of data sources in the whole data source register at the snapshot: the denominator every source count is over. Not a count of real-world data sources in the world.
203
+ attr_accessor :register_source_count
204
+
205
+ # The number of studies in the whole study register at the snapshot.
206
+ attr_accessor :study_register_total
207
+
208
+ # How many registered studies name at least one data source that is itself registered; the denominator under study_count.
209
+ attr_accessor :studies_naming_a_registered_source
210
+
211
+ # How many registered studies name a conducting institution that is itself registered.
212
+ attr_accessor :studies_naming_a_registered_conductor
213
+
214
+ # The label of the catalogue snapshot the row was read from (a date).
215
+ attr_accessor :snapshot_label
216
+
217
+ # The month and year the catalogue was accessed (YYYY-MM), which EMA's site asks to be cited with its URL.
218
+ attr_accessor :accessed_month
219
+
220
+ # The license restriction tier of the row's source. Every row of this dataset is licensable (PROVISIONAL, legal read pending).
221
+ attr_accessor :restriction_tier
222
+
223
+ # The attribution line EMA requires, including the catalogue URL and the access month; quote it with any figure taken from the row.
224
+ attr_accessor :attribution
225
+
226
+ # Attribute mapping from ruby-style variable name to JSON key.
227
+ def self.attribute_map
228
+ {
229
+ :'institution_id' => :'institution_id',
230
+ :'institution_name' => :'institution_name',
231
+ :'institution_org_id' => :'institution_org_id',
232
+ :'institution_company_id' => :'institution_company_id',
233
+ :'institution_company_name' => :'institution_company_name',
234
+ :'institution_group_id' => :'institution_group_id',
235
+ :'institution_group_name' => :'institution_group_name',
236
+ :'org_match_rung' => :'org_match_rung',
237
+ :'org_match_tier' => :'org_match_tier',
238
+ :'parent_org_id' => :'parent_org_id',
239
+ :'is_org_to_org' => :'is_org_to_org',
240
+ :'institution_name_key' => :'institution_name_key',
241
+ :'parent_name' => :'parent_name',
242
+ :'parent_name_key' => :'parent_name_key',
243
+ :'registration_state' => :'registration_state',
244
+ :'is_self_registered_profile' => :'is_self_registered_profile',
245
+ :'declared_profile_fields' => :'declared_profile_fields',
246
+ :'declarable_profile_fields' => :'declarable_profile_fields',
247
+ :'type_of_institution' => :'type_of_institution',
248
+ :'institution_role' => :'institution_role',
249
+ :'institution_countries' => :'institution_countries',
250
+ :'institution_country_names' => :'institution_country_names',
251
+ :'institution_country_count' => :'institution_country_count',
252
+ :'unmatched_country_fragments' => :'unmatched_country_fragments',
253
+ :'single_declared_country_iso2' => :'single_declared_country_iso2',
254
+ :'institution_website' => :'institution_website',
255
+ :'catalogue_url' => :'catalogue_url',
256
+ :'open_to_industry_funded_research' => :'open_to_industry_funded_research',
257
+ :'collects_data_directly_from_patients' => :'collects_data_directly_from_patients',
258
+ :'is_encepp_partner' => :'is_encepp_partner',
259
+ :'record_updated_at' => :'record_updated_at',
260
+ :'record_updated_is_mass_edit' => :'record_updated_is_mass_edit',
261
+ :'record_updated_at_attested' => :'record_updated_at_attested',
262
+ :'record_updated_date_share' => :'record_updated_date_share',
263
+ :'record_first_published_at' => :'record_first_published_at',
264
+ :'is_outdated' => :'is_outdated',
265
+ :'conducting_studies_lifetime' => :'conducting_studies_lifetime',
266
+ :'conducting_studies_last_5_years' => :'conducting_studies_last_5_years',
267
+ :'conducting_studies_ongoing' => :'conducting_studies_ongoing',
268
+ :'conducting_studies_planned' => :'conducting_studies_planned',
269
+ :'additional_role_studies' => :'additional_role_studies',
270
+ :'most_recent_study_start_on' => :'most_recent_study_start_on',
271
+ :'held_source_count' => :'held_source_count',
272
+ :'held_source_ids' => :'held_source_ids',
273
+ :'held_active_population' => :'held_active_population',
274
+ :'held_max_active_population' => :'held_max_active_population',
275
+ :'held_sources_declaring_active_population' => :'held_sources_declaring_active_population',
276
+ :'held_qualified_source_count' => :'held_qualified_source_count',
277
+ :'held_darwin_partner_source_count' => :'held_darwin_partner_source_count',
278
+ :'network_membership_count' => :'network_membership_count',
279
+ :'network_ids' => :'network_ids',
280
+ :'network_names' => :'network_names',
281
+ :'institution_register_total' => :'institution_register_total',
282
+ :'self_registered_profile_total' => :'self_registered_profile_total',
283
+ :'catalogue_name_entry_total' => :'catalogue_name_entry_total',
284
+ :'institutions_declaring_a_country' => :'institutions_declaring_a_country',
285
+ :'institutions_in_any_member_list' => :'institutions_in_any_member_list',
286
+ :'institution_name_key_total' => :'institution_name_key_total',
287
+ :'institutions_holding_a_source' => :'institutions_holding_a_source',
288
+ :'declared_holder_name_total' => :'declared_holder_name_total',
289
+ :'declared_holder_name_matched' => :'declared_holder_name_matched',
290
+ :'register_source_count' => :'register_source_count',
291
+ :'study_register_total' => :'study_register_total',
292
+ :'studies_naming_a_registered_source' => :'studies_naming_a_registered_source',
293
+ :'studies_naming_a_registered_conductor' => :'studies_naming_a_registered_conductor',
294
+ :'snapshot_label' => :'snapshot_label',
295
+ :'accessed_month' => :'accessed_month',
296
+ :'restriction_tier' => :'restriction_tier',
297
+ :'attribution' => :'attribution'
298
+ }
299
+ end
300
+
301
+ # Returns attribute mapping this model knows about
302
+ def self.acceptable_attribute_map
303
+ attribute_map
304
+ end
305
+
306
+ # Returns all the JSON keys this model knows about
307
+ def self.acceptable_attributes
308
+ acceptable_attribute_map.values
309
+ end
310
+
311
+ # Attribute type mapping.
312
+ def self.openapi_types
313
+ {
314
+ :'institution_id' => :'String',
315
+ :'institution_name' => :'String',
316
+ :'institution_org_id' => :'String',
317
+ :'institution_company_id' => :'String',
318
+ :'institution_company_name' => :'String',
319
+ :'institution_group_id' => :'String',
320
+ :'institution_group_name' => :'String',
321
+ :'org_match_rung' => :'String',
322
+ :'org_match_tier' => :'String',
323
+ :'parent_org_id' => :'String',
324
+ :'is_org_to_org' => :'Boolean',
325
+ :'institution_name_key' => :'String',
326
+ :'parent_name' => :'String',
327
+ :'parent_name_key' => :'String',
328
+ :'registration_state' => :'String',
329
+ :'is_self_registered_profile' => :'Boolean',
330
+ :'declared_profile_fields' => :'Integer',
331
+ :'declarable_profile_fields' => :'Integer',
332
+ :'type_of_institution' => :'String',
333
+ :'institution_role' => :'String',
334
+ :'institution_countries' => :'String',
335
+ :'institution_country_names' => :'Array<String>',
336
+ :'institution_country_count' => :'Integer',
337
+ :'unmatched_country_fragments' => :'Array<String>',
338
+ :'single_declared_country_iso2' => :'String',
339
+ :'institution_website' => :'String',
340
+ :'catalogue_url' => :'String',
341
+ :'open_to_industry_funded_research' => :'Boolean',
342
+ :'collects_data_directly_from_patients' => :'Boolean',
343
+ :'is_encepp_partner' => :'Boolean',
344
+ :'record_updated_at' => :'Time',
345
+ :'record_updated_is_mass_edit' => :'Boolean',
346
+ :'record_updated_at_attested' => :'Time',
347
+ :'record_updated_date_share' => :'Float',
348
+ :'record_first_published_at' => :'Time',
349
+ :'is_outdated' => :'Boolean',
350
+ :'conducting_studies_lifetime' => :'Integer',
351
+ :'conducting_studies_last_5_years' => :'Integer',
352
+ :'conducting_studies_ongoing' => :'Integer',
353
+ :'conducting_studies_planned' => :'Integer',
354
+ :'additional_role_studies' => :'Integer',
355
+ :'most_recent_study_start_on' => :'Date',
356
+ :'held_source_count' => :'Integer',
357
+ :'held_source_ids' => :'Array<String>',
358
+ :'held_active_population' => :'Integer',
359
+ :'held_max_active_population' => :'Integer',
360
+ :'held_sources_declaring_active_population' => :'Integer',
361
+ :'held_qualified_source_count' => :'Integer',
362
+ :'held_darwin_partner_source_count' => :'Integer',
363
+ :'network_membership_count' => :'Integer',
364
+ :'network_ids' => :'Array<String>',
365
+ :'network_names' => :'Array<String>',
366
+ :'institution_register_total' => :'Integer',
367
+ :'self_registered_profile_total' => :'Integer',
368
+ :'catalogue_name_entry_total' => :'Integer',
369
+ :'institutions_declaring_a_country' => :'Integer',
370
+ :'institutions_in_any_member_list' => :'Integer',
371
+ :'institution_name_key_total' => :'Integer',
372
+ :'institutions_holding_a_source' => :'Integer',
373
+ :'declared_holder_name_total' => :'Integer',
374
+ :'declared_holder_name_matched' => :'Integer',
375
+ :'register_source_count' => :'Integer',
376
+ :'study_register_total' => :'Integer',
377
+ :'studies_naming_a_registered_source' => :'Integer',
378
+ :'studies_naming_a_registered_conductor' => :'Integer',
379
+ :'snapshot_label' => :'String',
380
+ :'accessed_month' => :'String',
381
+ :'restriction_tier' => :'String',
382
+ :'attribution' => :'String'
383
+ }
384
+ end
385
+
386
+ # List of attributes with nullable: true
387
+ def self.openapi_nullable
388
+ Set.new([
389
+ :'institution_id',
390
+ :'institution_name',
391
+ :'institution_org_id',
392
+ :'institution_company_id',
393
+ :'institution_company_name',
394
+ :'institution_group_id',
395
+ :'institution_group_name',
396
+ :'org_match_rung',
397
+ :'org_match_tier',
398
+ :'parent_org_id',
399
+ :'is_org_to_org',
400
+ :'institution_name_key',
401
+ :'parent_name',
402
+ :'parent_name_key',
403
+ :'registration_state',
404
+ :'is_self_registered_profile',
405
+ :'declared_profile_fields',
406
+ :'declarable_profile_fields',
407
+ :'type_of_institution',
408
+ :'institution_role',
409
+ :'institution_countries',
410
+ :'institution_country_names',
411
+ :'institution_country_count',
412
+ :'unmatched_country_fragments',
413
+ :'single_declared_country_iso2',
414
+ :'institution_website',
415
+ :'catalogue_url',
416
+ :'open_to_industry_funded_research',
417
+ :'collects_data_directly_from_patients',
418
+ :'is_encepp_partner',
419
+ :'record_updated_at',
420
+ :'record_updated_is_mass_edit',
421
+ :'record_updated_at_attested',
422
+ :'record_updated_date_share',
423
+ :'record_first_published_at',
424
+ :'is_outdated',
425
+ :'conducting_studies_lifetime',
426
+ :'conducting_studies_last_5_years',
427
+ :'conducting_studies_ongoing',
428
+ :'conducting_studies_planned',
429
+ :'additional_role_studies',
430
+ :'most_recent_study_start_on',
431
+ :'held_source_count',
432
+ :'held_source_ids',
433
+ :'held_active_population',
434
+ :'held_max_active_population',
435
+ :'held_sources_declaring_active_population',
436
+ :'held_qualified_source_count',
437
+ :'held_darwin_partner_source_count',
438
+ :'network_membership_count',
439
+ :'network_ids',
440
+ :'network_names',
441
+ :'institution_register_total',
442
+ :'self_registered_profile_total',
443
+ :'catalogue_name_entry_total',
444
+ :'institutions_declaring_a_country',
445
+ :'institutions_in_any_member_list',
446
+ :'institution_name_key_total',
447
+ :'institutions_holding_a_source',
448
+ :'declared_holder_name_total',
449
+ :'declared_holder_name_matched',
450
+ :'register_source_count',
451
+ :'study_register_total',
452
+ :'studies_naming_a_registered_source',
453
+ :'studies_naming_a_registered_conductor',
454
+ :'snapshot_label',
455
+ :'accessed_month',
456
+ :'restriction_tier',
457
+ :'attribution'
458
+ ])
459
+ end
460
+
461
+ # Initializes the object
462
+ # @param [Hash] attributes Model attributes in the form of hash
463
+ def initialize(attributes = {})
464
+ if (!attributes.is_a?(Hash))
465
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PharmaObservatory::RwdInstitutionsRow` initialize method"
466
+ end
467
+
468
+ # check to see if the attribute exists and convert string to symbol for hash key
469
+ acceptable_attribute_map = self.class.acceptable_attribute_map
470
+ attributes = attributes.each_with_object({}) { |(k, v), h|
471
+ if (!acceptable_attribute_map.key?(k.to_sym))
472
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PharmaObservatory::RwdInstitutionsRow`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
473
+ end
474
+ h[k.to_sym] = v
475
+ }
476
+
477
+ if attributes.key?(:'institution_id')
478
+ self.institution_id = attributes[:'institution_id']
479
+ end
480
+
481
+ if attributes.key?(:'institution_name')
482
+ self.institution_name = attributes[:'institution_name']
483
+ end
484
+
485
+ if attributes.key?(:'institution_org_id')
486
+ self.institution_org_id = attributes[:'institution_org_id']
487
+ end
488
+
489
+ if attributes.key?(:'institution_company_id')
490
+ self.institution_company_id = attributes[:'institution_company_id']
491
+ end
492
+
493
+ if attributes.key?(:'institution_company_name')
494
+ self.institution_company_name = attributes[:'institution_company_name']
495
+ end
496
+
497
+ if attributes.key?(:'institution_group_id')
498
+ self.institution_group_id = attributes[:'institution_group_id']
499
+ end
500
+
501
+ if attributes.key?(:'institution_group_name')
502
+ self.institution_group_name = attributes[:'institution_group_name']
503
+ end
504
+
505
+ if attributes.key?(:'org_match_rung')
506
+ self.org_match_rung = attributes[:'org_match_rung']
507
+ end
508
+
509
+ if attributes.key?(:'org_match_tier')
510
+ self.org_match_tier = attributes[:'org_match_tier']
511
+ end
512
+
513
+ if attributes.key?(:'parent_org_id')
514
+ self.parent_org_id = attributes[:'parent_org_id']
515
+ end
516
+
517
+ if attributes.key?(:'is_org_to_org')
518
+ self.is_org_to_org = attributes[:'is_org_to_org']
519
+ end
520
+
521
+ if attributes.key?(:'institution_name_key')
522
+ self.institution_name_key = attributes[:'institution_name_key']
523
+ end
524
+
525
+ if attributes.key?(:'parent_name')
526
+ self.parent_name = attributes[:'parent_name']
527
+ end
528
+
529
+ if attributes.key?(:'parent_name_key')
530
+ self.parent_name_key = attributes[:'parent_name_key']
531
+ end
532
+
533
+ if attributes.key?(:'registration_state')
534
+ self.registration_state = attributes[:'registration_state']
535
+ end
536
+
537
+ if attributes.key?(:'is_self_registered_profile')
538
+ self.is_self_registered_profile = attributes[:'is_self_registered_profile']
539
+ end
540
+
541
+ if attributes.key?(:'declared_profile_fields')
542
+ self.declared_profile_fields = attributes[:'declared_profile_fields']
543
+ end
544
+
545
+ if attributes.key?(:'declarable_profile_fields')
546
+ self.declarable_profile_fields = attributes[:'declarable_profile_fields']
547
+ end
548
+
549
+ if attributes.key?(:'type_of_institution')
550
+ self.type_of_institution = attributes[:'type_of_institution']
551
+ end
552
+
553
+ if attributes.key?(:'institution_role')
554
+ self.institution_role = attributes[:'institution_role']
555
+ end
556
+
557
+ if attributes.key?(:'institution_countries')
558
+ self.institution_countries = attributes[:'institution_countries']
559
+ end
560
+
561
+ if attributes.key?(:'institution_country_names')
562
+ if (value = attributes[:'institution_country_names']).is_a?(Array)
563
+ self.institution_country_names = value
564
+ end
565
+ end
566
+
567
+ if attributes.key?(:'institution_country_count')
568
+ self.institution_country_count = attributes[:'institution_country_count']
569
+ end
570
+
571
+ if attributes.key?(:'unmatched_country_fragments')
572
+ if (value = attributes[:'unmatched_country_fragments']).is_a?(Array)
573
+ self.unmatched_country_fragments = value
574
+ end
575
+ end
576
+
577
+ if attributes.key?(:'single_declared_country_iso2')
578
+ self.single_declared_country_iso2 = attributes[:'single_declared_country_iso2']
579
+ end
580
+
581
+ if attributes.key?(:'institution_website')
582
+ self.institution_website = attributes[:'institution_website']
583
+ end
584
+
585
+ if attributes.key?(:'catalogue_url')
586
+ self.catalogue_url = attributes[:'catalogue_url']
587
+ end
588
+
589
+ if attributes.key?(:'open_to_industry_funded_research')
590
+ self.open_to_industry_funded_research = attributes[:'open_to_industry_funded_research']
591
+ end
592
+
593
+ if attributes.key?(:'collects_data_directly_from_patients')
594
+ self.collects_data_directly_from_patients = attributes[:'collects_data_directly_from_patients']
595
+ end
596
+
597
+ if attributes.key?(:'is_encepp_partner')
598
+ self.is_encepp_partner = attributes[:'is_encepp_partner']
599
+ end
600
+
601
+ if attributes.key?(:'record_updated_at')
602
+ self.record_updated_at = attributes[:'record_updated_at']
603
+ end
604
+
605
+ if attributes.key?(:'record_updated_is_mass_edit')
606
+ self.record_updated_is_mass_edit = attributes[:'record_updated_is_mass_edit']
607
+ end
608
+
609
+ if attributes.key?(:'record_updated_at_attested')
610
+ self.record_updated_at_attested = attributes[:'record_updated_at_attested']
611
+ end
612
+
613
+ if attributes.key?(:'record_updated_date_share')
614
+ self.record_updated_date_share = attributes[:'record_updated_date_share']
615
+ end
616
+
617
+ if attributes.key?(:'record_first_published_at')
618
+ self.record_first_published_at = attributes[:'record_first_published_at']
619
+ end
620
+
621
+ if attributes.key?(:'is_outdated')
622
+ self.is_outdated = attributes[:'is_outdated']
623
+ end
624
+
625
+ if attributes.key?(:'conducting_studies_lifetime')
626
+ self.conducting_studies_lifetime = attributes[:'conducting_studies_lifetime']
627
+ end
628
+
629
+ if attributes.key?(:'conducting_studies_last_5_years')
630
+ self.conducting_studies_last_5_years = attributes[:'conducting_studies_last_5_years']
631
+ end
632
+
633
+ if attributes.key?(:'conducting_studies_ongoing')
634
+ self.conducting_studies_ongoing = attributes[:'conducting_studies_ongoing']
635
+ end
636
+
637
+ if attributes.key?(:'conducting_studies_planned')
638
+ self.conducting_studies_planned = attributes[:'conducting_studies_planned']
639
+ end
640
+
641
+ if attributes.key?(:'additional_role_studies')
642
+ self.additional_role_studies = attributes[:'additional_role_studies']
643
+ end
644
+
645
+ if attributes.key?(:'most_recent_study_start_on')
646
+ self.most_recent_study_start_on = attributes[:'most_recent_study_start_on']
647
+ end
648
+
649
+ if attributes.key?(:'held_source_count')
650
+ self.held_source_count = attributes[:'held_source_count']
651
+ end
652
+
653
+ if attributes.key?(:'held_source_ids')
654
+ if (value = attributes[:'held_source_ids']).is_a?(Array)
655
+ self.held_source_ids = value
656
+ end
657
+ end
658
+
659
+ if attributes.key?(:'held_active_population')
660
+ self.held_active_population = attributes[:'held_active_population']
661
+ end
662
+
663
+ if attributes.key?(:'held_max_active_population')
664
+ self.held_max_active_population = attributes[:'held_max_active_population']
665
+ end
666
+
667
+ if attributes.key?(:'held_sources_declaring_active_population')
668
+ self.held_sources_declaring_active_population = attributes[:'held_sources_declaring_active_population']
669
+ end
670
+
671
+ if attributes.key?(:'held_qualified_source_count')
672
+ self.held_qualified_source_count = attributes[:'held_qualified_source_count']
673
+ end
674
+
675
+ if attributes.key?(:'held_darwin_partner_source_count')
676
+ self.held_darwin_partner_source_count = attributes[:'held_darwin_partner_source_count']
677
+ end
678
+
679
+ if attributes.key?(:'network_membership_count')
680
+ self.network_membership_count = attributes[:'network_membership_count']
681
+ end
682
+
683
+ if attributes.key?(:'network_ids')
684
+ if (value = attributes[:'network_ids']).is_a?(Array)
685
+ self.network_ids = value
686
+ end
687
+ end
688
+
689
+ if attributes.key?(:'network_names')
690
+ if (value = attributes[:'network_names']).is_a?(Array)
691
+ self.network_names = value
692
+ end
693
+ end
694
+
695
+ if attributes.key?(:'institution_register_total')
696
+ self.institution_register_total = attributes[:'institution_register_total']
697
+ end
698
+
699
+ if attributes.key?(:'self_registered_profile_total')
700
+ self.self_registered_profile_total = attributes[:'self_registered_profile_total']
701
+ end
702
+
703
+ if attributes.key?(:'catalogue_name_entry_total')
704
+ self.catalogue_name_entry_total = attributes[:'catalogue_name_entry_total']
705
+ end
706
+
707
+ if attributes.key?(:'institutions_declaring_a_country')
708
+ self.institutions_declaring_a_country = attributes[:'institutions_declaring_a_country']
709
+ end
710
+
711
+ if attributes.key?(:'institutions_in_any_member_list')
712
+ self.institutions_in_any_member_list = attributes[:'institutions_in_any_member_list']
713
+ end
714
+
715
+ if attributes.key?(:'institution_name_key_total')
716
+ self.institution_name_key_total = attributes[:'institution_name_key_total']
717
+ end
718
+
719
+ if attributes.key?(:'institutions_holding_a_source')
720
+ self.institutions_holding_a_source = attributes[:'institutions_holding_a_source']
721
+ end
722
+
723
+ if attributes.key?(:'declared_holder_name_total')
724
+ self.declared_holder_name_total = attributes[:'declared_holder_name_total']
725
+ end
726
+
727
+ if attributes.key?(:'declared_holder_name_matched')
728
+ self.declared_holder_name_matched = attributes[:'declared_holder_name_matched']
729
+ end
730
+
731
+ if attributes.key?(:'register_source_count')
732
+ self.register_source_count = attributes[:'register_source_count']
733
+ end
734
+
735
+ if attributes.key?(:'study_register_total')
736
+ self.study_register_total = attributes[:'study_register_total']
737
+ end
738
+
739
+ if attributes.key?(:'studies_naming_a_registered_source')
740
+ self.studies_naming_a_registered_source = attributes[:'studies_naming_a_registered_source']
741
+ end
742
+
743
+ if attributes.key?(:'studies_naming_a_registered_conductor')
744
+ self.studies_naming_a_registered_conductor = attributes[:'studies_naming_a_registered_conductor']
745
+ end
746
+
747
+ if attributes.key?(:'snapshot_label')
748
+ self.snapshot_label = attributes[:'snapshot_label']
749
+ end
750
+
751
+ if attributes.key?(:'accessed_month')
752
+ self.accessed_month = attributes[:'accessed_month']
753
+ end
754
+
755
+ if attributes.key?(:'restriction_tier')
756
+ self.restriction_tier = attributes[:'restriction_tier']
757
+ end
758
+
759
+ if attributes.key?(:'attribution')
760
+ self.attribution = attributes[:'attribution']
761
+ end
762
+ end
763
+
764
+ # Show invalid properties with the reasons. Usually used together with valid?
765
+ # @return Array for valid properties with the reasons
766
+ def list_invalid_properties
767
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
768
+ invalid_properties = Array.new
769
+ invalid_properties
770
+ end
771
+
772
+ # Check to see if the all the properties in the model are valid
773
+ # @return true if the model is valid
774
+ def valid?
775
+ warn '[DEPRECATED] the `valid?` method is obsolete'
776
+ true
777
+ end
778
+
779
+ # Checks equality by comparing each attribute.
780
+ # @param [Object] Object to be compared
781
+ def ==(o)
782
+ return true if self.equal?(o)
783
+ self.class == o.class &&
784
+ institution_id == o.institution_id &&
785
+ institution_name == o.institution_name &&
786
+ institution_org_id == o.institution_org_id &&
787
+ institution_company_id == o.institution_company_id &&
788
+ institution_company_name == o.institution_company_name &&
789
+ institution_group_id == o.institution_group_id &&
790
+ institution_group_name == o.institution_group_name &&
791
+ org_match_rung == o.org_match_rung &&
792
+ org_match_tier == o.org_match_tier &&
793
+ parent_org_id == o.parent_org_id &&
794
+ is_org_to_org == o.is_org_to_org &&
795
+ institution_name_key == o.institution_name_key &&
796
+ parent_name == o.parent_name &&
797
+ parent_name_key == o.parent_name_key &&
798
+ registration_state == o.registration_state &&
799
+ is_self_registered_profile == o.is_self_registered_profile &&
800
+ declared_profile_fields == o.declared_profile_fields &&
801
+ declarable_profile_fields == o.declarable_profile_fields &&
802
+ type_of_institution == o.type_of_institution &&
803
+ institution_role == o.institution_role &&
804
+ institution_countries == o.institution_countries &&
805
+ institution_country_names == o.institution_country_names &&
806
+ institution_country_count == o.institution_country_count &&
807
+ unmatched_country_fragments == o.unmatched_country_fragments &&
808
+ single_declared_country_iso2 == o.single_declared_country_iso2 &&
809
+ institution_website == o.institution_website &&
810
+ catalogue_url == o.catalogue_url &&
811
+ open_to_industry_funded_research == o.open_to_industry_funded_research &&
812
+ collects_data_directly_from_patients == o.collects_data_directly_from_patients &&
813
+ is_encepp_partner == o.is_encepp_partner &&
814
+ record_updated_at == o.record_updated_at &&
815
+ record_updated_is_mass_edit == o.record_updated_is_mass_edit &&
816
+ record_updated_at_attested == o.record_updated_at_attested &&
817
+ record_updated_date_share == o.record_updated_date_share &&
818
+ record_first_published_at == o.record_first_published_at &&
819
+ is_outdated == o.is_outdated &&
820
+ conducting_studies_lifetime == o.conducting_studies_lifetime &&
821
+ conducting_studies_last_5_years == o.conducting_studies_last_5_years &&
822
+ conducting_studies_ongoing == o.conducting_studies_ongoing &&
823
+ conducting_studies_planned == o.conducting_studies_planned &&
824
+ additional_role_studies == o.additional_role_studies &&
825
+ most_recent_study_start_on == o.most_recent_study_start_on &&
826
+ held_source_count == o.held_source_count &&
827
+ held_source_ids == o.held_source_ids &&
828
+ held_active_population == o.held_active_population &&
829
+ held_max_active_population == o.held_max_active_population &&
830
+ held_sources_declaring_active_population == o.held_sources_declaring_active_population &&
831
+ held_qualified_source_count == o.held_qualified_source_count &&
832
+ held_darwin_partner_source_count == o.held_darwin_partner_source_count &&
833
+ network_membership_count == o.network_membership_count &&
834
+ network_ids == o.network_ids &&
835
+ network_names == o.network_names &&
836
+ institution_register_total == o.institution_register_total &&
837
+ self_registered_profile_total == o.self_registered_profile_total &&
838
+ catalogue_name_entry_total == o.catalogue_name_entry_total &&
839
+ institutions_declaring_a_country == o.institutions_declaring_a_country &&
840
+ institutions_in_any_member_list == o.institutions_in_any_member_list &&
841
+ institution_name_key_total == o.institution_name_key_total &&
842
+ institutions_holding_a_source == o.institutions_holding_a_source &&
843
+ declared_holder_name_total == o.declared_holder_name_total &&
844
+ declared_holder_name_matched == o.declared_holder_name_matched &&
845
+ register_source_count == o.register_source_count &&
846
+ study_register_total == o.study_register_total &&
847
+ studies_naming_a_registered_source == o.studies_naming_a_registered_source &&
848
+ studies_naming_a_registered_conductor == o.studies_naming_a_registered_conductor &&
849
+ snapshot_label == o.snapshot_label &&
850
+ accessed_month == o.accessed_month &&
851
+ restriction_tier == o.restriction_tier &&
852
+ attribution == o.attribution
853
+ end
854
+
855
+ # @see the `==` method
856
+ # @param [Object] Object to be compared
857
+ def eql?(o)
858
+ self == o
859
+ end
860
+
861
+ # Calculates hash code according to all attributes.
862
+ # @return [Integer] Hash code
863
+ def hash
864
+ [institution_id, institution_name, institution_org_id, institution_company_id, institution_company_name, institution_group_id, institution_group_name, org_match_rung, org_match_tier, parent_org_id, is_org_to_org, institution_name_key, parent_name, parent_name_key, registration_state, is_self_registered_profile, declared_profile_fields, declarable_profile_fields, type_of_institution, institution_role, institution_countries, institution_country_names, institution_country_count, unmatched_country_fragments, single_declared_country_iso2, institution_website, catalogue_url, open_to_industry_funded_research, collects_data_directly_from_patients, is_encepp_partner, record_updated_at, record_updated_is_mass_edit, record_updated_at_attested, record_updated_date_share, record_first_published_at, is_outdated, conducting_studies_lifetime, conducting_studies_last_5_years, conducting_studies_ongoing, conducting_studies_planned, additional_role_studies, most_recent_study_start_on, held_source_count, held_source_ids, held_active_population, held_max_active_population, held_sources_declaring_active_population, held_qualified_source_count, held_darwin_partner_source_count, network_membership_count, network_ids, network_names, institution_register_total, self_registered_profile_total, catalogue_name_entry_total, institutions_declaring_a_country, institutions_in_any_member_list, institution_name_key_total, institutions_holding_a_source, declared_holder_name_total, declared_holder_name_matched, register_source_count, study_register_total, studies_naming_a_registered_source, studies_naming_a_registered_conductor, snapshot_label, accessed_month, restriction_tier, attribution].hash
865
+ end
866
+
867
+ # Builds the object from hash
868
+ # @param [Hash] attributes Model attributes in the form of hash
869
+ # @return [Object] Returns the model itself
870
+ def self.build_from_hash(attributes)
871
+ return nil unless attributes.is_a?(Hash)
872
+ attributes = attributes.transform_keys(&:to_sym)
873
+ transformed_hash = {}
874
+ openapi_types.each_pair do |key, type|
875
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
876
+ transformed_hash["#{key}"] = nil
877
+ elsif type =~ /\AArray<(.*)>/i
878
+ # check to ensure the input is an array given that the attribute
879
+ # is documented as an array but the input is not
880
+ if attributes[attribute_map[key]].is_a?(Array)
881
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
882
+ end
883
+ elsif !attributes[attribute_map[key]].nil?
884
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
885
+ end
886
+ end
887
+ new(transformed_hash)
888
+ end
889
+
890
+ # Deserializes the data based on type
891
+ # @param string type Data type
892
+ # @param string value Value to be deserialized
893
+ # @return [Object] Deserialized data
894
+ def self._deserialize(type, value)
895
+ case type.to_sym
896
+ when :Time
897
+ Time.parse(value)
898
+ when :Date
899
+ Date.parse(value)
900
+ when :String
901
+ value.to_s
902
+ when :Integer
903
+ value.to_i
904
+ when :Float
905
+ value.to_f
906
+ when :Boolean
907
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
908
+ true
909
+ else
910
+ false
911
+ end
912
+ when :Object
913
+ # generic object (usually a Hash), return directly
914
+ value
915
+ when /\AArray<(?<inner_type>.+)>\z/
916
+ inner_type = Regexp.last_match[:inner_type]
917
+ value.map { |v| _deserialize(inner_type, v) }
918
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
919
+ k_type = Regexp.last_match[:k_type]
920
+ v_type = Regexp.last_match[:v_type]
921
+ {}.tap do |hash|
922
+ value.each do |k, v|
923
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
924
+ end
925
+ end
926
+ else # model
927
+ # models (e.g. Pet) or oneOf
928
+ klass = PharmaObservatory.const_get(type)
929
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
930
+ end
931
+ end
932
+
933
+ # Returns the string representation of the object
934
+ # @return [String] String presentation of the object
935
+ def to_s
936
+ to_hash.to_s
937
+ end
938
+
939
+ # to_body is an alias to to_hash (backward compatibility)
940
+ # @return [Hash] Returns the object in the form of hash
941
+ def to_body
942
+ to_hash
943
+ end
944
+
945
+ # Returns the object in the form of hash
946
+ # @return [Hash] Returns the object in the form of hash
947
+ def to_hash
948
+ hash = {}
949
+ self.class.attribute_map.each_pair do |attr, param|
950
+ value = self.send(attr)
951
+ if value.nil?
952
+ is_nullable = self.class.openapi_nullable.include?(attr)
953
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
954
+ end
955
+
956
+ hash[param] = _to_hash(value)
957
+ end
958
+ hash
959
+ end
960
+
961
+ # Outputs non-array value in the form of hash
962
+ # For object, use to_hash. Otherwise, just return the value
963
+ # @param [Object] value Any valid value
964
+ # @return [Hash] Returns the value in the form of hash
965
+ def _to_hash(value)
966
+ if value.is_a?(Array)
967
+ value.compact.map { |v| _to_hash(v) }
968
+ elsif value.is_a?(Hash)
969
+ {}.tap do |hash|
970
+ value.each { |k, v| hash[k] = _to_hash(v) }
971
+ end
972
+ elsif value.respond_to? :to_hash
973
+ value.to_hash
974
+ else
975
+ value
976
+ end
977
+ end
978
+
979
+ end
980
+
981
+ end