adzerk_decision_sdk 1.0.0.pre.beta.1 → 1.0.0.pre.beta.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/Gemfile.lock +6 -6
  4. data/README.md +28 -2
  5. data/adzerk_decision_sdk.gemspec +1 -1
  6. data/docs/Content.md +1 -1
  7. data/docs/Decision.md +2 -0
  8. data/docs/DecisionRequest.md +9 -1
  9. data/docs/MatchedPoint.md +19 -0
  10. data/docs/Placement.md +9 -1
  11. data/docs/RequestLocation.md +19 -0
  12. data/docs/UserdbApi.md +0 -49
  13. data/lib/adzerk_decision_sdk.rb +1 -1
  14. data/lib/adzerk_decision_sdk/api/decision_api.rb +1 -1
  15. data/lib/adzerk_decision_sdk/api/userdb_api.rb +1 -68
  16. data/lib/adzerk_decision_sdk/api_client.rb +8 -6
  17. data/lib/adzerk_decision_sdk/api_error.rb +1 -1
  18. data/lib/adzerk_decision_sdk/client.rb +2 -2
  19. data/lib/adzerk_decision_sdk/configuration.rb +1 -1
  20. data/lib/adzerk_decision_sdk/decision_client.rb +21 -10
  21. data/lib/adzerk_decision_sdk/models/consent_request.rb +1 -1
  22. data/lib/adzerk_decision_sdk/models/content.rb +2 -2
  23. data/lib/adzerk_decision_sdk/models/decision.rb +13 -2
  24. data/lib/adzerk_decision_sdk/models/decision_request.rb +46 -6
  25. data/lib/adzerk_decision_sdk/models/decision_response.rb +1 -1
  26. data/lib/adzerk_decision_sdk/models/event.rb +1 -1
  27. data/lib/adzerk_decision_sdk/models/{decision_data.rb → matched_point.rb} +17 -44
  28. data/lib/adzerk_decision_sdk/models/placement.rb +73 -6
  29. data/lib/adzerk_decision_sdk/models/pricing_data.rb +1 -1
  30. data/lib/adzerk_decision_sdk/models/request_location.rb +215 -0
  31. data/lib/adzerk_decision_sdk/models/user.rb +1 -1
  32. data/lib/adzerk_decision_sdk/pixel_client.rb +8 -2
  33. data/lib/adzerk_decision_sdk/user_db_client.rb +16 -2
  34. data/lib/adzerk_decision_sdk/version.rb +2 -2
  35. data/pkg/adzerk_decision_sdk-1.0.0.pre.beta.3.gem +0 -0
  36. metadata +7 -5
  37. data/docs/DecisionData.md +0 -25
  38. data/pkg/adzerk_decision_sdk-1.0.0.gem +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffb53d3459cdf483d870b18c2618046e331e7c36ca40f2e3205892be67f3cd22
4
- data.tar.gz: 5f915af0222e96de0adfdedebb06f29836afdb4fa4f9417d5182f8f9aa679ad3
3
+ metadata.gz: fce29c00b972834e2083e8c1b2a76fb8a89c9a79d7ff19ec830b119f2556f658
4
+ data.tar.gz: 946df902d9a95dd4861d0d3c1d71b8e9a3a4456230806bbe6ac201c5e5cbbfa9
5
5
  SHA512:
6
- metadata.gz: 82d3aff0c40659a1fcbde114ac394170e0ed0e6406884cb3cda09ed966a5e5c7cf32482913ad57be0a7a6d3e4922217b22d5155143093d06606effc2d7691509
7
- data.tar.gz: a080a10d094e60e3dcb94b434c04ba52ca85c5d5b6930c76a688fc012067a26c02b08dfc53ac1bb447b500285bdf05747d29622513f5cb3300b79564ddfc3b27
6
+ metadata.gz: 55685179100bc74b81339c9c220700094b70f42f8635793708d37ba6241482fbd28ad855cd147e59dc3c261bf84caf98d05ab38354ffc9ae7438152d0ea3e4db
7
+ data.tar.gz: 324b1ffb753da43fabbfba416be61895def6ad26f0c96452bd7d3c0947c5d48feba923a5a0c3ac7d1f202355ae98e2387aca1295b6dfa47452e0ca249edf5606
data/Gemfile CHANGED
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  group :development, :test do
6
- gem 'rake', '~> 12.0.0'
6
+ gem 'rake', '~> 13.0.1'
7
7
  gem 'pry-byebug'
