peddler 1.6.7 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +69 -67
- data/lib/mws/feeds/client.rb +15 -12
- data/lib/mws/finances/client.rb +12 -11
- data/lib/mws/fulfillment_inbound_shipment/client.rb +79 -107
- data/lib/mws/fulfillment_inventory/client.rb +5 -5
- data/lib/mws/fulfillment_outbound_shipment/client.rb +36 -44
- data/lib/mws/merchant_fulfillment/client.rb +11 -17
- data/lib/mws/off_amazon_payments/client.rb +38 -68
- data/lib/mws/orders/client.rb +28 -24
- data/lib/mws/products/client.rb +118 -153
- data/lib/mws/recommendations/client.rb +13 -17
- data/lib/mws/reports/client.rb +24 -23
- data/lib/mws/sellers/client.rb +5 -5
- data/lib/mws/subscriptions/client.rb +25 -36
- data/lib/peddler/client.rb +47 -124
- data/lib/peddler/errors/builder.rb +40 -14
- data/lib/peddler/errors/class_generator.rb +34 -0
- data/lib/peddler/errors/error.rb +13 -3
- data/lib/peddler/headers.rb +27 -11
- data/lib/peddler/marketplace.rb +30 -11
- data/lib/peddler/vcr_matcher.rb +11 -1
- data/lib/peddler/version.rb +1 -1
- data/lib/peddler/xml_parser.rb +4 -2
- data/lib/peddler/xml_response_parser.rb +1 -1
- data/test/helper.rb +0 -1
- data/test/integration/test_errors.rb +2 -14
- data/test/integration/test_feeds.rb +0 -3
- data/test/integration/test_multibyte_queries.rb +1 -1
- data/test/integration/test_mws_headers.rb +3 -2
- data/test/integration/test_orders.rb +2 -1
- data/test/integration/test_products.rb +9 -9
- data/test/integration/test_recommendations.rb +1 -1
- data/test/integration/test_subscriptions.rb +2 -2
- data/test/integration_helper.rb +1 -1
- data/test/mws.yml +36 -0
- data/test/mws.yml.example +8 -12
- data/test/null_client.rb +10 -8
- data/test/unit/mws/test_feeds_client.rb +1 -2
- data/test/unit/mws/test_fulfillment_outbound_shipment_client.rb +1 -1
- data/test/unit/mws/test_off_amazon_payments_client.rb +1 -1
- data/test/unit/mws/test_orders_client.rb +7 -6
- data/test/unit/mws/test_products_client.rb +13 -28
- data/test/unit/mws/test_recommendations_client.rb +1 -2
- data/test/unit/mws/test_reports_client.rb +1 -1
- data/test/unit/mws/test_subscriptions_client.rb +1 -130
- data/test/unit/peddler/errors/test_builder.rb +54 -7
- data/test/unit/peddler/errors/test_class_generator.rb +18 -0
- data/test/unit/peddler/errors/test_error.rb +7 -2
- data/test/unit/peddler/test_client.rb +136 -190
- data/test/unit/peddler/test_flat_file_parser.rb +2 -2
- data/test/unit/peddler/test_headers.rb +19 -9
- data/test/unit/peddler/test_marketplace.rb +18 -5
- data/test/unit/peddler/test_vcr_matcher.rb +3 -1
- data/test/vcr_cassettes/Feeds.yml +4816 -5224
- data/test/vcr_cassettes/Reports.yml +3278 -2604
- metadata +8 -9
- data/lib/peddler/errors.rb +0 -12
- data/lib/peddler/errors/handler.rb +0 -59
- data/test/unit/peddler/errors/test_handler.rb +0 -62
- data/test/unit/peddler/test_errors.rb +0 -26
data/lib/mws/orders/client.rb
CHANGED
@@ -7,36 +7,40 @@ module MWS
|
|
7
7
|
# With the MWS Orders API, you can list orders created or updated during a
|
8
8
|
# time frame you specify or retrieve information about specific orders.
|
9
9
|
class Client < ::Peddler::Client
|
10
|
-
version '2013-09-01'
|
11
|
-
path "/Orders/#{version}"
|
10
|
+
self.version = '2013-09-01'
|
11
|
+
self.path = "/Orders/#{version}"
|
12
12
|
|
13
13
|
# Lists orders
|
14
14
|
#
|
15
15
|
# @note When calling this operation, you must specify a time frame using
|
16
16
|
# either created_after or last_updated_after. When requesting orders by
|
17
17
|
# "Unshipped" status you must also request "PartiallyShipped" orders.
|
18
|
-
# @see
|
19
|
-
# @
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
18
|
+
# @see https://docs.developer.amazonservices.com/en_US/orders/2013-09-01/Orders_ListOrders.html
|
19
|
+
# @overload list_orders(*marketplace_id, opts = {})
|
20
|
+
# @param [Array<String>] marketplace_id
|
21
|
+
# @param [Hash] opts
|
22
|
+
# @option opts [String, #iso8601] :created_after
|
23
|
+
# @option opts [String, #iso8601] :created_before
|
24
|
+
# @option opts [String, #iso8601] :last_updated_after
|
25
|
+
# @option opts [String, #iso8601] :last_updated_before
|
26
|
+
# @option opts [Array<String>, String] :order_status
|
27
|
+
# @option opts [Array<String>, String] :fulfillment_channel
|
28
|
+
# @option opts [Array<String>, String] :payment_method
|
29
|
+
# @option opts [String] :buyer_email
|
30
|
+
# @option opts [String] :seller_order_id
|
31
|
+
# @option opts [String] :max_results_per_page
|
32
|
+
# @option opts [String] :tfm_shipment_status
|
32
33
|
# @return [Peddler::XMLParser]
|
33
|
-
def list_orders(
|
34
|
-
|
34
|
+
def list_orders(*marketplace_id)
|
35
|
+
marketplace_id = marketplace_id.dup
|
36
|
+
opts = extract_options(marketplace_id)
|
35
37
|
if opts.key?(:tfm_shipment_status)
|
36
38
|
opts['TFMShipmentStatus'] = opts.delete(:tfm_shipment_status)
|
37
39
|
end
|
40
|
+
|
38
41
|
operation('ListOrders')
|
39
42
|
.add(opts)
|
43
|
+
.add('MarketplaceId' => marketplace_id)
|
40
44
|
.structure!('OrderStatus', 'Status')
|
41
45
|
.structure!('FulfillmentChannel', 'Channel')
|
42
46
|
.structure!('MarketplaceId', 'Id')
|
@@ -49,7 +53,7 @@ module MWS
|
|
49
53
|
|
50
54
|
# Lists the next page of orders
|
51
55
|
#
|
52
|
-
# @see
|
56
|
+
# @see https://docs.developer.amazonservices.com/en_US/orders/2013-09-01/Orders_ListOrdersByNextToken.html
|
53
57
|
# @param [String] next_token
|
54
58
|
# @return [Peddler::XMLParser]
|
55
59
|
def list_orders_by_next_token(next_token)
|
@@ -61,8 +65,8 @@ module MWS
|
|
61
65
|
|
62
66
|
# Gets one or more orders
|
63
67
|
#
|
64
|
-
# @see
|
65
|
-
# @param [String]
|
68
|
+
# @see https://docs.developer.amazonservices.com/en_US/orders/2013-09-01/Orders_GetOrder.html
|
69
|
+
# @param [Array<String>] amazon_order_ids
|
66
70
|
# @return [Peddler::XMLParser]
|
67
71
|
def get_order(*amazon_order_ids)
|
68
72
|
operation('GetOrder')
|
@@ -74,7 +78,7 @@ module MWS
|
|
74
78
|
|
75
79
|
# Lists order items for an order
|
76
80
|
#
|
77
|
-
# @see
|
81
|
+
# @see https://docs.developer.amazonservices.com/en_US/orders/2013-09-01/Orders_ListOrderItems.html
|
78
82
|
# @param [String] amazon_order_id
|
79
83
|
# @return [Peddler::XMLParser]
|
80
84
|
def list_order_items(amazon_order_id)
|
@@ -86,7 +90,7 @@ module MWS
|
|
86
90
|
|
87
91
|
# Lists the next page of order items for an order
|
88
92
|
#
|
89
|
-
# @see
|
93
|
+
# @see https://docs.developer.amazonservices.com/en_US/orders/2013-09-01/Orders_ListOrderItemsByNextToken.html
|
90
94
|
# @param [String] next_token
|
91
95
|
# @return [Peddler::XMLParser]
|
92
96
|
def list_order_items_by_next_token(next_token)
|
@@ -98,7 +102,7 @@ module MWS
|
|
98
102
|
|
99
103
|
# Gets the service status of the API
|
100
104
|
#
|
101
|
-
# @see
|
105
|
+
# @see https://docs.developer.amazonservices.com/en_US/orders/2013-09-01/MWS_GetServiceStatus.html
|
102
106
|
# @return [Peddler::XMLParser]
|
103
107
|
def get_service_status
|
104
108
|
operation('GetServiceStatus')
|
data/lib/mws/products/client.rb
CHANGED
@@ -9,80 +9,66 @@ module MWS
|
|
9
9
|
# sourcing and pricing decisions for listing those products on Amazon
|
10
10
|
# Marketplace websites.
|
11
11
|
class Client < ::Peddler::Client
|
12
|
-
version '2011-10-01'
|
13
|
-
path "/Products/#{version}"
|
12
|
+
self.version = '2011-10-01'
|
13
|
+
self.path = "/Products/#{version}"
|
14
14
|
|
15
15
|
# Lists products and their attributes, based on a search query
|
16
16
|
#
|
17
|
-
# @see
|
18
|
-
# @
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
# @option opts [String] :marketplace_id
|
23
|
-
# @option opts [String] :query_context_id
|
17
|
+
# @see https://docs.developer.amazonservices.com/en_US/products/Products_ListMatchingProducts.html
|
18
|
+
# @param [String] marketplace_id
|
19
|
+
# @param [String] query
|
20
|
+
# @param [Hash] opts
|
21
|
+
# @option opts [String] :query_context_id
|
24
22
|
# @return [Peddler::XMLParser]
|
25
|
-
def list_matching_products(query, opts = {})
|
26
|
-
|
27
|
-
.add(opts
|
23
|
+
def list_matching_products(marketplace_id, query, opts = {})
|
24
|
+
operation('ListMatchingProducts')
|
25
|
+
.add(opts)
|
26
|
+
.add('MarketplaceId' => marketplace_id, 'Query' => query)
|
28
27
|
|
29
28
|
run
|
30
29
|
end
|
31
30
|
|
32
|
-
# Lists products and their attributes, based on a list of ASIN
|
33
|
-
# SellerSKU, UPC, EAN, ISBN, and JAN values
|
31
|
+
# Lists products and their attributes, based on a list of ASIN values
|
34
32
|
#
|
35
|
-
# @see
|
36
|
-
# @
|
37
|
-
#
|
38
|
-
# @param [String] id_type
|
39
|
-
# @param [String] id one or more ids
|
40
|
-
# @param [Hash] opts
|
41
|
-
# @option opts [String] :marketplace_id
|
33
|
+
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetMatchingProductForId.html
|
34
|
+
# @param [String] marketplace_id
|
35
|
+
# @param [Array<String>] asin_list
|
42
36
|
# @return [Peddler::XMLParser]
|
43
|
-
def
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
.add(opts.update('IdType' => id_type, 'IdList' => id_list))
|
48
|
-
.structure!('IdList', 'Id')
|
37
|
+
def get_matching_product(marketplace_id, *asin_list)
|
38
|
+
operation('GetMatchingProduct')
|
39
|
+
.add('MarketplaceId' => marketplace_id, 'ASINList' => asin_list)
|
40
|
+
.structure!('ASINList', 'ASIN')
|
49
41
|
|
50
42
|
run
|
51
43
|
end
|
52
44
|
|
53
|
-
# Lists products and their attributes, based on a list of ASIN
|
45
|
+
# Lists products and their attributes, based on a list of ASIN, GCID,
|
46
|
+
# SellerSKU, UPC, EAN, ISBN, and JAN values
|
54
47
|
#
|
55
|
-
# @see
|
56
|
-
# @
|
57
|
-
#
|
58
|
-
#
|
59
|
-
# @param [Hash] opts
|
60
|
-
# @option opts [String] :marketplace_id
|
48
|
+
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetMatchingProduct.html
|
49
|
+
# @param [String] marketplace_id
|
50
|
+
# @param [String] id_type
|
51
|
+
# @param [Array<String>] id_list
|
61
52
|
# @return [Peddler::XMLParser]
|
62
|
-
def
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
.
|
67
|
-
.structure!('ASINList', 'ASIN')
|
53
|
+
def get_matching_product_for_id(marketplace_id, id_type, *id_list)
|
54
|
+
operation('GetMatchingProductForId')
|
55
|
+
.add('MarketplaceId' => marketplace_id, 'IdType' => id_type,
|
56
|
+
'IdList' => id_list)
|
57
|
+
.structure!('IdList', 'Id')
|
68
58
|
|
69
59
|
run
|
70
60
|
end
|
71
61
|
|
72
62
|
# Gets the current competitive price of a product, based on Seller SKU
|
73
63
|
#
|
74
|
-
# @see
|
75
|
-
# @
|
76
|
-
#
|
77
|
-
# @param [String] seller_sku one or more seller_skus
|
78
|
-
# @param [Hash] opts
|
79
|
-
# @option opts [String] :marketplace_id
|
64
|
+
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetCompetitivePricingForSKU.html
|
65
|
+
# @param [String] marketplace_id
|
66
|
+
# @param [Array<String>] seller_sku_list
|
80
67
|
# @return [Peddler::XMLParser]
|
81
|
-
def get_competitive_pricing_for_sku(*seller_sku_list)
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
.add(opts.update('SellerSKUList' => seller_sku_list))
|
68
|
+
def get_competitive_pricing_for_sku(marketplace_id, *seller_sku_list)
|
69
|
+
operation('GetCompetitivePricingForSKU')
|
70
|
+
.add('MarketplaceId' => marketplace_id,
|
71
|
+
'SellerSKUList' => seller_sku_list)
|
86
72
|
.structure!('SellerSKUList', 'SellerSKU')
|
87
73
|
|
88
74
|
run
|
@@ -90,18 +76,13 @@ module MWS
|
|
90
76
|
|
91
77
|
# Gets the current competitive price of a product, identified by its ASIN
|
92
78
|
#
|
93
|
-
# @see
|
94
|
-
# @
|
95
|
-
#
|
96
|
-
# @param [String] asin one or more asins
|
97
|
-
# @param [Hash] opts
|
98
|
-
# @option opts [String] :marketplace_id
|
79
|
+
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetCompetitivePricingForASIN.html
|
80
|
+
# @param [String] marketplace_id
|
81
|
+
# @param [Array<String>] asin_list
|
99
82
|
# @return [Peddler::XMLParser]
|
100
|
-
def get_competitive_pricing_for_asin(*asin_list)
|
101
|
-
|
102
|
-
|
103
|
-
operation_with_marketplace('GetCompetitivePricingForASIN')
|
104
|
-
.add(opts.update('ASINList' => asin_list))
|
83
|
+
def get_competitive_pricing_for_asin(marketplace_id, *asin_list)
|
84
|
+
operation('GetCompetitivePricingForASIN')
|
85
|
+
.add('MarketplaceId' => marketplace_id, 'ASINList' => asin_list)
|
105
86
|
.structure!('ASINList', 'ASIN')
|
106
87
|
|
107
88
|
run
|
@@ -110,20 +91,22 @@ module MWS
|
|
110
91
|
# Gets pricing information for the lowest-price active offer listings for
|
111
92
|
# a product, based on Seller SKU
|
112
93
|
#
|
113
|
-
# @see
|
114
|
-
# @overload get_lowest_offer_listings_for_sku(*
|
115
|
-
#
|
116
|
-
# @param [String]
|
94
|
+
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetLowestOfferListingsForSKU.html
|
95
|
+
# @overload get_lowest_offer_listings_for_sku(marketplace_id, *seller_sku_list, opts = {})
|
96
|
+
# @param [String] marketplace_id
|
97
|
+
# @param [Array<String>] seller_sku_list
|
117
98
|
# @param [Hash] opts
|
118
|
-
# @option opts [String] :marketplace_id
|
119
99
|
# @option opts [String] :item_condition
|
120
100
|
# @option opts [Boolean] :exclude_me
|
121
101
|
# @return [Peddler::XMLParser]
|
122
|
-
def get_lowest_offer_listings_for_sku(*seller_sku_list)
|
102
|
+
def get_lowest_offer_listings_for_sku(marketplace_id, *seller_sku_list)
|
103
|
+
seller_sku_list = seller_sku_list.dup
|
123
104
|
opts = extract_options(seller_sku_list)
|
124
105
|
|
125
|
-
|
126
|
-
.add(opts
|
106
|
+
operation('GetLowestOfferListingsForSKU')
|
107
|
+
.add(opts)
|
108
|
+
.add('MarketplaceId' => marketplace_id,
|
109
|
+
'SellerSKUList' => seller_sku_list)
|
127
110
|
.structure!('SellerSKUList', 'SellerSKU')
|
128
111
|
|
129
112
|
run
|
@@ -132,20 +115,21 @@ module MWS
|
|
132
115
|
# Gets pricing information for the lowest-price active offer listings for
|
133
116
|
# a product, identified by its ASIN
|
134
117
|
#
|
135
|
-
# @see
|
136
|
-
# @overload
|
137
|
-
#
|
138
|
-
# @param [String]
|
118
|
+
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetLowestOfferListingsForASIN.html
|
119
|
+
# @overload get_lowest_offers_listings_for_asin(marketplace_id, *asin_list, opts = {})
|
120
|
+
# @param [String] marketplace_id
|
121
|
+
# @param [Array<String>] asin_list
|
139
122
|
# @param [Hash] opts
|
140
|
-
# @option opts [String] :marketplace_id
|
141
123
|
# @option opts [String] :item_condition
|
142
124
|
# @option opts [Boolean] :exclude_me
|
143
125
|
# @return [Peddler::XMLParser]
|
144
|
-
def get_lowest_offer_listings_for_asin(*asin_list)
|
126
|
+
def get_lowest_offer_listings_for_asin(marketplace_id, *asin_list)
|
127
|
+
asin_list = asin_list.dup
|
145
128
|
opts = extract_options(asin_list)
|
146
129
|
|
147
|
-
|
148
|
-
.add(opts
|
130
|
+
operation('GetLowestOfferListingsForASIN')
|
131
|
+
.add(opts)
|
132
|
+
.add('MarketplaceId' => marketplace_id, 'ASINList' => asin_list)
|
149
133
|
.structure!('ASINList', 'ASIN')
|
150
134
|
|
151
135
|
run
|
@@ -153,52 +137,41 @@ module MWS
|
|
153
137
|
|
154
138
|
# Gets lowest priced offers for a single product, based on SellerSKU
|
155
139
|
#
|
156
|
-
# @see
|
157
|
-
# @
|
158
|
-
#
|
159
|
-
#
|
160
|
-
# @param [String] item_condition
|
161
|
-
# @param [Hash] opts
|
162
|
-
# @option opts [String] :marketplace_id
|
140
|
+
# @see https://docs.developer.amazonservices.com/en_MX/products/Products_GetLowestPricedOffersForSKU.html
|
141
|
+
# @param [String] marketplace_id
|
142
|
+
# @param [String] seller_sku
|
143
|
+
# @param [String] item_condition
|
163
144
|
# @return [Peddler::XMLParser]
|
164
|
-
def get_lowest_priced_offers_for_sku(
|
165
|
-
|
166
|
-
|
167
|
-
'SellerSKU' => seller_sku,
|
168
|
-
|
169
|
-
)
|
170
|
-
operation_with_marketplace('GetLowestPricedOffersForSKU')
|
171
|
-
.add(opts)
|
145
|
+
def get_lowest_priced_offers_for_sku(marketplace_id, seller_sku,
|
146
|
+
item_condition)
|
147
|
+
operation('GetLowestPricedOffersForSKU')
|
148
|
+
.add('MarketplaceId' => marketplace_id, 'SellerSKU' => seller_sku,
|
149
|
+
'ItemCondition' => item_condition)
|
172
150
|
|
173
151
|
run
|
174
152
|
end
|
175
153
|
|
176
154
|
# Gets lowest priced offers for a single product, based on ASIN
|
177
155
|
#
|
178
|
-
# @see
|
179
|
-
# @
|
180
|
-
#
|
181
|
-
#
|
182
|
-
# @param [String] item_condition
|
183
|
-
# @param [Hash] opts
|
184
|
-
# @option opts [String] :marketplace_id
|
156
|
+
# @see https://docs.developer.amazonservices.com/en_MX/products/Products_GetLowestPricedOffersForASIN.html
|
157
|
+
# @param [String] marketplace_id
|
158
|
+
# @param [String] asin
|
159
|
+
# @param [String] item_condition
|
185
160
|
# @return [Peddler::XMLParser]
|
186
|
-
def get_lowest_priced_offers_for_asin(
|
187
|
-
|
188
|
-
|
189
|
-
'
|
190
|
-
|
191
|
-
operation_with_marketplace('GetLowestPricedOffersForASIN')
|
192
|
-
.add(opts)
|
161
|
+
def get_lowest_priced_offers_for_asin(marketplace_id, asin,
|
162
|
+
item_condition)
|
163
|
+
operation('GetLowestPricedOffersForASIN')
|
164
|
+
.add('MarketplaceId' => marketplace_id, 'ASIN' => asin,
|
165
|
+
'ItemCondition' => item_condition)
|
193
166
|
|
194
167
|
run
|
195
168
|
end
|
196
169
|
|
197
170
|
# Gets the estimated fees for a list of products.
|
198
171
|
#
|
199
|
-
# @see
|
200
|
-
# @see
|
201
|
-
# @param [Hash]
|
172
|
+
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetMyFeesEstimate.html
|
173
|
+
# @see https://docs.developer.amazonservices.com/en_US/products/Products_Datatypes.html#FeesEstimateRequest
|
174
|
+
# @param [Array<Struct, Hash>] fees_estimate_requests
|
202
175
|
# @return [Peddler::XMLParser]
|
203
176
|
def get_my_fees_estimate(*fees_estimate_requests)
|
204
177
|
operation('GetMyFeesEstimate')
|
@@ -211,19 +184,22 @@ module MWS
|
|
211
184
|
# Gets pricing information for seller's own offer listings, based on
|
212
185
|
# Seller SKU
|
213
186
|
#
|
214
|
-
# @see
|
215
|
-
# @overload get_my_price_for_sku(*
|
216
|
-
#
|
217
|
-
# @param [String]
|
187
|
+
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetMyPriceForSKU.html
|
188
|
+
# @overload get_my_price_for_sku(marketplace_id, *seller_sku_list,
|
189
|
+
# opts = {})
|
190
|
+
# @param [String] marketplace_id
|
191
|
+
# @param [Array<String>] seller_sku_list
|
218
192
|
# @param [Hash] opts
|
219
|
-
# @option opts [String] :marketplace_id
|
220
193
|
# @option opts [String] :item_condition
|
221
194
|
# @return [Peddler::XMLParser]
|
222
|
-
def get_my_price_for_sku(*seller_sku_list)
|
195
|
+
def get_my_price_for_sku(marketplace_id, *seller_sku_list)
|
196
|
+
seller_sku_list = seller_sku_list.dup
|
223
197
|
opts = extract_options(seller_sku_list)
|
224
198
|
|
225
|
-
|
226
|
-
.add(opts
|
199
|
+
operation('GetMyPriceForSKU')
|
200
|
+
.add(opts)
|
201
|
+
.add('MarketplaceId' => marketplace_id,
|
202
|
+
'SellerSKUList' => seller_sku_list)
|
227
203
|
.structure!('SellerSKUList', 'SellerSKU')
|
228
204
|
|
229
205
|
run
|
@@ -232,72 +208,61 @@ module MWS
|
|
232
208
|
# Gets pricing information for seller's own offer listings, identified by
|
233
209
|
# its ASIN
|
234
210
|
#
|
235
|
-
# @see
|
236
|
-
# @overload get_my_price_for_asin(*
|
237
|
-
#
|
238
|
-
# @param [String]
|
211
|
+
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetMyPriceForASIN.html
|
212
|
+
# @overload get_my_price_for_asin(marketplace_id, *asin_list, opts = {})
|
213
|
+
# @param [String] marketplace_id
|
214
|
+
# @param [Array<String>] asin_list
|
239
215
|
# @param [Hash] opts
|
240
|
-
# @option opts [String] :marketplace_id
|
241
216
|
# @option opts [String] :item_condition
|
242
217
|
# @return [Peddler::XMLParser]
|
243
|
-
def get_my_price_for_asin(*asin_list)
|
218
|
+
def get_my_price_for_asin(marketplace_id, *asin_list)
|
219
|
+
asin_list = asin_list.dup
|
244
220
|
opts = extract_options(asin_list)
|
245
221
|
|
246
|
-
|
247
|
-
.add(opts
|
222
|
+
operation('GetMyPriceForASIN')
|
223
|
+
.add(opts)
|
224
|
+
.add('MarketplaceId' => marketplace_id,
|
225
|
+
'ASINList' => asin_list)
|
248
226
|
.structure!('ASINList', 'ASIN')
|
249
227
|
|
250
228
|
run
|
251
229
|
end
|
252
230
|
|
253
231
|
# Gets parent product categories that a product belongs to, based on
|
254
|
-
# Seller
|
232
|
+
# Seller SKU
|
255
233
|
#
|
256
|
-
# @see
|
257
|
-
# @
|
258
|
-
#
|
259
|
-
# @param [String] seller_sku
|
260
|
-
# @param [Hash] opts
|
261
|
-
# @option opts [String] :marketplace_id
|
234
|
+
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetProductCategoriesForSKU.html
|
235
|
+
# @param [String] marketplace_id
|
236
|
+
# @param [String] seller_sku
|
262
237
|
# @return [Peddler::XMLParser]
|
263
|
-
def get_product_categories_for_sku(
|
264
|
-
|
265
|
-
.add(
|
238
|
+
def get_product_categories_for_sku(marketplace_id, seller_sku)
|
239
|
+
operation('GetProductCategoriesForSKU')
|
240
|
+
.add('MarketplaceId' => marketplace_id, 'SellerSKU' => seller_sku)
|
266
241
|
|
267
242
|
run
|
268
243
|
end
|
269
244
|
|
270
245
|
# Gets parent product categories that a product belongs to, based on ASIN
|
271
246
|
#
|
272
|
-
# @see
|
273
|
-
# @
|
274
|
-
#
|
275
|
-
# @param [String] asin
|
276
|
-
# @param [Hash] opts
|
277
|
-
# @option opts [String] :marketplace_id
|
247
|
+
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetProductCategoriesForASIN.html
|
248
|
+
# @param [String] marketplace_id
|
249
|
+
# @param [String] asin
|
278
250
|
# @return [Peddler::XMLParser]
|
279
|
-
def get_product_categories_for_asin(
|
280
|
-
|
281
|
-
.add(
|
251
|
+
def get_product_categories_for_asin(marketplace_id, asin)
|
252
|
+
operation('GetProductCategoriesForASIN')
|
253
|
+
.add('MarketplaceId' => marketplace_id, 'ASIN' => asin)
|
282
254
|
|
283
255
|
run
|
284
256
|
end
|
285
257
|
|
286
258
|
# Gets the service status of the API
|
287
259
|
#
|
288
|
-
# @see
|
260
|
+
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetServiceStatus.html
|
289
261
|
# @return [Peddler::XMLParser]
|
290
262
|
def get_service_status
|
291
263
|
operation('GetServiceStatus')
|
292
264
|
run
|
293
265
|
end
|
294
|
-
|
295
|
-
# @api private
|
296
|
-
def operation_with_marketplace(action)
|
297
|
-
operation(action).tap do |opts|
|
298
|
-
opts.store('MarketplaceId', primary_marketplace_id)
|
299
|
-
end
|
300
|
-
end
|
301
266
|
end
|
302
267
|
end
|
303
268
|
end
|