adzerk_decision_sdk 1.0.0.pre.beta.5 → 1.0.0.pre.beta.9
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/Gemfile.lock +5 -7
- data/README.md +58 -4
- data/adzerk_decision_sdk.gemspec +3 -4
- data/docs/ConsentRequest.md +10 -9
- data/docs/Content.md +16 -15
- data/docs/Decision.md +28 -27
- data/docs/DecisionApi.md +30 -13
- data/docs/DecisionRequest.md +44 -41
- data/docs/DecisionResponse.md +12 -11
- data/docs/Event.md +10 -9
- data/docs/MatchedPoint.md +10 -9
- data/docs/Placement.md +50 -41
- data/docs/PricingData.md +16 -15
- data/docs/User.md +8 -7
- data/docs/UserdbApi.md +259 -98
- data/lib/adzerk_decision_sdk/api/decision_api.rb +5 -4
- data/lib/adzerk_decision_sdk/api/userdb_api.rb +37 -28
- data/lib/adzerk_decision_sdk/api_client.rb +50 -48
- data/lib/adzerk_decision_sdk/api_error.rb +1 -1
- data/lib/adzerk_decision_sdk/client.rb +2 -1
- data/lib/adzerk_decision_sdk/configuration.rb +39 -10
- data/lib/adzerk_decision_sdk/decision_client.rb +16 -6
- data/lib/adzerk_decision_sdk/models/consent_request.rb +19 -7
- data/lib/adzerk_decision_sdk/models/content.rb +19 -7
- data/lib/adzerk_decision_sdk/models/decision.rb +19 -7
- data/lib/adzerk_decision_sdk/models/decision_request.rb +32 -10
- data/lib/adzerk_decision_sdk/models/decision_response.rb +19 -7
- data/lib/adzerk_decision_sdk/models/event.rb +19 -7
- data/lib/adzerk_decision_sdk/models/matched_point.rb +19 -7
- data/lib/adzerk_decision_sdk/models/placement.rb +67 -12
- data/lib/adzerk_decision_sdk/models/pricing_data.rb +19 -7
- data/lib/adzerk_decision_sdk/models/user.rb +19 -7
- data/lib/adzerk_decision_sdk/user_db_client.rb +2 -2
- data/lib/adzerk_decision_sdk/version.rb +1 -1
- data/spec/spec_helper.rb +91 -0
- metadata +11 -30
- data/pkg/adzerk_decision_sdk-1.0.0.pre.beta.3.gem +0 -0
@@ -6,11 +6,12 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 5.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module AdzerkDecisionSdk
|
16
17
|
class Event
|
@@ -26,6 +27,11 @@ module AdzerkDecisionSdk
|
|
26
27
|
}
|
27
28
|
end
|
28
29
|
|
30
|
+
# Returns all the JSON keys this model knows about
|
31
|
+
def self.acceptable_attributes
|
32
|
+
attribute_map.values
|
33
|
+
end
|
34
|
+
|
29
35
|
# Attribute type mapping.
|
30
36
|
def self.openapi_types
|
31
37
|
{
|
@@ -111,7 +117,9 @@ module AdzerkDecisionSdk
|
|
111
117
|
def build_from_hash(attributes)
|
112
118
|
return nil unless attributes.is_a?(Hash)
|
113
119
|
self.class.openapi_types.each_pair do |key, type|
|
114
|
-
if
|
120
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
121
|
+
self.send("#{key}=", nil)
|
122
|
+
elsif type =~ /\AArray<(.*)>/i
|
115
123
|
# check to ensure the input is an array given that the attribute
|
116
124
|
# is documented as an array but the input is not
|
117
125
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -119,7 +127,7 @@ module AdzerkDecisionSdk
|
|
119
127
|
end
|
120
128
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
121
129
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
122
|
-
end
|
130
|
+
end
|
123
131
|
end
|
124
132
|
|
125
133
|
self
|
@@ -131,8 +139,8 @@ module AdzerkDecisionSdk
|
|
131
139
|
# @return [Object] Deserialized data
|
132
140
|
def _deserialize(type, value)
|
133
141
|
case type.to_sym
|
134
|
-
when :
|
135
|
-
|
142
|
+
when :Time
|
143
|
+
Time.parse(value)
|
136
144
|
when :Date
|
137
145
|
Date.parse(value)
|
138
146
|
when :String
|
@@ -162,7 +170,9 @@ module AdzerkDecisionSdk
|
|
162
170
|
end
|
163
171
|
end
|
164
172
|
else # model
|
165
|
-
|
173
|
+
# models (e.g. Pet) or oneOf
|
174
|
+
klass = AdzerkDecisionSdk.const_get(type)
|
175
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
166
176
|
end
|
167
177
|
end
|
168
178
|
|
@@ -188,7 +198,7 @@ module AdzerkDecisionSdk
|
|
188
198
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
189
199
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
190
200
|
end
|
191
|
-
|
201
|
+
|
192
202
|
hash[param] = _to_hash(value)
|
193
203
|
end
|
194
204
|
hash
|
@@ -211,5 +221,7 @@ module AdzerkDecisionSdk
|
|
211
221
|
value
|
212
222
|
end
|
213
223
|
end
|
224
|
+
|
214
225
|
end
|
226
|
+
|
215
227
|
end
|
@@ -6,11 +6,12 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 5.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module AdzerkDecisionSdk
|
16
17
|
class MatchedPoint
|
@@ -26,6 +27,11 @@ module AdzerkDecisionSdk
|
|
26
27
|
}
|
27
28
|
end
|
28
29
|
|
30
|
+
# Returns all the JSON keys this model knows about
|
31
|
+
def self.acceptable_attributes
|
32
|
+
attribute_map.values
|
33
|
+
end
|
34
|
+
|
29
35
|
# Attribute type mapping.
|
30
36
|
def self.openapi_types
|
31
37
|
{
|
@@ -111,7 +117,9 @@ module AdzerkDecisionSdk
|
|
111
117
|
def build_from_hash(attributes)
|
112
118
|
return nil unless attributes.is_a?(Hash)
|
113
119
|
self.class.openapi_types.each_pair do |key, type|
|
114
|
-
if
|
120
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
121
|
+
self.send("#{key}=", nil)
|
122
|
+
elsif type =~ /\AArray<(.*)>/i
|
115
123
|
# check to ensure the input is an array given that the attribute
|
116
124
|
# is documented as an array but the input is not
|
117
125
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -119,7 +127,7 @@ module AdzerkDecisionSdk
|
|
119
127
|
end
|
120
128
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
121
129
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
122
|
-
end
|
130
|
+
end
|
123
131
|
end
|
124
132
|
|
125
133
|
self
|
@@ -131,8 +139,8 @@ module AdzerkDecisionSdk
|
|
131
139
|
# @return [Object] Deserialized data
|
132
140
|
def _deserialize(type, value)
|
133
141
|
case type.to_sym
|
134
|
-
when :
|
135
|
-
|
142
|
+
when :Time
|
143
|
+
Time.parse(value)
|
136
144
|
when :Date
|
137
145
|
Date.parse(value)
|
138
146
|
when :String
|
@@ -162,7 +170,9 @@ module AdzerkDecisionSdk
|
|
162
170
|
end
|
163
171
|
end
|
164
172
|
else # model
|
165
|
-
|
173
|
+
# models (e.g. Pet) or oneOf
|
174
|
+
klass = AdzerkDecisionSdk.const_get(type)
|
175
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
166
176
|
end
|
167
177
|
end
|
168
178
|
|
@@ -188,7 +198,7 @@ module AdzerkDecisionSdk
|
|
188
198
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
189
199
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
190
200
|
end
|
191
|
-
|
201
|
+
|
192
202
|
hash[param] = _to_hash(value)
|
193
203
|
end
|
194
204
|
hash
|
@@ -211,5 +221,7 @@ module AdzerkDecisionSdk
|
|
211
221
|
value
|
212
222
|
end
|
213
223
|
end
|
224
|
+
|
214
225
|
end
|
226
|
+
|
215
227
|
end
|
@@ -6,11 +6,12 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 5.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module AdzerkDecisionSdk
|
16
17
|
class Placement
|
@@ -62,10 +63,19 @@ module AdzerkDecisionSdk
|
|
62
63
|
# (BETA) The name of the eCPM Partition that should be used to source eCPM data for auctions
|
63
64
|
attr_accessor :ecpm_partition
|
64
65
|
|
66
|
+
# (BETA) The names of the eCPM Partitions that should be used to source eCPM data for auctions
|
67
|
+
attr_accessor :ecpm_partitions
|
68
|
+
|
65
69
|
attr_accessor :event_multiplier
|
66
70
|
|
67
71
|
attr_accessor :skip_selection
|
68
72
|
|
73
|
+
attr_accessor :ad_query
|
74
|
+
|
75
|
+
attr_accessor :floor_price
|
76
|
+
|
77
|
+
attr_accessor :floor_cpc
|
78
|
+
|
69
79
|
# Attribute mapping from ruby-style variable name to JSON key.
|
70
80
|
def self.attribute_map
|
71
81
|
{
|
@@ -85,11 +95,20 @@ module AdzerkDecisionSdk
|
|
85
95
|
:'count' => :'count',
|
86
96
|
:'proportionality' => :'proportionality',
|
87
97
|
:'ecpm_partition' => :'ecpmPartition',
|
98
|
+
:'ecpm_partitions' => :'ecpmPartitions',
|
88
99
|
:'event_multiplier' => :'eventMultiplier',
|
89
|
-
:'skip_selection' => :'skipSelection'
|
100
|
+
:'skip_selection' => :'skipSelection',
|
101
|
+
:'ad_query' => :'adQuery',
|
102
|
+
:'floor_price' => :'floorPrice',
|
103
|
+
:'floor_cpc' => :'floorCpc'
|
90
104
|
}
|
91
105
|
end
|
92
106
|
|
107
|
+
# Returns all the JSON keys this model knows about
|
108
|
+
def self.acceptable_attributes
|
109
|
+
attribute_map.values
|
110
|
+
end
|
111
|
+
|
93
112
|
# Attribute type mapping.
|
94
113
|
def self.openapi_types
|
95
114
|
{
|
@@ -109,8 +128,12 @@ module AdzerkDecisionSdk
|
|
109
128
|
:'count' => :'Integer',
|
110
129
|
:'proportionality' => :'Boolean',
|
111
130
|
:'ecpm_partition' => :'String',
|
131
|
+
:'ecpm_partitions' => :'Array<String>',
|
112
132
|
:'event_multiplier' => :'Integer',
|
113
|
-
:'skip_selection' => :'Boolean'
|
133
|
+
:'skip_selection' => :'Boolean',
|
134
|
+
:'ad_query' => :'Object',
|
135
|
+
:'floor_price' => :'Float',
|
136
|
+
:'floor_cpc' => :'Float'
|
114
137
|
}
|
115
138
|
end
|
116
139
|
|
@@ -129,8 +152,12 @@ module AdzerkDecisionSdk
|
|
129
152
|
:'count',
|
130
153
|
:'proportionality',
|
131
154
|
:'ecpm_partition',
|
155
|
+
:'ecpm_partitions',
|
132
156
|
:'event_multiplier',
|
133
|
-
:'skip_selection'
|
157
|
+
:'skip_selection',
|
158
|
+
:'ad_query',
|
159
|
+
:'floor_price',
|
160
|
+
:'floor_cpc'
|
134
161
|
])
|
135
162
|
end
|
136
163
|
|
@@ -221,6 +248,12 @@ module AdzerkDecisionSdk
|
|
221
248
|
self.ecpm_partition = attributes[:'ecpm_partition']
|
222
249
|
end
|
223
250
|
|
251
|
+
if attributes.key?(:'ecpm_partitions')
|
252
|
+
if (value = attributes[:'ecpm_partitions']).is_a?(Array)
|
253
|
+
self.ecpm_partitions = value
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
224
257
|
if attributes.key?(:'event_multiplier')
|
225
258
|
self.event_multiplier = attributes[:'event_multiplier']
|
226
259
|
end
|
@@ -228,6 +261,18 @@ module AdzerkDecisionSdk
|
|
228
261
|
if attributes.key?(:'skip_selection')
|
229
262
|
self.skip_selection = attributes[:'skip_selection']
|
230
263
|
end
|
264
|
+
|
265
|
+
if attributes.key?(:'ad_query')
|
266
|
+
self.ad_query = attributes[:'ad_query']
|
267
|
+
end
|
268
|
+
|
269
|
+
if attributes.key?(:'floor_price')
|
270
|
+
self.floor_price = attributes[:'floor_price']
|
271
|
+
end
|
272
|
+
|
273
|
+
if attributes.key?(:'floor_cpc')
|
274
|
+
self.floor_cpc = attributes[:'floor_cpc']
|
275
|
+
end
|
231
276
|
end
|
232
277
|
|
233
278
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -288,8 +333,12 @@ module AdzerkDecisionSdk
|
|
288
333
|
count == o.count &&
|
289
334
|
proportionality == o.proportionality &&
|
290
335
|
ecpm_partition == o.ecpm_partition &&
|
336
|
+
ecpm_partitions == o.ecpm_partitions &&
|
291
337
|
event_multiplier == o.event_multiplier &&
|
292
|
-
skip_selection == o.skip_selection
|
338
|
+
skip_selection == o.skip_selection &&
|
339
|
+
ad_query == o.ad_query &&
|
340
|
+
floor_price == o.floor_price &&
|
341
|
+
floor_cpc == o.floor_cpc
|
293
342
|
end
|
294
343
|
|
295
344
|
# @see the `==` method
|
@@ -301,7 +350,7 @@ module AdzerkDecisionSdk
|
|
301
350
|
# Calculates hash code according to all attributes.
|
302
351
|
# @return [Integer] Hash code
|
303
352
|
def hash
|
304
|
-
[div_name, network_id, site_id, ad_types, zone_ids, campaign_id, flight_id, ad_id, click_url, properties, event_ids, overrides, content_keys, count, proportionality, ecpm_partition, event_multiplier, skip_selection].hash
|
353
|
+
[div_name, network_id, site_id, ad_types, zone_ids, campaign_id, flight_id, ad_id, click_url, properties, event_ids, overrides, content_keys, count, proportionality, ecpm_partition, ecpm_partitions, event_multiplier, skip_selection, ad_query, floor_price, floor_cpc].hash
|
305
354
|
end
|
306
355
|
|
307
356
|
# Builds the object from hash
|
@@ -317,7 +366,9 @@ module AdzerkDecisionSdk
|
|
317
366
|
def build_from_hash(attributes)
|
318
367
|
return nil unless attributes.is_a?(Hash)
|
319
368
|
self.class.openapi_types.each_pair do |key, type|
|
320
|
-
if
|
369
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
370
|
+
self.send("#{key}=", nil)
|
371
|
+
elsif type =~ /\AArray<(.*)>/i
|
321
372
|
# check to ensure the input is an array given that the attribute
|
322
373
|
# is documented as an array but the input is not
|
323
374
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -325,7 +376,7 @@ module AdzerkDecisionSdk
|
|
325
376
|
end
|
326
377
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
327
378
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
328
|
-
end
|
379
|
+
end
|
329
380
|
end
|
330
381
|
|
331
382
|
self
|
@@ -337,8 +388,8 @@ module AdzerkDecisionSdk
|
|
337
388
|
# @return [Object] Deserialized data
|
338
389
|
def _deserialize(type, value)
|
339
390
|
case type.to_sym
|
340
|
-
when :
|
341
|
-
|
391
|
+
when :Time
|
392
|
+
Time.parse(value)
|
342
393
|
when :Date
|
343
394
|
Date.parse(value)
|
344
395
|
when :String
|
@@ -368,7 +419,9 @@ module AdzerkDecisionSdk
|
|
368
419
|
end
|
369
420
|
end
|
370
421
|
else # model
|
371
|
-
|
422
|
+
# models (e.g. Pet) or oneOf
|
423
|
+
klass = AdzerkDecisionSdk.const_get(type)
|
424
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
372
425
|
end
|
373
426
|
end
|
374
427
|
|
@@ -394,7 +447,7 @@ module AdzerkDecisionSdk
|
|
394
447
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
395
448
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
396
449
|
end
|
397
|
-
|
450
|
+
|
398
451
|
hash[param] = _to_hash(value)
|
399
452
|
end
|
400
453
|
hash
|
@@ -417,5 +470,7 @@ module AdzerkDecisionSdk
|
|
417
470
|
value
|
418
471
|
end
|
419
472
|
end
|
473
|
+
|
420
474
|
end
|
475
|
+
|
421
476
|
end
|
@@ -6,11 +6,12 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 5.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module AdzerkDecisionSdk
|
16
17
|
class PricingData
|
@@ -35,6 +36,11 @@ module AdzerkDecisionSdk
|
|
35
36
|
}
|
36
37
|
end
|
37
38
|
|
39
|
+
# Returns all the JSON keys this model knows about
|
40
|
+
def self.acceptable_attributes
|
41
|
+
attribute_map.values
|
42
|
+
end
|
43
|
+
|
38
44
|
# Attribute type mapping.
|
39
45
|
def self.openapi_types
|
40
46
|
{
|
@@ -138,7 +144,9 @@ module AdzerkDecisionSdk
|
|
138
144
|
def build_from_hash(attributes)
|
139
145
|
return nil unless attributes.is_a?(Hash)
|
140
146
|
self.class.openapi_types.each_pair do |key, type|
|
141
|
-
if
|
147
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
148
|
+
self.send("#{key}=", nil)
|
149
|
+
elsif type =~ /\AArray<(.*)>/i
|
142
150
|
# check to ensure the input is an array given that the attribute
|
143
151
|
# is documented as an array but the input is not
|
144
152
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -146,7 +154,7 @@ module AdzerkDecisionSdk
|
|
146
154
|
end
|
147
155
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
148
156
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
149
|
-
end
|
157
|
+
end
|
150
158
|
end
|
151
159
|
|
152
160
|
self
|
@@ -158,8 +166,8 @@ module AdzerkDecisionSdk
|
|
158
166
|
# @return [Object] Deserialized data
|
159
167
|
def _deserialize(type, value)
|
160
168
|
case type.to_sym
|
161
|
-
when :
|
162
|
-
|
169
|
+
when :Time
|
170
|
+
Time.parse(value)
|
163
171
|
when :Date
|
164
172
|
Date.parse(value)
|
165
173
|
when :String
|
@@ -189,7 +197,9 @@ module AdzerkDecisionSdk
|
|
189
197
|
end
|
190
198
|
end
|
191
199
|
else # model
|
192
|
-
|
200
|
+
# models (e.g. Pet) or oneOf
|
201
|
+
klass = AdzerkDecisionSdk.const_get(type)
|
202
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
193
203
|
end
|
194
204
|
end
|
195
205
|
|
@@ -215,7 +225,7 @@ module AdzerkDecisionSdk
|
|
215
225
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
216
226
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
217
227
|
end
|
218
|
-
|
228
|
+
|
219
229
|
hash[param] = _to_hash(value)
|
220
230
|
end
|
221
231
|
hash
|
@@ -238,5 +248,7 @@ module AdzerkDecisionSdk
|
|
238
248
|
value
|
239
249
|
end
|
240
250
|
end
|
251
|
+
|
241
252
|
end
|
253
|
+
|
242
254
|
end
|
@@ -6,11 +6,12 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 5.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module AdzerkDecisionSdk
|
16
17
|
# Object containing the UserKey used for [UserDB targeting](https://dev.adzerk.com/docs/userdb-1)
|
@@ -25,6 +26,11 @@ module AdzerkDecisionSdk
|
|
25
26
|
}
|
26
27
|
end
|
27
28
|
|
29
|
+
# Returns all the JSON keys this model knows about
|
30
|
+
def self.acceptable_attributes
|
31
|
+
attribute_map.values
|
32
|
+
end
|
33
|
+
|
28
34
|
# Attribute type mapping.
|
29
35
|
def self.openapi_types
|
30
36
|
{
|
@@ -104,7 +110,9 @@ module AdzerkDecisionSdk
|
|
104
110
|
def build_from_hash(attributes)
|
105
111
|
return nil unless attributes.is_a?(Hash)
|
106
112
|
self.class.openapi_types.each_pair do |key, type|
|
107
|
-
if
|
113
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
114
|
+
self.send("#{key}=", nil)
|
115
|
+
elsif type =~ /\AArray<(.*)>/i
|
108
116
|
# check to ensure the input is an array given that the attribute
|
109
117
|
# is documented as an array but the input is not
|
110
118
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -112,7 +120,7 @@ module AdzerkDecisionSdk
|
|
112
120
|
end
|
113
121
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
114
122
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
115
|
-
end
|
123
|
+
end
|
116
124
|
end
|
117
125
|
|
118
126
|
self
|
@@ -124,8 +132,8 @@ module AdzerkDecisionSdk
|
|
124
132
|
# @return [Object] Deserialized data
|
125
133
|
def _deserialize(type, value)
|
126
134
|
case type.to_sym
|
127
|
-
when :
|
128
|
-
|
135
|
+
when :Time
|
136
|
+
Time.parse(value)
|
129
137
|
when :Date
|
130
138
|
Date.parse(value)
|
131
139
|
when :String
|
@@ -155,7 +163,9 @@ module AdzerkDecisionSdk
|
|
155
163
|
end
|
156
164
|
end
|
157
165
|
else # model
|
158
|
-
|
166
|
+
# models (e.g. Pet) or oneOf
|
167
|
+
klass = AdzerkDecisionSdk.const_get(type)
|
168
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
159
169
|
end
|
160
170
|
end
|
161
171
|
|
@@ -181,7 +191,7 @@ module AdzerkDecisionSdk
|
|
181
191
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
182
192
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
183
193
|
end
|
184
|
-
|
194
|
+
|
185
195
|
hash[param] = _to_hash(value)
|
186
196
|
end
|
187
197
|
hash
|
@@ -204,5 +214,7 @@ module AdzerkDecisionSdk
|
|
204
214
|
value
|
205
215
|
end
|
206
216
|
end
|
217
|
+
|
207
218
|
end
|
219
|
+
|
208
220
|
end
|