adzerk_decision_sdk 1.0.0.pre.beta.3 → 1.0.0.pre.beta.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +8 -10
- 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 -25
- data/docs/DecisionApi.md +30 -13
- data/docs/DecisionRequest.md +44 -33
- data/docs/DecisionResponse.md +12 -11
- data/docs/Event.md +10 -9
- data/docs/MatchedPoint.md +20 -0
- data/docs/Placement.md +46 -37
- data/docs/PricingData.md +16 -15
- data/docs/RequestLocation.md +19 -0
- data/docs/User.md +8 -7
- data/docs/UserdbApi.md +252 -140
- data/lib/adzerk_decision_sdk.rb +1 -1
- data/lib/adzerk_decision_sdk/api/decision_api.rb +5 -4
- data/lib/adzerk_decision_sdk/api/userdb_api.rb +37 -95
- 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 +4 -3
- data/lib/adzerk_decision_sdk/configuration.rb +39 -10
- data/lib/adzerk_decision_sdk/decision_client.rb +18 -7
- data/lib/adzerk_decision_sdk/models/consent_request.rb +19 -7
- data/lib/adzerk_decision_sdk/models/content.rb +20 -8
- data/lib/adzerk_decision_sdk/models/decision.rb +31 -8
- data/lib/adzerk_decision_sdk/models/decision_request.rb +74 -12
- 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 +227 -0
- data/lib/adzerk_decision_sdk/models/placement.rb +91 -12
- data/lib/adzerk_decision_sdk/models/pricing_data.rb +19 -7
- data/lib/adzerk_decision_sdk/models/{decision_data.rb → request_location.rb} +16 -52
- data/lib/adzerk_decision_sdk/models/user.rb +19 -7
- data/lib/adzerk_decision_sdk/pixel_client.rb +8 -2
- data/lib/adzerk_decision_sdk/user_db_client.rb +18 -4
- data/lib/adzerk_decision_sdk/version.rb +1 -1
- data/spec/spec_helper.rb +91 -0
- metadata +15 -34
- data/docs/DecisionData.md +0 -27
- data/pkg/adzerk_decision_sdk-1.0.0.gem +0 -0
- data/pkg/adzerk_decision_sdk-1.0.0.pre.beta.1.gem +0 -0
- data/pkg/adzerk_decision_sdk-1.0.0.pre.beta.2.gem +0 -0
data/lib/adzerk_decision_sdk.rb
CHANGED
@@ -24,13 +24,13 @@ require 'adzerk_decision_sdk/configuration'
|
|
24
24
|
require 'adzerk_decision_sdk/models/consent_request'
|
25
25
|
require 'adzerk_decision_sdk/models/content'
|
26
26
|
require 'adzerk_decision_sdk/models/decision'
|
27
|
-
require 'adzerk_decision_sdk/models/decision_data'
|
28
27
|
require 'adzerk_decision_sdk/models/event'
|
29
28
|
require 'adzerk_decision_sdk/models/placement'
|
30
29
|
require 'adzerk_decision_sdk/models/pricing_data'
|
31
30
|
require 'adzerk_decision_sdk/models/decision_request'
|
32
31
|
require 'adzerk_decision_sdk/models/decision_response'
|
33
32
|
require 'adzerk_decision_sdk/models/user'
|
33
|
+
require 'adzerk_decision_sdk/models/matched_point'
|
34
34
|
|
35
35
|
# APIs
|
36
36
|
require 'adzerk_decision_sdk/api/decision_api'
|
@@ -6,7 +6,7 @@
|
|
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.0.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -53,15 +53,16 @@ module AdzerkDecisionSdk
|
|
53
53
|
form_params = opts[:form_params] || {}
|
54
54
|
|
55
55
|
# http body (model)
|
56
|
-
post_body = opts[:
|
56
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'decision_request'])
|
57
57
|
|
58
58
|
# return_type
|
59
|
-
return_type = opts[:
|
59
|
+
return_type = opts[:debug_return_type] || 'DecisionResponse'
|
60
60
|
|
61
61
|
# auth_names
|
62
|
-
auth_names = opts[:
|
62
|
+
auth_names = opts[:debug_auth_names] || []
|
63
63
|
|
64
64
|
new_options = opts.merge(
|
65
|
+
:operation => :"DecisionApi.get_decisions",
|
65
66
|
:header_params => header_params,
|
66
67
|
:query_params => query_params,
|
67
68
|
:form_params => form_params,
|
@@ -6,7 +6,7 @@
|
|
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.0.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -66,15 +66,16 @@ module AdzerkDecisionSdk
|
|
66
66
|
form_params = opts[:form_params] || {}
|
67
67
|
|
68
68
|
# http body (model)
|
69
|
-
post_body = opts[:
|
69
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
|
70
70
|
|
71
71
|
# return_type
|
72
|
-
return_type = opts[:
|
72
|
+
return_type = opts[:debug_return_type] || 'File'
|
73
73
|
|
74
74
|
# auth_names
|
75
|
-
auth_names = opts[:
|
75
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
76
76
|
|
77
77
|
new_options = opts.merge(
|
78
|
+
:operation => :"UserdbApi.add_custom_properties",
|
78
79
|
:header_params => header_params,
|
79
80
|
:query_params => query_params,
|
80
81
|
:form_params => form_params,
|
@@ -140,15 +141,16 @@ module AdzerkDecisionSdk
|
|
140
141
|
form_params = opts[:form_params] || {}
|
141
142
|
|
142
143
|
# http body (model)
|
143
|
-
post_body = opts[:
|
144
|
+
post_body = opts[:debug_body]
|
144
145
|
|
145
146
|
# return_type
|
146
|
-
return_type = opts[:
|
147
|
+
return_type = opts[:debug_return_type] || 'File'
|
147
148
|
|
148
149
|
# auth_names
|
149
|
-
auth_names = opts[:
|
150
|
+
auth_names = opts[:debug_auth_names] || []
|
150
151
|
|
151
152
|
new_options = opts.merge(
|
153
|
+
:operation => :"UserdbApi.add_interests",
|
152
154
|
:header_params => header_params,
|
153
155
|
:query_params => query_params,
|
154
156
|
:form_params => form_params,
|
@@ -219,15 +221,16 @@ module AdzerkDecisionSdk
|
|
219
221
|
form_params = opts[:form_params] || {}
|
220
222
|
|
221
223
|
# http body (model)
|
222
|
-
post_body = opts[:
|
224
|
+
post_body = opts[:debug_body]
|
223
225
|
|
224
226
|
# return_type
|
225
|
-
return_type = opts[:
|
227
|
+
return_type = opts[:debug_return_type] || 'File'
|
226
228
|
|
227
229
|
# auth_names
|
228
|
-
auth_names = opts[:
|
230
|
+
auth_names = opts[:debug_auth_names] || []
|
229
231
|
|
230
232
|
new_options = opts.merge(
|
233
|
+
:operation => :"UserdbApi.add_retargeting_segment",
|
231
234
|
:header_params => header_params,
|
232
235
|
:query_params => query_params,
|
233
236
|
:form_params => form_params,
|
@@ -284,15 +287,16 @@ module AdzerkDecisionSdk
|
|
284
287
|
form_params = opts[:form_params] || {}
|
285
288
|
|
286
289
|
# http body (model)
|
287
|
-
post_body = opts[:
|
290
|
+
post_body = opts[:debug_body]
|
288
291
|
|
289
292
|
# return_type
|
290
|
-
return_type = opts[:
|
293
|
+
return_type = opts[:debug_return_type]
|
291
294
|
|
292
295
|
# auth_names
|
293
|
-
auth_names = opts[:
|
296
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
294
297
|
|
295
298
|
new_options = opts.merge(
|
299
|
+
:operation => :"UserdbApi.forget",
|
296
300
|
:header_params => header_params,
|
297
301
|
:query_params => query_params,
|
298
302
|
:form_params => form_params,
|
@@ -348,15 +352,16 @@ module AdzerkDecisionSdk
|
|
348
352
|
form_params = opts[:form_params] || {}
|
349
353
|
|
350
354
|
# http body (model)
|
351
|
-
post_body = opts[:
|
355
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'consent_request'])
|
352
356
|
|
353
357
|
# return_type
|
354
|
-
return_type = opts[:
|
358
|
+
return_type = opts[:debug_return_type] || 'File'
|
355
359
|
|
356
360
|
# auth_names
|
357
|
-
auth_names = opts[:
|
361
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
358
362
|
|
359
363
|
new_options = opts.merge(
|
364
|
+
:operation => :"UserdbApi.gdpr_consent",
|
360
365
|
:header_params => header_params,
|
361
366
|
:query_params => query_params,
|
362
367
|
:form_params => form_params,
|
@@ -422,15 +427,16 @@ module AdzerkDecisionSdk
|
|
422
427
|
form_params = opts[:form_params] || {}
|
423
428
|
|
424
429
|
# http body (model)
|
425
|
-
post_body = opts[:
|
430
|
+
post_body = opts[:debug_body]
|
426
431
|
|
427
432
|
# return_type
|
428
|
-
return_type = opts[:
|
433
|
+
return_type = opts[:debug_return_type] || 'File'
|
429
434
|
|
430
435
|
# auth_names
|
431
|
-
auth_names = opts[:
|
436
|
+
auth_names = opts[:debug_auth_names] || []
|
432
437
|
|
433
438
|
new_options = opts.merge(
|
439
|
+
:operation => :"UserdbApi.ip_override",
|
434
440
|
:header_params => header_params,
|
435
441
|
:query_params => query_params,
|
436
442
|
:form_params => form_params,
|
@@ -503,15 +509,16 @@ module AdzerkDecisionSdk
|
|
503
509
|
form_params = opts[:form_params] || {}
|
504
510
|
|
505
511
|
# http body (model)
|
506
|
-
post_body = opts[:
|
512
|
+
post_body = opts[:debug_body]
|
507
513
|
|
508
514
|
# return_type
|
509
|
-
return_type = opts[:
|
515
|
+
return_type = opts[:debug_return_type] || 'File'
|
510
516
|
|
511
517
|
# auth_names
|
512
|
-
auth_names = opts[:
|
518
|
+
auth_names = opts[:debug_auth_names] || []
|
513
519
|
|
514
520
|
new_options = opts.merge(
|
521
|
+
:operation => :"UserdbApi.match_user",
|
515
522
|
:header_params => header_params,
|
516
523
|
:query_params => query_params,
|
517
524
|
:form_params => form_params,
|
@@ -570,15 +577,16 @@ module AdzerkDecisionSdk
|
|
570
577
|
form_params = opts[:form_params] || {}
|
571
578
|
|
572
579
|
# http body (model)
|
573
|
-
post_body = opts[:
|
580
|
+
post_body = opts[:debug_body]
|
574
581
|
|
575
582
|
# return_type
|
576
|
-
return_type = opts[:
|
583
|
+
return_type = opts[:debug_return_type] || 'File'
|
577
584
|
|
578
585
|
# auth_names
|
579
|
-
auth_names = opts[:
|
586
|
+
auth_names = opts[:debug_auth_names] || []
|
580
587
|
|
581
588
|
new_options = opts.merge(
|
589
|
+
:operation => :"UserdbApi.opt_out",
|
582
590
|
:header_params => header_params,
|
583
591
|
:query_params => query_params,
|
584
592
|
:form_params => form_params,
|
@@ -637,15 +645,16 @@ module AdzerkDecisionSdk
|
|
637
645
|
form_params = opts[:form_params] || {}
|
638
646
|
|
639
647
|
# http body (model)
|
640
|
-
post_body = opts[:
|
648
|
+
post_body = opts[:debug_body]
|
641
649
|
|
642
650
|
# return_type
|
643
|
-
return_type = opts[:
|
651
|
+
return_type = opts[:debug_return_type] || 'Object'
|
644
652
|
|
645
653
|
# auth_names
|
646
|
-
auth_names = opts[:
|
654
|
+
auth_names = opts[:debug_auth_names] || []
|
647
655
|
|
648
656
|
new_options = opts.merge(
|
657
|
+
:operation => :"UserdbApi.read",
|
649
658
|
:header_params => header_params,
|
650
659
|
:query_params => query_params,
|
651
660
|
:form_params => form_params,
|
@@ -660,72 +669,5 @@ module AdzerkDecisionSdk
|
|
660
669
|
end
|
661
670
|
return data, status_code, headers
|
662
671
|
end
|
663
|
-
|
664
|
-
# Set User Cookie
|
665
|
-
# @param network_id [Integer] Your Network Id
|
666
|
-
# @param user_key [String] UserDB Id for the user
|
667
|
-
# @param [Hash] opts the optional parameters
|
668
|
-
# @return [File]
|
669
|
-
def set_user_cookie(network_id, user_key, opts = {})
|
670
|
-
data, _status_code, _headers = set_user_cookie_with_http_info(network_id, user_key, opts)
|
671
|
-
data
|
672
|
-
end
|
673
|
-
|
674
|
-
# Set User Cookie
|
675
|
-
# @param network_id [Integer] Your Network Id
|
676
|
-
# @param user_key [String] UserDB Id for the user
|
677
|
-
# @param [Hash] opts the optional parameters
|
678
|
-
# @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
|
679
|
-
def set_user_cookie_with_http_info(network_id, user_key, opts = {})
|
680
|
-
if @api_client.config.debugging
|
681
|
-
@api_client.config.logger.debug 'Calling API: UserdbApi.set_user_cookie ...'
|
682
|
-
end
|
683
|
-
# verify the required parameter 'network_id' is set
|
684
|
-
if @api_client.config.client_side_validation && network_id.nil?
|
685
|
-
fail ArgumentError, "Missing the required parameter 'network_id' when calling UserdbApi.set_user_cookie"
|
686
|
-
end
|
687
|
-
# verify the required parameter 'user_key' is set
|
688
|
-
if @api_client.config.client_side_validation && user_key.nil?
|
689
|
-
fail ArgumentError, "Missing the required parameter 'user_key' when calling UserdbApi.set_user_cookie"
|
690
|
-
end
|
691
|
-
# resource path
|
692
|
-
local_var_path = '/udb/{networkId}/set/i.gif'.sub('{' + 'networkId' + '}', CGI.escape(network_id.to_s))
|
693
|
-
|
694
|
-
# query parameters
|
695
|
-
query_params = opts[:query_params] || {}
|
696
|
-
query_params[:'userKey'] = user_key
|
697
|
-
|
698
|
-
# header parameters
|
699
|
-
header_params = opts[:header_params] || {}
|
700
|
-
# HTTP header 'Accept' (if needed)
|
701
|
-
header_params['Accept'] = @api_client.select_header_accept(['image/gif'])
|
702
|
-
|
703
|
-
# form parameters
|
704
|
-
form_params = opts[:form_params] || {}
|
705
|
-
|
706
|
-
# http body (model)
|
707
|
-
post_body = opts[:body]
|
708
|
-
|
709
|
-
# return_type
|
710
|
-
return_type = opts[:return_type] || 'File'
|
711
|
-
|
712
|
-
# auth_names
|
713
|
-
auth_names = opts[:auth_names] || []
|
714
|
-
|
715
|
-
new_options = opts.merge(
|
716
|
-
:header_params => header_params,
|
717
|
-
:query_params => query_params,
|
718
|
-
:form_params => form_params,
|
719
|
-
:body => post_body,
|
720
|
-
:auth_names => auth_names,
|
721
|
-
:return_type => return_type
|
722
|
-
)
|
723
|
-
|
724
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
725
|
-
if @api_client.config.debugging
|
726
|
-
@api_client.config.logger.debug "API called: UserdbApi#set_user_cookie\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
727
|
-
end
|
728
|
-
return data, status_code, headers
|
729
|
-
end
|
730
672
|
end
|
731
673
|
end
|
@@ -6,7 +6,7 @@
|
|
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.0.1
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -14,6 +14,7 @@ require 'date'
|
|
14
14
|
require 'json'
|
15
15
|
require 'logger'
|
16
16
|
require 'tempfile'
|
17
|
+
require 'time'
|
17
18
|
require 'typhoeus'
|
18
19
|
|
19
20
|
module AdzerkDecisionSdk
|
@@ -86,7 +87,7 @@ module AdzerkDecisionSdk
|
|
86
87
|
# @option opts [Object] :body HTTP body (JSON/XML)
|
87
88
|
# @return [Typhoeus::Request] A Typhoeus Request
|
88
89
|
def build_request(http_method, path, opts = {})
|
89
|
-
url = build_request_url(path)
|
90
|
+
url = build_request_url(path, opts)
|
90
91
|
http_method = http_method.to_sym.downcase
|
91
92
|
|
92
93
|
header_params = @default_headers.merge(opts[:header_params] || {})
|
@@ -155,6 +156,44 @@ module AdzerkDecisionSdk
|
|
155
156
|
data
|
156
157
|
end
|
157
158
|
|
159
|
+
# Save response body into a file in (the defined) temporary folder, using the filename
|
160
|
+
# from the "Content-Disposition" header if provided, otherwise a random filename.
|
161
|
+
# The response body is written to the file in chunks in order to handle files which
|
162
|
+
# size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
|
163
|
+
# process can use.
|
164
|
+
#
|
165
|
+
# @see Configuration#temp_folder_path
|
166
|
+
def download_file(request)
|
167
|
+
tempfile = nil
|
168
|
+
encoding = nil
|
169
|
+
request.on_headers do |response|
|
170
|
+
content_disposition = response.headers['Content-Disposition']
|
171
|
+
if content_disposition && content_disposition =~ /filename=/i
|
172
|
+
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
173
|
+
prefix = sanitize_filename(filename)
|
174
|
+
else
|
175
|
+
prefix = 'download-'
|
176
|
+
end
|
177
|
+
prefix = prefix + '-' unless prefix.end_with?('-')
|
178
|
+
encoding = response.body.encoding
|
179
|
+
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
180
|
+
@tempfile = tempfile
|
181
|
+
end
|
182
|
+
request.on_body do |chunk|
|
183
|
+
chunk.force_encoding(encoding)
|
184
|
+
tempfile.write(chunk)
|
185
|
+
end
|
186
|
+
request.on_complete do |response|
|
187
|
+
if tempfile
|
188
|
+
tempfile.close
|
189
|
+
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
190
|
+
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
191
|
+
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
192
|
+
"explicitly with `tempfile.delete`"
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
158
197
|
# Check if the given MIME is a JSON MIME.
|
159
198
|
# JSON MIME examples:
|
160
199
|
# application/json
|
@@ -191,7 +230,7 @@ module AdzerkDecisionSdk
|
|
191
230
|
begin
|
192
231
|
data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
|
193
232
|
rescue JSON::ParserError => e
|
194
|
-
if %w(String Date
|
233
|
+
if %w(String Date Time).include?(return_type)
|
195
234
|
data = body
|
196
235
|
else
|
197
236
|
raise e
|
@@ -216,9 +255,9 @@ module AdzerkDecisionSdk
|
|
216
255
|
data.to_f
|
217
256
|
when 'Boolean'
|
218
257
|
data == true
|
219
|
-
when '
|
258
|
+
when 'Time'
|
220
259
|
# parse date time (expecting ISO 8601 format)
|
221
|
-
|
260
|
+
Time.parse data
|
222
261
|
when 'Date'
|
223
262
|
# parse date time (expecting ISO 8601 format)
|
224
263
|
Date.parse data
|
@@ -236,46 +275,9 @@ module AdzerkDecisionSdk
|
|
236
275
|
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
|
237
276
|
end
|
238
277
|
else
|
239
|
-
# models
|
240
|
-
AdzerkDecisionSdk.const_get(return_type)
|
241
|
-
|
242
|
-
end
|
243
|
-
|
244
|
-
# Save response body into a file in (the defined) temporary folder, using the filename
|
245
|
-
# from the "Content-Disposition" header if provided, otherwise a random filename.
|
246
|
-
# The response body is written to the file in chunks in order to handle files which
|
247
|
-
# size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
|
248
|
-
# process can use.
|
249
|
-
#
|
250
|
-
# @see Configuration#temp_folder_path
|
251
|
-
def download_file(request)
|
252
|
-
tempfile = nil
|
253
|
-
encoding = nil
|
254
|
-
request.on_headers do |response|
|
255
|
-
content_disposition = response.headers['Content-Disposition']
|
256
|
-
if content_disposition && content_disposition =~ /filename=/i
|
257
|
-
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
258
|
-
prefix = sanitize_filename(filename)
|
259
|
-
else
|
260
|
-
prefix = 'download-'
|
261
|
-
end
|
262
|
-
prefix = prefix + '-' unless prefix.end_with?('-')
|
263
|
-
encoding = response.body.encoding
|
264
|
-
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
265
|
-
@tempfile = tempfile
|
266
|
-
end
|
267
|
-
request.on_body do |chunk|
|
268
|
-
chunk.force_encoding(encoding)
|
269
|
-
tempfile.write(chunk)
|
270
|
-
end
|
271
|
-
request.on_complete do |response|
|
272
|
-
if tempfile
|
273
|
-
tempfile.close
|
274
|
-
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
275
|
-
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
276
|
-
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
277
|
-
"explicitly with `tempfile.delete`"
|
278
|
-
end
|
278
|
+
# models (e.g. Pet) or oneOf
|
279
|
+
klass = AdzerkDecisionSdk.const_get(return_type)
|
280
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
|
279
281
|
end
|
280
282
|
end
|
281
283
|
|
@@ -288,10 +290,10 @@ module AdzerkDecisionSdk
|
|
288
290
|
filename.gsub(/.*[\/\\]/, '')
|
289
291
|
end
|
290
292
|
|
291
|
-
def build_request_url(path)
|
293
|
+
def build_request_url(path, opts = {})
|
292
294
|
# Add leading and trailing slashes to path
|
293
295
|
path = "/#{path}".gsub(/\/+/, '/')
|
294
|
-
@config.base_url + path
|
296
|
+
@config.base_url(opts[:operation]) + path
|
295
297
|
end
|
296
298
|
|
297
299
|
# Update hearder and query params based on authentication settings.
|
@@ -306,7 +308,7 @@ module AdzerkDecisionSdk
|
|
306
308
|
case auth_setting[:in]
|
307
309
|
when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
|
308
310
|
when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
|
309
|
-
else fail ArgumentError, 'Authentication token must be in `query`
|
311
|
+
else fail ArgumentError, 'Authentication token must be in `query` or `header`'
|
310
312
|
end
|
311
313
|
end
|
312
314
|
end
|