Sha256: 1f51e792873ecd4496344f14e6af5f7eb2b51bb84197bafa14d50bc0d6e001ff

Contents?: true

Size: 1 KB

Versions: 6

Compression:

Stored size: 1 KB

Contents

require "oauth2"
require "rest-client"

require "blurb/version"
require "blurb/base_resource"

require "blurb/bid_recommendation"
require "blurb/campaign"
require "blurb/profile"
require "blurb/report"
require "blurb/snapshot"
require "blurb/suggested_keyword"
require "blurb/token"

module Blurb
  TOKEN_URL = "https://api.amazon.com"
  API_URL = "https://advertising-api.amazon.com"
  TEST_API_URL = "https://advertising-api-test.amazon.com"
  EU_API_URL = "https://advertising-api-eu.amazon.com"

  def self.client
    return OAuth2::Client.new(
      "",
      "",
      :site => TOKEN_URL
    )
  end

  # By default this gem will use the production API url unless the test_env module
  # variable is set to true. Then the test API url will be used
  def self.active_api_url
    if test_env
      return TEST_API_URL
    end
    if eu_env
      return EU_API_URL
    end

    return API_URL
  end

  class << self
    attr_accessor :client_secret, :client_id, :refresh_token, :profile_id, :test_env, :eu_env
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
blurb-0.2.3 lib/blurb.rb
blurb-0.2.2 lib/blurb.rb
blurb-0.2.1 lib/blurb.rb
blurb-0.2.0 lib/blurb.rb
blurb-0.1.2 lib/blurb.rb
blurb-0.1.1 lib/blurb.rb