8
8
  gem 'rubocop', '~> 0.66.0'
9
9
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- adzerk_decision_sdk (1.0.0)
4
+ adzerk_decision_sdk (1.0.0.pre.beta.5)
5
5
  json (~> 2.1, >= 2.1.0)
6
6
  typhoeus (~> 1.0, >= 1.0.1)
7
7
 
@@ -14,9 +14,9 @@ GEM
14
14
  diff-lcs (1.3)
15
15
  ethon (0.12.0)
16
16
  ffi (>= 1.3.0)
17
- ffi (1.12.2)
17
+ ffi (1.13.1)
18
18
  jaro_winkler (1.5.4)
19
- json (2.3.0)
19
+ json (2.3.1)
20
20
  method_source (0.9.2)
21
21
  parallel (1.19.1)
22
22
  parser (2.7.0.2)
@@ -29,7 +29,7 @@ GEM
29
29
  pry (~> 0.10)
30
30
  psych (3.1.0)
31
31
  rainbow (3.0.0)
32
- rake (12.0.0)
32
+ rake (13.0.1)
33
33
  rspec (3.9.0)
34
34
  rspec-core (~> 3.9.0)
35
35
  rspec-expectations (~> 3.9.0)
@@ -52,7 +52,7 @@ GEM
52
52
  ruby-progressbar (~> 1.7)
53
53
  unicode-display_width (>= 1.4.0, < 1.6)
54
54
  ruby-progressbar (1.10.1)
55
- typhoeus (1.3.1)
55
+ typhoeus (1.4.0)
56
56
  ethon (>= 0.9.0)
57
57
  unicode-display_width (1.5.0)
58
58
 
@@ -62,7 +62,7 @@ PLATFORMS
62
62
  DEPENDENCIES
63
63
  adzerk_decision_sdk!
64
64
  pry-byebug
65
- rake (~> 12.0.0)
65
+ rake (~> 13.0.1)
66
66
  rspec (~> 3.6, >= 3.6.0)
67
67
  rubocop (~> 0.66.0)
68
68
 
data/README.md CHANGED
@@ -6,6 +6,8 @@ Ruby Software Development Kit for Adzerk Decision & UserDB APIs
6
6
 
