mirror of
https://github.com/dkam/paapi.git
synced 2025-12-28 15:14:52 +00:00
Add client, request and response classes
This commit is contained in:
11
lib/aws_paa.rb
Normal file
11
lib/aws_paa.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
require "aws_paa/version"
|
||||
|
||||
require 'aws_paa/client'
|
||||
require 'aws_paa/request'
|
||||
require 'aws_paa/response'
|
||||
|
||||
module AwsPaa
|
||||
class Error < StandardError; end
|
||||
class NotImplemented < StandardError; end
|
||||
# Your code goes here...
|
||||
end
|
||||
8
lib/aws_paa/client.rb
Normal file
8
lib/aws_paa/client.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'rest-client'
|
||||
|
||||
module AwsPaa
|
||||
class Client
|
||||
def initialize(:access_key, :secret_key, :marketplace, partner_tag: nil, partner_type: 'Associates')
|
||||
end
|
||||
end
|
||||
end
|
||||
43
lib/aws_paa/request.rb
Normal file
43
lib/aws_paa/request.rb
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
|
||||
module AwsPaa
|
||||
class Request
|
||||
def initialize()
|
||||
@request_example = {
|
||||
"Keywords": "Harry",
|
||||
"Marketplace": "www.amazon.com",
|
||||
"PartnerTag": "xyz-20",
|
||||
"PartnerType": "Associates",
|
||||
"Resources": ["Images.Primary.Small","ItemInfo.Title","Offers.Listings.Price"],
|
||||
"SearchIndex": "All"
|
||||
}
|
||||
|
||||
@headers = {
|
||||
'host' => 'webservices.amazon.com',
|
||||
'content-type' => 'application/json; charset=utf-8',
|
||||
'content-encoding' => 'amz-1.0',
|
||||
'x-amz-date' => '20160925T120000Z',
|
||||
'x-amz-target' => 'com.amazon.paapi5.v1.ProductAdvertisingAPIv1.SearchItems',
|
||||
'Authorization' => 'AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=&5d672d79c15b13162d9279b0855cfba6789a8edb4c82c400e06b5924a6f2b5d7;'
|
||||
}
|
||||
|
||||
@marketplaces = [www.amazon.com]
|
||||
end
|
||||
|
||||
def get_browse_nodes
|
||||
raise NotImplemented
|
||||
end
|
||||
|
||||
def get_items
|
||||
raise NotImplemented
|
||||
end
|
||||
|
||||
def get_variations
|
||||
raise NotImplemented
|
||||
end
|
||||
|
||||
def search_items
|
||||
raise NotImplemented
|
||||
end
|
||||
end
|
||||
end
|
||||
6
lib/aws_paa/response.rb
Normal file
6
lib/aws_paa/response.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
require 'json'
|
||||
|
||||
module AwsPaa
|
||||
class Response
|
||||
end
|
||||
end
|
||||
3
lib/aws_paa/version.rb
Normal file
3
lib/aws_paa/version.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
module AwsPaa
|
||||
VERSION = "0.1.0"
|
||||
end
|
||||
Reference in New Issue
Block a user