pharmaobservatory 0.1.4 → 0.1.6
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.
- checksums.yaml +4 -4
- data/README.md +118 -7
- data/docs/ApiV1WhoamiGet200Response.md +13 -1
- data/docs/ApiV1WhoamiGet200ResponseLimits.md +32 -0
- data/docs/ApiV1WhoamiGet200ResponseQuota.md +20 -0
- data/docs/ApiV1WhoamiGet200ResponseQuotaBuckets.md +28 -0
- data/docs/ApiV1WhoamiGet200ResponseQuotaBucketsRequestsPerMinute.md +28 -0
- data/docs/BiomarkerAssayEvidenceResponse.md +58 -0
- data/docs/{BiomarkerCdxAssertionsResponseBuild.md → BiomarkerAssayEvidenceResponseBuild.md} +2 -2
- data/docs/{BiomarkerCdxAssertionsResponseFreshness.md → BiomarkerAssayEvidenceResponseFreshness.md} +2 -2
- data/docs/{BiomarkerCdxAssertionsResponseScope.md → BiomarkerAssayEvidenceResponseScope.md} +2 -2
- data/docs/BiomarkerAssayEvidenceRow.md +68 -0
- data/docs/BiomarkerAssayWhitespaceResponse.md +58 -0
- data/docs/BiomarkerAssayWhitespaceRow.md +66 -0
- data/docs/BiomarkerBqpAssertionsResponse.md +3 -3
- data/docs/BiomarkerCdxAssertionsResponse.md +3 -3
- data/docs/BiomarkerEvidenceResponse.md +3 -3
- data/docs/BiomarkerLiteratureResponse.md +3 -3
- data/docs/BiomarkerPublishingCompaniesResponse.md +3 -3
- data/docs/BiomarkerPublishingCompaniesRow.md +9 -1
- data/docs/BiomarkerRelationsResponse.md +3 -3
- data/docs/BiomarkerSampleCoverageResponse.md +3 -3
- data/docs/BiomarkerSamplePrevalenceResponse.md +3 -3
- data/docs/BiomarkerValidationResponse.md +3 -3
- data/docs/BiomarkerVariantMentionsResponse.md +3 -3
- data/docs/BiomarkersApi.md +160 -0
- data/docs/BiomarkersRecord.md +2 -2
- data/docs/BiomarkersResponse.md +3 -3
- data/docs/BiomarkersRow.md +2 -0
- data/docs/CellLinesRecord.md +2 -2
- data/docs/CellLinesResponse.md +3 -3
- data/docs/CompaniesApi.md +246 -0
- data/docs/CompaniesRecord.md +2 -2
- data/docs/CompaniesResponse.md +3 -3
- data/docs/CompaniesRow.md +1 -1
- data/docs/CompanyAssetsResponse.md +3 -3
- data/docs/CompanyFundingEventsResponse.md +3 -3
- data/docs/CompanyFundingEventsRow.md +1 -1
- data/docs/CompanyFundingSummaryResponse.md +3 -3
- data/docs/CompanyMembersResponse.md +3 -3
- data/docs/CompanyProgramsResponse.md +3 -3
- data/docs/CompanyTargetsResponse.md +3 -3
- data/docs/CompanyTargetsRow.md +5 -1
- data/docs/ConditionAdverseEventsResponse.md +3 -3
- data/docs/ConditionBurdenResponse.md +3 -3
- data/docs/ConditionDeliveryResponse.md +3 -3
- data/docs/ConditionDrugsResponse.md +3 -3
- data/docs/ConditionPrevalenceResponse.md +3 -3
- data/docs/ConditionPrevalenceRow.md +1 -1
- data/docs/ConditionPublicationsResponse.md +3 -3
- data/docs/ConditionRecruitmentByPhaseResponse.md +58 -0
- data/docs/ConditionRecruitmentByPhaseRow.md +50 -0
- data/docs/ConditionRecruitmentDurationResponse.md +58 -0
- data/docs/ConditionRecruitmentDurationRow.md +86 -0
- data/docs/ConditionSitesResponse.md +3 -3
- data/docs/ConditionTrialStartForecastResponse.md +58 -0
- data/docs/ConditionTrialStartForecastRow.md +70 -0
- data/docs/ConditionTrialsResponse.md +3 -3
- data/docs/ConditionTrialsRow.md +4 -2
- data/docs/ConditionsApi.md +240 -0
- data/docs/ConditionsRecord.md +2 -2
- data/docs/ConditionsRecordAttributes.md +3 -1
- data/docs/ConditionsResponse.md +3 -3
- data/docs/DrugPatentCliffResponse.md +3 -3
- data/docs/InstitutionalHoldingsResponse.md +3 -3
- data/docs/InstitutionalHoldingsRow.md +7 -1
- data/docs/InvestorFundsResponse.md +58 -0
- data/docs/InvestorFundsRow.md +24 -0
- data/docs/InvestorPortfolioResponse.md +58 -0
- data/docs/InvestorPortfolioRow.md +42 -0
- data/docs/InvestorPrivateFundsResponse.md +58 -0
- data/docs/InvestorPrivateFundsRow.md +44 -0
- data/docs/InvestorsApi.md +633 -0
- data/docs/InvestorsRecord.md +38 -0
- data/docs/InvestorsResponse.md +58 -0
- data/docs/InvestorsRow.md +54 -0
- data/docs/LegalEntitiesApi.md +240 -0
- data/docs/LegalEntitiesRecord.md +2 -2
- data/docs/LegalEntitiesResponse.md +3 -3
- data/docs/LegalEntitiesRow.md +1 -1
- data/docs/ManagersApi.md +233 -0
- data/docs/ManagersRecord.md +38 -0
- data/docs/ManagersResponse.md +58 -0
- data/docs/ManagersRow.md +46 -0
- data/docs/OrgDisclosuresResponse.md +58 -0
- data/docs/OrgDisclosuresRow.md +56 -0
- data/docs/OrgRelationshipsResponse.md +58 -0
- data/docs/OrgRelationshipsRow.md +68 -0
- data/docs/OwnershipPositionsResponse.md +3 -3
- data/docs/OwnershipPositionsRow.md +16 -14
- data/docs/PdufaDatesResponse.md +3 -3
- data/docs/SiteBedsYearlyResponse.md +3 -3
- data/docs/SiteCroTrialsResponse.md +3 -3
- data/docs/SiteHospitalsResponse.md +3 -3
- data/docs/SiteInvestigatorsResponse.md +3 -3
- data/docs/SiteTrialConditionsResponse.md +3 -3
- data/docs/SiteTrialDrugsResponse.md +3 -3
- data/docs/SiteTrialsResponse.md +3 -3
- data/docs/SiteTrialsRow.md +3 -1
- data/docs/SitesRecord.md +2 -2
- data/docs/SitesResponse.md +3 -3
- data/docs/SponsorRecruitmentByPhaseResponse.md +3 -3
- data/docs/SponsorRecruitmentDurationResponse.md +3 -3
- data/docs/SponsorTrialStartForecastResponse.md +3 -3
- data/docs/SponsorTrialsResponse.md +3 -3
- data/docs/SponsorTrialsRow.md +4 -2
- data/docs/SupplierCapabilityEsgResponse.md +58 -0
- data/docs/SupplierCapabilityEsgRow.md +64 -0
- data/docs/SupplierServicesResponse.md +58 -0
- data/docs/SupplierServicesRow.md +30 -0
- data/docs/SupplierSitesResponse.md +58 -0
- data/docs/SupplierSitesRow.md +42 -0
- data/docs/SuppliersApi.md +313 -0
- data/docs/SuppliersRecord.md +38 -0
- data/docs/SuppliersResponse.md +58 -0
- data/docs/SuppliersRow.md +76 -0
- data/docs/TargetAssociationsResponse.md +58 -0
- data/docs/TargetAssociationsRow.md +26 -0
- data/docs/TargetCrowdingResponse.md +58 -0
- data/docs/TargetCrowdingRow.md +30 -0
- data/docs/TargetDrugsResponse.md +58 -0
- data/docs/TargetDrugsRow.md +38 -0
- data/docs/TargetEvidenceResponse.md +58 -0
- data/docs/TargetEvidenceRow.md +52 -0
- data/docs/TargetPatentMentionsResponse.md +58 -0
- data/docs/TargetPatentMentionsRow.md +34 -0
- data/docs/TargetProgramsResponse.md +58 -0
- data/docs/TargetProgramsRow.md +58 -0
- data/docs/TargetPublicationsResponse.md +58 -0
- data/docs/TargetPublicationsRow.md +32 -0
- data/docs/TargetRegulatoryPrecedentResponse.md +58 -0
- data/docs/TargetRegulatoryPrecedentRow.md +38 -0
- data/docs/TargetTrialsResponse.md +58 -0
- data/docs/TargetTrialsRow.md +46 -0
- data/docs/TargetsApi.md +1033 -0
- data/docs/TargetsRecord.md +38 -0
- data/docs/TargetsResponse.md +58 -0
- data/docs/TargetsRow.md +68 -0
- data/docs/TrialAdverseEventsResponse.md +3 -3
- data/docs/TrialChangesResponse.md +3 -3
- data/docs/TrialDeliveryResponse.md +3 -3
- data/docs/TrialDeliveryRow.md +7 -5
- data/docs/TrialDemographicsResponse.md +3 -3
- data/docs/TrialDrugClassesResponse.md +58 -0
- data/docs/TrialDrugClassesRow.md +28 -0
- data/docs/TrialDrugsResponse.md +3 -3
- data/docs/TrialEnrollmentHistoryResponse.md +3 -3
- data/docs/TrialEnrollmentRateResponse.md +3 -3
- data/docs/TrialEnrollmentRateRow.md +5 -3
- data/docs/TrialExtractedEndpointsResponse.md +3 -3
- data/docs/TrialKolsResponse.md +58 -0
- data/docs/TrialKolsRow.md +32 -0
- data/docs/TrialOutcomeMeasuresResponse.md +3 -3
- data/docs/TrialResearchPaymentsResponse.md +58 -0
- data/docs/TrialResearchPaymentsRow.md +44 -0
- data/docs/TrialSiteHistoryResponse.md +58 -0
- data/docs/TrialSiteHistoryRow.md +50 -0
- data/docs/TrialSitesResponse.md +3 -3
- data/docs/TrialsApi.md +320 -0
- data/docs/TrialsRecord.md +2 -2
- data/docs/TrialsResponse.md +3 -3
- data/docs/TrialsRow.md +3 -3
- data/lib/pharmaobservatory/api/biomarkers_api.rb +168 -0
- data/lib/pharmaobservatory/api/companies_api.rb +273 -0
- data/lib/pharmaobservatory/api/conditions_api.rb +252 -0
- data/lib/pharmaobservatory/api/investors_api.rb +665 -0
- data/lib/pharmaobservatory/api/legal_entities_api.rb +252 -0
- data/lib/pharmaobservatory/api/managers_api.rb +245 -0
- data/lib/pharmaobservatory/api/suppliers_api.rb +329 -0
- data/lib/pharmaobservatory/api/targets_api.rb +1085 -0
- data/lib/pharmaobservatory/api/trials_api.rb +336 -0
- data/lib/pharmaobservatory/models/api_v1_whoami_get200_response.rb +62 -4
- data/lib/pharmaobservatory/models/api_v1_whoami_get200_response_limits.rb +419 -0
- data/lib/pharmaobservatory/models/api_v1_whoami_get200_response_quota.rb +263 -0
- data/lib/pharmaobservatory/models/api_v1_whoami_get200_response_quota_buckets.rb +367 -0
- data/lib/pharmaobservatory/models/api_v1_whoami_get200_response_quota_buckets_requests_per_minute.rb +367 -0
- data/lib/pharmaobservatory/models/biomarker_assay_evidence_response.rb +478 -0
- data/lib/pharmaobservatory/models/{biomarker_cdx_assertions_response_build.rb → biomarker_assay_evidence_response_build.rb} +3 -3
- data/lib/pharmaobservatory/models/{biomarker_cdx_assertions_response_freshness.rb → biomarker_assay_evidence_response_freshness.rb} +3 -3
- data/lib/pharmaobservatory/models/{biomarker_cdx_assertions_response_scope.rb → biomarker_assay_evidence_response_scope.rb} +3 -3
- data/lib/pharmaobservatory/models/biomarker_assay_evidence_row.rb +506 -0
- data/lib/pharmaobservatory/models/biomarker_assay_whitespace_response.rb +478 -0
- data/lib/pharmaobservatory/models/biomarker_assay_whitespace_row.rb +499 -0
- data/lib/pharmaobservatory/models/biomarker_bqp_assertions_response.rb +3 -3
- data/lib/pharmaobservatory/models/biomarker_cdx_assertions_response.rb +3 -3
- data/lib/pharmaobservatory/models/biomarker_evidence_response.rb +3 -3
- data/lib/pharmaobservatory/models/biomarker_literature_response.rb +3 -3
- data/lib/pharmaobservatory/models/biomarker_publishing_companies_response.rb +3 -3
- data/lib/pharmaobservatory/models/biomarker_publishing_companies_row.rb +49 -5
- data/lib/pharmaobservatory/models/biomarker_relations_response.rb +3 -3
- data/lib/pharmaobservatory/models/biomarker_sample_coverage_response.rb +3 -3
- data/lib/pharmaobservatory/models/biomarker_sample_prevalence_response.rb +3 -3
- data/lib/pharmaobservatory/models/biomarker_validation_response.rb +3 -3
- data/lib/pharmaobservatory/models/biomarker_variant_mentions_response.rb +3 -3
- data/lib/pharmaobservatory/models/biomarkers_record.rb +2 -2
- data/lib/pharmaobservatory/models/biomarkers_response.rb +3 -3
- data/lib/pharmaobservatory/models/biomarkers_row.rb +12 -1
- data/lib/pharmaobservatory/models/cell_lines_record.rb +2 -2
- data/lib/pharmaobservatory/models/cell_lines_response.rb +3 -3
- data/lib/pharmaobservatory/models/companies_record.rb +2 -2
- data/lib/pharmaobservatory/models/companies_response.rb +3 -3
- data/lib/pharmaobservatory/models/companies_row.rb +1 -1
- data/lib/pharmaobservatory/models/company_assets_response.rb +3 -3
- data/lib/pharmaobservatory/models/company_funding_events_response.rb +3 -3
- data/lib/pharmaobservatory/models/company_funding_events_row.rb +1 -1
- data/lib/pharmaobservatory/models/company_funding_summary_response.rb +3 -3
- data/lib/pharmaobservatory/models/company_members_response.rb +3 -3
- data/lib/pharmaobservatory/models/company_programs_response.rb +3 -3
- data/lib/pharmaobservatory/models/company_targets_response.rb +3 -3
- data/lib/pharmaobservatory/models/company_targets_row.rb +27 -5
- data/lib/pharmaobservatory/models/condition_adverse_events_response.rb +3 -3
- data/lib/pharmaobservatory/models/condition_burden_response.rb +3 -3
- data/lib/pharmaobservatory/models/condition_delivery_response.rb +3 -3
- data/lib/pharmaobservatory/models/condition_drugs_response.rb +3 -3
- data/lib/pharmaobservatory/models/condition_prevalence_response.rb +3 -3
- data/lib/pharmaobservatory/models/condition_prevalence_row.rb +1 -1
- data/lib/pharmaobservatory/models/condition_publications_response.rb +3 -3
- data/lib/pharmaobservatory/models/condition_recruitment_by_phase_response.rb +478 -0
- data/lib/pharmaobservatory/models/condition_recruitment_by_phase_row.rb +399 -0
- data/lib/pharmaobservatory/models/condition_recruitment_duration_response.rb +478 -0
- data/lib/pharmaobservatory/models/condition_recruitment_duration_row.rb +597 -0
- data/lib/pharmaobservatory/models/condition_sites_response.rb +3 -3
- data/lib/pharmaobservatory/models/condition_trial_start_forecast_response.rb +478 -0
- data/lib/pharmaobservatory/models/condition_trial_start_forecast_row.rb +509 -0
- data/lib/pharmaobservatory/models/condition_trials_response.rb +3 -3
- data/lib/pharmaobservatory/models/condition_trials_row.rb +14 -3
- data/lib/pharmaobservatory/models/conditions_record.rb +2 -2
- data/lib/pharmaobservatory/models/conditions_record_attributes.rb +13 -4
- data/lib/pharmaobservatory/models/conditions_response.rb +3 -3
- data/lib/pharmaobservatory/models/drug_patent_cliff_response.rb +3 -3
- data/lib/pharmaobservatory/models/institutional_holdings_response.rb +3 -3
- data/lib/pharmaobservatory/models/institutional_holdings_row.rb +35 -2
- data/lib/pharmaobservatory/models/investor_funds_response.rb +478 -0
- data/lib/pharmaobservatory/models/investor_funds_row.rb +256 -0
- data/lib/pharmaobservatory/models/investor_portfolio_response.rb +478 -0
- data/lib/pharmaobservatory/models/investor_portfolio_row.rb +357 -0
- data/lib/pharmaobservatory/models/investor_private_funds_response.rb +478 -0
- data/lib/pharmaobservatory/models/investor_private_funds_row.rb +366 -0
- data/lib/pharmaobservatory/models/investors_record.rb +385 -0
- data/lib/pharmaobservatory/models/investors_response.rb +478 -0
- data/lib/pharmaobservatory/models/investors_row.rb +421 -0
- data/lib/pharmaobservatory/models/legal_entities_record.rb +2 -2
- data/lib/pharmaobservatory/models/legal_entities_response.rb +3 -3
- data/lib/pharmaobservatory/models/legal_entities_row.rb +1 -1
- data/lib/pharmaobservatory/models/managers_record.rb +385 -0
- data/lib/pharmaobservatory/models/managers_response.rb +478 -0
- data/lib/pharmaobservatory/models/managers_row.rb +377 -0
- data/lib/pharmaobservatory/models/org_disclosures_response.rb +478 -0
- data/lib/pharmaobservatory/models/org_disclosures_row.rb +432 -0
- data/lib/pharmaobservatory/models/org_relationships_response.rb +478 -0
- data/lib/pharmaobservatory/models/org_relationships_row.rb +498 -0
- data/lib/pharmaobservatory/models/ownership_positions_response.rb +3 -3
- data/lib/pharmaobservatory/models/ownership_positions_row.rb +26 -15
- data/lib/pharmaobservatory/models/pdufa_dates_response.rb +3 -3
- data/lib/pharmaobservatory/models/site_beds_yearly_response.rb +3 -3
- data/lib/pharmaobservatory/models/site_cro_trials_response.rb +3 -3
- data/lib/pharmaobservatory/models/site_hospitals_response.rb +3 -3
- data/lib/pharmaobservatory/models/site_investigators_response.rb +3 -3
- data/lib/pharmaobservatory/models/site_trial_conditions_response.rb +3 -3
- data/lib/pharmaobservatory/models/site_trial_drugs_response.rb +3 -3
- data/lib/pharmaobservatory/models/site_trials_response.rb +3 -3
- data/lib/pharmaobservatory/models/site_trials_row.rb +13 -2
- data/lib/pharmaobservatory/models/sites_record.rb +2 -2
- data/lib/pharmaobservatory/models/sites_response.rb +3 -3
- data/lib/pharmaobservatory/models/sponsor_recruitment_by_phase_response.rb +3 -3
- data/lib/pharmaobservatory/models/sponsor_recruitment_duration_response.rb +3 -3
- data/lib/pharmaobservatory/models/sponsor_trial_start_forecast_response.rb +3 -3
- data/lib/pharmaobservatory/models/sponsor_trials_response.rb +3 -3
- data/lib/pharmaobservatory/models/sponsor_trials_row.rb +14 -3
- data/lib/pharmaobservatory/models/supplier_capability_esg_response.rb +478 -0
- data/lib/pharmaobservatory/models/supplier_capability_esg_row.rb +480 -0
- data/lib/pharmaobservatory/models/supplier_services_response.rb +478 -0
- data/lib/pharmaobservatory/models/supplier_services_row.rb +289 -0
- data/lib/pharmaobservatory/models/supplier_sites_response.rb +478 -0
- data/lib/pharmaobservatory/models/supplier_sites_row.rb +357 -0
- data/lib/pharmaobservatory/models/suppliers_record.rb +385 -0
- data/lib/pharmaobservatory/models/suppliers_response.rb +478 -0
- data/lib/pharmaobservatory/models/suppliers_row.rb +544 -0
- data/lib/pharmaobservatory/models/target_associations_response.rb +478 -0
- data/lib/pharmaobservatory/models/target_associations_row.rb +267 -0
- data/lib/pharmaobservatory/models/target_crowding_response.rb +478 -0
- data/lib/pharmaobservatory/models/target_crowding_row.rb +289 -0
- data/lib/pharmaobservatory/models/target_drugs_response.rb +478 -0
- data/lib/pharmaobservatory/models/target_drugs_row.rb +335 -0
- data/lib/pharmaobservatory/models/target_evidence_response.rb +478 -0
- data/lib/pharmaobservatory/models/target_evidence_row.rb +410 -0
- data/lib/pharmaobservatory/models/target_patent_mentions_response.rb +478 -0
- data/lib/pharmaobservatory/models/target_patent_mentions_row.rb +311 -0
- data/lib/pharmaobservatory/models/target_programs_response.rb +478 -0
- data/lib/pharmaobservatory/models/target_programs_row.rb +447 -0
- data/lib/pharmaobservatory/models/target_publications_response.rb +478 -0
- data/lib/pharmaobservatory/models/target_publications_row.rb +300 -0
- data/lib/pharmaobservatory/models/target_regulatory_precedent_response.rb +478 -0
- data/lib/pharmaobservatory/models/target_regulatory_precedent_row.rb +333 -0
- data/lib/pharmaobservatory/models/target_trials_response.rb +478 -0
- data/lib/pharmaobservatory/models/target_trials_row.rb +377 -0
- data/lib/pharmaobservatory/models/targets_record.rb +385 -0
- data/lib/pharmaobservatory/models/targets_response.rb +478 -0
- data/lib/pharmaobservatory/models/targets_row.rb +498 -0
- data/lib/pharmaobservatory/models/trial_adverse_events_response.rb +3 -3
- data/lib/pharmaobservatory/models/trial_changes_response.rb +3 -3
- data/lib/pharmaobservatory/models/trial_delivery_response.rb +3 -3
- data/lib/pharmaobservatory/models/trial_delivery_row.rb +22 -11
- data/lib/pharmaobservatory/models/trial_demographics_response.rb +3 -3
- data/lib/pharmaobservatory/models/trial_drug_classes_response.rb +478 -0
- data/lib/pharmaobservatory/models/trial_drug_classes_row.rb +278 -0
- data/lib/pharmaobservatory/models/trial_drugs_response.rb +3 -3
- data/lib/pharmaobservatory/models/trial_enrollment_history_response.rb +3 -3
- data/lib/pharmaobservatory/models/trial_enrollment_rate_response.rb +3 -3
- data/lib/pharmaobservatory/models/trial_enrollment_rate_row.rb +15 -4
- data/lib/pharmaobservatory/models/trial_extracted_endpoints_response.rb +3 -3
- data/lib/pharmaobservatory/models/trial_kols_response.rb +478 -0
- data/lib/pharmaobservatory/models/trial_kols_row.rb +302 -0
- data/lib/pharmaobservatory/models/trial_outcome_measures_response.rb +3 -3
- data/lib/pharmaobservatory/models/trial_research_payments_response.rb +478 -0
- data/lib/pharmaobservatory/models/trial_research_payments_row.rb +366 -0
- data/lib/pharmaobservatory/models/trial_site_history_response.rb +478 -0
- data/lib/pharmaobservatory/models/trial_site_history_row.rb +401 -0
- data/lib/pharmaobservatory/models/trial_sites_response.rb +3 -3
- data/lib/pharmaobservatory/models/trials_record.rb +2 -2
- data/lib/pharmaobservatory/models/trials_response.rb +3 -3
- data/lib/pharmaobservatory/models/trials_row.rb +3 -3
- data/lib/pharmaobservatory/version.rb +1 -1
- data/lib/pharmaobservatory.rb +75 -3
- metadata +152 -8
|
@@ -0,0 +1,544 @@
|
|
|
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 suppliers dataset: one row per research supplier published in the public Scientist.com marketplace with at least one located site. A grouped request returns the group columns and the measures instead, as additional properties.
|
|
18
|
+
class SuppliersRow
|
|
19
|
+
# The supplier id: the Scientist.com provider id as text, the id in the supplier page address (/suppliers/<id>). A supplier is not a company.
|
|
20
|
+
attr_accessor :provider_id
|
|
21
|
+
|
|
22
|
+
# The supplier's name as listed on the marketplace.
|
|
23
|
+
attr_accessor :name
|
|
24
|
+
|
|
25
|
+
# The supplier's company type as the marketplace spells it (small-business, academic-core and so on). An open set; null when the supplier lists none.
|
|
26
|
+
attr_accessor :company_type
|
|
27
|
+
|
|
28
|
+
# The supplier's marketplace tier word; null when the marketplace assigns none.
|
|
29
|
+
attr_accessor :marketplace_tier
|
|
30
|
+
|
|
31
|
+
# The service areas the supplier lists, one array element each (empty when none). Filter with 'Biology' = ANY(service_areas).
|
|
32
|
+
attr_accessor :service_areas
|
|
33
|
+
|
|
34
|
+
# ISO 3166-1 alpha-2 country code of the supplier's headquarters point (null when unknown).
|
|
35
|
+
attr_accessor :hq_country
|
|
36
|
+
|
|
37
|
+
# The broad world region of hq_country, from the country_regions reference table; other when the country is unknown or in none of the six regions.
|
|
38
|
+
attr_accessor :hq_region
|
|
39
|
+
|
|
40
|
+
# Latitude of the supplier's headquarters point: the Headquarters site, else the first site by category then site id.
|
|
41
|
+
attr_accessor :hq_latitude
|
|
42
|
+
|
|
43
|
+
# Longitude of the supplier's headquarters point.
|
|
44
|
+
attr_accessor :hq_longitude
|
|
45
|
+
|
|
46
|
+
# How many located sites the supplier has.
|
|
47
|
+
attr_accessor :n_sites
|
|
48
|
+
|
|
49
|
+
# How many distinct countries the supplier's sites are in.
|
|
50
|
+
attr_accessor :n_countries
|
|
51
|
+
|
|
52
|
+
# True when the supplier's organization is a contract research organization (CRO) under the one organization-level definition.
|
|
53
|
+
attr_accessor :is_cro
|
|
54
|
+
|
|
55
|
+
# True when the supplier name matches a registered trial sponsor. A name match, not a verified identity.
|
|
56
|
+
attr_accessor :is_trial_sponsor
|
|
57
|
+
|
|
58
|
+
# Registered trials where an organization matched to the supplier by name is lead sponsor or collaborator.
|
|
59
|
+
attr_accessor :n_trials
|
|
60
|
+
|
|
61
|
+
# The subset of n_trials where the matched organization is the lead sponsor.
|
|
62
|
+
attr_accessor :n_lead_trials
|
|
63
|
+
|
|
64
|
+
# The website the supplier listed; a third-party address, not vouched for.
|
|
65
|
+
attr_accessor :website
|
|
66
|
+
|
|
67
|
+
# The supplier's page on the Scientist.com marketplace; the marketplace asks a visitor to sign in.
|
|
68
|
+
attr_accessor :profile_url
|
|
69
|
+
|
|
70
|
+
# The path of the supplier's logo on our own origin (/supplier-logos/<sha>.png); null when it has none.
|
|
71
|
+
attr_accessor :logo_path
|
|
72
|
+
|
|
73
|
+
# True when the supplier wrote a profile description. The description text is not published.
|
|
74
|
+
attr_accessor :has_description
|
|
75
|
+
|
|
76
|
+
# SAM.gov self-certified veteran-owned designation.
|
|
77
|
+
attr_accessor :is_veteran_owned
|
|
78
|
+
|
|
79
|
+
# SAM.gov self-certified woman-owned designation.
|
|
80
|
+
attr_accessor :is_woman_owned
|
|
81
|
+
|
|
82
|
+
# SAM.gov self-certified minority-owned designation (8(a) or small disadvantaged business).
|
|
83
|
+
attr_accessor :is_minority_owned
|
|
84
|
+
|
|
85
|
+
# SAM.gov self-certified HUBZone (historically underutilized business zone) designation.
|
|
86
|
+
attr_accessor :is_hubzone
|
|
87
|
+
|
|
88
|
+
# Legal-entity level: the organization record the supplier resolved to. Null when the supplier has no organization record of its own.
|
|
89
|
+
attr_accessor :supplier_org_id
|
|
90
|
+
|
|
91
|
+
# Company level: the company the supplier's organization belongs to (null when none).
|
|
92
|
+
attr_accessor :supplier_company_id
|
|
93
|
+
|
|
94
|
+
# Display name of the supplier's company.
|
|
95
|
+
attr_accessor :supplier_company_name
|
|
96
|
+
|
|
97
|
+
# Group level: the supplier's company's current ultimate parent company; a root company's group is itself.
|
|
98
|
+
attr_accessor :supplier_group_id
|
|
99
|
+
|
|
100
|
+
# Display name of the supplier's group.
|
|
101
|
+
attr_accessor :supplier_group_name
|
|
102
|
+
|
|
103
|
+
# How the supplier was linked to its organization record, so a caller can apply a confidence floor. The supplier pages on organization pages show only provider_ror_exact, provider_edgar_exact and supplier_curated.
|
|
104
|
+
attr_accessor :org_link_method
|
|
105
|
+
|
|
106
|
+
# True when the supplier has a public page on the web (every row of this dataset does).
|
|
107
|
+
attr_accessor :has_public_page
|
|
108
|
+
|
|
109
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
110
|
+
def self.attribute_map
|
|
111
|
+
{
|
|
112
|
+
:'provider_id' => :'provider_id',
|
|
113
|
+
:'name' => :'name',
|
|
114
|
+
:'company_type' => :'company_type',
|
|
115
|
+
:'marketplace_tier' => :'marketplace_tier',
|
|
116
|
+
:'service_areas' => :'service_areas',
|
|
117
|
+
:'hq_country' => :'hq_country',
|
|
118
|
+
:'hq_region' => :'hq_region',
|
|
119
|
+
:'hq_latitude' => :'hq_latitude',
|
|
120
|
+
:'hq_longitude' => :'hq_longitude',
|
|
121
|
+
:'n_sites' => :'n_sites',
|
|
122
|
+
:'n_countries' => :'n_countries',
|
|
123
|
+
:'is_cro' => :'is_cro',
|
|
124
|
+
:'is_trial_sponsor' => :'is_trial_sponsor',
|
|
125
|
+
:'n_trials' => :'n_trials',
|
|
126
|
+
:'n_lead_trials' => :'n_lead_trials',
|
|
127
|
+
:'website' => :'website',
|
|
128
|
+
:'profile_url' => :'profile_url',
|
|
129
|
+
:'logo_path' => :'logo_path',
|
|
130
|
+
:'has_description' => :'has_description',
|
|
131
|
+
:'is_veteran_owned' => :'is_veteran_owned',
|
|
132
|
+
:'is_woman_owned' => :'is_woman_owned',
|
|
133
|
+
:'is_minority_owned' => :'is_minority_owned',
|
|
134
|
+
:'is_hubzone' => :'is_hubzone',
|
|
135
|
+
:'supplier_org_id' => :'supplier_org_id',
|
|
136
|
+
:'supplier_company_id' => :'supplier_company_id',
|
|
137
|
+
:'supplier_company_name' => :'supplier_company_name',
|
|
138
|
+
:'supplier_group_id' => :'supplier_group_id',
|
|
139
|
+
:'supplier_group_name' => :'supplier_group_name',
|
|
140
|
+
:'org_link_method' => :'org_link_method',
|
|
141
|
+
:'has_public_page' => :'has_public_page'
|
|
142
|
+
}
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Returns attribute mapping this model knows about
|
|
146
|
+
def self.acceptable_attribute_map
|
|
147
|
+
attribute_map
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Returns all the JSON keys this model knows about
|
|
151
|
+
def self.acceptable_attributes
|
|
152
|
+
acceptable_attribute_map.values
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Attribute type mapping.
|
|
156
|
+
def self.openapi_types
|
|
157
|
+
{
|
|
158
|
+
:'provider_id' => :'String',
|
|
159
|
+
:'name' => :'String',
|
|
160
|
+
:'company_type' => :'String',
|
|
161
|
+
:'marketplace_tier' => :'String',
|
|
162
|
+
:'service_areas' => :'Array<String>',
|
|
163
|
+
:'hq_country' => :'String',
|
|
164
|
+
:'hq_region' => :'String',
|
|
165
|
+
:'hq_latitude' => :'Float',
|
|
166
|
+
:'hq_longitude' => :'Float',
|
|
167
|
+
:'n_sites' => :'Integer',
|
|
168
|
+
:'n_countries' => :'Integer',
|
|
169
|
+
:'is_cro' => :'Boolean',
|
|
170
|
+
:'is_trial_sponsor' => :'Boolean',
|
|
171
|
+
:'n_trials' => :'Integer',
|
|
172
|
+
:'n_lead_trials' => :'Integer',
|
|
173
|
+
:'website' => :'String',
|
|
174
|
+
:'profile_url' => :'String',
|
|
175
|
+
:'logo_path' => :'String',
|
|
176
|
+
:'has_description' => :'Boolean',
|
|
177
|
+
:'is_veteran_owned' => :'Boolean',
|
|
178
|
+
:'is_woman_owned' => :'Boolean',
|
|
179
|
+
:'is_minority_owned' => :'Boolean',
|
|
180
|
+
:'is_hubzone' => :'Boolean',
|
|
181
|
+
:'supplier_org_id' => :'String',
|
|
182
|
+
:'supplier_company_id' => :'String',
|
|
183
|
+
:'supplier_company_name' => :'String',
|
|
184
|
+
:'supplier_group_id' => :'String',
|
|
185
|
+
:'supplier_group_name' => :'String',
|
|
186
|
+
:'org_link_method' => :'String',
|
|
187
|
+
:'has_public_page' => :'Boolean'
|
|
188
|
+
}
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# List of attributes with nullable: true
|
|
192
|
+
def self.openapi_nullable
|
|
193
|
+
Set.new([
|
|
194
|
+
:'provider_id',
|
|
195
|
+
:'name',
|
|
196
|
+
:'company_type',
|
|
197
|
+
:'marketplace_tier',
|
|
198
|
+
:'service_areas',
|
|
199
|
+
:'hq_country',
|
|
200
|
+
:'hq_region',
|
|
201
|
+
:'hq_latitude',
|
|
202
|
+
:'hq_longitude',
|
|
203
|
+
:'n_sites',
|
|
204
|
+
:'n_countries',
|
|
205
|
+
:'is_cro',
|
|
206
|
+
:'is_trial_sponsor',
|
|
207
|
+
:'n_trials',
|
|
208
|
+
:'n_lead_trials',
|
|
209
|
+
:'website',
|
|
210
|
+
:'profile_url',
|
|
211
|
+
:'logo_path',
|
|
212
|
+
:'has_description',
|
|
213
|
+
:'is_veteran_owned',
|
|
214
|
+
:'is_woman_owned',
|
|
215
|
+
:'is_minority_owned',
|
|
216
|
+
:'is_hubzone',
|
|
217
|
+
:'supplier_org_id',
|
|
218
|
+
:'supplier_company_id',
|
|
219
|
+
:'supplier_company_name',
|
|
220
|
+
:'supplier_group_id',
|
|
221
|
+
:'supplier_group_name',
|
|
222
|
+
:'org_link_method',
|
|
223
|
+
:'has_public_page'
|
|
224
|
+
])
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Initializes the object
|
|
228
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
229
|
+
def initialize(attributes = {})
|
|
230
|
+
if (!attributes.is_a?(Hash))
|
|
231
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PharmaObservatory::SuppliersRow` initialize method"
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
235
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
236
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
237
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
238
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PharmaObservatory::SuppliersRow`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
239
|
+
end
|
|
240
|
+
h[k.to_sym] = v
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if attributes.key?(:'provider_id')
|
|
244
|
+
self.provider_id = attributes[:'provider_id']
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
if attributes.key?(:'name')
|
|
248
|
+
self.name = attributes[:'name']
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
if attributes.key?(:'company_type')
|
|
252
|
+
self.company_type = attributes[:'company_type']
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
if attributes.key?(:'marketplace_tier')
|
|
256
|
+
self.marketplace_tier = attributes[:'marketplace_tier']
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
if attributes.key?(:'service_areas')
|
|
260
|
+
if (value = attributes[:'service_areas']).is_a?(Array)
|
|
261
|
+
self.service_areas = value
|
|
262
|
+
end
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
if attributes.key?(:'hq_country')
|
|
266
|
+
self.hq_country = attributes[:'hq_country']
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
if attributes.key?(:'hq_region')
|
|
270
|
+
self.hq_region = attributes[:'hq_region']
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
if attributes.key?(:'hq_latitude')
|
|
274
|
+
self.hq_latitude = attributes[:'hq_latitude']
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
if attributes.key?(:'hq_longitude')
|
|
278
|
+
self.hq_longitude = attributes[:'hq_longitude']
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
if attributes.key?(:'n_sites')
|
|
282
|
+
self.n_sites = attributes[:'n_sites']
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
if attributes.key?(:'n_countries')
|
|
286
|
+
self.n_countries = attributes[:'n_countries']
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
if attributes.key?(:'is_cro')
|
|
290
|
+
self.is_cro = attributes[:'is_cro']
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
if attributes.key?(:'is_trial_sponsor')
|
|
294
|
+
self.is_trial_sponsor = attributes[:'is_trial_sponsor']
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
if attributes.key?(:'n_trials')
|
|
298
|
+
self.n_trials = attributes[:'n_trials']
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
if attributes.key?(:'n_lead_trials')
|
|
302
|
+
self.n_lead_trials = attributes[:'n_lead_trials']
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
if attributes.key?(:'website')
|
|
306
|
+
self.website = attributes[:'website']
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
if attributes.key?(:'profile_url')
|
|
310
|
+
self.profile_url = attributes[:'profile_url']
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
if attributes.key?(:'logo_path')
|
|
314
|
+
self.logo_path = attributes[:'logo_path']
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
if attributes.key?(:'has_description')
|
|
318
|
+
self.has_description = attributes[:'has_description']
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
if attributes.key?(:'is_veteran_owned')
|
|
322
|
+
self.is_veteran_owned = attributes[:'is_veteran_owned']
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
if attributes.key?(:'is_woman_owned')
|
|
326
|
+
self.is_woman_owned = attributes[:'is_woman_owned']
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
if attributes.key?(:'is_minority_owned')
|
|
330
|
+
self.is_minority_owned = attributes[:'is_minority_owned']
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
if attributes.key?(:'is_hubzone')
|
|
334
|
+
self.is_hubzone = attributes[:'is_hubzone']
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
if attributes.key?(:'supplier_org_id')
|
|
338
|
+
self.supplier_org_id = attributes[:'supplier_org_id']
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
if attributes.key?(:'supplier_company_id')
|
|
342
|
+
self.supplier_company_id = attributes[:'supplier_company_id']
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
if attributes.key?(:'supplier_company_name')
|
|
346
|
+
self.supplier_company_name = attributes[:'supplier_company_name']
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
if attributes.key?(:'supplier_group_id')
|
|
350
|
+
self.supplier_group_id = attributes[:'supplier_group_id']
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
if attributes.key?(:'supplier_group_name')
|
|
354
|
+
self.supplier_group_name = attributes[:'supplier_group_name']
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
if attributes.key?(:'org_link_method')
|
|
358
|
+
self.org_link_method = attributes[:'org_link_method']
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
if attributes.key?(:'has_public_page')
|
|
362
|
+
self.has_public_page = attributes[:'has_public_page']
|
|
363
|
+
end
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
367
|
+
# @return Array for valid properties with the reasons
|
|
368
|
+
def list_invalid_properties
|
|
369
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
370
|
+
invalid_properties = Array.new
|
|
371
|
+
invalid_properties
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
# Check to see if the all the properties in the model are valid
|
|
375
|
+
# @return true if the model is valid
|
|
376
|
+
def valid?
|
|
377
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
378
|
+
true
|
|
379
|
+
end
|
|
380
|
+
|
|
381
|
+
# Checks equality by comparing each attribute.
|
|
382
|
+
# @param [Object] Object to be compared
|
|
383
|
+
def ==(o)
|
|
384
|
+
return true if self.equal?(o)
|
|
385
|
+
self.class == o.class &&
|
|
386
|
+
provider_id == o.provider_id &&
|
|
387
|
+
name == o.name &&
|
|
388
|
+
company_type == o.company_type &&
|
|
389
|
+
marketplace_tier == o.marketplace_tier &&
|
|
390
|
+
service_areas == o.service_areas &&
|
|
391
|
+
hq_country == o.hq_country &&
|
|
392
|
+
hq_region == o.hq_region &&
|
|
393
|
+
hq_latitude == o.hq_latitude &&
|
|
394
|
+
hq_longitude == o.hq_longitude &&
|
|
395
|
+
n_sites == o.n_sites &&
|
|
396
|
+
n_countries == o.n_countries &&
|
|
397
|
+
is_cro == o.is_cro &&
|
|
398
|
+
is_trial_sponsor == o.is_trial_sponsor &&
|
|
399
|
+
n_trials == o.n_trials &&
|
|
400
|
+
n_lead_trials == o.n_lead_trials &&
|
|
401
|
+
website == o.website &&
|
|
402
|
+
profile_url == o.profile_url &&
|
|
403
|
+
logo_path == o.logo_path &&
|
|
404
|
+
has_description == o.has_description &&
|
|
405
|
+
is_veteran_owned == o.is_veteran_owned &&
|
|
406
|
+
is_woman_owned == o.is_woman_owned &&
|
|
407
|
+
is_minority_owned == o.is_minority_owned &&
|
|
408
|
+
is_hubzone == o.is_hubzone &&
|
|
409
|
+
supplier_org_id == o.supplier_org_id &&
|
|
410
|
+
supplier_company_id == o.supplier_company_id &&
|
|
411
|
+
supplier_company_name == o.supplier_company_name &&
|
|
412
|
+
supplier_group_id == o.supplier_group_id &&
|
|
413
|
+
supplier_group_name == o.supplier_group_name &&
|
|
414
|
+
org_link_method == o.org_link_method &&
|
|
415
|
+
has_public_page == o.has_public_page
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
# @see the `==` method
|
|
419
|
+
# @param [Object] Object to be compared
|
|
420
|
+
def eql?(o)
|
|
421
|
+
self == o
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
# Calculates hash code according to all attributes.
|
|
425
|
+
# @return [Integer] Hash code
|
|
426
|
+
def hash
|
|
427
|
+
[provider_id, name, company_type, marketplace_tier, service_areas, hq_country, hq_region, hq_latitude, hq_longitude, n_sites, n_countries, is_cro, is_trial_sponsor, n_trials, n_lead_trials, website, profile_url, logo_path, has_description, is_veteran_owned, is_woman_owned, is_minority_owned, is_hubzone, supplier_org_id, supplier_company_id, supplier_company_name, supplier_group_id, supplier_group_name, org_link_method, has_public_page].hash
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
# Builds the object from hash
|
|
431
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
432
|
+
# @return [Object] Returns the model itself
|
|
433
|
+
def self.build_from_hash(attributes)
|
|
434
|
+
return nil unless attributes.is_a?(Hash)
|
|
435
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
436
|
+
transformed_hash = {}
|
|
437
|
+
openapi_types.each_pair do |key, type|
|
|
438
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
439
|
+
transformed_hash["#{key}"] = nil
|
|
440
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
441
|
+
# check to ensure the input is an array given that the attribute
|
|
442
|
+
# is documented as an array but the input is not
|
|
443
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
444
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
445
|
+
end
|
|
446
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
447
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
448
|
+
end
|
|
449
|
+
end
|
|
450
|
+
new(transformed_hash)
|
|
451
|
+
end
|
|
452
|
+
|
|
453
|
+
# Deserializes the data based on type
|
|
454
|
+
# @param string type Data type
|
|
455
|
+
# @param string value Value to be deserialized
|
|
456
|
+
# @return [Object] Deserialized data
|
|
457
|
+
def self._deserialize(type, value)
|
|
458
|
+
case type.to_sym
|
|
459
|
+
when :Time
|
|
460
|
+
Time.parse(value)
|
|
461
|
+
when :Date
|
|
462
|
+
Date.parse(value)
|
|
463
|
+
when :String
|
|
464
|
+
value.to_s
|
|
465
|
+
when :Integer
|
|
466
|
+
value.to_i
|
|
467
|
+
when :Float
|
|
468
|
+
value.to_f
|
|
469
|
+
when :Boolean
|
|
470
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
471
|
+
true
|
|
472
|
+
else
|
|
473
|
+
false
|
|
474
|
+
end
|
|
475
|
+
when :Object
|
|
476
|
+
# generic object (usually a Hash), return directly
|
|
477
|
+
value
|
|
478
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
479
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
480
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
481
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
482
|
+
k_type = Regexp.last_match[:k_type]
|
|
483
|
+
v_type = Regexp.last_match[:v_type]
|
|
484
|
+
{}.tap do |hash|
|
|
485
|
+
value.each do |k, v|
|
|
486
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
487
|
+
end
|
|
488
|
+
end
|
|
489
|
+
else # model
|
|
490
|
+
# models (e.g. Pet) or oneOf
|
|
491
|
+
klass = PharmaObservatory.const_get(type)
|
|
492
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
493
|
+
end
|
|
494
|
+
end
|
|
495
|
+
|
|
496
|
+
# Returns the string representation of the object
|
|
497
|
+
# @return [String] String presentation of the object
|
|
498
|
+
def to_s
|
|
499
|
+
to_hash.to_s
|
|
500
|
+
end
|
|
501
|
+
|
|
502
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
503
|
+
# @return [Hash] Returns the object in the form of hash
|
|
504
|
+
def to_body
|
|
505
|
+
to_hash
|
|
506
|
+
end
|
|
507
|
+
|
|
508
|
+
# Returns the object in the form of hash
|
|
509
|
+
# @return [Hash] Returns the object in the form of hash
|
|
510
|
+
def to_hash
|
|
511
|
+
hash = {}
|
|
512
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
513
|
+
value = self.send(attr)
|
|
514
|
+
if value.nil?
|
|
515
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
516
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
517
|
+
end
|
|
518
|
+
|
|
519
|
+
hash[param] = _to_hash(value)
|
|
520
|
+
end
|
|
521
|
+
hash
|
|
522
|
+
end
|
|
523
|
+
|
|
524
|
+
# Outputs non-array value in the form of hash
|
|
525
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
526
|
+
# @param [Object] value Any valid value
|
|
527
|
+
# @return [Hash] Returns the value in the form of hash
|
|
528
|
+
def _to_hash(value)
|
|
529
|
+
if value.is_a?(Array)
|
|
530
|
+
value.compact.map { |v| _to_hash(v) }
|
|
531
|
+
elsif value.is_a?(Hash)
|
|
532
|
+
{}.tap do |hash|
|
|
533
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
534
|
+
end
|
|
535
|
+
elsif value.respond_to? :to_hash
|
|
536
|
+
value.to_hash
|
|
537
|
+
else
|
|
538
|
+
value
|
|
539
|
+
end
|
|
540
|
+
end
|
|
541
|
+
|
|
542
|
+
end
|
|
543
|
+
|
|
544
|
+
end
|