7
7
  Requires [Ruby 2.5](https://en.wikipedia.org/wiki/Ruby_(programming_language)#Table_of_versions) or higher.
8
8
 
9
+ [RubyGem Package](https://rubygems.org/gems/adzerk_decision_sdk)
10
+
9
11
  ```shell
10
12
  gem install adzerk_decision_sdk
11
13
  ```
@@ -13,7 +15,7 @@ gem install adzerk_decision_sdk
13
15
  Or add to your `Gemfile`:
14
16
 
15
17
  ```ruby
16
- gem 'adzerk_decision_sdk', '~> 1.0.0'
18
+ gem 'adzerk_decision_sdk', '~> 1.0.0-pre.beta.2'
17
19
  ```
18
20
 
19
21
  ## Examples
@@ -43,6 +45,20 @@ request = {
43
45
  pp client.decisions.get(request)
44
46
  ```
45
47
 
48
+ ### Recording Impression & Clicks
49
+
50
+ Use with the fetch ad example above.
51
+
52
+ ```ruby
53
+ # Impression pixel; fire when user sees the ad
54
+ client.pixels.fire(decision.impression_url)
55
+
56
+ # Click pixel; fire when user clicks on the ad
57
+ # status: HTTP status code
58
+ # location: click target URL
59
+ status, location = client.pixels.fire(decision.click_url)
60
+ ```
61
+
46
62
  ### UserDB: Reading User Record
47
63
 
48
64
  ```ruby
@@ -59,7 +75,7 @@ pp client.user_db.read("abc")
59
75
  require "adzerk_decision_sdk"
60
76
 
61
77
  # Demo network ID; find your own via the Adzerk UI!
62
- client = AdzerkDecisionSdk::Client.new(network_id: 23, api_key: "YOUR_API_KEY")
78
+ client = AdzerkDecisionSdk::Client.new(network_id: 23)
63
79
 
64
80
  props = {
65
81
  favoriteColor: "blue",
@@ -70,6 +86,16 @@ props = {
70
86
  client.user_db.set_custom_properties("abc", props)
71
87
  ```
72
88
 
89
+ ### UserDB: Forgetting User Record
90
+
91
+ ```ruby
92
+ require "adzerk_decision_sdk"
93
+
94
+ # Demo network ID and API key; find your own via the Adzerk UI!
95
+ client = AdzerkDecisionSdk::Client.new(network_id: 23, api_key: "YOUR_API_KEY")
96
+ client.user_db.forget("abc")
97
+ ```
98
+
73
99
  <!-- ### Logging Example
74
100
 
75
101
  TBD: ....... -->
@@ -8,7 +8,7 @@
8
8
  The version of the OpenAPI document: 1.0
9
9
 
10
10
  Generated by: https://openapi-generator.tech
11
- OpenAPI Generator version: 4.2.3
11
+ OpenAPI Generator version: 4.3.1
12
12
 
13
13
  =end
14
14
 
@@ -7,7 +7,7 @@ Name | Type | Description | Notes
7
7
  **type** | **String** | | [optional]
8
8
  **template** | **String** | | [optional]
9
9
  **custom_template** | **String** | | [optional]
10
- **data** | [**DecisionData**](DecisionData.md) | | [optional]
10
+ **data** | [**Object**](.md) | | [optional]
11
11
  **body** | **String** | | [optional]
12
12
 
13
13
  ## Code Sample
@@ -13,6 +13,7 @@ Name | Type | Description | Notes
13
13
  **contents** | [**Array&lt;Content&gt;**](Content.md) | | [optional]
14
14
  **impression_url** | **String** | | [optional]
15
15
  **events** | [**Array&lt;Event&gt;**](Event.md) | | [optional]
16
+ **matched_points** | [**Array&lt;MatchedPoint&gt;**](MatchedPoint.md) | | [optional]
16
17
  **pricing** | [**PricingData**](PricingData.md) | | [optional]
17
18
 
18
19
  ## Code Sample
@@ -29,6 +30,7 @@ instance = AdzerkDecisionSdk::Decision.new(ad_id: null,
29
30
  contents: null,
30
31
  impression_url: null,
31
32
  events: null,
33
+ matched_points: null,
32
34
  pricing: null)
33
35
  ```
34
36
 
@@ -18,6 +18,10 @@ Name | Type | Description | Notes
18
18
  **enable_user_dbip** | **Boolean** | If true, override the IP address of the request with the IP address supplied on the UserKey. If no IP address is found on the UserKey, this will fall back to the IP address on the request. Requires UserDB | [optional]
19
19
  **consent** | [**Object**](.md) | Object that sets the data consent preferences. Other consent settings are available in the GDPR settings documentation. | [optional]
20
20
  **device_id** | **String** | RTB requests only - sets an Identifier for Advertisers (IFA or IDFA) | [optional]
21
+ **parallel** | **Boolean** | | [optional]
22
+ **intended_latitude** | **String** | | [optional]
23
+ **intended_longitude** | **String** | | [optional]
24
+ **include_matched_points** | **Boolean** | | [optional]
21
25
 
22
26
  ## Code Sample
23
27
 
@@ -37,7 +41,11 @@ instance = AdzerkDecisionSdk::DecisionRequest.new(placements: null,
37
41
  enable_bot_filtering: null,
38
42
  enable_user_dbip: null,
39
43
  consent: null,
40
- device_id: null)
44
+ device_id: null,
45
+ parallel: null,
46
+ intended_latitude: null,
47
+ intended_longitude: null,
48
+ include_matched_points: null)
41
49
  ```
42
50
 
43
51
 
@@ -0,0 +1,19 @@
1
+ # AdzerkDecisionSdk::MatchedPoint
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **lat** | **String** | | [optional]
8
+ **lon** | **String** | | [optional]
9
+
10
+ ## Code Sample
11
+
12
+ ```ruby
13
+ require 'AdzerkDecisionSdk'
14
+
15
+ instance = AdzerkDecisionSdk::MatchedPoint.new(lat: null,
16
+ lon: null)
17
+ ```
18
+
19
+
@@ -20,6 +20,10 @@ Name | Type | Description | Notes
20
20
  **count** | **Integer** | (BETA) The number of ads to return per placement. Integer between 1 and 20 | [optional]
21
21
  **proportionality** | **Boolean** | (BETA) If true, fills ads in a multi-winner placement in proportion to the flight&#39;s goals | [optional]
22
22
  **ecpm_partition** | **String** | (BETA) The name of the eCPM Partition that should be used to source eCPM data for auctions | [optional]
23
+ **ecpm_partitions** | **Array&lt;String&gt;** | (BETA) The names of the eCPM Partitions that should be used to source eCPM data for auctions | [optional]
24
+ **event_multiplier** | **Integer** | | [optional]
25
+ **skip_selection** | **Boolean** | | [optional]
26
+ **ad_query** | [**Object**](.md) | | [optional]
23
27
 
24
28
  ## Code Sample
25
29
 
@@ -41,7 +45,11 @@ instance = AdzerkDecisionSdk::Placement.new(div_name: null,
41
45
  content_keys: null,
42
46
  count: null,
43
47
  proportionality: null,
44
- ecpm_partition: null)
48
+ ecpm_partition: null,
49
+ ecpm_partitions: null,
50
+ event_multiplier: null,
51
+ skip_selection: null,
52
+ ad_query: null)
45
53
  ```
46
54
 
47
55
 
@@ -0,0 +1,19 @@
1
+ # AdzerkDecisionSdk::RequestLocation
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **latitude** | **String** | | [optional]
8
+ **longitude** | **String** | | [optional]
9
+
10
+ ## Code Sample
11
+
12
+ ```ruby
13
+ require 'AdzerkDecisionSdk'
14
+
15
+ instance = AdzerkDecisionSdk::RequestLocation.new(latitude: null,
16
+ longitude: null)
17
+ ```
18
+
19
+
@@ -13,7 +13,6 @@ Method | HTTP request | Description
13
13
  [**match_user**](UserdbApi.md#match_user) | **GET** /udb/{networkId}/sync/i.gif |
14
14
  [**opt_out**](UserdbApi.md#opt_out) | **GET** /udb/{networkId}/optout/i.gif |
15
15
  [**read**](UserdbApi.md#read) | **GET** /udb/{networkId}/read |
16
- [**set_user_cookie**](UserdbApi.md#set_user_cookie) | **GET** /udb/{networkId}/set/i.gif |
17
16
 
18
17
 
19
18
 
@@ -486,51 +485,3 @@ No authorization required
486
485
  - **Content-Type**: Not defined
487
486
  - **Accept**: application/json
488
487
 
489
-
490
- ## set_user_cookie
491
-
492
- > File set_user_cookie(network_id, user_key)
493
-
494
-
495
-
496
- Set User Cookie
497
-
498
- ### Example
499
-
500
- ```ruby
501
- # load the gem
502
- require 'adzerk_decision_sdk'
503
-
504
- api_instance = AdzerkDecisionSdk::UserdbApi.new
505
- network_id = 56 # Integer | Your Network Id
506
- user_key = 'user_key_example' # String | UserDB Id for the user
507
-
508
- begin
509
- result = api_instance.set_user_cookie(network_id, user_key)
510
- p result
511
- rescue AdzerkDecisionSdk::ApiError => e
512
- puts "Exception when calling UserdbApi->set_user_cookie: #{e}"
513
- end
514
- ```
515
-
516
- ### Parameters
517
-
518
-
519
- Name | Type | Description | Notes
520
- ------------- | ------------- | ------------- | -------------
521
- **network_id** | **Integer**| Your Network Id |
522
- **user_key** | **String**| UserDB Id for the user |
523
-
524
- ### Return type
525
-
526
- **File**
527
-
528
- ### Authorization
529
-
530
- No authorization required
531
-
532
- ### HTTP request headers
533
-
534
- - **Content-Type**: Not defined
535
- - **Accept**: image/gif
536
-
@@ -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: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -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: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -660,72 +660,5 @@ module AdzerkDecisionSdk
660
660
  end
661
661
  return data, status_code, headers
662
662
  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
663
  end
731
664
  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: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -269,11 +269,13 @@ module AdzerkDecisionSdk
269
269
  tempfile.write(chunk)
270
270
  end
271
271
  request.on_complete do |response|
272
- tempfile.close if tempfile
273
- @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
274
- "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
275
- "will be deleted automatically with GC. It's also recommended to delete the temp file "\
276
- "explicitly with `tempfile.delete`"
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
277
279
  end
278
280
  end
279
281