mirror of
https://github.com/dkam/paapi.git
synced 2025-12-28 07:04:53 +00:00
Merge branch 'add_condition' into master
This commit is contained in:
@@ -11,6 +11,7 @@ module Paapi
|
||||
SEARCH_PARAMS = %i[keywords actor, artist, author, brand title].freeze
|
||||
DEFAULT_PARTNER_TYPE = 'Associates'
|
||||
DEFAULT_MARKET = :us
|
||||
DEFAULT_CONDITION = 'Any'
|
||||
DEFAULT_RESOURCES = [
|
||||
'Images.Primary.Large',
|
||||
'ItemInfo.ByLineInfo',
|
||||
@@ -72,6 +73,7 @@ module Paapi
|
||||
:partner_type,
|
||||
:market,
|
||||
:partner_market,
|
||||
:condition,
|
||||
:resources,
|
||||
:test_mode
|
||||
|
||||
|
||||
@@ -4,13 +4,14 @@ require 'aws-sigv4'
|
||||
module Paapi
|
||||
class Client
|
||||
|
||||
attr_accessor :partner_tag, :marketplace, :resources
|
||||
attr_accessor :partner_tag, :marketplace, :resources, :condition
|
||||
attr_reader :partner_type, :access_key, :secret_key, :market
|
||||
|
||||
def initialize(access_key: Paapi.access_key,
|
||||
secret_key: Paapi.secret_key,
|
||||
partner_tag: Paapi.partner_tag,
|
||||
market: Paapi.market || DEFAULT_MARKET,
|
||||
condition: Paapi.condition || DEFAULT_CONDITION,
|
||||
resources: Paapi.resources || DEFAULT_RESOURCES,
|
||||
partner_type: DEFAULT_PARTNER_TYPE
|
||||
)
|
||||
@@ -20,7 +21,7 @@ module Paapi
|
||||
@secret_key = secret_key
|
||||
@partner_type = partner_type
|
||||
@resources = resources unless resources.nil?
|
||||
|
||||
@condition = condition
|
||||
self.market = market
|
||||
@partner_tag = partner_tag if !partner_tag.nil?
|
||||
end
|
||||
@@ -72,6 +73,7 @@ module Paapi
|
||||
}
|
||||
|
||||
default_payload = {
|
||||
'Condition' => condition,
|
||||
'PartnerTag' => partner_tag,
|
||||
'PartnerType' => partner_type,
|
||||
'Marketplace' => marketplace.site
|
||||
|
||||
Reference in New Issue
Block a user