pharmaobservatory 0.1.13 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -4
  3. data/docs/BiomarkerValidationRow.md +1 -1
  4. data/docs/ChangesList200Response.md +26 -0
  5. data/docs/ChangesList200ResponseBuildState.md +20 -0
  6. data/docs/ChangesList200ResponseItemsInner.md +48 -0
  7. data/docs/ChangesList200ResponseItemsInnerEntryKeys.md +18 -0
  8. data/docs/CompanyFinancialsRow.md +18 -0
  9. data/docs/ConditionAdverseEventsRow.md +5 -1
  10. data/docs/SubscriptionsApi.md +282 -0
  11. data/docs/SubscriptionsCreate201Response.md +22 -0
  12. data/docs/SubscriptionsCreate201ResponseSubscription.md +28 -0
  13. data/docs/SubscriptionsCreate201ResponseSubscriptionTarget.md +22 -0
  14. data/docs/SubscriptionsCreateRequest.md +20 -0
  15. data/docs/SubscriptionsDelete200Response.md +24 -0
  16. data/docs/SubscriptionsList200Response.md +22 -0
  17. data/docs/SubscriptionsList200ResponseSubscriptionsInner.md +28 -0
  18. data/docs/SubscriptionsList200ResponseSubscriptionsInnerTarget.md +26 -0
  19. data/docs/SubscriptionsList200ResponseSubscriptionsInnerTargetFilters.md +18 -0
  20. data/lib/pharmaobservatory/api/subscriptions_api.rb +261 -0
  21. data/lib/pharmaobservatory/models/biomarker_validation_row.rb +1 -1
  22. data/lib/pharmaobservatory/models/changes_list200_response.rb +343 -0
  23. data/lib/pharmaobservatory/models/changes_list200_response_build_state.rb +263 -0
  24. data/lib/pharmaobservatory/models/changes_list200_response_items_inner.rb +627 -0
  25. data/lib/pharmaobservatory/models/changes_list200_response_items_inner_entry_keys.rb +237 -0
  26. data/lib/pharmaobservatory/models/company_financials_row.rb +100 -1
  27. data/lib/pharmaobservatory/models/condition_adverse_events_row.rb +27 -5
  28. data/lib/pharmaobservatory/models/subscriptions_create201_response.rb +289 -0
  29. data/lib/pharmaobservatory/models/subscriptions_create201_response_subscription.rb +369 -0
  30. data/lib/pharmaobservatory/models/subscriptions_create201_response_subscription_target.rb +289 -0
  31. data/lib/pharmaobservatory/models/subscriptions_create_request.rb +263 -0
  32. data/lib/pharmaobservatory/models/subscriptions_delete200_response.rb +315 -0
  33. data/lib/pharmaobservatory/models/subscriptions_list200_response.rb +291 -0
  34. data/lib/pharmaobservatory/models/subscriptions_list200_response_subscriptions_inner.rb +369 -0
  35. data/lib/pharmaobservatory/models/subscriptions_list200_response_subscriptions_inner_target.rb +277 -0
  36. data/lib/pharmaobservatory/models/subscriptions_list200_response_subscriptions_inner_target_filters.rb +237 -0
  37. data/lib/pharmaobservatory/version.rb +1 -1
  38. data/lib/pharmaobservatory.rb +14 -0
  39. metadata +30 -2
