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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fce29c00b972834e2083e8c1b2a76fb8a89c9a79d7ff19ec830b119f2556f658
4
- data.tar.gz: 946df902d9a95dd4861d0d3c1d71b8e9a3a4456230806bbe6ac201c5e5cbbfa9
3
+ metadata.gz: 69c2c3f742c3359a34c6a15ea195143430e194a6206f2a8b0080b74232ec9f34
4
+ data.tar.gz: 9530944f24b7c30a63a65650daf88ecf6feb2806fee2299838bb25fb3d19c2e6
5
5
  SHA512:
6
- metadata.gz: 55685179100bc74b81339c9c220700094b70f42f8635793708d37ba6241482fbd28ad855cd147e59dc3c261bf84caf98d05ab38354ffc9ae7438152d0ea3e4db
7
- data.tar.gz: 324b1ffb753da43fabbfba416be61895def6ad26f0c96452bd7d3c0947c5d48feba923a5a0c3ac7d1f202355ae98e2387aca1295b6dfa47452e0ca249edf5606
6
+ metadata.gz: 3759cc220044e90f877b03a1e54ae693781a1a04a9cef28b76b9a1ca0237c56d8ffd952282ee641aa155b9eb6539ae90c68a74e5a88a33b080b419e5beeb0acf
7
+ data.tar.gz: c59f853bd03677cebe2f6fbcc5e6364173f216ed326d3824b01984467f92fc5679c34e6440ab7f0e2645e4ad56ef825f032ec2f4c5463ab575901cf7d6f7380e
data/Gemfile.lock CHANGED
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- adzerk_decision_sdk (1.0.0.pre.beta.5)
5
- json (~> 2.1, >= 2.1.0)
4
+ adzerk_decision_sdk (1.0.0.pre.beta.7)
6
5
  typhoeus (~> 1.0, >= 1.0.1)
7
6
 
8
7
  GEM
@@ -12,11 +11,10 @@ GEM
12
11
  byebug (11.1.1)
13
12
  coderay (1.1.2)
14
13
  diff-lcs (1.3)
15
- ethon (0.12.0)
16
- ffi (>= 1.3.0)
17
- ffi (1.13.1)
14
+ ethon (0.14.0)
15
+ ffi (>= 1.15.0)
16
+ ffi (1.15.1)
18
17
  jaro_winkler (1.5.4)
19
- json (2.3.1)
20
18
  method_source (0.9.2)
21
19
  parallel (1.19.1)
22
20
  parser (2.7.0.2)
@@ -67,4 +65,4 @@ DEPENDENCIES
67
65
  rubocop (~> 0.66.0)
68
66
 
69
67
  BUNDLED WITH
70
- 2.1.2
68
+ 2.2.17
data/README.md CHANGED
@@ -96,9 +96,23 @@ client = AdzerkDecisionSdk::Client.new(network_id: 23, api_key: "YOUR_API_KEY")
96
96
  client.user_db.forget("abc")
