blurb 0.3.2 → 0.4.0

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.
@@ -1,35 +0,0 @@
1
- module Blurb
2
- class Snapshot < BaseResource
3
- CAMPAIGNS = "campaigns"
4
- AD_GROUPS = "adGroups"
5
- KEYWORDS = "keywords"
6
- NEGATIVE_KEYWORDS = "negativeKeywords"
7
- CAMPAIGN_NEGATIVE_KEYWORDS = "campaignNegativeKeywords"
8
- PRODUCT_ADS = "productAds"
9
- TARGETS = "targets"
10
-
11
- def create(params = {}, opts = {})
12
- # required argument checks
13
- raise ArgumentError.new("params hash must contain a recordType") unless params["recordType"]
14
-
15
- # Default State Filter if no params passed in
16
- state_filter = params["stateFilter"] || "enabled,paused"
17
-
18
- # Default campaign type so version 2.3 is backward compatible with version 2.2
19
- campaign_type = params["campaignType"] || SPONSORED_PRODUCTS
20
-
21
- post_request("/v2/#{campaign_type}/#{params["recordType"]}/snapshot", {
22
- "stateFilter" => state_filter
23
- })
24
- end
25
-
26
- def status(snapshot_id, opts = {})
27
- get_request("/v2/snapshots/#{snapshot_id}")
28
- end
29
-
30
- def download(location, opts = {})
31
- opts.merge!({:full_path => true, :gzip => true, :no_token => true})
32
- get_request(location, opts)
33
- end
34
- end
35
- end
@@ -1,39 +0,0 @@
1
- module Blurb
2
- class SuggestedKeyword < BaseResource
3
- URL_PARAMS = ['maxNumSuggestions', 'adStateFilter', 'suggestBids']
4
-
5
- def ad_group_suggestions(params = {}, opts = {})
6
- # required argument checks
7
- raise ArgumentError.new("params hash must contain an adGroupId") unless params["adGroupId"]
8
-
9
- get_request("/v2/adGroups/#{params["adGroupId"]}/suggested/keywords?#{setup_url_params(params, URL_PARAMS)}")
10
- end
11
-
12
- def ad_group_extended_suggestions(params = {}, opts = {})
13
- # required argument checks
14
- raise ArgumentError.new("params hash must contain an adGroupId") unless params["adGroupId"]
15
-
16
- get_request("/v2/adGroups/#{params["adGroupId"]}/suggested/keywords/extended?#{setup_url_params(params, URL_PARAMS)}")
17
- end
18
-
19
- def asin_suggestions(params = {}, opts = {})
20
- # required argument checks
21
- raise ArgumentError.new("params hash must contain an asinValue") unless params["asinValue"]
22
-
23
- get_request("/v2/asins/#{params["asinValue"]}/suggested/keywords?#{setup_url_params(params, URL_PARAMS)}")
24
- end
25
-
26
- def bulk_asin_suggestions(params = {}, opts = {})
27
- # required argument checks
28
- raise ArgumentError.new("params hash must contain an asins array") unless params["asins"]
29
-
30
- maxNumSuggestions = 100
31
- maxNumSuggestions = params["maxNumSuggestions"] if params["maxNumSuggestions"]
32
-
33
- post_request("/v2/asins/suggested/keywords", {
34
- "asins" => params["asins"],
35
- "maxNumSuggestions" => maxNumSuggestions
36
- })
37
- end
38
- end
39
- end
@@ -1,3 +0,0 @@
1
- module Blurb
2
- VERSION = "0.3.2".freeze
3
- end