class AmzSpApi::SpConfiguration
Constants
Attributes
aws_access_key_id[RW]
aws_secret_access_key[RW]
client_id[RW]
client_secret[RW]
credentials_provider[RW]
get_access_token[RW]
refresh_token[RW]
region[RW]
sandbox[RW]
save_access_token[RW]
Public Class Methods
default()
click to toggle source
# File lib/sp_configuration.rb, line 36 def self.default @@default ||= SpConfiguration.new end
Public Instance Methods
access_token_key()
click to toggle source
# File lib/sp_configuration.rb, line 32 def access_token_key Digest::MD5.hexdigest("#{client_id} #{refresh_token}") end
aws_region()
click to toggle source
# File lib/sp_configuration.rb, line 16 def aws_region AWS_REGION_MAP[region] end
region=(region)
click to toggle source
# File lib/sp_configuration.rb, line 20 def region=(region) @region = region fail ApiError.new("#{region} is not supported or does not exist. Region must be one of the following: #{AWS_REGION_MAP.keys.join(', ')}") unless aws_region self.host = "#{sandbox ? "sandbox." : ""}sellingpartnerapi-#{region}.amazon.com" self.base_path = "/" # incorrectly set to full url by codegen end
sandbox=(sandbox)
click to toggle source
# File lib/sp_configuration.rb, line 27 def sandbox=(sandbox) @sandbox = sandbox self.region = @region end