adzerk_decision_sdk 1.0.0.pre.beta.6 → 1.0.0.pre.beta.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +5 -7
  3. data/README.md +16 -2
  4. data/adzerk_decision_sdk.gemspec +3 -4
  5. data/docs/ConsentRequest.md +10 -9
  6. data/docs/Content.md +16 -15
  7. data/docs/Decision.md +28 -27
  8. data/docs/DecisionApi.md +30 -13
  9. data/docs/DecisionRequest.md +44 -41
  10. data/docs/DecisionResponse.md +12 -11
  11. data/docs/Event.md +10 -9
  12. data/docs/MatchedPoint.md +10 -9
  13. data/docs/Placement.md +46 -45
  14. data/docs/PricingData.md +16 -15
  15. data/docs/User.md +8 -7
  16. data/docs/UserdbApi.md +259 -98
  17. data/lib/adzerk_decision_sdk/api/decision_api.rb +5 -4
  18. data/lib/adzerk_decision_sdk/api/userdb_api.rb +37 -28
  19. data/lib/adzerk_decision_sdk/api_client.rb +50 -48
  20. data/lib/adzerk_decision_sdk/api_error.rb +1 -1
  21. data/lib/adzerk_decision_sdk/configuration.rb +39 -10
  22. data/lib/adzerk_decision_sdk/models/consent_request.rb +19 -7
  23. data/lib/adzerk_decision_sdk/models/content.rb +19 -7
  24. data/lib/adzerk_decision_sdk/models/decision.rb +19 -7
  25. data/lib/adzerk_decision_sdk/models/decision_request.rb +32 -10
  26. data/lib/adzerk_decision_sdk/models/decision_response.rb +19 -7
  27. data/lib/adzerk_decision_sdk/models/event.rb +19 -7
  28. data/lib/adzerk_decision_sdk/models/matched_point.rb +19 -7
  29. data/lib/adzerk_decision_sdk/models/placement.rb +19 -7
  30. data/lib/adzerk_decision_sdk/models/pricing_data.rb +19 -7
  31. data/lib/adzerk_decision_sdk/models/user.rb +19 -7
  32. data/lib/adzerk_decision_sdk/version.rb +1 -1
  33. data/spec/spec_helper.rb +91 -0
  34. metadata +11 -30
  35. 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: 4.3.1
9
+ OpenAPI Generator version: 5.0.1
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 type =~ /\AArray<(.*)>/i
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 # or else data not found in attributes(hash), not an issue as the data can be optional
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 :DateTime
135
- DateTime.parse(value)
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
- AdzerkDecisionSdk.const_get(type).build_from_hash(value)
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: 4.3.1
9
+ OpenAPI Generator version: 5.0.1
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 type =~ /\AArray<(.*)>/i
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 # or else data not found in attributes(hash), not an issue as the data can be optional
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 :DateTime
135
- DateTime.parse(value)
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
- AdzerkDecisionSdk.const_get(type).build_from_hash(value)
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: 4.3.1
9
+ OpenAPI Generator version: 5.0.1
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module AdzerkDecisionSdk
16
17
  class Placement
@@ -97,6 +98,11 @@ module AdzerkDecisionSdk
97
98
  }
98
99
  end
99
100
 
101
+ # Returns all the JSON keys this model knows about
102
+ def self.acceptable_attributes
103
+ attribute_map.values
104
+ end
105
+
100
106
  # Attribute type mapping.
101
107
  def self.openapi_types
