Documentation ¶
Index ¶
- Constants
- Variables
- type Argument
- type Client
- func (client Client) ItemLookup(query ItemLookupQuery) (*ItemLookupResponse, error)
- func (client Client) ItemLookupByKeyword(keywords []string) (*ItemLookupResponse, error)
- func (client Client) NewRequest(operation string) *Request
- func (client Client) ProcessRequest(request *Request) ([]byte, error)
- func (client Client) SignRequest(request *Request)
- type Config
- type Image
- type Item
- type ItemAttributes
- type ItemLookupQuery
- type ItemLookupRequest
- type ItemLookupResponse
- type Offer
- type OfferSummary
- type Offers
- type Price
- type Request
- type Response
Constants ¶
const EndpointURI = "/onca/xml"
EndpointURI is the fixed request URI of the API
Variables ¶
var Endpoints = map[string]string{
"BR": "webservices.amazon.com.br",
"CA": "webservices.amazon.ca",
"CN": "webservices.amazon.cn",
"DE": "webservices.amazon.de",
"ES": "webservices.amazon.es",
"FR": "webservices.amazon.fr",
"IN": "webservices.amazon.in",
"IT": "webservices.amazon.it",
"JP": "webservices.amazon.co.jp",
"MX": "webservices.amazon.com.mx",
"UK": "webservices.amazon.co.uk",
"US": "webservices.amazon.com",
}
Endpoints are the Amazon API endpoints by region
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides the functions to interact with the API
func (Client) ItemLookup ¶
func (client Client) ItemLookup(query ItemLookupQuery) (*ItemLookupResponse, error)
ItemLookup performs an ItemLookup request
func (Client) ItemLookupByKeyword ¶
func (client Client) ItemLookupByKeyword(keywords []string) (*ItemLookupResponse, error)
ItemLookup performs an ItemLookup request
func (Client) NewRequest ¶
NewRequest returns a request with basic parameters
func (Client) ProcessRequest ¶
ProcessRequest takes a request and queries the API
func (Client) SignRequest ¶
SignRequest produces the signature for the given query string
type Config ¶
type Config struct { AccessKey string AccessSecret string AssociateTag string Region string Secure bool }
Config describes the service configuration
type Item ¶
type Item struct { ASIN string URL string DetailPageURL string ItemAttributes ItemAttributes OfferSummary OfferSummary Offers Offers }
Item represents a product returned by the API
type ItemAttributes ¶
type ItemAttributes struct { Brand string Creator string Title string ListPrice Price Manufacturer string Publisher string NumberOfItems int PackageQuantity int Feature string Model string ProductGroup string ReleaseDate string Studio string Warranty string Size string UPC string }
ItemAttributes response group
type ItemLookupQuery ¶
type ItemLookupQuery struct { ItemIDs []string IDType string MerchantID string ResponseGroups []string }
ItemLookupQuery describes the allowed parameters for a ItemLookup request
type ItemLookupRequest ¶
type ItemLookupRequest struct { IDType string `xml:"IdType"` ItemID string `xml:"ItemId"` ResponseGroups []string `xml:"ResponseGroup"` VariationPage string }
ItemLookupRequest is the confirmation of a ItemLookup request
type ItemLookupResponse ¶
type ItemLookupResponse struct { Response Items struct { Request struct { IsValid bool ItemLookupRequest ItemLookupRequest } Items []Item `xml:"Item"` } }
ItemLookupResponse describes the API response for the ItemLookup operation
type Offer ¶
type Offer struct { Condition string `xml:"OfferAttributes>Condition"` ID string `xml:"OfferListing>OfferListingId"` Price Price `xml:"OfferListing>Price"` PercentageSaved uint `xml:"OfferListing>PercentageSaved"` Availability string `xml:"OfferListing>Availability"` }
Offer response attribute
type OfferSummary ¶
type OfferSummary struct { LowestNewPrice Price LowerUsedPrice Price TotalNew int TotalUsed int TotalCollectible int TotalRefurbished int }
OfferSummary response group
type Offers ¶
type Offers struct { TotalOffers int TotalOfferPages int MoreOffersURL string `xml:"MoreOffersUrl"` Offers []Offer `xml:"Offer"` }
Offers response group
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request represents an API request
func (Request) Parameters ¶
Parameters returns the request parameters
func (Request) QueryString ¶
QueryString returns the query string of the request
func (Request) SetParameter ¶
SetParameter adds a parameter to the request