pharmaobservatory 0.1.13 → 0.1.15
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 +25 -5
- data/docs/BiomarkerValidationRow.md +1 -1
- data/docs/ChangesList200Response.md +26 -0
- data/docs/ChangesList200ResponseBuildState.md +20 -0
- data/docs/ChangesList200ResponseItemsInner.md +48 -0
- data/docs/ChangesList200ResponseItemsInnerEntryKeys.md +18 -0
- data/docs/CompaniesApi.md +86 -4
- data/docs/CompanyAssetCollisionsResponse.md +58 -0
- data/docs/CompanyAssetCollisionsRow.md +68 -0
- data/docs/CompanyCompetitorsRow.md +16 -32
- data/docs/CompanyFinancialsRow.md +18 -0
- data/docs/ConditionAdverseEventsRow.md +5 -1
- data/docs/SubscriptionsApi.md +282 -0
- data/docs/SubscriptionsCreate201Response.md +22 -0
- data/docs/SubscriptionsCreate201ResponseSubscription.md +28 -0
- data/docs/SubscriptionsCreate201ResponseSubscriptionTarget.md +22 -0
- data/docs/SubscriptionsCreateRequest.md +20 -0
- data/docs/SubscriptionsDelete200Response.md +24 -0
- data/docs/SubscriptionsList200Response.md +22 -0
- data/docs/SubscriptionsList200ResponseSubscriptionsInner.md +28 -0
- data/docs/SubscriptionsList200ResponseSubscriptionsInnerTarget.md +26 -0
- data/docs/SubscriptionsList200ResponseSubscriptionsInnerTargetFilters.md +18 -0
- data/lib/pharmaobservatory/api/companies_api.rb +93 -2
- data/lib/pharmaobservatory/api/subscriptions_api.rb +261 -0
- data/lib/pharmaobservatory/models/biomarker_validation_row.rb +1 -1
- data/lib/pharmaobservatory/models/changes_list200_response.rb +343 -0
- data/lib/pharmaobservatory/models/changes_list200_response_build_state.rb +263 -0
- data/lib/pharmaobservatory/models/changes_list200_response_items_inner.rb +627 -0
- data/lib/pharmaobservatory/models/changes_list200_response_items_inner_entry_keys.rb +237 -0
- data/lib/pharmaobservatory/models/company_asset_collisions_response.rb +478 -0
- data/lib/pharmaobservatory/models/company_asset_collisions_row.rb +502 -0
- data/lib/pharmaobservatory/models/company_competitors_row.rb +61 -153
- data/lib/pharmaobservatory/models/company_financials_row.rb +100 -1
- data/lib/pharmaobservatory/models/condition_adverse_events_row.rb +27 -5
- data/lib/pharmaobservatory/models/subscriptions_create201_response.rb +289 -0
- data/lib/pharmaobservatory/models/subscriptions_create201_response_subscription.rb +369 -0
- data/lib/pharmaobservatory/models/subscriptions_create201_response_subscription_target.rb +289 -0
- data/lib/pharmaobservatory/models/subscriptions_create_request.rb +263 -0
- data/lib/pharmaobservatory/models/subscriptions_delete200_response.rb +315 -0
- data/lib/pharmaobservatory/models/subscriptions_list200_response.rb +291 -0
- data/lib/pharmaobservatory/models/subscriptions_list200_response_subscriptions_inner.rb +369 -0
- data/lib/pharmaobservatory/models/subscriptions_list200_response_subscriptions_inner_target.rb +277 -0
- data/lib/pharmaobservatory/models/subscriptions_list200_response_subscriptions_inner_target_filters.rb +237 -0
- data/lib/pharmaobservatory/version.rb +1 -1
- data/lib/pharmaobservatory.rb +16 -0
- metadata +34 -2
|
@@ -0,0 +1,627 @@
|
|
|
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 ChangesList200ResponseItemsInner
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
attr_accessor :subscription_id
|
|
21
|
+
|
|
22
|
+
attr_accessor :event_id
|
|
23
|
+
|
|
24
|
+
attr_accessor :dataset
|
|
25
|
+
|
|
26
|
+
attr_accessor :key
|
|
27
|
+
|
|
28
|
+
attr_accessor :title
|
|
29
|
+
|
|
30
|
+
attr_accessor :event_type
|
|
31
|
+
|
|
32
|
+
attr_accessor :event_label
|
|
33
|
+
|
|
34
|
+
attr_accessor :field
|
|
35
|
+
|
|
36
|
+
attr_accessor :old_value
|
|
37
|
+
|
|
38
|
+
attr_accessor :new_value
|
|
39
|
+
|
|
40
|
+
attr_accessor :source_date
|
|
41
|
+
|
|
42
|
+
attr_accessor :observed_at
|
|
43
|
+
|
|
44
|
+
attr_accessor :match_kind
|
|
45
|
+
|
|
46
|
+
attr_accessor :entry_keys
|
|
47
|
+
|
|
48
|
+
attr_accessor :source_credit
|
|
49
|
+
|
|
50
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
51
|
+
def self.attribute_map
|
|
52
|
+
{
|
|
53
|
+
:'id' => :'id',
|
|
54
|
+
:'subscription_id' => :'subscription_id',
|
|
55
|
+
:'event_id' => :'event_id',
|
|
56
|
+
:'dataset' => :'dataset',
|
|
57
|
+
:'key' => :'key',
|
|
58
|
+
:'title' => :'title',
|
|
59
|
+
:'event_type' => :'event_type',
|
|
60
|
+
:'event_label' => :'event_label',
|
|
61
|
+
:'field' => :'field',
|
|
62
|
+
:'old_value' => :'old_value',
|
|
63
|
+
:'new_value' => :'new_value',
|
|
64
|
+
:'source_date' => :'source_date',
|
|
65
|
+
:'observed_at' => :'observed_at',
|
|
66
|
+
:'match_kind' => :'match_kind',
|
|
67
|
+
:'entry_keys' => :'entry_keys',
|
|
68
|
+
:'source_credit' => :'source_credit'
|
|
69
|
+
}
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Returns attribute mapping this model knows about
|
|
73
|
+
def self.acceptable_attribute_map
|
|
74
|
+
attribute_map
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Returns all the JSON keys this model knows about
|
|
78
|
+
def self.acceptable_attributes
|
|
79
|
+
acceptable_attribute_map.values
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Attribute type mapping.
|
|
83
|
+
def self.openapi_types
|
|
84
|
+
{
|
|
85
|
+
:'id' => :'Integer',
|
|
86
|
+
:'subscription_id' => :'Integer',
|
|
87
|
+
:'event_id' => :'String',
|
|
88
|
+
:'dataset' => :'String',
|
|
89
|
+
:'key' => :'String',
|
|
90
|
+
:'title' => :'String',
|
|
91
|
+
:'event_type' => :'String',
|
|
92
|
+
:'event_label' => :'String',
|
|
93
|
+
:'field' => :'String',
|
|
94
|
+
:'old_value' => :'String',
|
|
95
|
+
:'new_value' => :'String',
|
|
96
|
+
:'source_date' => :'String',
|
|
97
|
+
:'observed_at' => :'String',
|
|
98
|
+
:'match_kind' => :'String',
|
|
99
|
+
:'entry_keys' => :'ChangesList200ResponseItemsInnerEntryKeys',
|
|
100
|
+
:'source_credit' => :'String'
|
|
101
|
+
}
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# List of attributes with nullable: true
|
|
105
|
+
def self.openapi_nullable
|
|
106
|
+
Set.new([
|
|
107
|
+
])
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Initializes the object
|
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
112
|
+
def initialize(attributes = {})
|
|
113
|
+
if (!attributes.is_a?(Hash))
|
|
114
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PharmaObservatory::ChangesList200ResponseItemsInner` initialize method"
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
118
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
119
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
120
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
121
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PharmaObservatory::ChangesList200ResponseItemsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
122
|
+
end
|
|
123
|
+
h[k.to_sym] = v
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'id')
|
|
127
|
+
self.id = attributes[:'id']
|
|
128
|
+
else
|
|
129
|
+
self.id = nil
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'subscription_id')
|
|
133
|
+
self.subscription_id = attributes[:'subscription_id']
|
|
134
|
+
else
|
|
135
|
+
self.subscription_id = nil
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'event_id')
|
|
139
|
+
self.event_id = attributes[:'event_id']
|
|
140
|
+
else
|
|
141
|
+
self.event_id = nil
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'dataset')
|
|
145
|
+
self.dataset = attributes[:'dataset']
|
|
146
|
+
else
|
|
147
|
+
self.dataset = nil
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if attributes.key?(:'key')
|
|
151
|
+
self.key = attributes[:'key']
|
|
152
|
+
else
|
|
153
|
+
self.key = nil
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'title')
|
|
157
|
+
self.title = attributes[:'title']
|
|
158
|
+
else
|
|
159
|
+
self.title = nil
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if attributes.key?(:'event_type')
|
|
163
|
+
self.event_type = attributes[:'event_type']
|
|
164
|
+
else
|
|
165
|
+
self.event_type = nil
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if attributes.key?(:'event_label')
|
|
169
|
+
self.event_label = attributes[:'event_label']
|
|
170
|
+
else
|
|
171
|
+
self.event_label = nil
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if attributes.key?(:'field')
|
|
175
|
+
self.field = attributes[:'field']
|
|
176
|
+
else
|
|
177
|
+
self.field = nil
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
if attributes.key?(:'old_value')
|
|
181
|
+
self.old_value = attributes[:'old_value']
|
|
182
|
+
else
|
|
183
|
+
self.old_value = nil
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
if attributes.key?(:'new_value')
|
|
187
|
+
self.new_value = attributes[:'new_value']
|
|
188
|
+
else
|
|
189
|
+
self.new_value = nil
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
if attributes.key?(:'source_date')
|
|
193
|
+
self.source_date = attributes[:'source_date']
|
|
194
|
+
else
|
|
195
|
+
self.source_date = nil
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
if attributes.key?(:'observed_at')
|
|
199
|
+
self.observed_at = attributes[:'observed_at']
|
|
200
|
+
else
|
|
201
|
+
self.observed_at = nil
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
if attributes.key?(:'match_kind')
|
|
205
|
+
self.match_kind = attributes[:'match_kind']
|
|
206
|
+
else
|
|
207
|
+
self.match_kind = nil
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
if attributes.key?(:'entry_keys')
|
|
211
|
+
self.entry_keys = attributes[:'entry_keys']
|
|
212
|
+
else
|
|
213
|
+
self.entry_keys = nil
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
if attributes.key?(:'source_credit')
|
|
217
|
+
self.source_credit = attributes[:'source_credit']
|
|
218
|
+
else
|
|
219
|
+
self.source_credit = nil
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
224
|
+
# @return Array for valid properties with the reasons
|
|
225
|
+
def list_invalid_properties
|
|
226
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
227
|
+
invalid_properties = Array.new
|
|
228
|
+
if @id.nil?
|
|
229
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
if @subscription_id.nil?
|
|
233
|
+
invalid_properties.push('invalid value for "subscription_id", subscription_id cannot be nil.')
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
if @event_id.nil?
|
|
237
|
+
invalid_properties.push('invalid value for "event_id", event_id cannot be nil.')
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
if @dataset.nil?
|
|
241
|
+
invalid_properties.push('invalid value for "dataset", dataset cannot be nil.')
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
if @key.nil?
|
|
245
|
+
invalid_properties.push('invalid value for "key", key cannot be nil.')
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
if @title.nil?
|
|
249
|
+
invalid_properties.push('invalid value for "title", title cannot be nil.')
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
if @event_type.nil?
|
|
253
|
+
invalid_properties.push('invalid value for "event_type", event_type cannot be nil.')
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
if @event_label.nil?
|
|
257
|
+
invalid_properties.push('invalid value for "event_label", event_label cannot be nil.')
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
if @field.nil?
|
|
261
|
+
invalid_properties.push('invalid value for "field", field cannot be nil.')
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
if @old_value.nil?
|
|
265
|
+
invalid_properties.push('invalid value for "old_value", old_value cannot be nil.')
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
if @new_value.nil?
|
|
269
|
+
invalid_properties.push('invalid value for "new_value", new_value cannot be nil.')
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
if @source_date.nil?
|
|
273
|
+
invalid_properties.push('invalid value for "source_date", source_date cannot be nil.')
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
if @observed_at.nil?
|
|
277
|
+
invalid_properties.push('invalid value for "observed_at", observed_at cannot be nil.')
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
if @match_kind.nil?
|
|
281
|
+
invalid_properties.push('invalid value for "match_kind", match_kind cannot be nil.')
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
if @entry_keys.nil?
|
|
285
|
+
invalid_properties.push('invalid value for "entry_keys", entry_keys cannot be nil.')
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
if @source_credit.nil?
|
|
289
|
+
invalid_properties.push('invalid value for "source_credit", source_credit cannot be nil.')
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
invalid_properties
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
# Check to see if the all the properties in the model are valid
|
|
296
|
+
# @return true if the model is valid
|
|
297
|
+
def valid?
|
|
298
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
299
|
+
return false if @id.nil?
|
|
300
|
+
return false if @subscription_id.nil?
|
|
301
|
+
return false if @event_id.nil?
|
|
302
|
+
return false if @dataset.nil?
|
|
303
|
+
return false if @key.nil?
|
|
304
|
+
return false if @title.nil?
|
|
305
|
+
return false if @event_type.nil?
|
|
306
|
+
return false if @event_label.nil?
|
|
307
|
+
return false if @field.nil?
|
|
308
|
+
return false if @old_value.nil?
|
|
309
|
+
return false if @new_value.nil?
|
|
310
|
+
return false if @source_date.nil?
|
|
311
|
+
return false if @observed_at.nil?
|
|
312
|
+
return false if @match_kind.nil?
|
|
313
|
+
return false if @entry_keys.nil?
|
|
314
|
+
return false if @source_credit.nil?
|
|
315
|
+
true
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# Custom attribute writer method with validation
|
|
319
|
+
# @param [Object] id Value to be assigned
|
|
320
|
+
def id=(id)
|
|
321
|
+
if id.nil?
|
|
322
|
+
fail ArgumentError, 'id cannot be nil'
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
@id = id
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
# Custom attribute writer method with validation
|
|
329
|
+
# @param [Object] subscription_id Value to be assigned
|
|
330
|
+
def subscription_id=(subscription_id)
|
|
331
|
+
if subscription_id.nil?
|
|
332
|
+
fail ArgumentError, 'subscription_id cannot be nil'
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
@subscription_id = subscription_id
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
# Custom attribute writer method with validation
|
|
339
|
+
# @param [Object] event_id Value to be assigned
|
|
340
|
+
def event_id=(event_id)
|
|
341
|
+
if event_id.nil?
|
|
342
|
+
fail ArgumentError, 'event_id cannot be nil'
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
@event_id = event_id
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
# Custom attribute writer method with validation
|
|
349
|
+
# @param [Object] dataset Value to be assigned
|
|
350
|
+
def dataset=(dataset)
|
|
351
|
+
if dataset.nil?
|
|
352
|
+
fail ArgumentError, 'dataset cannot be nil'
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
@dataset = dataset
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
# Custom attribute writer method with validation
|
|
359
|
+
# @param [Object] key Value to be assigned
|
|
360
|
+
def key=(key)
|
|
361
|
+
if key.nil?
|
|
362
|
+
fail ArgumentError, 'key cannot be nil'
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
@key = key
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
# Custom attribute writer method with validation
|
|
369
|
+
# @param [Object] title Value to be assigned
|
|
370
|
+
def title=(title)
|
|
371
|
+
if title.nil?
|
|
372
|
+
fail ArgumentError, 'title cannot be nil'
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
@title = title
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
# Custom attribute writer method with validation
|
|
379
|
+
# @param [Object] event_type Value to be assigned
|
|
380
|
+
def event_type=(event_type)
|
|
381
|
+
if event_type.nil?
|
|
382
|
+
fail ArgumentError, 'event_type cannot be nil'
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
@event_type = event_type
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
# Custom attribute writer method with validation
|
|
389
|
+
# @param [Object] event_label Value to be assigned
|
|
390
|
+
def event_label=(event_label)
|
|
391
|
+
if event_label.nil?
|
|
392
|
+
fail ArgumentError, 'event_label cannot be nil'
|
|
393
|
+
end
|
|
394
|
+
|
|
395
|
+
@event_label = event_label
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
# Custom attribute writer method with validation
|
|
399
|
+
# @param [Object] field Value to be assigned
|
|
400
|
+
def field=(field)
|
|
401
|
+
if field.nil?
|
|
402
|
+
fail ArgumentError, 'field cannot be nil'
|
|
403
|
+
end
|
|
404
|
+
|
|
405
|
+
@field = field
|
|
406
|
+
end
|
|
407
|
+
|
|
408
|
+
# Custom attribute writer method with validation
|
|
409
|
+
# @param [Object] old_value Value to be assigned
|
|
410
|
+
def old_value=(old_value)
|
|
411
|
+
if old_value.nil?
|
|
412
|
+
fail ArgumentError, 'old_value cannot be nil'
|
|
413
|
+
end
|
|
414
|
+
|
|
415
|
+
@old_value = old_value
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
# Custom attribute writer method with validation
|
|
419
|
+
# @param [Object] new_value Value to be assigned
|
|
420
|
+
def new_value=(new_value)
|
|
421
|
+
if new_value.nil?
|
|
422
|
+
fail ArgumentError, 'new_value cannot be nil'
|
|
423
|
+
end
|
|
424
|
+
|
|
425
|
+
@new_value = new_value
|
|
426
|
+
end
|
|
427
|
+
|
|
428
|
+
# Custom attribute writer method with validation
|
|
429
|
+
# @param [Object] source_date Value to be assigned
|
|
430
|
+
def source_date=(source_date)
|
|
431
|
+
if source_date.nil?
|
|
432
|
+
fail ArgumentError, 'source_date cannot be nil'
|
|
433
|
+
end
|
|
434
|
+
|
|
435
|
+
@source_date = source_date
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
# Custom attribute writer method with validation
|
|
439
|
+
# @param [Object] observed_at Value to be assigned
|
|
440
|
+
def observed_at=(observed_at)
|
|
441
|
+
if observed_at.nil?
|
|
442
|
+
fail ArgumentError, 'observed_at cannot be nil'
|
|
443
|
+
end
|
|
444
|
+
|
|
445
|
+
@observed_at = observed_at
|
|
446
|
+
end
|
|
447
|
+
|
|
448
|
+
# Custom attribute writer method with validation
|
|
449
|
+
# @param [Object] match_kind Value to be assigned
|
|
450
|
+
def match_kind=(match_kind)
|
|
451
|
+
if match_kind.nil?
|
|
452
|
+
fail ArgumentError, 'match_kind cannot be nil'
|
|
453
|
+
end
|
|
454
|
+
|
|
455
|
+
@match_kind = match_kind
|
|
456
|
+
end
|
|
457
|
+
|
|
458
|
+
# Custom attribute writer method with validation
|
|
459
|
+
# @param [Object] entry_keys Value to be assigned
|
|
460
|
+
def entry_keys=(entry_keys)
|
|
461
|
+
if entry_keys.nil?
|
|
462
|
+
fail ArgumentError, 'entry_keys cannot be nil'
|
|
463
|
+
end
|
|
464
|
+
|
|
465
|
+
@entry_keys = entry_keys
|
|
466
|
+
end
|
|
467
|
+
|
|
468
|
+
# Custom attribute writer method with validation
|
|
469
|
+
# @param [Object] source_credit Value to be assigned
|
|
470
|
+
def source_credit=(source_credit)
|
|
471
|
+
if source_credit.nil?
|
|
472
|
+
fail ArgumentError, 'source_credit cannot be nil'
|
|
473
|
+
end
|
|
474
|
+
|
|
475
|
+
@source_credit = source_credit
|
|
476
|
+
end
|
|
477
|
+
|
|
478
|
+
# Checks equality by comparing each attribute.
|
|
479
|
+
# @param [Object] Object to be compared
|
|
480
|
+
def ==(o)
|
|
481
|
+
return true if self.equal?(o)
|
|
482
|
+
self.class == o.class &&
|
|
483
|
+
id == o.id &&
|
|
484
|
+
subscription_id == o.subscription_id &&
|
|
485
|
+
event_id == o.event_id &&
|
|
486
|
+
dataset == o.dataset &&
|
|
487
|
+
key == o.key &&
|
|
488
|
+
title == o.title &&
|
|
489
|
+
event_type == o.event_type &&
|
|
490
|
+
event_label == o.event_label &&
|
|
491
|
+
field == o.field &&
|
|
492
|
+
old_value == o.old_value &&
|
|
493
|
+
new_value == o.new_value &&
|
|
494
|
+
source_date == o.source_date &&
|
|
495
|
+
observed_at == o.observed_at &&
|
|
496
|
+
match_kind == o.match_kind &&
|
|
497
|
+
entry_keys == o.entry_keys &&
|
|
498
|
+
source_credit == o.source_credit
|
|
499
|
+
end
|
|
500
|
+
|
|
501
|
+
# @see the `==` method
|
|
502
|
+
# @param [Object] Object to be compared
|
|
503
|
+
def eql?(o)
|
|
504
|
+
self == o
|
|
505
|
+
end
|
|
506
|
+
|
|
507
|
+
# Calculates hash code according to all attributes.
|
|
508
|
+
# @return [Integer] Hash code
|
|
509
|
+
def hash
|
|
510
|
+
[id, subscription_id, event_id, dataset, key, title, event_type, event_label, field, old_value, new_value, source_date, observed_at, match_kind, entry_keys, source_credit].hash
|
|
511
|
+
end
|
|
512
|
+
|
|
513
|
+
# Builds the object from hash
|
|
514
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
515
|
+
# @return [Object] Returns the model itself
|
|
516
|
+
def self.build_from_hash(attributes)
|
|
517
|
+
return nil unless attributes.is_a?(Hash)
|
|
518
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
519
|
+
transformed_hash = {}
|
|
520
|
+
openapi_types.each_pair do |key, type|
|
|
521
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
522
|
+
transformed_hash["#{key}"] = nil
|
|
523
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
524
|
+
# check to ensure the input is an array given that the attribute
|
|
525
|
+
# is documented as an array but the input is not
|
|
526
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
527
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
528
|
+
end
|
|
529
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
530
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
531
|
+
end
|
|
532
|
+
end
|
|
533
|
+
new(transformed_hash)
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
# Deserializes the data based on type
|
|
537
|
+
# @param string type Data type
|
|
538
|
+
# @param string value Value to be deserialized
|
|
539
|
+
# @return [Object] Deserialized data
|
|
540
|
+
def self._deserialize(type, value)
|
|
541
|
+
case type.to_sym
|
|
542
|
+
when :Time
|
|
543
|
+
Time.parse(value)
|
|
544
|
+
when :Date
|
|
545
|
+
Date.parse(value)
|
|
546
|
+
when :String
|
|
547
|
+
value.to_s
|
|
548
|
+
when :Integer
|
|
549
|
+
value.to_i
|
|
550
|
+
when :Float
|
|
551
|
+
value.to_f
|
|
552
|
+
when :Boolean
|
|
553
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
554
|
+
true
|
|
555
|
+
else
|
|
556
|
+
false
|
|
557
|
+
end
|
|
558
|
+
when :Object
|
|
559
|
+
# generic object (usually a Hash), return directly
|
|
560
|
+
value
|
|
561
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
562
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
563
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
564
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
565
|
+
k_type = Regexp.last_match[:k_type]
|
|
566
|
+
v_type = Regexp.last_match[:v_type]
|
|
567
|
+
{}.tap do |hash|
|
|
568
|
+
value.each do |k, v|
|
|
569
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
570
|
+
end
|
|
571
|
+
end
|
|
572
|
+
else # model
|
|
573
|
+
# models (e.g. Pet) or oneOf
|
|
574
|
+
klass = PharmaObservatory.const_get(type)
|
|
575
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
576
|
+
end
|
|
577
|
+
end
|
|
578
|
+
|
|
579
|
+
# Returns the string representation of the object
|
|
580
|
+
# @return [String] String presentation of the object
|
|
581
|
+
def to_s
|
|
582
|
+
to_hash.to_s
|
|
583
|
+
end
|
|
584
|
+
|
|
585
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
586
|
+
# @return [Hash] Returns the object in the form of hash
|
|
587
|
+
def to_body
|
|
588
|
+
to_hash
|
|
589
|
+
end
|
|
590
|
+
|
|
591
|
+
# Returns the object in the form of hash
|
|
592
|
+
# @return [Hash] Returns the object in the form of hash
|
|
593
|
+
def to_hash
|
|
594
|
+
hash = {}
|
|
595
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
596
|
+
value = self.send(attr)
|
|
597
|
+
if value.nil?
|
|
598
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
599
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
600
|
+
end
|
|
601
|
+
|
|
602
|
+
hash[param] = _to_hash(value)
|
|
603
|
+
end
|
|
604
|
+
hash
|
|
605
|
+
end
|
|
606
|
+
|
|
607
|
+
# Outputs non-array value in the form of hash
|
|
608
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
609
|
+
# @param [Object] value Any valid value
|
|
610
|
+
# @return [Hash] Returns the value in the form of hash
|
|
611
|
+
def _to_hash(value)
|
|
612
|
+
if value.is_a?(Array)
|
|
613
|
+
value.compact.map { |v| _to_hash(v) }
|
|
614
|
+
elsif value.is_a?(Hash)
|
|
615
|
+
{}.tap do |hash|
|
|
616
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
617
|
+
end
|
|
618
|
+
elsif value.respond_to? :to_hash
|
|
619
|
+
value.to_hash
|
|
620
|
+
else
|
|
621
|
+
value
|
|
622
|
+
end
|
|
623
|
+
end
|
|
624
|
+
|
|
625
|
+
end
|
|
626
|
+
|
|
627
|
+
end
|