adzerk_decision_sdk 1.0.0.pre.beta.9 → 1.0.0.pre.beta.12
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 +4 -4
 - data/docs/Decision.md +2 -0
 - data/lib/adzerk_decision_sdk/client.rb +3 -0
 - data/lib/adzerk_decision_sdk/decision_client.rb +16 -0
 - data/lib/adzerk_decision_sdk/models/decision.rb +10 -1
 - data/lib/adzerk_decision_sdk/pixel_client.rb +2 -1
 - data/lib/adzerk_decision_sdk/version.rb +1 -1
 - data/openapitools.json +7 -0
 - metadata +3 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 13cf854831f1ac41060e1a71e3dc4a4b65c8d472e20caf4798626b0e0e97d00c
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 6fdc2f65beddae85bcdbe5d157615eb7928a6d6d9a55b5308033fddf80628ae2
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: e7d5231251f6fc2d640afc19e0add2ec0571d8abdd0257aab370ff664f2ff46458495018d11b4cedcfc3c87a99de2a5e6bf576baa46bbce7a7b4612a651f31c7
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: f7b44382abcb10c9b2380cdc4837cd05b314071f1e75dd949347d4a1260223f72913ca354c673c7188acdadfe1d4e03281bde2828e503b1fe4da6d9fd7be60d3
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            PATH
         
     | 
| 
       2 
2 
     | 
    
         
             
              remote: .
         
     | 
| 
       3 
3 
     | 
    
         
             
              specs:
         
     | 
