pharmaobservatory 0.1.25 → 0.1.26
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 +24 -4
- data/docs/BiomarkerLiteraturePeopleResponse.md +58 -0
- data/docs/BiomarkerLiteraturePeopleRow.md +36 -0
- data/docs/BiomarkersApi.md +80 -0
- data/docs/CompanyRareDiseaseDeclarationsRow.md +1 -1
- data/docs/ConditionLiteraturePeopleResponse.md +58 -0
- data/docs/ConditionLiteraturePeopleRow.md +36 -0
- data/docs/ConditionsApi.md +160 -0
- data/docs/ConditionsRecord.md +2 -0
- data/docs/InvestigatorsApi.md +320 -0
- data/docs/InvestmentGraphNodesRow.md +4 -2
- data/docs/LegalEntitiesApi.md +80 -0
- data/docs/OrgLiteraturePeopleResponse.md +58 -0
- data/docs/OrgLiteraturePeopleRow.md +36 -0
- data/docs/PatientOrganisationResponse.md +58 -0
- data/docs/PatientOrganisationRow.md +74 -0
- data/docs/RareDiseaseOrganizationsRow.md +1 -1
- data/docs/RareDiseaseTrialSitesRow.md +5 -3
- data/docs/RareDiseasesApi.md +80 -0
- data/docs/RareDiseasesRecord.md +2 -0
- data/docs/TargetLiteraturePeopleResponse.md +58 -0
- data/docs/TargetLiteraturePeopleRow.md +36 -0
- data/docs/TargetsApi.md +80 -0
- data/lib/pharmaobservatory/api/biomarkers_api.rb +84 -0
- data/lib/pharmaobservatory/api/conditions_api.rb +168 -0
- data/lib/pharmaobservatory/api/investigators_api.rb +336 -0
- data/lib/pharmaobservatory/api/legal_entities_api.rb +84 -0
- data/lib/pharmaobservatory/api/rare_diseases_api.rb +84 -0
- data/lib/pharmaobservatory/api/targets_api.rb +84 -0
- data/lib/pharmaobservatory/models/biomarker_literature_people_response.rb +478 -0
- data/lib/pharmaobservatory/models/biomarker_literature_people_row.rb +322 -0
- data/lib/pharmaobservatory/models/company_rare_disease_declarations_row.rb +1 -1
- data/lib/pharmaobservatory/models/condition_literature_people_response.rb +478 -0
- data/lib/pharmaobservatory/models/condition_literature_people_row.rb +322 -0
- data/lib/pharmaobservatory/models/conditions_record.rb +13 -1
- data/lib/pharmaobservatory/models/investment_graph_nodes_row.rb +19 -6
- data/lib/pharmaobservatory/models/org_literature_people_response.rb +478 -0
- data/lib/pharmaobservatory/models/org_literature_people_row.rb +322 -0
- data/lib/pharmaobservatory/models/patient_organisation_response.rb +478 -0
- data/lib/pharmaobservatory/models/patient_organisation_row.rb +545 -0
- data/lib/pharmaobservatory/models/rare_disease_organizations_row.rb +1 -1
- data/lib/pharmaobservatory/models/rare_disease_trial_sites_row.rb +15 -4
- data/lib/pharmaobservatory/models/rare_diseases_record.rb +13 -1
- data/lib/pharmaobservatory/models/target_literature_people_response.rb +478 -0
- data/lib/pharmaobservatory/models/target_literature_people_row.rb +322 -0
- data/lib/pharmaobservatory/version.rb +1 -1
- data/lib/pharmaobservatory.rb +10 -0
- metadata +22 -2
|
@@ -158,6 +158,90 @@ module PharmaObservatory
|
|
|
158
158
|
return data, status_code, headers
|
|
159
159
|
end
|
|
160
160
|
|
|
161
|
+
# Patient organisations
|
|
162
|
+
# @param id [Integer]
|
|
163
|
+
# @param [Hash] opts the optional parameters
|
|
164
|
+
# @option opts [String] :cursor The next_cursor of the previous page. Opaque; it is bound to the filters and the warehouse build that issued it.
|
|
165
|
+
# @option opts [Integer] :limit Rows per page, up to 500 (default 50).
|
|
166
|
+
# @option opts [String] :sort Comma separated columns, a leading minus for descending: sort=a,-b.
|
|
167
|
+
# @option opts [String] :group_by A dimension to group by; a date takes :year, :quarter or :month.
|
|
168
|
+
# @option opts [String] :measure count, sum(col), avg(col), min(col), max(col), median(col) or count_distinct(col).
|
|
169
|
+
# @return [PatientOrganisationResponse]
|
|
170
|
+
def rare_diseases_patient_organisation(id, opts = {})
|
|
171
|
+
data, _status_code, _headers = rare_diseases_patient_organisation_with_http_info(id, opts)
|
|
172
|
+
data
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Patient organisations
|
|
176
|
+
# @param id [Integer]
|
|
177
|
+
# @param [Hash] opts the optional parameters
|
|
178
|
+
# @option opts [String] :cursor The next_cursor of the previous page. Opaque; it is bound to the filters and the warehouse build that issued it.
|
|
179
|
+
# @option opts [Integer] :limit Rows per page, up to 500 (default 50).
|
|
180
|
+
# @option opts [String] :sort Comma separated columns, a leading minus for descending: sort=a,-b.
|
|
181
|
+
# @option opts [String] :group_by A dimension to group by; a date takes :year, :quarter or :month.
|
|
182
|
+
# @option opts [String] :measure count, sum(col), avg(col), min(col), max(col), median(col) or count_distinct(col).
|
|
183
|
+
# @return [Array<(PatientOrganisationResponse, Integer, Hash)>] PatientOrganisationResponse data, response status code and response headers
|
|
184
|
+
def rare_diseases_patient_organisation_with_http_info(id, opts = {})
|
|
185
|
+
if @api_client.config.debugging
|
|
186
|
+
@api_client.config.logger.debug 'Calling API: RareDiseasesApi.rare_diseases_patient_organisation ...'
|
|
187
|
+
end
|
|
188
|
+
# verify the required parameter 'id' is set
|
|
189
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
190
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling RareDiseasesApi.rare_diseases_patient_organisation"
|
|
191
|
+
end
|
|
192
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
|
|
193
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RareDiseasesApi.rare_diseases_patient_organisation, must be smaller than or equal to 500.'
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
197
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RareDiseasesApi.rare_diseases_patient_organisation, must be greater than or equal to 1.'
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# resource path
|
|
201
|
+
local_var_path = '/api/v1/rare_diseases/{id}/patient_organisation'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
202
|
+
|
|
203
|
+
# query parameters
|
|
204
|
+
query_params = opts[:query_params] || {}
|
|
205
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
|
206
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
207
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
208
|
+
query_params[:'group_by'] = opts[:'group_by'] if !opts[:'group_by'].nil?
|
|
209
|
+
query_params[:'measure'] = opts[:'measure'] if !opts[:'measure'].nil?
|
|
210
|
+
|
|
211
|
+
# header parameters
|
|
212
|
+
header_params = opts[:header_params] || {}
|
|
213
|
+
# HTTP header 'Accept' (if needed)
|
|
214
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
215
|
+
|
|
216
|
+
# form parameters
|
|
217
|
+
form_params = opts[:form_params] || {}
|
|
218
|
+
|
|
219
|
+
# http body (model)
|
|
220
|
+
post_body = opts[:debug_body]
|
|
221
|
+
|
|
222
|
+
# return_type
|
|
223
|
+
return_type = opts[:debug_return_type] || 'PatientOrganisationResponse'
|
|
224
|
+
|
|
225
|
+
# auth_names
|
|
226
|
+
auth_names = opts[:debug_auth_names] || ['ApiBearerJwt']
|
|
227
|
+
|
|
228
|
+
new_options = opts.merge(
|
|
229
|
+
:operation => :"RareDiseasesApi.rare_diseases_patient_organisation",
|
|
230
|
+
:header_params => header_params,
|
|
231
|
+
:query_params => query_params,
|
|
232
|
+
:form_params => form_params,
|
|
233
|
+
:body => post_body,
|
|
234
|
+
:auth_names => auth_names,
|
|
235
|
+
:return_type => return_type
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
239
|
+
if @api_client.config.debugging
|
|
240
|
+
@api_client.config.logger.debug "API called: RareDiseasesApi#rare_diseases_patient_organisation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
241
|
+
end
|
|
242
|
+
return data, status_code, headers
|
|
243
|
+
end
|
|
244
|
+
|
|
161
245
|
# Rare disease genes
|
|
162
246
|
# @param id [Integer]
|
|
163
247
|
# @param [Hash] opts the optional parameters
|
|
@@ -914,6 +914,90 @@ module PharmaObservatory
|
|
|
914
914
|
return data, status_code, headers
|
|
915
915
|
end
|
|
916
916
|
|
|
917
|
+
# Target literature, most active authors
|
|
918
|
+
# @param id [String]
|
|
919
|
+
# @param [Hash] opts the optional parameters
|
|
920
|
+
# @option opts [String] :cursor The next_cursor of the previous page. Opaque; it is bound to the filters and the warehouse build that issued it.
|
|
921
|
+
# @option opts [Integer] :limit Rows per page, up to 500 (default 50).
|
|
922
|
+
# @option opts [String] :sort Comma separated columns, a leading minus for descending: sort=a,-b.
|
|
923
|
+
# @option opts [String] :group_by A dimension to group by; a date takes :year, :quarter or :month.
|
|
924
|
+
# @option opts [String] :measure count, sum(col), avg(col), min(col), max(col), median(col) or count_distinct(col).
|
|
925
|
+
# @return [TargetLiteraturePeopleResponse]
|
|
926
|
+
def targets_target_literature_people(id, opts = {})
|
|
927
|
+
data, _status_code, _headers = targets_target_literature_people_with_http_info(id, opts)
|
|
928
|
+
data
|
|
929
|
+
end
|
|
930
|
+
|
|
931
|
+
# Target literature, most active authors
|
|
932
|
+
# @param id [String]
|
|
933
|
+
# @param [Hash] opts the optional parameters
|
|
934
|
+
# @option opts [String] :cursor The next_cursor of the previous page. Opaque; it is bound to the filters and the warehouse build that issued it.
|
|
935
|
+
# @option opts [Integer] :limit Rows per page, up to 500 (default 50).
|
|
936
|
+
# @option opts [String] :sort Comma separated columns, a leading minus for descending: sort=a,-b.
|
|
937
|
+
# @option opts [String] :group_by A dimension to group by; a date takes :year, :quarter or :month.
|
|
938
|
+
# @option opts [String] :measure count, sum(col), avg(col), min(col), max(col), median(col) or count_distinct(col).
|
|
939
|
+
# @return [Array<(TargetLiteraturePeopleResponse, Integer, Hash)>] TargetLiteraturePeopleResponse data, response status code and response headers
|
|
940
|
+
def targets_target_literature_people_with_http_info(id, opts = {})
|
|
941
|
+
if @api_client.config.debugging
|
|
942
|
+
@api_client.config.logger.debug 'Calling API: TargetsApi.targets_target_literature_people ...'
|
|
943
|
+
end
|
|
944
|
+
# verify the required parameter 'id' is set
|
|
945
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
946
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TargetsApi.targets_target_literature_people"
|
|
947
|
+
end
|
|
948
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
|
|
949
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TargetsApi.targets_target_literature_people, must be smaller than or equal to 500.'
|
|
950
|
+
end
|
|
951
|
+
|
|
952
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
953
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TargetsApi.targets_target_literature_people, must be greater than or equal to 1.'
|
|
954
|
+
end
|
|
955
|
+
|
|
956
|
+
# resource path
|
|
957
|
+
local_var_path = '/api/v1/targets/{id}/target_literature_people'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
958
|
+
|
|
959
|
+
# query parameters
|
|
960
|
+
query_params = opts[:query_params] || {}
|
|
961
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
|
962
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
963
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
964
|
+
query_params[:'group_by'] = opts[:'group_by'] if !opts[:'group_by'].nil?
|
|
965
|
+
query_params[:'measure'] = opts[:'measure'] if !opts[:'measure'].nil?
|
|
966
|
+
|
|
967
|
+
# header parameters
|
|
968
|
+
header_params = opts[:header_params] || {}
|
|
969
|
+
# HTTP header 'Accept' (if needed)
|
|
970
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
971
|
+
|
|
972
|
+
# form parameters
|
|
973
|
+
form_params = opts[:form_params] || {}
|
|
974
|
+
|
|
975
|
+
# http body (model)
|
|
976
|
+
post_body = opts[:debug_body]
|
|
977
|
+
|
|
978
|
+
# return_type
|
|
979
|
+
return_type = opts[:debug_return_type] || 'TargetLiteraturePeopleResponse'
|
|
980
|
+
|
|
981
|
+
# auth_names
|
|
982
|
+
auth_names = opts[:debug_auth_names] || ['ApiBearerJwt']
|
|
983
|
+
|
|
984
|
+
new_options = opts.merge(
|
|
985
|
+
:operation => :"TargetsApi.targets_target_literature_people",
|
|
986
|
+
:header_params => header_params,
|
|
987
|
+
:query_params => query_params,
|
|
988
|
+
:form_params => form_params,
|
|
989
|
+
:body => post_body,
|
|
990
|
+
:auth_names => auth_names,
|
|
991
|
+
:return_type => return_type
|
|
992
|
+
)
|
|
993
|
+
|
|
994
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
995
|
+
if @api_client.config.debugging
|
|
996
|
+
@api_client.config.logger.debug "API called: TargetsApi#targets_target_literature_people\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
997
|
+
end
|
|
998
|
+
return data, status_code, headers
|
|
999
|
+
end
|
|
1000
|
+
|
|
917
1001
|
# Target patent mentions
|
|
918
1002
|
# @param id [String]
|
|
919
1003
|
# @param [Hash] opts the optional parameters
|
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Pharma Observatory Public REST API
|
|
3
|
+
|
|
4
|
+
#Read-only REST API over the Pharma Observatory biomedical data platform. Reference: https://pharmaobservatory.com/api-reference
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.13.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module PharmaObservatory
|
|
17
|
+
class BiomarkerLiteraturePeopleResponse
|
|
18
|
+
attr_accessor :dataset
|
|
19
|
+
|
|
20
|
+
attr_accessor :grain
|
|
21
|
+
|
|
22
|
+
attr_accessor :object_type
|
|
23
|
+
|
|
24
|
+
attr_accessor :id
|
|
25
|
+
|
|
26
|
+
attr_accessor :scope
|
|
27
|
+
|
|
28
|
+
attr_accessor :columns
|
|
29
|
+
|
|
30
|
+
attr_accessor :rows
|
|
31
|
+
|
|
32
|
+
# The exact count of the filtered rows on an ungrouped read, carried by the cursor; null when grouped.
|
|
33
|
+
attr_accessor :total
|
|
34
|
+
|
|
35
|
+
attr_accessor :next_cursor
|
|
36
|
+
|
|
37
|
+
attr_accessor :sort
|
|
38
|
+
|
|
39
|
+
attr_accessor :filters
|
|
40
|
+
|
|
41
|
+
attr_accessor :group_by
|
|
42
|
+
|
|
43
|
+
attr_accessor :measures
|
|
44
|
+
|
|
45
|
+
attr_accessor :attribution
|
|
46
|
+
|
|
47
|
+
attr_accessor :source_credit
|
|
48
|
+
|
|
49
|
+
attr_accessor :withheld_tiers
|
|
50
|
+
|
|
51
|
+
attr_accessor :withheld_columns
|
|
52
|
+
|
|
53
|
+
attr_accessor :freshness
|
|
54
|
+
|
|
55
|
+
attr_accessor :build
|
|
56
|
+
|
|
57
|
+
attr_accessor :build_state
|
|
58
|
+
|
|
59
|
+
attr_accessor :restriction
|
|
60
|
+
|
|
61
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
62
|
+
def self.attribute_map
|
|
63
|
+
{
|
|
64
|
+
:'dataset' => :'dataset',
|
|
65
|
+
:'grain' => :'grain',
|
|
66
|
+
:'object_type' => :'object_type',
|
|
67
|
+
:'id' => :'id',
|
|
68
|
+
:'scope' => :'scope',
|
|
69
|
+
:'columns' => :'columns',
|
|
70
|
+
:'rows' => :'rows',
|
|
71
|
+
:'total' => :'total',
|
|
72
|
+
:'next_cursor' => :'next_cursor',
|
|
73
|
+
:'sort' => :'sort',
|
|
74
|
+
:'filters' => :'filters',
|
|
75
|
+
:'group_by' => :'group_by',
|
|
76
|
+
:'measures' => :'measures',
|
|
77
|
+
:'attribution' => :'attribution',
|
|
78
|
+
:'source_credit' => :'source_credit',
|
|
79
|
+
:'withheld_tiers' => :'withheld_tiers',
|
|
80
|
+
:'withheld_columns' => :'withheld_columns',
|
|
81
|
+
:'freshness' => :'freshness',
|
|
82
|
+
:'build' => :'build',
|
|
83
|
+
:'build_state' => :'build_state',
|
|
84
|
+
:'restriction' => :'restriction'
|
|
85
|
+
}
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Returns attribute mapping this model knows about
|
|
89
|
+
def self.acceptable_attribute_map
|
|
90
|
+
attribute_map
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Returns all the JSON keys this model knows about
|
|
94
|
+
def self.acceptable_attributes
|
|
95
|
+
acceptable_attribute_map.values
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Attribute type mapping.
|
|
99
|
+
def self.openapi_types
|
|
100
|
+
{
|
|
101
|
+
:'dataset' => :'String',
|
|
102
|
+
:'grain' => :'String',
|
|
103
|
+
:'object_type' => :'String',
|
|
104
|
+
:'id' => :'String',
|
|
105
|
+
:'scope' => :'AnimalWelfareAssurancesResponseScope',
|
|
106
|
+
:'columns' => :'Array<DatasetColumn>',
|
|
107
|
+
:'rows' => :'Array<BiomarkerLiteraturePeopleRow>',
|
|
108
|
+
:'total' => :'Integer',
|
|
109
|
+
:'next_cursor' => :'String',
|
|
110
|
+
:'sort' => :'Array<String>',
|
|
111
|
+
:'filters' => :'Array<Hash<String, Object>>',
|
|
112
|
+
:'group_by' => :'Array<String>',
|
|
113
|
+
:'measures' => :'Array<String>',
|
|
114
|
+
:'attribution' => :'Array<DatasetAttribution>',
|
|
115
|
+
:'source_credit' => :'String',
|
|
116
|
+
:'withheld_tiers' => :'Array<String>',
|
|
117
|
+
:'withheld_columns' => :'Array<String>',
|
|
118
|
+
:'freshness' => :'AnimalWelfareAssurancesResponseFreshness',
|
|
119
|
+
:'build' => :'AnimalWelfareAssurancesResponseBuild',
|
|
120
|
+
:'build_state' => :'DatasetBuildState',
|
|
121
|
+
:'restriction' => :'Hash<String, Object>'
|
|
122
|
+
}
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# List of attributes with nullable: true
|
|
126
|
+
def self.openapi_nullable
|
|
127
|
+
Set.new([
|
|
128
|
+
:'object_type',
|
|
129
|
+
:'id',
|
|
130
|
+
:'scope',
|
|
131
|
+
:'total',
|
|
132
|
+
:'next_cursor',
|
|
133
|
+
:'restriction'
|
|
134
|
+
])
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Initializes the object
|
|
138
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
139
|
+
def initialize(attributes = {})
|
|
140
|
+
if (!attributes.is_a?(Hash))
|
|
141
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PharmaObservatory::BiomarkerLiteraturePeopleResponse` initialize method"
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
145
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
146
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
147
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
148
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PharmaObservatory::BiomarkerLiteraturePeopleResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
149
|
+
end
|
|
150
|
+
h[k.to_sym] = v
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if attributes.key?(:'dataset')
|
|
154
|
+
self.dataset = attributes[:'dataset']
|
|
155
|
+
else
|
|
156
|
+
self.dataset = nil
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if attributes.key?(:'grain')
|
|
160
|
+
self.grain = attributes[:'grain']
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
if attributes.key?(:'object_type')
|
|
164
|
+
self.object_type = attributes[:'object_type']
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
if attributes.key?(:'id')
|
|
168
|
+
self.id = attributes[:'id']
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
if attributes.key?(:'scope')
|
|
172
|
+
self.scope = attributes[:'scope']
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if attributes.key?(:'columns')
|
|
176
|
+
if (value = attributes[:'columns']).is_a?(Array)
|
|
177
|
+
self.columns = value
|
|
178
|
+
end
|
|
179
|
+
else
|
|
180
|
+
self.columns = nil
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
if attributes.key?(:'rows')
|
|
184
|
+
if (value = attributes[:'rows']).is_a?(Array)
|
|
185
|
+
self.rows = value
|
|
186
|
+
end
|
|
187
|
+
else
|
|
188
|
+
self.rows = nil
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
if attributes.key?(:'total')
|
|
192
|
+
self.total = attributes[:'total']
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if attributes.key?(:'next_cursor')
|
|
196
|
+
self.next_cursor = attributes[:'next_cursor']
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
if attributes.key?(:'sort')
|
|
200
|
+
if (value = attributes[:'sort']).is_a?(Array)
|
|
201
|
+
self.sort = value
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
if attributes.key?(:'filters')
|
|
206
|
+
if (value = attributes[:'filters']).is_a?(Array)
|
|
207
|
+
self.filters = value
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
if attributes.key?(:'group_by')
|
|
212
|
+
if (value = attributes[:'group_by']).is_a?(Array)
|
|
213
|
+
self.group_by = value
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
if attributes.key?(:'measures')
|
|
218
|
+
if (value = attributes[:'measures']).is_a?(Array)
|
|
219
|
+
self.measures = value
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
if attributes.key?(:'attribution')
|
|
224
|
+
if (value = attributes[:'attribution']).is_a?(Array)
|
|
225
|
+
self.attribution = value
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
if attributes.key?(:'source_credit')
|
|
230
|
+
self.source_credit = attributes[:'source_credit']
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
if attributes.key?(:'withheld_tiers')
|
|
234
|
+
if (value = attributes[:'withheld_tiers']).is_a?(Array)
|
|
235
|
+
self.withheld_tiers = value
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
if attributes.key?(:'withheld_columns')
|
|
240
|
+
if (value = attributes[:'withheld_columns']).is_a?(Array)
|
|
241
|
+
self.withheld_columns = value
|
|
242
|
+
end
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
if attributes.key?(:'freshness')
|
|
246
|
+
self.freshness = attributes[:'freshness']
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
if attributes.key?(:'build')
|
|
250
|
+
self.build = attributes[:'build']
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
if attributes.key?(:'build_state')
|
|
254
|
+
self.build_state = attributes[:'build_state']
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
if attributes.key?(:'restriction')
|
|
258
|
+
if (value = attributes[:'restriction']).is_a?(Hash)
|
|
259
|
+
self.restriction = value
|
|
260
|
+
end
|
|
261
|
+
end
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
265
|
+
# @return Array for valid properties with the reasons
|
|
266
|
+
def list_invalid_properties
|
|
267
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
268
|
+
invalid_properties = Array.new
|
|
269
|
+
if @dataset.nil?
|
|
270
|
+
invalid_properties.push('invalid value for "dataset", dataset cannot be nil.')
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
if @columns.nil?
|
|
274
|
+
invalid_properties.push('invalid value for "columns", columns cannot be nil.')
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
if @rows.nil?
|
|
278
|
+
invalid_properties.push('invalid value for "rows", rows cannot be nil.')
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
invalid_properties
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
# Check to see if the all the properties in the model are valid
|
|
285
|
+
# @return true if the model is valid
|
|
286
|
+
def valid?
|
|
287
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
288
|
+
return false if @dataset.nil?
|
|
289
|
+
return false if @columns.nil?
|
|
290
|
+
return false if @rows.nil?
|
|
291
|
+
true
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
# Custom attribute writer method with validation
|
|
295
|
+
# @param [Object] dataset Value to be assigned
|
|
296
|
+
def dataset=(dataset)
|
|
297
|
+
if dataset.nil?
|
|
298
|
+
fail ArgumentError, 'dataset cannot be nil'
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
@dataset = dataset
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
# Custom attribute writer method with validation
|
|
305
|
+
# @param [Object] columns Value to be assigned
|
|
306
|
+
def columns=(columns)
|
|
307
|
+
if columns.nil?
|
|
308
|
+
fail ArgumentError, 'columns cannot be nil'
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
@columns = columns
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
# Custom attribute writer method with validation
|
|
315
|
+
# @param [Object] rows Value to be assigned
|
|
316
|
+
def rows=(rows)
|
|
317
|
+
if rows.nil?
|
|
318
|
+
fail ArgumentError, 'rows cannot be nil'
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
@rows = rows
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
# Checks equality by comparing each attribute.
|
|
325
|
+
# @param [Object] Object to be compared
|
|
326
|
+
def ==(o)
|
|
327
|
+
return true if self.equal?(o)
|
|
328
|
+
self.class == o.class &&
|
|
329
|
+
dataset == o.dataset &&
|
|
330
|
+
grain == o.grain &&
|
|
331
|
+
object_type == o.object_type &&
|
|
332
|
+
id == o.id &&
|
|
333
|
+
scope == o.scope &&
|
|
334
|
+
columns == o.columns &&
|
|
335
|
+
rows == o.rows &&
|
|
336
|
+
total == o.total &&
|
|
337
|
+
next_cursor == o.next_cursor &&
|
|
338
|
+
sort == o.sort &&
|
|
339
|
+
filters == o.filters &&
|
|
340
|
+
group_by == o.group_by &&
|
|
341
|
+
measures == o.measures &&
|
|
342
|
+
attribution == o.attribution &&
|
|
343
|
+
source_credit == o.source_credit &&
|
|
344
|
+
withheld_tiers == o.withheld_tiers &&
|
|
345
|
+
withheld_columns == o.withheld_columns &&
|
|
346
|
+
freshness == o.freshness &&
|
|
347
|
+
build == o.build &&
|
|
348
|
+
build_state == o.build_state &&
|
|
349
|
+
restriction == o.restriction
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
# @see the `==` method
|
|
353
|
+
# @param [Object] Object to be compared
|
|
354
|
+
def eql?(o)
|
|
355
|
+
self == o
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
# Calculates hash code according to all attributes.
|
|
359
|
+
# @return [Integer] Hash code
|
|
360
|
+
def hash
|
|
361
|
+
[dataset, grain, object_type, id, scope, columns, rows, total, next_cursor, sort, filters, group_by, measures, attribution, source_credit, withheld_tiers, withheld_columns, freshness, build, build_state, restriction].hash
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
# Builds the object from hash
|
|
365
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
366
|
+
# @return [Object] Returns the model itself
|
|
367
|
+
def self.build_from_hash(attributes)
|
|
368
|
+
return nil unless attributes.is_a?(Hash)
|
|
369
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
370
|
+
transformed_hash = {}
|
|
371
|
+
openapi_types.each_pair do |key, type|
|
|
372
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
373
|
+
transformed_hash["#{key}"] = nil
|
|
374
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
375
|
+
# check to ensure the input is an array given that the attribute
|
|
376
|
+
# is documented as an array but the input is not
|
|
377
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
378
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
379
|
+
end
|
|
380
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
381
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
382
|
+
end
|
|
383
|
+
end
|
|
384
|
+
new(transformed_hash)
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
# Deserializes the data based on type
|
|
388
|
+
# @param string type Data type
|
|
389
|
+
# @param string value Value to be deserialized
|
|
390
|
+
# @return [Object] Deserialized data
|
|
391
|
+
def self._deserialize(type, value)
|
|
392
|
+
case type.to_sym
|
|
393
|
+
when :Time
|
|
394
|
+
Time.parse(value)
|
|
395
|
+
when :Date
|
|
396
|
+
Date.parse(value)
|
|
397
|
+
when :String
|
|
398
|
+
value.to_s
|
|
399
|
+
when :Integer
|
|
400
|
+
value.to_i
|
|
401
|
+
when :Float
|
|
402
|
+
value.to_f
|
|
403
|
+
when :Boolean
|
|
404
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
405
|
+
true
|
|
406
|
+
else
|
|
407
|
+
false
|
|
408
|
+
end
|
|
409
|
+
when :Object
|
|
410
|
+
# generic object (usually a Hash), return directly
|
|
411
|
+
value
|
|
412
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
413
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
414
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
415
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
416
|
+
k_type = Regexp.last_match[:k_type]
|
|
417
|
+
v_type = Regexp.last_match[:v_type]
|
|
418
|
+
{}.tap do |hash|
|
|
419
|
+
value.each do |k, v|
|
|
420
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
421
|
+
end
|
|
422
|
+
end
|
|
423
|
+
else # model
|
|
424
|
+
# models (e.g. Pet) or oneOf
|
|
425
|
+
klass = PharmaObservatory.const_get(type)
|
|
426
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
427
|
+
end
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
# Returns the string representation of the object
|
|
431
|
+
# @return [String] String presentation of the object
|
|
432
|
+
def to_s
|
|
433
|
+
to_hash.to_s
|
|
434
|
+
end
|
|
435
|
+
|
|
436
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
437
|
+
# @return [Hash] Returns the object in the form of hash
|
|
438
|
+
def to_body
|
|
439
|
+
to_hash
|
|
440
|
+
end
|
|
441
|
+
|
|
442
|
+
# Returns the object in the form of hash
|
|
443
|
+
# @return [Hash] Returns the object in the form of hash
|
|
444
|
+
def to_hash
|
|
445
|
+
hash = {}
|
|
446
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
447
|
+
value = self.send(attr)
|
|
448
|
+
if value.nil?
|
|
449
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
450
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
451
|
+
end
|
|
452
|
+
|
|
453
|
+
hash[param] = _to_hash(value)
|
|
454
|
+
end
|
|
455
|
+
hash
|
|
456
|
+
end
|
|
457
|
+
|
|
458
|
+
# Outputs non-array value in the form of hash
|
|
459
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
460
|
+
# @param [Object] value Any valid value
|
|
461
|
+
# @return [Hash] Returns the value in the form of hash
|
|
462
|
+
def _to_hash(value)
|
|
463
|
+
if value.is_a?(Array)
|
|
464
|
+
value.compact.map { |v| _to_hash(v) }
|
|
465
|
+
elsif value.is_a?(Hash)
|
|
466
|
+
{}.tap do |hash|
|
|
467
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
468
|
+
end
|
|
469
|
+
elsif value.respond_to? :to_hash
|
|
470
|
+
value.to_hash
|
|
471
|
+
else
|
|
472
|
+
value
|
|
473
|
+
end
|
|
474
|
+
end
|
|
475
|
+
|
|
476
|
+
end
|
|
477
|
+
|
|
478
|
+
end
|