blurb 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +2 -1
- data/.gitignore +1 -0
- data/.travis.yml +2 -2
- data/README.md +39 -37
- data/bin/console +1 -0
- data/blurb.gemspec +8 -5
- data/lib/blurb.rb +19 -25
- data/lib/blurb/account.rb +108 -0
- data/lib/blurb/base_class.rb +8 -0
- data/lib/blurb/campaign_requests.rb +23 -0
- data/lib/blurb/client.rb +12 -0
- data/lib/blurb/profile.rb +140 -6
- data/lib/blurb/{report.rb → report_requests.rb} +50 -64
- data/lib/blurb/request.rb +81 -0
- data/lib/blurb/request_collection.rb +99 -0
- data/lib/blurb/request_collection_with_campaign_type.rb +12 -0
- data/lib/blurb/snapshot_requests.rb +36 -0
- data/lib/blurb/suggested_keyword_requests.rb +61 -0
- metadata +73 -16
- data/lib/blurb/ad_group.rb +0 -40
- data/lib/blurb/base_resource.rb +0 -172
- data/lib/blurb/bid_recommendation.rb +0 -24
- data/lib/blurb/campaign.rb +0 -38
- data/lib/blurb/keyword.rb +0 -51
- data/lib/blurb/snapshot.rb +0 -35
- data/lib/blurb/suggested_keyword.rb +0 -39
- data/lib/blurb/version.rb +0 -3
data/lib/blurb/snapshot.rb
DELETED
@@ -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
|
data/lib/blurb/version.rb
DELETED