102
108
  {
@@ -340,7 +346,9 @@ module AdzerkDecisionSdk
340
346
  def build_from_hash(attributes)
341
347
  return nil unless attributes.is_a?(Hash)
342
348
  self.class.openapi_types.each_pair do |key, type|
343
- if type =~ /\AArray<(.*)>/i
349
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
350
+ self.send("#{key}=", nil)
351
+ elsif type =~ /\AArray<(.*)>/i
344
352
  # check to ensure the input is an array given that the attribute
345
353
  # is documented as an array but the input is not
346
354
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -348,7 +356,7 @@ module AdzerkDecisionSdk
348
356
  end
349
357
  elsif !attributes[self.class.attribute_map[key]].nil?
350
358
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
351
- end # or else data not found in attributes(hash), not an issue as the data can be optional
359
+ end
352
360
  end
353
361
 
354
362
  self
@@ -360,8 +368,8 @@ module AdzerkDecisionSdk
360
368
  # @return [Object] Deserialized data
361
369
  def _deserialize(type, value)
362
370
  case type.to_sym
363
- when :DateTime
364
- DateTime.parse(value)
371
+ when :Time
372
+ Time.parse(value)
365
373
  when :Date
366
374
  Date.parse(value)
367
375
  when :String
@@ -391,7 +399,9 @@ module AdzerkDecisionSdk
391
399
  end
392
400
  end
393
401
  else # model
394
- AdzerkDecisionSdk.const_get(type).build_from_hash(value)
402
+ # models (e.g. Pet) or oneOf
403
+ klass = AdzerkDecisionSdk.const_get(type)
404
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
395
405
  end
396
406
  end
397
407
 
@@ -417,7 +427,7 @@ module AdzerkDecisionSdk
417
427
  is_nullable = self.class.openapi_nullable.include?(attr)
418
428
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
419
429
  end
420
-
430
+
421
431
  hash[param] = _to_hash(value)
422
432
  end
423
433
  hash
@@ -440,5 +450,7 @@ module AdzerkDecisionSdk
440
450
  value
441
451
  end
442
452
  end
453
+
443
454
  end
455
+
444
456
  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: 4.3.1
9
+ OpenAPI Generator version: 5.0.1
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 type =~ /\AArray<(.*)>/i
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 # or else data not found in attributes(hash), not an issue as the data can be optional
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 :DateTime
162
- DateTime.parse(value)
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
- AdzerkDecisionSdk.const_get(type).build_from_hash(value)
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: 4.3.1
9
+ OpenAPI Generator version: 5.0.1
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 type =~ /\AArray<(.*)>/i
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 # or else data not found in attributes(hash), not an issue as the data can be optional
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 :DateTime
128
- DateTime.parse(value)
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
- AdzerkDecisionSdk.const_get(type).build_from_hash(value)
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
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.3.1
11
11
  =end
12
12
 
13
13
  module AdzerkDecisionSdk
14
- VERSION = '1.0.0-beta.6'
14
+ VERSION = '1.0.0-beta.7'
15
15
  end
@@ -0,0 +1,91 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
4
+ # this file to always be loaded, without a need to explicitly require it in any
5
+ # files.
6
+ #
7
+ # Given that it is always loaded, you are encouraged to keep this file as
8
+ # light-weight as possible. Requiring heavyweight dependencies from this file
9
+ # will add to the boot time of your test suite on EVERY test run, even for an
10
+ # individual file that may not need all of that loaded. Instead, consider making
11
+ # a separate helper file that requires the additional dependencies and performs
12
+ # the additional setup, and require it from the spec files that actually need
13
+ # it.
14
+ #
15
+ # The `.rspec` file also contains a few flags that are not defaults but that
16
+ # users commonly want.
17
+ #
18
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
19
+ RSpec.configure do |config|
20
+ # rspec-expectations config goes here. You can use an alternate
21
+ # assertion/expectation library such as wrong or the stdlib/minitest
22
+ # assertions if you prefer.
23
+ config.expect_with :rspec do |expectations|
24
+ # This option will default to `true` in RSpec 4. It makes the `description`
25
+ # and `failure_message` of custom matchers include text for helper methods
26
+ # defined using `chain`, e.g.:
27
+ # be_bigger_than(2).and_smaller_than(4).description
28
+ # # => "be bigger than 2 and smaller than 4"
29
+ # ...rather than:
30
+ # # => "be bigger than 2"
31
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
32
+ end
33
+
34
+ # rspec-mocks config goes here. You can use an alternate test double
35
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
36
+ config.mock_with :rspec do |mocks|
37
+ # Prevents you from mocking or stubbing a method that does not exist on
38
+ # a real object. This is generally recommended, and will default to
39
+ # `true` in RSpec 4.
40
+ mocks.verify_partial_doubles = true
41
+ end
42
+
43
+ # The settings below are suggested to provide a good initial experience
44
+ # with RSpec, but feel free to customize to your heart's content.
45
+ =begin
46
+ # These two settings work together to allow you to limit a spec run
47
+ # to individual examples or groups you care about by tagging them with
48
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
49
+ # get run.
50
+ config.filter_run :focus
51
+ config.run_all_when_everything_filtered = true
52
+
53
+ # Limits the available syntax to the non-monkey patched syntax that is
54
+ # recommended. For more details, see:
55
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
56
+ # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
57
+ # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
58
+ config.disable_monkey_patching!
59
+
60
+ # This setting enables warnings. It's recommended, but in some cases may
61
+ # be too noisy due to issues in dependencies.
62
+ config.warnings = true
63
+
64
+ # Many RSpec users commonly either run the entire suite or an individual
65
+ # file, and it's useful to allow more verbose output when running an
66
+ # individual spec file.
67
+ if config.files_to_run.one?
68
+ # Use the documentation formatter for detailed output,
69
+ # unless a formatter has already been configured
70
+ # (e.g. via a command-line flag).
71
+ config.default_formatter = 'doc'
72
+ end
73
+
74
+ # Print the 10 slowest examples and example groups at the
75
+ # end of the spec run, to help surface which specs are running
76
+ # particularly slow.
77
+ config.profile_examples = 10
78
+
79
+ # Run specs in random order to surface order dependencies. If you find an
80
+ # order dependency and want to debug it, you can fix the order by providing
81
+ # the seed, which is printed after each run.
82
+ # --seed 1234
83
+ config.order = :random
84
+
85
+ # Seed global randomization in this process using the `--seed` CLI option.
86
+ # Setting this allows you to use `--seed` to deterministically reproduce
87
+ # test failures related to randomization by passing the same `--seed` value
88
+ # as the one that triggered the failure.
89
+ Kernel.srand config.seed
90
+ =end
91
+ end