lib/blurb/report.rb in blurb-0.2.3 vs lib/blurb/report.rb in blurb-0.3.0

- old
+ new

@@ -7,11 +7,11 @@ ASINS = "asins" TARGETS = "targets" SPONSORED_PRODUCTS = "sp" SPONSORED_BRANDS = "hsa" - def self.create(params = {}, opts = {}) + def create(params = {}, opts = {}) # required argument checks raise ArgumentError.new("params hash must contain a recordType") unless params["recordType"] # If no metrics are passed in, use the default metrics metrics = params["metrics"] || get_default_metrics(params["recordType"],params["campaignType"]) @@ -32,22 +32,20 @@ end post_request(request_url, api_params) end - def self.status(report_id, opts = {}) + def status(report_id, opts = {}) get_request("/v2/reports/#{report_id}") end - def self.download(location, opts = {}) + def download(location, opts = {}) opts.merge!({:full_path => true, :gzip => true, :no_token => true}) get_request(location, opts) end - private - - def self.get_default_metrics(record_type, campaign_type) + def get_default_metrics(record_type, campaign_type) if campaign_type == SPONSORED_BRANDS return [ "campaignName", "campaignId", "campaignStatus", @@ -116,10 +114,9 @@ "attributedSales7dOtherSKU", "attributedSales14dOtherSKU", "attributedSales30dOtherSKU" ].join(",") if record_type == ASINS return [ - "bidPlus", "campaignName", "campaignId", "campaignStatus", "campaignBudget", "impressions",