@@ -0,0 +1,315 @@
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 SubscriptionsDelete200Response
18
+ attr_accessor :deleted
19
+
20
+ attr_accessor :id
21
+
22
+ attr_accessor :label
23
+
24
+ attr_accessor :build_state
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'deleted' => :'deleted',
30
+ :'id' => :'id',
31
+ :'label' => :'label',
32
+ :'build_state' => :'build_state'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'deleted' => :'Boolean',
50
+ :'id' => :'Integer',
51
+ :'label' => :'String',
52
+ :'build_state' => :'ChangesList200ResponseBuildState'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PharmaObservatory::SubscriptionsDelete200Response` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PharmaObservatory::SubscriptionsDelete200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'deleted')
79
+ self.deleted = attributes[:'deleted']
80
+ else
81
+ self.deleted = nil
82
+ end
83
+
84
+ if attributes.key?(:'id')
85
+ self.id = attributes[:'id']
86
+ else
87
+ self.id = nil
88
+ end
89
+
90
+ if attributes.key?(:'label')
91
+ self.label = attributes[:'label']
92
+ else
93
+ self.label = nil
94
+ end
95
+
96
+ if attributes.key?(:'build_state')
97
+ self.build_state = attributes[:'build_state']
98
+ else
99
+ self.build_state = nil
100
+ end
101
+ end
102
+
103
+ # Show invalid properties with the reasons. Usually used together with valid?
104
+ # @return Array for valid properties with the reasons
105
+ def list_invalid_properties
106
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
107
+ invalid_properties = Array.new
108
+ if @deleted.nil?
109
+ invalid_properties.push('invalid value for "deleted", deleted cannot be nil.')
110
+ end
111
+
112
+ if @id.nil?
113
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
114
+ end
115
+
116
+ if @label.nil?
117
+ invalid_properties.push('invalid value for "label", label cannot be nil.')
118
+ end
119
+
120
+ if @build_state.nil?
121
+ invalid_properties.push('invalid value for "build_state", build_state cannot be nil.')
122
+ end
123
+
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ warn '[DEPRECATED] the `valid?` method is obsolete'
131
+ return false if @deleted.nil?
132
+ return false if @id.nil?
133
+ return false if @label.nil?
134
+ return false if @build_state.nil?
135
+ true
136
+ end
137
+
138
+ # Custom attribute writer method with validation
139
+ # @param [Object] deleted Value to be assigned
140
+ def deleted=(deleted)
141
+ if deleted.nil?
142
+ fail ArgumentError, 'deleted cannot be nil'
143
+ end
144
+
145
+ @deleted = deleted
146
+ end
147
+
148
+ # Custom attribute writer method with validation
149
+ # @param [Object] id Value to be assigned
150
+ def id=(id)
151
+ if id.nil?
152
+ fail ArgumentError, 'id cannot be nil'
153
+ end
154
+
155
+ @id = id
156
+ end
157
+
158
+ # Custom attribute writer method with validation
159
+ # @param [Object] label Value to be assigned
160
+ def label=(label)
161
+ if label.nil?
162
+ fail ArgumentError, 'label cannot be nil'
163
+ end
164
+
165
+ @label = label
166
+ end
167
+
168
+ # Custom attribute writer method with validation
169
+ # @param [Object] build_state Value to be assigned
170
+ def build_state=(build_state)
171
+ if build_state.nil?
172
+ fail ArgumentError, 'build_state cannot be nil'
173
+ end
174
+
175
+ @build_state = build_state
176
+ end
177
+
178
+ # Checks equality by comparing each attribute.
179
+ # @param [Object] Object to be compared
180
+ def ==(o)
181
+ return true if self.equal?(o)
182
+ self.class == o.class &&
183
+ deleted == o.deleted &&
184
+ id == o.id &&
185
+ label == o.label &&
186
+ build_state == o.build_state
187
+ end
188
+
189
+ # @see the `==` method
190
+ # @param [Object] Object to be compared
191
+ def eql?(o)
192
+ self == o
193
+ end
194
+
195
+ # Calculates hash code according to all attributes.
196
+ # @return [Integer] Hash code
197
+ def hash
198
+ [deleted, id, label, build_state].hash
199
+ end
200
+
201
+ # Builds the object from hash
202
+ # @param [Hash] attributes Model attributes in the form of hash
203
+ # @return [Object] Returns the model itself
204
+ def self.build_from_hash(attributes)
205
+ return nil unless attributes.is_a?(Hash)
206
+ attributes = attributes.transform_keys(&:to_sym)
207
+ transformed_hash = {}
208
+ openapi_types.each_pair do |key, type|
209
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
210
+ transformed_hash["#{key}"] = nil
211
+ elsif type =~ /\AArray<(.*)>/i
212
+ # check to ensure the input is an array given that the attribute
213
+ # is documented as an array but the input is not
214
+ if attributes[attribute_map[key]].is_a?(Array)
215
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
216
+ end
217
+ elsif !attributes[attribute_map[key]].nil?
218
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
219
+ end
220
+ end
221
+ new(transformed_hash)
222
+ end
223
+
224
+ # Deserializes the data based on type
225
+ # @param string type Data type
226
+ # @param string value Value to be deserialized
227
+ # @return [Object] Deserialized data
228
+ def self._deserialize(type, value)
229
+ case type.to_sym
230
+ when :Time
231
+ Time.parse(value)
232
+ when :Date
233
+ Date.parse(value)
234
+ when :String
235
+ value.to_s
236
+ when :Integer
237
+ value.to_i
238
+ when :Float
239
+ value.to_f
240
+ when :Boolean
241
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
242
+ true
243
+ else
244
+ false
245
+ end
246
+ when :Object
247
+ # generic object (usually a Hash), return directly
248
+ value
249
+ when /\AArray<(?<inner_type>.+)>\z/
250
+ inner_type = Regexp.last_match[:inner_type]
251
+ value.map { |v| _deserialize(inner_type, v) }
252
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
253
+ k_type = Regexp.last_match[:k_type]
254
+ v_type = Regexp.last_match[:v_type]
255
+ {}.tap do |hash|
256
+ value.each do |k, v|
257
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
258
+ end
259
+ end
260
+ else # model
261
+ # models (e.g. Pet) or oneOf
262
+ klass = PharmaObservatory.const_get(type)
263
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
264
+ end
265
+ end
266
+
267
+ # Returns the string representation of the object
268
+ # @return [String] String presentation of the object
269
+ def to_s
270
+ to_hash.to_s
271
+ end
272
+
273
+ # to_body is an alias to to_hash (backward compatibility)
274
+ # @return [Hash] Returns the object in the form of hash
275
+ def to_body
276
+ to_hash
277
+ end
278
+
279
+ # Returns the object in the form of hash
280
+ # @return [Hash] Returns the object in the form of hash
281
+ def to_hash
282
+ hash = {}
283
+ self.class.attribute_map.each_pair do |attr, param|
284
+ value = self.send(attr)
285
+ if value.nil?
286
+ is_nullable = self.class.openapi_nullable.include?(attr)
287
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
288
+ end
289
+
290
+ hash[param] = _to_hash(value)
291
+ end
292
+ hash
293
+ end
294
+
295
+ # Outputs non-array value in the form of hash
296
+ # For object, use to_hash. Otherwise, just return the value
297
+ # @param [Object] value Any valid value
298
+ # @return [Hash] Returns the value in the form of hash
299
+ def _to_hash(value)
300
+ if value.is_a?(Array)
301
+ value.compact.map { |v| _to_hash(v) }
302
+ elsif value.is_a?(Hash)
303
+ {}.tap do |hash|
304
+ value.each { |k, v| hash[k] = _to_hash(v) }
305
+ end
306
+ elsif value.respond_to? :to_hash
307
+ value.to_hash
308
+ else
309
+ value
310
+ end
311
+ end
312
+
313
+ end
314
+
315
+ end
@@ -0,0 +1,291 @@
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 SubscriptionsList200Response
18
+ attr_accessor :subscriptions
19
+
20
+ attr_accessor :count
21
+
22
+ attr_accessor :build_state
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'subscriptions' => :'subscriptions',
28
+ :'count' => :'count',
29
+ :'build_state' => :'build_state'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'subscriptions' => :'Array<SubscriptionsList200ResponseSubscriptionsInner>',
47
+ :'count' => :'Integer',
48
+ :'build_state' => :'ChangesList200ResponseBuildState'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PharmaObservatory::SubscriptionsList200Response` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PharmaObservatory::SubscriptionsList200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'subscriptions')
75
+ if (value = attributes[:'subscriptions']).is_a?(Array)
76
+ self.subscriptions = value
77
+ end
78
+ else
79
+ self.subscriptions = nil
80
+ end
81
+
82
+ if attributes.key?(:'count')
83
+ self.count = attributes[:'count']
84
+ else
85
+ self.count = nil
86
+ end
87
+
88
+ if attributes.key?(:'build_state')
89
+ self.build_state = attributes[:'build_state']
90
+ else
91
+ self.build_state = nil
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ if @subscriptions.nil?
101
+ invalid_properties.push('invalid value for "subscriptions", subscriptions cannot be nil.')
102
+ end
103
+
104
+ if @count.nil?
105
+ invalid_properties.push('invalid value for "count", count cannot be nil.')
106
+ end
107
+
108
+ if @build_state.nil?
109
+ invalid_properties.push('invalid value for "build_state", build_state cannot be nil.')
110
+ end
111
+
112
+ invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ warn '[DEPRECATED] the `valid?` method is obsolete'
119
+ return false if @subscriptions.nil?
120
+ return false if @count.nil?
121
+ return false if @build_state.nil?
122
+ true
123
+ end
124
+
125
+ # Custom attribute writer method with validation
126
+ # @param [Object] subscriptions Value to be assigned
127
+ def subscriptions=(subscriptions)
128
+ if subscriptions.nil?
129
+ fail ArgumentError, 'subscriptions cannot be nil'
130
+ end
131
+
132
+ @subscriptions = subscriptions
133
+ end
134
+
135
+ # Custom attribute writer method with validation
136
+ # @param [Object] count Value to be assigned
137
+ def count=(count)
138
+ if count.nil?
139
+ fail ArgumentError, 'count cannot be nil'
140
+ end
141
+
142
+ @count = count
143
+ end
144
+
145
+ # Custom attribute writer method with validation
146
+ # @param [Object] build_state Value to be assigned
147
+ def build_state=(build_state)
148
+ if build_state.nil?
149
+ fail ArgumentError, 'build_state cannot be nil'
150
+ end
151
+
152
+ @build_state = build_state
153
+ end
154
+
155
+ # Checks equality by comparing each attribute.
156
+ # @param [Object] Object to be compared
157
+ def ==(o)
158
+ return true if self.equal?(o)
159
+ self.class == o.class &&
160
+ subscriptions == o.subscriptions &&
161
+ count == o.count &&
162
+ build_state == o.build_state
163
+ end
164
+
165
+ # @see the `==` method
166
+ # @param [Object] Object to be compared
167
+ def eql?(o)
168
+ self == o
169
+ end
170
+
171
+ # Calculates hash code according to all attributes.
172
+ # @return [Integer] Hash code
173
+ def hash
174
+ [subscriptions, count, build_state].hash
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def self.build_from_hash(attributes)
181
+ return nil unless attributes.is_a?(Hash)
182
+ attributes = attributes.transform_keys(&:to_sym)
183
+ transformed_hash = {}
184
+ openapi_types.each_pair do |key, type|
185
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
186
+ transformed_hash["#{key}"] = nil
187
+ elsif type =~ /\AArray<(.*)>/i
188
+ # check to ensure the input is an array given that the attribute
189
+ # is documented as an array but the input is not
190
+ if attributes[attribute_map[key]].is_a?(Array)
191
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
192
+ end
193
+ elsif !attributes[attribute_map[key]].nil?
194
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
195
+ end
196
+ end
197
+ new(transformed_hash)
198
+ end
199
+
200
+ # Deserializes the data based on type
201
+ # @param string type Data type
202
+ # @param string value Value to be deserialized
203
+ # @return [Object] Deserialized data
204
+ def self._deserialize(type, value)
205
+ case type.to_sym
206
+ when :Time
207
+ Time.parse(value)
208
+ when :Date
209
+ Date.parse(value)
210
+ when :String
211
+ value.to_s
212
+ when :Integer
213
+ value.to_i
214
+ when :Float
215
+ value.to_f
216
+ when :Boolean
217
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
218
+ true
219
+ else
220
+ false
221
+ end
222
+ when :Object
223
+ # generic object (usually a Hash), return directly
224
+ value
225
+ when /\AArray<(?<inner_type>.+)>\z/
226
+ inner_type = Regexp.last_match[:inner_type]
227
+ value.map { |v| _deserialize(inner_type, v) }
228
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
229
+ k_type = Regexp.last_match[:k_type]
230
+ v_type = Regexp.last_match[:v_type]
231
+ {}.tap do |hash|
232
+ value.each do |k, v|
233
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
234
+ end
235
+ end
236
+ else # model
237
+ # models (e.g. Pet) or oneOf
238
+ klass = PharmaObservatory.const_get(type)
239
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
240
+ end
241
+ end
242
+
243
+ # Returns the string representation of the object
244
+ # @return [String] String presentation of the object
245
+ def to_s
246
+ to_hash.to_s
247
+ end
248
+
249
+ # to_body is an alias to to_hash (backward compatibility)
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_body
252
+ to_hash
253
+ end
254
+
255
+ # Returns the object in the form of hash
256
+ # @return [Hash] Returns the object in the form of hash
257
+ def to_hash
258
+ hash = {}
259
+ self.class.attribute_map.each_pair do |attr, param|
260
+ value = self.send(attr)
261
+ if value.nil?
262
+ is_nullable = self.class.openapi_nullable.include?(attr)
263
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
264
+ end
265
+
266
+ hash[param] = _to_hash(value)
267
+ end
268
+ hash
269
+ end
270
+
271
+ # Outputs non-array value in the form of hash
272
+ # For object, use to_hash. Otherwise, just return the value
273
+ # @param [Object] value Any valid value
274
+ # @return [Hash] Returns the value in the form of hash
275
+ def _to_hash(value)
276
+ if value.is_a?(Array)
277
+ value.compact.map { |v| _to_hash(v) }
278
+ elsif value.is_a?(Hash)
279
+ {}.tap do |hash|
280
+ value.each { |k, v| hash[k] = _to_hash(v) }
281
+ end
282
+ elsif value.respond_to? :to_hash
283
+ value.to_hash
284
+ else
285
+ value
286
+ end
287
+ end
288
+
289
+ end
290
+
291
+ end