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,369 @@
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 SubscriptionsList200ResponseSubscriptionsInner
18
+ attr_accessor :id
19
+
20
+ attr_accessor :label
21
+
22
+ attr_accessor :target
23
+
24
+ attr_accessor :event_types
25
+
26
+ attr_accessor :paused
27
+
28
+ attr_accessor :created_at
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'id' => :'id',
34
+ :'label' => :'label',
35
+ :'target' => :'target',
36
+ :'event_types' => :'event_types',
37
+ :'paused' => :'paused',
38
+ :'created_at' => :'created_at'
39
+ }
40
+ end
41
+
42
+ # Returns attribute mapping this model knows about
43
+ def self.acceptable_attribute_map
44
+ attribute_map
45
+ end
46
+
47
+ # Returns all the JSON keys this model knows about
48
+ def self.acceptable_attributes
49
+ acceptable_attribute_map.values
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'id' => :'Integer',
56
+ :'label' => :'String',
57
+ :'target' => :'SubscriptionsList200ResponseSubscriptionsInnerTarget',
58
+ :'event_types' => :'Array<String>',
59
+ :'paused' => :'Boolean',
60
+ :'created_at' => :'String'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PharmaObservatory::SubscriptionsList200ResponseSubscriptionsInner` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ acceptable_attribute_map = self.class.acceptable_attribute_map
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!acceptable_attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PharmaObservatory::SubscriptionsList200ResponseSubscriptionsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'id')
87
+ self.id = attributes[:'id']
88
+ else
89
+ self.id = nil
90
+ end
91
+
92
+ if attributes.key?(:'label')
93
+ self.label = attributes[:'label']
94
+ else
95
+ self.label = nil
96
+ end
97
+
98
+ if attributes.key?(:'target')
99
+ self.target = attributes[:'target']
100
+ else
101
+ self.target = nil
102
+ end
103
+
104
+ if attributes.key?(:'event_types')
105
+ if (value = attributes[:'event_types']).is_a?(Array)
106
+ self.event_types = value
107
+ end
108
+ else
109
+ self.event_types = nil
110
+ end
111
+
112
+ if attributes.key?(:'paused')
113
+ self.paused = attributes[:'paused']
114
+ else
115
+ self.paused = nil
116
+ end
117
+
118
+ if attributes.key?(:'created_at')
119
+ self.created_at = attributes[:'created_at']
120
+ else
121
+ self.created_at = nil
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
129
+ invalid_properties = Array.new
130
+ if @id.nil?
131
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
132
+ end
133
+
134
+ if @label.nil?
135
+ invalid_properties.push('invalid value for "label", label cannot be nil.')
136
+ end
137
+
138
+ if @target.nil?
139
+ invalid_properties.push('invalid value for "target", target cannot be nil.')
140
+ end
141
+
142
+ if @event_types.nil?
143
+ invalid_properties.push('invalid value for "event_types", event_types cannot be nil.')
144
+ end
145
+
146
+ if @paused.nil?
147
+ invalid_properties.push('invalid value for "paused", paused cannot be nil.')
148
+ end
149
+
150
+ if @created_at.nil?
151
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
152
+ end
153
+
154
+ invalid_properties
155
+ end
156
+
157
+ # Check to see if the all the properties in the model are valid
158
+ # @return true if the model is valid
159
+ def valid?
160
+ warn '[DEPRECATED] the `valid?` method is obsolete'
161
+ return false if @id.nil?
162
+ return false if @label.nil?
163
+ return false if @target.nil?
164
+ return false if @event_types.nil?
165
+ return false if @paused.nil?
166
+ return false if @created_at.nil?
167
+ true
168
+ end
169
+
170
+ # Custom attribute writer method with validation
171
+ # @param [Object] id Value to be assigned
172
+ def id=(id)
173
+ if id.nil?
174
+ fail ArgumentError, 'id cannot be nil'
175
+ end
176
+
177
+ @id = id
178
+ end
179
+
180
+ # Custom attribute writer method with validation
181
+ # @param [Object] label Value to be assigned
182
+ def label=(label)
183
+ if label.nil?
184
+ fail ArgumentError, 'label cannot be nil'
185
+ end
186
+
187
+ @label = label
188
+ end
189
+
190
+ # Custom attribute writer method with validation
191
+ # @param [Object] target Value to be assigned
192
+ def target=(target)
193
+ if target.nil?
194
+ fail ArgumentError, 'target cannot be nil'
195
+ end
196
+
197
+ @target = target
198
+ end
199
+
200
+ # Custom attribute writer method with validation
201
+ # @param [Object] event_types Value to be assigned
202
+ def event_types=(event_types)
203
+ if event_types.nil?
204
+ fail ArgumentError, 'event_types cannot be nil'
205
+ end
206
+
207
+ @event_types = event_types
208
+ end
209
+
210
+ # Custom attribute writer method with validation
211
+ # @param [Object] paused Value to be assigned
212
+ def paused=(paused)
213
+ if paused.nil?
214
+ fail ArgumentError, 'paused cannot be nil'
215
+ end
216
+
217
+ @paused = paused
218
+ end
219
+
220
+ # Custom attribute writer method with validation
221
+ # @param [Object] created_at Value to be assigned
222
+ def created_at=(created_at)
223
+ if created_at.nil?
224
+ fail ArgumentError, 'created_at cannot be nil'
225
+ end
226
+
227
+ @created_at = created_at
228
+ end
229
+
230
+ # Checks equality by comparing each attribute.
231
+ # @param [Object] Object to be compared
232
+ def ==(o)
233
+ return true if self.equal?(o)
234
+ self.class == o.class &&
235
+ id == o.id &&
236
+ label == o.label &&
237
+ target == o.target &&
238
+ event_types == o.event_types &&
239
+ paused == o.paused &&
240
+ created_at == o.created_at
241
+ end
242
+
243
+ # @see the `==` method
244
+ # @param [Object] Object to be compared
245
+ def eql?(o)
246
+ self == o
247
+ end
248
+
249
+ # Calculates hash code according to all attributes.
250
+ # @return [Integer] Hash code
251
+ def hash
252
+ [id, label, target, event_types, paused, created_at].hash
253
+ end
254
+
255
+ # Builds the object from hash
256
+ # @param [Hash] attributes Model attributes in the form of hash
257
+ # @return [Object] Returns the model itself
258
+ def self.build_from_hash(attributes)
259
+ return nil unless attributes.is_a?(Hash)
260
+ attributes = attributes.transform_keys(&:to_sym)
261
+ transformed_hash = {}
262
+ openapi_types.each_pair do |key, type|
263
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
264
+ transformed_hash["#{key}"] = nil
265
+ elsif type =~ /\AArray<(.*)>/i
266
+ # check to ensure the input is an array given that the attribute
267
+ # is documented as an array but the input is not
268
+ if attributes[attribute_map[key]].is_a?(Array)
269
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
270
+ end
271
+ elsif !attributes[attribute_map[key]].nil?
272
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
273
+ end
274
+ end
275
+ new(transformed_hash)
276
+ end
277
+
278
+ # Deserializes the data based on type
279
+ # @param string type Data type
280
+ # @param string value Value to be deserialized
281
+ # @return [Object] Deserialized data
282
+ def self._deserialize(type, value)
283
+ case type.to_sym
284
+ when :Time
285
+ Time.parse(value)
286
+ when :Date
287
+ Date.parse(value)
288
+ when :String
289
+ value.to_s
290
+ when :Integer
291
+ value.to_i
292
+ when :Float
293
+ value.to_f
294
+ when :Boolean
295
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
296
+ true
297
+ else
298
+ false
299
+ end
300
+ when :Object
301
+ # generic object (usually a Hash), return directly
302
+ value
303
+ when /\AArray<(?<inner_type>.+)>\z/
304
+ inner_type = Regexp.last_match[:inner_type]
305
+ value.map { |v| _deserialize(inner_type, v) }
306
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
307
+ k_type = Regexp.last_match[:k_type]
308
+ v_type = Regexp.last_match[:v_type]
309
+ {}.tap do |hash|
310
+ value.each do |k, v|
311
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
312
+ end
313
+ end
314
+ else # model
315
+ # models (e.g. Pet) or oneOf
316
+ klass = PharmaObservatory.const_get(type)
317
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
318
+ end
319
+ end
320
+
321
+ # Returns the string representation of the object
322
+ # @return [String] String presentation of the object
323
+ def to_s
324
+ to_hash.to_s
325
+ end
326
+
327
+ # to_body is an alias to to_hash (backward compatibility)
328
+ # @return [Hash] Returns the object in the form of hash
329
+ def to_body
330
+ to_hash
331
+ end
332
+
333
+ # Returns the object in the form of hash
334
+ # @return [Hash] Returns the object in the form of hash
335
+ def to_hash
336
+ hash = {}
337
+ self.class.attribute_map.each_pair do |attr, param|
338
+ value = self.send(attr)
339
+ if value.nil?
340
+ is_nullable = self.class.openapi_nullable.include?(attr)
341
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
342
+ end
343
+
344
+ hash[param] = _to_hash(value)
345
+ end
346
+ hash
347
+ end
348
+
349
+ # Outputs non-array value in the form of hash
350
+ # For object, use to_hash. Otherwise, just return the value
351
+ # @param [Object] value Any valid value
352
+ # @return [Hash] Returns the value in the form of hash
353
+ def _to_hash(value)
354
+ if value.is_a?(Array)
355
+ value.compact.map { |v| _to_hash(v) }
356
+ elsif value.is_a?(Hash)
357
+ {}.tap do |hash|
358
+ value.each { |k, v| hash[k] = _to_hash(v) }
359
+ end
360
+ elsif value.respond_to? :to_hash
361
+ value.to_hash
362
+ else
363
+ value
364
+ end
365
+ end
366
+
367
+ end
368
+
369
+ end
@@ -0,0 +1,277 @@
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 SubscriptionsList200ResponseSubscriptionsInnerTarget
18
+ attr_accessor :kind
19
+
20
+ attr_accessor :dataset
21
+
22
+ attr_accessor :filters
23
+
24
+ attr_accessor :object_type
25
+
26
+ attr_accessor :entity_id
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'kind' => :'kind',
32
+ :'dataset' => :'dataset',
33
+ :'filters' => :'filters',
34
+ :'object_type' => :'object_type',
35
+ :'entity_id' => :'entity_id'
36
+ }
37
+ end
38
+
39
+ # Returns attribute mapping this model knows about
40
+ def self.acceptable_attribute_map
41
+ attribute_map
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ acceptable_attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'kind' => :'String',
53
+ :'dataset' => :'String',
54
+ :'filters' => :'SubscriptionsList200ResponseSubscriptionsInnerTargetFilters',
55
+ :'object_type' => :'String',
56
+ :'entity_id' => :'String'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ :'dataset',
64
+ :'filters',
65
+ :'object_type',
66
+ :'entity_id'
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PharmaObservatory::SubscriptionsList200ResponseSubscriptionsInnerTarget` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ acceptable_attribute_map = self.class.acceptable_attribute_map
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!acceptable_attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PharmaObservatory::SubscriptionsList200ResponseSubscriptionsInnerTarget`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'kind')
87
+ self.kind = attributes[:'kind']
88
+ else
89
+ self.kind = nil
90
+ end
91
+
92
+ if attributes.key?(:'dataset')
93
+ self.dataset = attributes[:'dataset']
94
+ end
95
+
96
+ if attributes.key?(:'filters')
97
+ self.filters = attributes[:'filters']
98
+ end
99
+
100
+ if attributes.key?(:'object_type')
101
+ self.object_type = attributes[:'object_type']
102
+ end
103
+
104
+ if attributes.key?(:'entity_id')
105
+ self.entity_id = attributes[:'entity_id']
106
+ end
107
+ end
108
+
109
+ # Show invalid properties with the reasons. Usually used together with valid?
110
+ # @return Array for valid properties with the reasons
111
+ def list_invalid_properties
112
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
113
+ invalid_properties = Array.new
114
+ if @kind.nil?
115
+ invalid_properties.push('invalid value for "kind", kind cannot be nil.')
116
+ end
117
+
118
+ invalid_properties
119
+ end
120
+
121
+ # Check to see if the all the properties in the model are valid
122
+ # @return true if the model is valid
123
+ def valid?
124
+ warn '[DEPRECATED] the `valid?` method is obsolete'
125
+ return false if @kind.nil?
126
+ true
127
+ end
128
+
129
+ # Custom attribute writer method with validation
130
+ # @param [Object] kind Value to be assigned
131
+ def kind=(kind)
132
+ if kind.nil?
133
+ fail ArgumentError, 'kind cannot be nil'
134
+ end
135
+
136
+ @kind = kind
137
+ end
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] Object to be compared
141
+ def ==(o)
142
+ return true if self.equal?(o)
143
+ self.class == o.class &&
144
+ kind == o.kind &&
145
+ dataset == o.dataset &&
146
+ filters == o.filters &&
147
+ object_type == o.object_type &&
148
+ entity_id == o.entity_id
149
+ end
150
+
151
+ # @see the `==` method
152
+ # @param [Object] Object to be compared
153
+ def eql?(o)
154
+ self == o
155
+ end
156
+
157
+ # Calculates hash code according to all attributes.
158
+ # @return [Integer] Hash code
159
+ def hash
160
+ [kind, dataset, filters, object_type, entity_id].hash
161
+ end
162
+
163
+ # Builds the object from hash
164
+ # @param [Hash] attributes Model attributes in the form of hash
165
+ # @return [Object] Returns the model itself
166
+ def self.build_from_hash(attributes)
167
+ return nil unless attributes.is_a?(Hash)
168
+ attributes = attributes.transform_keys(&:to_sym)
169
+ transformed_hash = {}
170
+ openapi_types.each_pair do |key, type|
171
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
172
+ transformed_hash["#{key}"] = nil
173
+ elsif type =~ /\AArray<(.*)>/i
174
+ # check to ensure the input is an array given that the attribute
175
+ # is documented as an array but the input is not
176
+ if attributes[attribute_map[key]].is_a?(Array)
177
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
178
+ end
179
+ elsif !attributes[attribute_map[key]].nil?
180
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
181
+ end
182
+ end
183
+ new(transformed_hash)
184
+ end
185
+
186
+ # Deserializes the data based on type
187
+ # @param string type Data type
188
+ # @param string value Value to be deserialized
189
+ # @return [Object] Deserialized data
190
+ def self._deserialize(type, value)
191
+ case type.to_sym
192
+ when :Time
193
+ Time.parse(value)
194
+ when :Date
195
+ Date.parse(value)
196
+ when :String
197
+ value.to_s
198
+ when :Integer
199
+ value.to_i
200
+ when :Float
201
+ value.to_f
202
+ when :Boolean
203
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
204
+ true
205
+ else
206
+ false
207
+ end
208
+ when :Object
209
+ # generic object (usually a Hash), return directly
210
+ value
211
+ when /\AArray<(?<inner_type>.+)>\z/
212
+ inner_type = Regexp.last_match[:inner_type]
213
+ value.map { |v| _deserialize(inner_type, v) }
214
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
215
+ k_type = Regexp.last_match[:k_type]
216
+ v_type = Regexp.last_match[:v_type]
217
+ {}.tap do |hash|
218
+ value.each do |k, v|
219
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
220
+ end
221
+ end
222
+ else # model
223
+ # models (e.g. Pet) or oneOf
224
+ klass = PharmaObservatory.const_get(type)
225
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
226
+ end
227
+ end
228
+
229
+ # Returns the string representation of the object
230
+ # @return [String] String presentation of the object
231
+ def to_s
232
+ to_hash.to_s
233
+ end
234
+
235
+ # to_body is an alias to to_hash (backward compatibility)
236
+ # @return [Hash] Returns the object in the form of hash
237
+ def to_body
238
+ to_hash
239
+ end
240
+
241
+ # Returns the object in the form of hash
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_hash
244
+ hash = {}
245
+ self.class.attribute_map.each_pair do |attr, param|
246
+ value = self.send(attr)
247
+ if value.nil?
248
+ is_nullable = self.class.openapi_nullable.include?(attr)
249
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
250
+ end
251
+
252
+ hash[param] = _to_hash(value)
253
+ end
254
+ hash
255
+ end
256
+
257
+ # Outputs non-array value in the form of hash
258
+ # For object, use to_hash. Otherwise, just return the value
259
+ # @param [Object] value Any valid value
260
+ # @return [Hash] Returns the value in the form of hash
261
+ def _to_hash(value)
262
+ if value.is_a?(Array)
263
+ value.compact.map { |v| _to_hash(v) }
264
+ elsif value.is_a?(Hash)
265
+ {}.tap do |hash|
266
+ value.each { |k, v| hash[k] = _to_hash(v) }
267
+ end
268
+ elsif value.respond_to? :to_hash
269
+ value.to_hash
270
+ else
271
+ value
272
+ end
273
+ end
274
+
275
+ end
276
+
277
+ end