| 
       4 
     | 
    
         
            -
                adzerk_decision_sdk (1.0.0.pre.beta. 
     | 
| 
      
 4 
     | 
    
         
            +
                adzerk_decision_sdk (1.0.0.pre.beta.12)
         
     | 
| 
       5 
5 
     | 
    
         
             
                  typhoeus (~> 1.0, >= 1.0.1)
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
            GEM
         
     | 
| 
         @@ -11,9 +11,9 @@ GEM 
     | 
|
| 
       11 
11 
     | 
    
         
             
                byebug (11.1.1)
         
     | 
| 
       12 
12 
     | 
    
         
             
                coderay (1.1.2)
         
     | 
| 
       13 
13 
     | 
    
         
             
                diff-lcs (1.3)
         
     | 
| 
       14 
     | 
    
         
            -
                ethon (0. 
     | 
| 
      
 14 
     | 
    
         
            +
                ethon (0.15.0)
         
     | 
| 
       15 
15 
     | 
    
         
             
                  ffi (>= 1.15.0)
         
     | 
| 
       16 
     | 
    
         
            -
                ffi (1.15. 
     | 
| 
      
 16 
     | 
    
         
            +
                ffi (1.15.5)
         
     | 
| 
       17 
17 
     | 
    
         
             
                jaro_winkler (1.5.4)
         
     | 
| 
       18 
18 
     | 
    
         
             
                method_source (0.9.2)
         
     | 
| 
       19 
19 
     | 
    
         
             
                parallel (1.19.1)
         
     | 
| 
         @@ -65,4 +65,4 @@ DEPENDENCIES 
     | 
|
| 
       65 
65 
     | 
    
         
             
              rubocop (~> 0.66.0)
         
     | 
| 
       66 
66 
     | 
    
         | 
| 
       67 
67 
     | 
    
         
             
            BUNDLED WITH
         
     | 
| 
       68 
     | 
    
         
            -
               2. 
     | 
| 
      
 68 
     | 
    
         
            +
               2.3.8
         
     | 
    
        data/docs/Decision.md
    CHANGED
    
    | 
         @@ -5,6 +5,7 @@ 
     | 
|
| 
       5 
5 
     | 
    
         
             
            | Name | Type | Description | Notes |
         
     | 
| 
       6 
6 
     | 
    
         
             
            | ---- | ---- | ----------- | ----- |
         
     | 
| 
       7 
7 
     | 
    
         
             
            | **ad_id** | **Integer** |  | [optional] |
         
     | 
| 
      
 8 
     | 
    
         
            +
            | **advertiser_id** | **Integer** |  | [optional] |
         
     | 
| 
       8 
9 
     | 
    
         
             
            | **creative_id** | **Integer** |  | [optional] |
         
     | 
| 
       9 
10 
     | 
    
         
             
            | **flight_id** | **Integer** |  | [optional] |
         
     | 
| 
       10 
11 
     | 
    
         
             
            | **campaign_id** | **Integer** |  | [optional] |
         
     | 
| 
         @@ -23,6 +24,7 @@ require 'adzerk_decision_sdk' 
     | 
|
| 
       23 
24 
     | 
    
         | 
| 
       24 
25 
     | 
    
         
             
            instance = AdzerkDecisionSdk::Decision.new(
         
     | 
| 
       25 
26 
     | 
    
         
             
              ad_id: null,
         
     | 
| 
      
 27 
     | 
    
         
            +
              advertiser_id: null,
         
     | 
| 
       26 
28 
     | 
    
         
             
              creative_id: null,
         
     | 
| 
       27 
29 
     | 
    
         
             
              flight_id: null,
         
     | 
| 
       28 
30 
     | 
    
         
             
              campaign_id: null,
         
     | 
| 
         @@ -35,6 +35,9 @@ module AdzerkDecisionSdk 
     | 
|
| 
       35 
35 
     | 
    
         | 
| 
       36 
36 
     | 
    
         
             
                  api_client = ApiClient.new(configuration)
         
     | 
| 
       37 
37 
     | 
    
         
             
                  api_client.default_headers['X-Adzerk-Sdk-Version'] = "adzerk-decision-sdk-ruby:#{version}"
         
     | 
| 
      
 38 
     | 
    
         
            +
                  if api_key
         
     | 
| 
      
 39 
     | 
    
         
            +
                    api_client.default_headers['X-Adzerk-ApiKey'] = api_key
         
     | 
| 
      
 40 
     | 
    
         
            +
                  end
         
     | 
| 
       38 
41 
     | 
    
         | 
| 
       39 
42 
     | 
    
         
             
                  @decisions = DecisionClient.new(network_id, site_id, api_client, configuration.logger)
         
     | 
| 
       40 
43 
     | 
    
         
             
                  @user_db = UserDbClient.new(network_id, api_client, configuration.logger)
         
     | 
| 
         @@ -44,6 +44,22 @@ module AdzerkDecisionSdk 
     | 
|
| 
       44 
44 
     | 
    
         
             
                  header_params['User-Agent'] = opts[:user_agent] if opts.has_key?(:user_agent)
         
     | 
| 
       45 
45 
     | 
    
         | 
| 
       46 
46 
     | 
    
         
             
                  if opts.has_key?(:include_explanation) and opts[:include_explanation] == true
         
     | 
| 
      
 47 
     | 
    
         
            +
                    if opts[:desired_ads]
         
     | 
| 
      
 48 
     | 
    
         
            +
                      header_object = {
         
     | 
| 
      
 49 
     | 
    
         
            +
                        api_key: opts[:api_key],
         
     | 
| 
      
 50 
     | 
    
         
            +
                        desired_ads: opts[:desired_ads]
         
     | 
| 
      
 51 
     | 
    
         
            +
                      }
         
     | 
| 
      
 52 
     | 
    
         
            +
                      header_params['X-Adzerk-Explain'] = header_object.to_json
         
     | 
| 
      
 53 
     | 
    
         
            +
                    end
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
                    if opts[:desired_ad_map]
         
     | 
| 
      
 56 
     | 
    
         
            +
                      header_object = {
         
     | 
| 
      
 57 
     | 
    
         
            +
                        api_key: opts[:api_key],
         
     | 
| 
      
 58 
     | 
    
         
            +
                        desired_ad_map: opts[:desired_ad_map]
         
     | 
| 
      
 59 
     | 
    
         
            +
                      }
         
     | 
| 
      
 60 
     | 
    
         
            +
                      header_params['X-Adzerk-Explain'] = header_object.to_json
         
     | 
| 
      
 61 
     | 
    
         
            +
                    end
         
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
       47 
63 
     | 
    
         
             
                    header_params['X-Adzerk-Explain'] = opts[:api_key]
         
     | 
| 
       48 
64 
     | 
    
         
             
                    @logger.warn("--------------------------------------------------------------")
         
     | 
| 
       49 
65 
     | 
    
         
             
                    @logger.warn("              !!! WARNING - WARNING - WARNING !!!             ")
         
     | 
| 
         @@ -17,6 +17,8 @@ module AdzerkDecisionSdk 
     | 
|
| 
       17 
17 
     | 
    
         
             
              class Decision
         
     | 
| 
       18 
18 
     | 
    
         
             
                attr_accessor :ad_id
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
      
 20 
     | 
    
         
            +
                attr_accessor :advertiser_id
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
       20 
22 
     | 
    
         
             
                attr_accessor :creative_id
         
     | 
| 
       21 
23 
     | 
    
         | 
| 
       22 
24 
     | 
    
         
             
                attr_accessor :flight_id
         
     | 
| 
         @@ -41,6 +43,7 @@ module AdzerkDecisionSdk 
     | 
|
| 
       41 
43 
     | 
    
         
             
                def self.attribute_map
         
     | 
| 
       42 
44 
     | 
    
         
             
                  {
         
     | 
| 
       43 
45 
     | 
    
         
             
                    :'ad_id' => :'adId',
         
     | 
| 
      
 46 
     | 
    
         
            +
                    :'advertiser_id' => :'advertiserId',
         
     | 
| 
       44 
47 
     | 
    
         
             
                    :'creative_id' => :'creativeId',
         
     | 
| 
       45 
48 
     | 
    
         
             
                    :'flight_id' => :'flightId',
         
     | 
| 
       46 
49 
     | 
    
         
             
                    :'campaign_id' => :'campaignId',
         
     | 
| 
         @@ -63,6 +66,7 @@ module AdzerkDecisionSdk 
     | 
|
| 
       63 
66 
     | 
    
         
             
                def self.openapi_types
         
     | 
| 
       64 
67 
     | 
    
         
             
                  {
         
     | 
| 
       65 
68 
     | 
    
         
             
                    :'ad_id' => :'Integer',
         
     | 
| 
      
 69 
     | 
    
         
            +
                    :'advertiser_id' => :'Integer',
         
     | 
| 
       66 
70 
     | 
    
         
             
                    :'creative_id' => :'Integer',
         
     | 
| 
       67 
71 
     | 
    
         
             
                    :'flight_id' => :'Integer',
         
     | 
| 
       68 
72 
     | 
    
         
             
                    :'campaign_id' => :'Integer',
         
     | 
| 
         @@ -101,6 +105,10 @@ module AdzerkDecisionSdk 
     | 
|
| 
       101 
105 
     | 
    
         
             
                    self.ad_id = attributes[:'ad_id']
         
     | 
| 
       102 
106 
     | 
    
         
             
                  end
         
     | 
| 
       103 
107 
     | 
    
         | 
| 
      
 108 
     | 
    
         
            +
                  if attributes.key?(:'advertiser_id')
         
     | 
| 
      
 109 
     | 
    
         
            +
                    self.advertiser_id = attributes[:'advertiser_id']
         
     | 
| 
      
 110 
     | 
    
         
            +
                  end
         
     | 
| 
      
 111 
     | 
    
         
            +
             
     | 
| 
       104 
112 
     | 
    
         
             
                  if attributes.key?(:'creative_id')
         
     | 
| 
       105 
113 
     | 
    
         
             
                    self.creative_id = attributes[:'creative_id']
         
     | 
| 
       106 
114 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -167,6 +175,7 @@ module AdzerkDecisionSdk 
     | 
|
| 
       167 
175 
     | 
    
         
             
                  return true if self.equal?(o)
         
     | 
| 
       168 
176 
     | 
    
         
             
                  self.class == o.class &&
         
     | 
| 
       169 
177 
     | 
    
         
             
                      ad_id == o.ad_id &&
         
     | 
| 
      
 178 
     | 
    
         
            +
                      advertiser_id == o.advertiser_id &&
         
     | 
| 
       170 
179 
     | 
    
         
             
                      creative_id == o.creative_id &&
         
     | 
| 
       171 
180 
     | 
    
         
             
                      flight_id == o.flight_id &&
         
     | 
| 
       172 
181 
     | 
    
         
             
                      campaign_id == o.campaign_id &&
         
     | 
| 
         @@ -188,7 +197,7 @@ module AdzerkDecisionSdk 
     | 
|
| 
       188 
197 
     | 
    
         
             
                # Calculates hash code according to all attributes.
         
     | 
| 
       189 
198 
     | 
    
         
             
                # @return [Integer] Hash code
         
     | 
| 
       190 
199 
     | 
    
         
             
                def hash
         
     | 
| 
       191 
     | 
    
         
            -
                  [ad_id, creative_id, flight_id, campaign_id, priority_id, click_url, contents, impression_url, events, matched_points, pricing].hash
         
     | 
| 
      
 200 
     | 
    
         
            +
                  [ad_id, advertiser_id, creative_id, flight_id, campaign_id, priority_id, click_url, contents, impression_url, events, matched_points, pricing].hash
         
     | 
| 
       192 
201 
     | 
    
         
             
                end
         
     | 
| 
       193 
202 
     | 
    
         | 
| 
       194 
203 
     | 
    
         
             
                # Builds the object from hash
         
     | 
| 
         @@ -8,7 +8,7 @@ module AdzerkDecisionSdk 
     | 
|
| 
       8 
8 
     | 
    
         
             
                  @logger = logger
         
     | 
| 
       9 
9 
     | 
    
         
             
                end
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
     | 
    
         
            -
                def fire(url, revenue_override: nil, additional_revenue: nil, event_multiplier: nil)
         
     | 
| 
      
 11 
     | 
    
         
            +
                def fire(url, revenue_override: nil, additional_revenue: nil, event_multiplier: nil, gross_merchandise_value: nil)
         
     | 
| 
       12 
12 
     | 
    
         
             
                  uri = URI(url)
         
     | 
| 
       13 
13 
     | 
    
         
             
                  @logger.info("Firing Pixel at base url of: #{uri.to_s}")
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
         @@ -16,6 +16,7 @@ module AdzerkDecisionSdk 
     | 
|
| 
       16 
16 
     | 
    
         
             
                  query_params << ["override", revenue_override] if not revenue_override.nil?
         
     | 
| 
       17 
17 
     | 
    
         
             
                  query_params << ["additional", additional_revenue] if not additional_revenue.nil?
         
     | 
| 
       18 
18 
     | 
    
         
             
                  query_params << ["eventMultiplier", event_multiplier] if not event_multiplier.nil?
         
     | 
| 
      
 19 
     | 
    
         
            +
                  query_params << ["gmv", gross_merchandise_value] if not gross_merchandise_value.nil?
         
     | 
| 
       19 
20 
     | 
    
         
             
                  uri.query = URI.encode_www_form(query_params)
         
     | 
| 
       20 
21 
     | 
    
         
             
                  new_url = uri.to_s()
         
     | 
| 
       21 
22 
     | 
    
         | 
    
        data/openapitools.json
    ADDED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: adzerk_decision_sdk
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.0.0.pre.beta. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.0.pre.beta.12
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Adzerk, Inc.
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2022-03-04 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: typhoeus
         
     | 
| 
         @@ -105,6 +105,7 @@ files: 
     | 
|
| 
       105 
105 
     | 
    
         
             
            - lib/adzerk_decision_sdk/rate_type.rb
         
     | 
| 
       106 
106 
     | 
    
         
             
            - lib/adzerk_decision_sdk/user_db_client.rb
         
     | 
| 
       107 
107 
     | 
    
         
             
            - lib/adzerk_decision_sdk/version.rb
         
     | 
| 
      
 108 
     | 
    
         
            +
            - openapitools.json
         
     | 
| 
       108 
109 
     | 
    
         
             
            - spec/.gitkeep
         
     | 
| 
       109 
110 
     | 
    
         
             
            - spec/placeholder_spec.rb
         
     | 
| 
       110 
111 
     | 
    
         
             
            - spec/spec_helper.rb
         
     |