97
97
  ```
98
98
 
99
- <!-- ### Logging Example
99
+ ### Logging
100
100
 
101
- TBD: ....... -->
101
+ Our logging implementation is meant to be flexible enough to fit into any common Ruby logging framework.
102
+
103
+ You can use the [logger](https://ruby-doc.org/stdlib-2.4.0/libdoc/logger/rdoc/Logger.html) utility to output messages.
104
+
105
+ The messages have associated levels: unknown, fatal, error, warn, info, and debug.
106
+
107
+ The easiest way to integrate is to write a function that handles translating the data from the Adzerk SDK Logger into whatever logging framework you're using in the rest of your application:
108
+
109
+ ```ruby
110
+ require "adzerk_decision_sdk"
111
+
112
+ logger.level("Message")
113
+
114
+ client = AdzerkDecisionSdk::Client.new(logger)
115
+ ```
102
116
 
103
117
  ## Documentation
104
118
 
@@ -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.3.1
11
+ OpenAPI Generator version: 5.0.1
12
12
 
13
13
  =end
14
14
 
@@ -24,11 +24,10 @@ Gem::Specification.new do |s|
24
24
  s.homepage = "http://adzerk.com"
25
25
  s.summary = "Adzerk Decision API"
26
26
  s.description = "Ruby library for the Adzerk Decision API"
27
- s.license = 'Apache-2.0'
28
- s.required_ruby_version = ">= 1.9"
27
+ s.license = "Apache-2.0"
28
+ s.required_ruby_version = ">= 2.4"
29
29
 
30
30
  s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
31
- s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
32
31
 
33
32
  s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
34
33
 
@@ -2,18 +2,19 @@
2
2
 
3
3
  ## Properties
4
4
 
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **user_key** | **String** | | [optional]
8
- **consent** | [**Object**](.md) | | [optional]
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **user_key** | **String** | | [optional] |
8
+ | **consent** | **Object** | | [optional] |
9
9
 
10
- ## Code Sample
10
+ ## Example
11
11
 
12
12
  ```ruby
13
- require 'AdzerkDecisionSdk'
13
+ require 'adzerk_decision_sdk'
14
14
 
15
- instance = AdzerkDecisionSdk::ConsentRequest.new(user_key: null,
16
- consent: null)
15
+ instance = AdzerkDecisionSdk::ConsentRequest.new(
16
+ user_key: null,
17
+ consent: null
18
+ )
17
19
  ```
18
20
 
19
-
data/docs/Content.md CHANGED
@@ -2,24 +2,25 @@
2
2
 
3
3
  ## Properties
4
4
 
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **type** | **String** | | [optional]
8
- **template** | **String** | | [optional]
9
- **custom_template** | **String** | | [optional]
10
- **data** | [**Object**](.md) | | [optional]
11
- **body** | **String** | | [optional]
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **type** | **String** | | [optional] |
8
+ | **template** | **String** | | [optional] |
9
+ | **custom_template** | **String** | | [optional] |
10
+ | **data** | **Object** | | [optional] |
11
+ | **body** | **String** | | [optional] |
12
12
 
13
- ## Code Sample
13
+ ## Example
14
14
 
15
15
  ```ruby
16
- require 'AdzerkDecisionSdk'
16
+ require 'adzerk_decision_sdk'
17
17
 
18
- instance = AdzerkDecisionSdk::Content.new(type: null,
19
- template: null,
20
- custom_template: null,
21
- data: null,
22
- body: null)
18
+ instance = AdzerkDecisionSdk::Content.new(
19
+ type: null,
20
+ template: null,
21
+ custom_template: null,
22
+ data: null,
23
+ body: null
24
+ )
23
25
  ```
24
26
 
25
-
data/docs/Decision.md CHANGED
@@ -2,36 +2,37 @@
2
2
 
3
3
  ## Properties
4
4
 
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **ad_id** | **Integer** | | [optional]
8
- **creative_id** | **Integer** | | [optional]
9
- **flight_id** | **Integer** | | [optional]
10
- **campaign_id** | **Integer** | | [optional]
11
- **priority_id** | **Integer** | | [optional]
12
- **click_url** | **String** | | [optional]
13
- **contents** | [**Array&lt;Content&gt;**](Content.md) | | [optional]
14
- **impression_url** | **String** | | [optional]
15
- **events** | [**Array&lt;Event&gt;**](Event.md) | | [optional]
16
- **matched_points** | [**Array&lt;MatchedPoint&gt;**](MatchedPoint.md) | | [optional]
17
- **pricing** | [**PricingData**](PricingData.md) | | [optional]
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **ad_id** | **Integer** | | [optional] |
8
+ | **creative_id** | **Integer** | | [optional] |
9
+ | **flight_id** | **Integer** | | [optional] |
10
+ | **campaign_id** | **Integer** | | [optional] |
11
+ | **priority_id** | **Integer** | | [optional] |
12
+ | **click_url** | **String** | | [optional] |
13
+ | **contents** | [**Array&lt;Content&gt;**](Content.md) | | [optional] |
14
+ | **impression_url** | **String** | | [optional] |
15
+ | **events** | [**Array&lt;Event&gt;**](Event.md) | | [optional] |
16
+ | **matched_points** | [**Array&lt;MatchedPoint&gt;**](MatchedPoint.md) | | [optional] |
17
+ | **pricing** | [**PricingData**](PricingData.md) | | [optional] |
18
18
 
19
- ## Code Sample
19
+ ## Example
20
20
 
21
21
  ```ruby
