Sha256: f048ed2e4c09885320dbbfc0ed1e0f45fd585fd6612aaf804d3cbb2b04e92297
Contents?: true
Size: 1.92 KB
Versions: 2
Compression:
Stored size: 1.92 KB
Contents
module Blurb class SuggestedKeyword < BaseResource def self.ad_group_suggestions(params = {}, opts = {}) # required argument checks raise ArgumentError.new("params hash must contain an adGroupId") unless params["adGroupId"] get_request("/v1/adGroups/#{params["adGroupId"]}/suggested/keywords?#{setup_url_params(params)}") end def self.ad_group_extended_suggestions(params = {}, opts = {}) # required argument checks raise ArgumentError.new("params hash must contain an adGroupId") unless params["adGroupId"] get_request("/v1/adGroups/#{params["adGroupId"]}/suggested/keywords/extended?#{setup_url_params(params)}") end def self.asin_suggestions(params = {}, opts = {}) # required argument checks raise ArgumentError.new("params hash must contain an asinValue") unless params["asinValue"] get_request("/v1/asins/#{params["asinValue"]}/suggested/keywords?#{setup_url_params(params)}") end def self.bulk_asin_suggestions(params = {}, opts = {}) # required argument checks raise ArgumentError.new("params hash must contain an asins array") unless params["asins"] maxNumSuggestions = 100 maxNumSuggestions = params["maxNumSuggestions"] if params["maxNumSuggestions"] post_request("/v1/asins/suggested/keywords", { "asins" => params["asins"], "maxNumSuggestions" => maxNumSuggestions }) end private def self.setup_url_params(params) url_params = "" url_params = "maxNumSuggestions=#{params['maxNumSuggestions']}" if params['maxNumSuggestions'] if params['adStateFilter'] url_params += "&" if url_params.size > 0 url_params += "adStateFilter=#{params['adStateFilter']}" end if params['suggestBids'] url_params += "&" if url_params.size > 0 url_params += "suggestBids=#{params['suggestBids']}" end return url_params end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
blurb-0.1.2 | lib/blurb/suggested_keyword.rb |
blurb-0.1.1 | lib/blurb/suggested_keyword.rb |