blurb 0.4.11 → 0.4.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/blurb.gemspec +1 -1
- data/lib/blurb/campaign_requests.rb +23 -0
- data/lib/blurb/profile.rb +3 -2
- 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: f51804779721ce8f8d372f54e8d81b4a04595803cefe311407d2ee8dbb445789
|
4
|
+
data.tar.gz: 7962d3726afd7d7fbdcd8d7cf8721bf8b8db483ea5c8abb9540fa0cc7e65c62e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ed1f87374153e5064b0112cdec7ecf74b1e7078ab2197315fdb6429afbaeb0ce57ee824232cfefa19357d3e1698544794b77dad44d355370a2dd6dbc0bba8b0
|
7
|
+
data.tar.gz: af34fd65630827543685bf9f7367bae7bf44b3b904f3958892e42b0bc0c1d50dc6cf45b121540021e69648b80a0eb7b753aab3a30a4ef6e34a392215998fcc4e
|
data/blurb.gemspec
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'blurb/request_collection_with_campaign_type'
|
2
|
+
|
3
|
+
class Blurb
|
4
|
+
class CampaignRequests < RequestCollectionWithCampaignType
|
5
|
+
def create_bulk(create_array)
|
6
|
+
create_array = map_campaign_payload(create_array)
|
7
|
+
super(create_array)
|
8
|
+
end
|
9
|
+
|
10
|
+
def update_bulk(update_array)
|
11
|
+
update_array = map_campaign_payload(update_array)
|
12
|
+
super(update_array)
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def map_campaign_payload(payload)
|
18
|
+
campaign_type_string = "sponsoredProducts" if @campaign_type == CAMPAIGN_TYPE_CODES[:sp]
|
19
|
+
campaign_type_string = "sponsoredBrands" if @campaign_type == CAMPAIGN_TYPE_CODES[:sb]
|
20
|
+
payload.each{ |p| p[:campaign_type] = campaign_type_string }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/blurb/profile.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "blurb/account"
|
2
|
+
require "blurb/campaign_requests"
|
2
3
|
require "blurb/snapshot_requests"
|
3
4
|
require "blurb/report_requests"
|
4
5
|
require "blurb/request_collection"
|
@@ -23,13 +24,13 @@ class Blurb
|
|
23
24
|
@profile_id = profile_id
|
24
25
|
@account = account
|
25
26
|
|
26
|
-
@sp_campaigns =
|
27
|
+
@sp_campaigns = CampaignRequests.new(
|
27
28
|
headers: headers_hash,
|
28
29
|
base_url: @account.api_url,
|
29
30
|
resource: "campaigns",
|
30
31
|
campaign_type: CAMPAIGN_TYPE_CODES[:sp]
|
31
32
|
)
|
32
|
-
@sb_campaigns =
|
33
|
+
@sb_campaigns = CampaignRequests.new(
|
33
34
|
headers: headers_hash,
|
34
35
|
base_url: @account.api_url,
|
35
36
|
resource: "campaigns",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blurb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dlbunker
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-
|
13
|
+
date: 2020-03-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -175,6 +175,7 @@ files:
|
|
175
175
|
- lib/blurb.rb
|
176
176
|
- lib/blurb/account.rb
|
177
177
|
- lib/blurb/base_class.rb
|
178
|
+
- lib/blurb/campaign_requests.rb
|
178
179
|
- lib/blurb/client.rb
|
179
180
|
- lib/blurb/errors/failed_request.rb
|
180
181
|
- lib/blurb/errors/invalid_report_request.rb
|