22
- require 'AdzerkDecisionSdk'
22
+ require 'adzerk_decision_sdk'
23
23
 
24
- instance = AdzerkDecisionSdk::Decision.new(ad_id: null,
25
- creative_id: null,
26
- flight_id: null,
27
- campaign_id: null,
28
- priority_id: null,
29
- click_url: null,
30
- contents: null,
31
- impression_url: null,
32
- events: null,
33
- matched_points: null,
34
- pricing: null)
24
+ instance = AdzerkDecisionSdk::Decision.new(
25
+ ad_id: null,
26
+ creative_id: null,
27
+ flight_id: null,
28
+ campaign_id: null,
29
+ priority_id: null,
30
+ click_url: null,
31
+ contents: null,
32
+ impression_url: null,
33
+ events: null,
34
+ matched_points: null,
35
+ pricing: null
36
+ )
35
37
  ```
36
38
 
37
-
data/docs/DecisionApi.md CHANGED
@@ -2,45 +2,62 @@
2
2
 
3
3
  All URIs are relative to *https://e-23.adzerk.net*
4
4
 
5
- Method | HTTP request | Description
6
- ------------- | ------------- | -------------
7
- [**get_decisions**](DecisionApi.md#get_decisions) | **POST** /api/v2 |
8
-
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**get_decisions**](DecisionApi.md#get_decisions) | **POST** /api/v2 | |
9
8
 
10
9
 
11
10
  ## get_decisions
12
11
 
13
- > DecisionResponse get_decisions(opts)
12
+ > <DecisionResponse> get_decisions(opts)
14
13
 
15
14
 
16
15
 
17
16
  Request Decision(s)
18
17
 
19
- ### Example
18
+ ### Examples
20
19
 
21
20
  ```ruby
22
- # load the gem
21
+ require 'time'
23
22
  require 'adzerk_decision_sdk'
24
23
 
25
24
  api_instance = AdzerkDecisionSdk::DecisionApi.new
26
25
  opts = {
27
- decision_request: {"placements": [{ "divName": "header", "networkId": 23, "siteId": 667480, "adTypes": [5] }] } # DecisionRequest |
26
+ decision_request: AdzerkDecisionSdk::DecisionRequest.new({placements: [AdzerkDecisionSdk::Placement.new]}) # DecisionRequest |
28
27
  }
29
28
 
30
29
  begin
30
+
31
31
  result = api_instance.get_decisions(opts)
32
32
  p result
33
33
  rescue AdzerkDecisionSdk::ApiError => e
34
- puts "Exception when calling DecisionApi->get_decisions: #{e}"
34
+ puts "Error when calling DecisionApi->get_decisions: #{e}"
35
35
  end
