blurb 0.2.1 → 0.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 004d2d0b9c693746aeaee5a50ab9162b261a1582
4
- data.tar.gz: 27edfbdf34bbf555ce2dd92f3810e4a4733aa06a
3
+ metadata.gz: 95515276b7058a1f6ab23991cc605a9294afa58c
4
+ data.tar.gz: f21e7906747788b74888e83e407bf5fe10da5608
5
5
  SHA512:
6
- metadata.gz: 744fb19e8af5a98530c37f35da86931b2ee976d09dc838ca3101de0fba695a8b8e2e5b0801a610871b0057061dfee686ba583cbf499c75368b0f3edc9570e3c5
7
- data.tar.gz: 7c8495be4e7ec9251d90f3528c74e8e33e84ec08907314c89fa929e18569228bc316ba146e8c8ddf17b0faf09db4b6a2b02de96d455460814cd67324cdcb8d4c
6
+ metadata.gz: e703d76700f42cbbc5999fa42e28652f4daab46a0740342045b5e2080a6f2e504eb0e9841cc13c9a1efeb5fb7373d4b1d482d8efaa7afb4d6187f12b841a87cc
7
+ data.tar.gz: 103d9d1ccc450e53cefa5de366eadf9e06b5ee97b4b13249548f1ba5f0e969c8df633b6d90fc79b5d66361c363e707223258dadc0e075dc3fe2cd87b20288531
data/README.md CHANGED
@@ -201,6 +201,7 @@ Blurb::Report::KEYWORDS
201
201
  Blurb::Report::CAMPAIGNS
202
202
  Blurb::Report::AD_GROUPS
203
203
  Blurb::Report::PRODUCT_ADS
204
+ Blurb::Report::ASINS
204
205
  ```
205
206
 
206
207
  Campaign types are
data/lib/blurb/report.rb CHANGED
@@ -4,6 +4,7 @@ module Blurb
4
4
  AD_GROUPS = "adGroups"
5
5
  KEYWORDS = "keywords"
6
6
  PRODUCT_ADS = "productAds"
7
+ ASINS = "asins"
7
8
  SPONSORED_PRODUCTS = "sp"
8
9
  SPONSORED_BRANDS = "hsa"
9
10
 
@@ -21,7 +22,15 @@ module Blurb
21
22
 
22
23
  api_params["segment"] = params["segment"] if params["segment"]
23
24
 
24
- post_request("/v2/#{params["campaignType"]}/#{params["recordType"]}/report", api_params)
25
+ if params["recordType"] == ASINS
26
+ request_url = "/v2/#{ASINS}/report"
27
+ api_params["campaignType"] = 'sponsoredProducts' if params["campaignType"] == SPONSORED_PRODUCTS
28
+ raise ArgumentError.new("ASIN report is not supported for Sponsored Brands") if params["campaignType"] == SPONSORED_BRANDS
29
+ else
30
+ request_url = "/v2/#{params["campaignType"]}/#{params["recordType"]}/report"
31
+ end
32
+
33
+ post_request(request_url, api_params)
25
34
  end
26
35
 
27
36
  def self.status(report_id, opts = {})
@@ -89,6 +98,24 @@ module Blurb
89
98
  "attributedConversions14dSameSKU"
90
99
  ].join(",") if record_type == KEYWORDS
91
100
  elsif campaign_type == SPONSORED_PRODUCTS
101
+ return [
102
+ "campaignName",
103
+ "campaignId",
104
+ "adGroupId",
105
+ "adGroupName",
106
+ "asin",
107
+ "otherAsin",
108
+ "sku",
109
+ "currency",
110
+ "attributedUnitsOrdered1dOtherSKU",
111
+ "attributedUnitsOrdered7dOtherSKU",
112
+ "attributedUnitsOrdered14dOtherSKU",
113
+ "attributedUnitsOrdered30dOtherSKU",
114
+ "attributedSales1dOtherSKU",
115
+ "attributedSales7dOtherSKU",
116
+ "attributedSales14dOtherSKU",
117
+ "attributedSales30dOtherSKU"
118
+ ].join(",") if record_type == ASINS
92
119
  return [
93
120
  "bidPlus",
94
121
  "campaignName",
data/lib/blurb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Blurb
2
- VERSION = "0.2.1".freeze
2
+ VERSION = "0.2.2".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blurb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - dlbunker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-25 00:00:00.000000000 Z
11
+ date: 2018-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler