adzerk_decision_sdk 1.0.0.pre.beta.2 → 1.0.0.pre.beta.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98a58b88ec2b9ac57d7076dfc382414899a6d2572eac8f5f111cda4d95fa046b
4
- data.tar.gz: 24ebea4daeb15eb26df71a0684db120f98eaabad6509dcba5f4a85dded99fdb8
3
+ metadata.gz: ad73c68c0252fbd2ccbbd837f77aa25c67b52d64cd595586f9e3040ad9199082
4
+ data.tar.gz: 5059026a68d95ed6b749a56573a5e0d8bce32dafb9a6cdcbf5bcaa87a053a991
5
5
  SHA512:
6
- metadata.gz: 8f66f87ecac97e11d07ecfd015057408d34ed6e489edf4640bc85be439374ef152c436a09f34168e5011027278260e7544ed03fbff6f6e15535c21b8c705e39a
7
- data.tar.gz: 80727134639eaeeb3706d49c6b0a30d532c8f053fa0861c983504a28913a8ab9aa4b65cd58006154943d007f43c7f7520d9a7402aa29b38356c9e8eed67e218e
6
+ metadata.gz: 5e435954e9d9c91c2d47ebc040da9227bc00db16eb50f6cdca0b870cf2fb8876d156fbd2e8c5340db1fdea8da1091189681bbbf867cc434b99af02b66801095e
7
+ data.tar.gz: 8102a548ce7a4c1a785f00afb27366a7c20debdd4daba20bcc63481e1c9a7ac19cc308719a8ec8b0e80b674524c441bb1b668f006b9f94741f0fa9c44c76d32f
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
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
 
@@ -5,6 +5,7 @@
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
7
  **image_url** | **String** | | [optional]
8
+ **file_name** | **String** | | [optional]
8
9
  **title** | **String** | | [optional]
9
10
  **width** | **Integer** | | [optional]
10
11
  **height** | **Integer** | | [optional]
@@ -16,6 +17,7 @@ Name | Type | Description | Notes
16
17
  require 'AdzerkDecisionSdk'
17
18
 
18
19
  instance = AdzerkDecisionSdk::DecisionData.new(image_url: null,
20
+ file_name: null,
19
21
  title: null,
20
22
  width: null,
21
23
  height: null,
@@ -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
 
@@ -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
 
@@ -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
 
@@ -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
 
@@ -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
 
@@ -16,6 +16,8 @@ module AdzerkDecisionSdk
16
16
  class DecisionData
17
17
  attr_accessor :image_url
18
18
 
19
+ attr_accessor :file_name
20
+
19
21
  attr_accessor :title
20
22
 
21
23
  attr_accessor :width
@@ -27,7 +29,8 @@ module AdzerkDecisionSdk
27
29
  # Attribute mapping from ruby-style variable name to JSON key.
28
30
  def self.attribute_map
29
31
  {
30
- :'image_url' => :'imageURL',
32
+ :'image_url' => :'imageUrl',
33
+ :'file_name' => :'fileName',
31
34
  :'title' => :'title',
32
35
  :'width' => :'width',
33
36
  :'height' => :'height',
@@ -39,6 +42,7 @@ module AdzerkDecisionSdk
39
42
  def self.openapi_types
40
43
  {
41
44
  :'image_url' => :'String',
45
+ :'file_name' => :'String',
42
46
  :'title' => :'String',
43
47
  :'width' => :'Integer',
44
48
  :'height' => :'Integer',
@@ -71,6 +75,10 @@ module AdzerkDecisionSdk
71
75
  self.image_url = attributes[:'image_url']
72
76
  end
73
77
 
78
+ if attributes.key?(:'file_name')
79
+ self.file_name = attributes[:'file_name']
80
+ end
81
+
74
82
  if attributes.key?(:'title')
75
83
  self.title = attributes[:'title']
76
84
  end
@@ -107,6 +115,7 @@ module AdzerkDecisionSdk
107
115
  return true if self.equal?(o)
108
116
  self.class == o.class &&
109
117
  image_url == o.image_url &&
118
+ file_name == o.file_name &&
110
119
  title == o.title &&
111
120
  width == o.width &&
112
121
  height == o.height &&
@@ -122,7 +131,7 @@ module AdzerkDecisionSdk
122
131
  # Calculates hash code according to all attributes.
123
132
  # @return [Integer] Hash code
124
133
  def hash
125
- [image_url, title, width, height, custom_data].hash
134
+ [image_url, file_name, title, width, height, custom_data].hash
126
135
  end
127
136
 
128
137
  # Builds the object from hash
@@ -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
 
@@ -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
 
@@ -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
 
@@ -6,10 +6,10 @@
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
 
13
13
  module AdzerkDecisionSdk
14
- VERSION = '1.0.0-beta.2'
14
+ VERSION = '1.0.0-beta.3'
15
15
  end
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.2
4
+ version: 1.0.0.pre.beta.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adzerk, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-26 00:00:00.000000000 Z
11
+ date: 2020-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -125,6 +125,7 @@ files:
125
125
  - lib/adzerk_decision_sdk/version.rb
126
126
  - pkg/adzerk_decision_sdk-1.0.0.gem
127
127
  - pkg/adzerk_decision_sdk-1.0.0.pre.beta.1.gem
128
+ - pkg/adzerk_decision_sdk-1.0.0.pre.beta.2.gem
128
129
  - spec/.gitkeep
129
130
  - spec/placeholder_spec.rb
130
131
  homepage: http://adzerk.com