36
36
  ```
37
37
 
38
- ### Parameters
38
+ #### Using the get_decisions_with_http_info variant
39
+
40
+ This returns an Array which contains the response data, status code and headers.
39
41
 
42
+ > <Array(<DecisionResponse>, Integer, Hash)> get_decisions_with_http_info(opts)
43
+
44
+ ```ruby
45
+ begin
46
+
47
+ data, status_code, headers = api_instance.get_decisions_with_http_info(opts)
48
+ p status_code # => 2xx
49
+ p headers # => { ... }
50
+ p data # => <DecisionResponse>
51
+ rescue AdzerkDecisionSdk::ApiError => e
52
+ puts "Error when calling DecisionApi->get_decisions_with_http_info: #{e}"
53
+ end
54
+ ```
55
+
56
+ ### Parameters
40
57
 
41
- Name | Type | Description | Notes
42
- ------------- | ------------- | ------------- | -------------
43
- **decision_request** | [**DecisionRequest**](DecisionRequest.md)| | [optional]
58
+ | Name | Type | Description | Notes |
59
+ | ---- | ---- | ----------- | ----- |
60
+ | **decision_request** | [**DecisionRequest**](DecisionRequest.md) | | [optional] |
44
61
 
45
62
  ### Return type
46
63
 
@@ -2,50 +2,53 @@
2
2
 
3
3
  ## Properties
4
4
 
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **placements** | [**Array&lt;Placement&gt;**](Placement.md) | One or more Placement objects |
8
- **user** | [**User**](User.md) | | [optional]
9
- **keywords** | **Array&lt;String&gt;** | Keywords for keyword Targeting. Such as &#x60;\&quot;keywords\&quot;: [\&quot;foo\&quot;, \&quot;bar\&quot;, \&quot;baz\&quot;]&#x60;. | [optional]
10
- **url** | **String** | The current page URL | [optional]
11
- **referrer** | **String** | The referrer URL | [optional]
12
- **ip** | **String** | The IP address. Required for [Geo-Targeting](https://dev.adzerk.com/docs/geo-location) | [optional]
13
- **blocked_creatives** | **Array&lt;Integer&gt;** | Numeric creative ids to disregard for ad selection | [optional]
14
- **is_mobile** | **Boolean** | If true, only ads containing a single image will be returned | [optional]
15
- **include_pricing_data** | **Boolean** | If true, return pricing data for the decision in the response | [optional]
16
- **notrack** | **Boolean** | If true, only return ads that are set to honor Do Not Track | [optional]
17
- **enable_bot_filtering** | **Boolean** | If making a client-side request, set to true. Defaults to false to ensure a server isn&#39;t seen as a bot. See [here](https://dev.adzerk.com/docs/tracking-overview#section-bot-filtering) for more info | [optional]
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
- **consent** | [**Object**](.md) | Object that sets the data consent preferences. Other consent settings are available in the GDPR settings documentation. | [optional]
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]
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **placements** | [**Array&lt;Placement&gt;**](Placement.md) | One or more Placement objects | |
8
+ | **user** | [**User**](User.md) | | [optional] |
9
+ | **keywords** | **Array&lt;String&gt;** | Keywords for keyword Targeting. Such as &#x60;\&quot;keywords\&quot;: [\&quot;foo\&quot;, \&quot;bar\&quot;, \&quot;baz\&quot;]&#x60;. | [optional] |
10
+ | **url** | **String** | The current page URL | [optional] |
11
+ | **referrer** | **String** | The referrer URL | [optional] |
12
+ | **ip** | **String** | The IP address. Required for [Geo-Targeting](https://dev.adzerk.com/docs/geo-location) | [optional] |
13
+ | **blocked_creatives** | **Array&lt;Integer&gt;** | Numeric creative ids to disregard for ad selection | [optional] |
14
+ | **is_mobile** | **Boolean** | If true, only ads containing a single image will be returned | [optional] |
15
+ | **include_pricing_data** | **Boolean** | If true, return pricing data for the decision in the response | [optional] |
16
+ | **notrack** | **Boolean** | If true, only return ads that are set to honor Do Not Track | [optional] |
17
+ | **enable_bot_filtering** | **Boolean** | If making a client-side request, set to true. Defaults to false to ensure a server isn&#39;t seen as a bot. See [here](https://dev.adzerk.com/docs/tracking-overview#section-bot-filtering) for more info | [optional] |
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
+ | **consent** | **Object** | Object that sets the data consent preferences. Other consent settings are available in the GDPR settings documentation. | [optional] |
20
+ | **device_id** | **String** | RTB requests only - sets an Identifier for Advertisers (IFA or IDFA) | [optional] |
21
+ | **parallel** | **Boolean** | | [optional] |
22
+ | **intended_latitude** | **Float** | | [optional] |
23
+ | **intended_longitude** | **Float** | | [optional] |
24
+ | **radius** | **Float** | | [optional] |
25
+ | **include_matched_points** | **Boolean** | | [optional] |
25
26
 
26
- ## Code Sample
27
+ ## Example
27
28
 
28
29
  ```ruby
29
- require 'AdzerkDecisionSdk'
30
+ require 'adzerk_decision_sdk'
30
31
 
31
- instance = AdzerkDecisionSdk::DecisionRequest.new(placements: null,
32
- user: null,
33
- keywords: null,
34
- url: null,
35
- referrer: null,
36
- ip: null,
37
- blocked_creatives: null,
38
- is_mobile: null,
39
- include_pricing_data: null,
40
- notrack: null,
41
- enable_bot_filtering: null,
42
- enable_user_dbip: null,
43
- consent: null,
44
- device_id: null,
45
- parallel: null,
46
- intended_latitude: null,
47
- intended_longitude: null,
48
- include_matched_points: null)
32
+ instance = AdzerkDecisionSdk::DecisionRequest.new(
33
+ placements: null,
34
+ user: null,
35
+ keywords: null,
36
+ url: null,
37
+ referrer: null,
38
+ ip: null,
39
+ blocked_creatives: null,
40
+ is_mobile: null,
41
+ include_pricing_data: null,
42
+ notrack: null,
43
+ enable_bot_filtering: null,
44
+ enable_user_dbip: null,
45
+ consent: null,
46
+ device_id: null,
47
+ parallel: null,
48
+ intended_latitude: null,
49
+ intended_longitude: null,
50
+ radius: null,
51
+ include_matched_points: null
52
+ )
49
53
  ```
50
54
 
51
-
@@ -2,20 +2,21 @@
2
2
 
3
3
  ## Properties
4
4
 
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **user** | [**User**](User.md) | | [optional]
8
- **decisions** | [**Object**](.md) | | [optional]
9
- **explain** | [**Object**](.md) | | [optional]
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **user** | [**User**](User.md) | | [optional] |
8
+ | **decisions** | **Object** | | [optional] |
9
+ | **explain** | **Object** | | [optional] |
10
10
 
11
- ## Code Sample
11
+ ## Example
12
12
 
13
13
  ```ruby
14
- require 'AdzerkDecisionSdk'
14
+ require 'adzerk_decision_sdk'
15
15
 
16
- instance = AdzerkDecisionSdk::DecisionResponse.new(user: null,
17
- decisions: null,
18
- explain: null)
16
+ instance = AdzerkDecisionSdk::DecisionResponse.new(
17
+ user: null,
18
+ decisions: null,
19
+ explain: null
20
+ )
19
21
  ```
20
22
 
21
-
data/docs/Event.md CHANGED
@@ -2,18 +2,19 @@
2
2
 
3
3
  ## Properties
4
4
 
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **id** | **Integer** | | [optional]
8
- **url** | **String** | | [optional]
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **Integer** | | [optional] |
8
+ | **url** | **String** | | [optional] |
9
9
 
10
- ## Code Sample
10
+ ## Example
11
11
 
12
12
  ```ruby
13
- require 'AdzerkDecisionSdk'
13
+ require 'adzerk_decision_sdk'
14
14
 
15
- instance = AdzerkDecisionSdk::Event.new(id: null,
16
- url: null)
15
+ instance = AdzerkDecisionSdk::Event.new(
16
+ id: null,
17
+ url: null
18
+ )
17
19
  ```
18
20
 
19
-