peddler 2.4.5 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +402 -140
- data/lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb +92 -0
- data/lib/peddler/api/aplus_content_2020_11_01.rb +246 -0
- data/lib/peddler/api/application_integrations_2024_04_01.rb +56 -0
- data/lib/peddler/api/application_management_2023_11_30.rb +35 -0
- data/lib/peddler/api/catalog_items_2020_12_01.rb +81 -0
- data/lib/peddler/api/catalog_items_2022_04_01.rb +93 -0
- data/lib/peddler/api/catalog_items_v0.rb +103 -0
- data/lib/peddler/api/data_kiosk_2023_11_15.rb +108 -0
- data/lib/peddler/api/easy_ship_2022_03_23.rb +127 -0
- data/lib/peddler/api/fba_inbound_eligibility_v1.rb +44 -0
- data/lib/peddler/api/fba_inventory_v1.rb +122 -0
- data/lib/peddler/api/feeds_2021_06_30.rb +122 -0
- data/lib/peddler/api/finances_2024_06_19.rb +50 -0
- data/lib/peddler/api/finances_v0.rb +148 -0
- data/lib/peddler/api/fulfillment_inbound_2024_03_20.rb +759 -0
- data/lib/peddler/api/fulfillment_inbound_v0.rb +352 -0
- data/lib/peddler/api/fulfillment_outbound_2020_07_01.rb +259 -0
- data/lib/peddler/api/invoices_2024_06_19.rb +180 -0
- data/lib/peddler/api/listings_items_2020_09_01.rb +95 -0
- data/lib/peddler/api/listings_items_2021_08_01.rb +170 -0
- data/lib/peddler/api/listings_restrictions_2021_08_01.rb +47 -0
- data/lib/peddler/api/merchant_fulfillment_v0.rb +80 -0
- data/lib/peddler/api/messaging_v1.rb +273 -0
- data/lib/peddler/api/notifications_v1.rb +145 -0
- data/lib/peddler/api/orders_v0.rb +279 -0
- data/lib/peddler/api/product_fees_v0.rb +77 -0
- data/lib/peddler/api/product_pricing_2022_05_01.rb +54 -0
- data/lib/peddler/api/product_pricing_v0.rb +162 -0
- data/lib/peddler/api/product_type_definitions_2020_09_01.rb +86 -0
- data/lib/peddler/api/replenishment_2022_11_07.rb +57 -0
- data/lib/peddler/api/reports_2021_06_30.rb +163 -0
- data/lib/peddler/api/sales_v1.rb +77 -0
- data/lib/peddler/api/sellers_v1.rb +45 -0
- data/lib/peddler/api/services_v1.rb +348 -0
- data/lib/peddler/api/shipment_invoicing_v0.rb +59 -0
- data/lib/peddler/api/shipping_v1.rb +132 -0
- data/lib/peddler/api/shipping_v2.rb +319 -0
- data/lib/peddler/api/solicitations_v1.rb +63 -0
- data/lib/peddler/api/supply_sources_2020_07_01.rb +100 -0
- data/lib/peddler/api/tokens_2021_03_01.rb +38 -0
- data/lib/peddler/api/uploads_2020_11_01.rb +50 -0
- data/lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb +32 -0
- data/lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb +84 -0
- data/lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb +84 -0
- data/lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb +31 -0
- data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +45 -0
- data/lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb +203 -0
- data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +189 -0
- data/lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb +32 -0
- data/lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb +32 -0
- data/lib/peddler/api/vendor_invoices_v1.rb +30 -0
- data/lib/peddler/api/vendor_orders_v1.rb +159 -0
- data/lib/peddler/api/vendor_shipments_v1.rb +132 -0
- data/lib/peddler/api/vendor_transaction_status_v1.rb +33 -0
- data/lib/peddler/api.rb +138 -0
- data/lib/peddler/endpoint.rb +51 -0
- data/lib/peddler/error.rb +31 -0
- data/lib/peddler/marketplace.rb +38 -68
- data/lib/peddler/token.rb +70 -0
- data/lib/peddler/version.rb +1 -1
- data/lib/peddler.rb +56 -1
- metadata +74 -80
- data/lib/mws/easy_ship/client.rb +0 -93
- data/lib/mws/easy_ship.rb +0 -3
- data/lib/mws/feeds/client.rb +0 -122
- data/lib/mws/feeds.rb +0 -3
- data/lib/mws/finances/client.rb +0 -82
- data/lib/mws/finances.rb +0 -3
- data/lib/mws/fulfillment_inbound_shipment/client.rb +0 -388
- data/lib/mws/fulfillment_inbound_shipment.rb +0 -3
- data/lib/mws/fulfillment_inventory/client.rb +0 -57
- data/lib/mws/fulfillment_inventory.rb +0 -3
- data/lib/mws/fulfillment_outbound_shipment/client.rb +0 -211
- data/lib/mws/fulfillment_outbound_shipment.rb +0 -3
- data/lib/mws/merchant_fulfillment/client.rb +0 -87
- data/lib/mws/merchant_fulfillment.rb +0 -3
- data/lib/mws/off_amazon_payments.rb +0 -3
- data/lib/mws/orders/client.rb +0 -120
- data/lib/mws/orders.rb +0 -3
- data/lib/mws/products/client.rb +0 -268
- data/lib/mws/products.rb +0 -3
- data/lib/mws/recommendations/client.rb +0 -72
- data/lib/mws/recommendations.rb +0 -3
- data/lib/mws/reports/client.rb +0 -236
- data/lib/mws/reports.rb +0 -3
- data/lib/mws/sellers/client.rb +0 -44
- data/lib/mws/sellers.rb +0 -3
- data/lib/mws/shipment_invoicing/client.rb +0 -74
- data/lib/mws/shipment_invoicing.rb +0 -3
- data/lib/mws/subscriptions/client.rb +0 -179
- data/lib/mws/subscriptions.rb +0 -3
- data/lib/mws.rb +0 -29
- data/lib/peddler/client.rb +0 -159
- data/lib/peddler/errors/builder.rb +0 -64
- data/lib/peddler/errors/class_generator.rb +0 -40
- data/lib/peddler/errors/error.rb +0 -45
- data/lib/peddler/errors/parser.rb +0 -28
- data/lib/peddler/flat_file_parser.rb +0 -56
- data/lib/peddler/headers.rb +0 -102
- data/lib/peddler/operation.rb +0 -78
- data/lib/peddler/parser.rb +0 -33
- data/lib/peddler/structured_list.rb +0 -23
- data/lib/peddler/vcr_matcher.rb +0 -97
- data/lib/peddler/xml_parser.rb +0 -38
- data/lib/peddler/xml_response_parser.rb +0 -25
data/lib/mws/products/client.rb
DELETED
@@ -1,268 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'peddler/client'
|
4
|
-
|
5
|
-
module MWS
|
6
|
-
module Products
|
7
|
-
# The MWS Products API helps you get information to match your products to
|
8
|
-
# existing product listings on Amazon Marketplace websites and to make
|
9
|
-
# sourcing and pricing decisions for listing those products on Amazon
|
10
|
-
# Marketplace websites.
|
11
|
-
class Client < ::Peddler::Client
|
12
|
-
self.version = '2011-10-01'
|
13
|
-
self.path = "/Products/#{version}"
|
14
|
-
|
15
|
-
# Lists products and their attributes, based on a search query
|
16
|
-
#
|
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
|
22
|
-
# @return [Peddler::XMLParser]
|
23
|
-
def list_matching_products(marketplace_id, query, opts = {})
|
24
|
-
operation('ListMatchingProducts')
|
25
|
-
.add(opts)
|
26
|
-
.add('MarketplaceId' => marketplace_id, 'Query' => query)
|
27
|
-
|
28
|
-
run
|
29
|
-
end
|
30
|
-
|
31
|
-
# Lists products and their attributes, based on a list of ASIN values
|
32
|
-
#
|
33
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetMatchingProductForId.html
|
34
|
-
# @param [String] marketplace_id
|
35
|
-
# @param [Array<String>] asin_list
|
36
|
-
# @return [Peddler::XMLParser]
|
37
|
-
def get_matching_product(marketplace_id, *asin_list)
|
38
|
-
operation('GetMatchingProduct')
|
39
|
-
.add('MarketplaceId' => marketplace_id, 'ASINList' => asin_list)
|
40
|
-
.structure!('ASINList', 'ASIN')
|
41
|
-
|
42
|
-
run
|
43
|
-
end
|
44
|
-
|
45
|
-
# Lists products and their attributes, based on a list of ASIN, GCID,
|
46
|
-
# SellerSKU, UPC, EAN, ISBN, and JAN values
|
47
|
-
#
|
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
|
52
|
-
# @return [Peddler::XMLParser]
|
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')
|
58
|
-
|
59
|
-
run
|
60
|
-
end
|
61
|
-
|
62
|
-
# Gets the current competitive price of a product, based on Seller SKU
|
63
|
-
#
|
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
|
67
|
-
# @return [Peddler::XMLParser]
|
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)
|
72
|
-
.structure!('SellerSKUList', 'SellerSKU')
|
73
|
-
|
74
|
-
run
|
75
|
-
end
|
76
|
-
|
77
|
-
# Gets the current competitive price of a product, identified by its ASIN
|
78
|
-
#
|
79
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetCompetitivePricingForASIN.html
|
80
|
-
# @param [String] marketplace_id
|
81
|
-
# @param [Array<String>] asin_list
|
82
|
-
# @return [Peddler::XMLParser]
|
83
|
-
def get_competitive_pricing_for_asin(marketplace_id, *asin_list)
|
84
|
-
operation('GetCompetitivePricingForASIN')
|
85
|
-
.add('MarketplaceId' => marketplace_id, 'ASINList' => asin_list)
|
86
|
-
.structure!('ASINList', 'ASIN')
|
87
|
-
|
88
|
-
run
|
89
|
-
end
|
90
|
-
|
91
|
-
# Gets pricing information for the lowest-price active offer listings for
|
92
|
-
# a product, based on Seller SKU
|
93
|
-
#
|
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
|
98
|
-
# @param [Hash] opts
|
99
|
-
# @option opts [String] :item_condition
|
100
|
-
# @option opts [Boolean] :exclude_me
|
101
|
-
# @return [Peddler::XMLParser]
|
102
|
-
def get_lowest_offer_listings_for_sku(marketplace_id, *seller_sku_list)
|
103
|
-
seller_sku_list = seller_sku_list.dup
|
104
|
-
opts = extract_options(seller_sku_list)
|
105
|
-
|
106
|
-
operation('GetLowestOfferListingsForSKU')
|
107
|
-
.add(opts)
|
108
|
-
.add('MarketplaceId' => marketplace_id,
|
109
|
-
'SellerSKUList' => seller_sku_list)
|
110
|
-
.structure!('SellerSKUList', 'SellerSKU')
|
111
|
-
|
112
|
-
run
|
113
|
-
end
|
114
|
-
|
115
|
-
# Gets pricing information for the lowest-price active offer listings for
|
116
|
-
# a product, identified by its ASIN
|
117
|
-
#
|
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
|
122
|
-
# @param [Hash] opts
|
123
|
-
# @option opts [String] :item_condition
|
124
|
-
# @option opts [Boolean] :exclude_me
|
125
|
-
# @return [Peddler::XMLParser]
|
126
|
-
def get_lowest_offer_listings_for_asin(marketplace_id, *asin_list)
|
127
|
-
asin_list = asin_list.dup
|
128
|
-
opts = extract_options(asin_list)
|
129
|
-
|
130
|
-
operation('GetLowestOfferListingsForASIN')
|
131
|
-
.add(opts)
|
132
|
-
.add('MarketplaceId' => marketplace_id, 'ASINList' => asin_list)
|
133
|
-
.structure!('ASINList', 'ASIN')
|
134
|
-
|
135
|
-
run
|
136
|
-
end
|
137
|
-
|
138
|
-
# Gets lowest priced offers for a single product, based on SellerSKU
|
139
|
-
#
|
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
|
144
|
-
# @return [Peddler::XMLParser]
|
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)
|
150
|
-
|
151
|
-
run
|
152
|
-
end
|
153
|
-
|
154
|
-
# Gets lowest priced offers for a single product, based on ASIN
|
155
|
-
#
|
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
|
160
|
-
# @return [Peddler::XMLParser]
|
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)
|
166
|
-
|
167
|
-
run
|
168
|
-
end
|
169
|
-
|
170
|
-
# Gets the estimated fees for a list of products.
|
171
|
-
#
|
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
|
175
|
-
# @return [Peddler::XMLParser]
|
176
|
-
def get_my_fees_estimate(*fees_estimate_requests)
|
177
|
-
operation('GetMyFeesEstimate')
|
178
|
-
.add('FeesEstimateRequestList' => fees_estimate_requests)
|
179
|
-
.structure!('FeesEstimateRequestList', 'FeesEstimateRequest')
|
180
|
-
|
181
|
-
run
|
182
|
-
end
|
183
|
-
|
184
|
-
# Gets pricing information for seller's own offer listings, based on
|
185
|
-
# Seller SKU
|
186
|
-
#
|
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
|
192
|
-
# @param [Hash] opts
|
193
|
-
# @option opts [String] :item_condition
|
194
|
-
# @return [Peddler::XMLParser]
|
195
|
-
def get_my_price_for_sku(marketplace_id, *seller_sku_list)
|
196
|
-
seller_sku_list = seller_sku_list.dup
|
197
|
-
opts = extract_options(seller_sku_list)
|
198
|
-
|
199
|
-
operation('GetMyPriceForSKU')
|
200
|
-
.add(opts)
|
201
|
-
.add('MarketplaceId' => marketplace_id,
|
202
|
-
'SellerSKUList' => seller_sku_list)
|
203
|
-
.structure!('SellerSKUList', 'SellerSKU')
|
204
|
-
|
205
|
-
run
|
206
|
-
end
|
207
|
-
|
208
|
-
# Gets pricing information for seller's own offer listings, identified by
|
209
|
-
# its ASIN
|
210
|
-
#
|
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
|
215
|
-
# @param [Hash] opts
|
216
|
-
# @option opts [String] :item_condition
|
217
|
-
# @return [Peddler::XMLParser]
|
218
|
-
def get_my_price_for_asin(marketplace_id, *asin_list)
|
219
|
-
asin_list = asin_list.dup
|
220
|
-
opts = extract_options(asin_list)
|
221
|
-
|
222
|
-
operation('GetMyPriceForASIN')
|
223
|
-
.add(opts)
|
224
|
-
.add('MarketplaceId' => marketplace_id,
|
225
|
-
'ASINList' => asin_list)
|
226
|
-
.structure!('ASINList', 'ASIN')
|
227
|
-
|
228
|
-
run
|
229
|
-
end
|
230
|
-
|
231
|
-
# Gets parent product categories that a product belongs to, based on
|
232
|
-
# Seller SKU
|
233
|
-
#
|
234
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetProductCategoriesForSKU.html
|
235
|
-
# @param [String] marketplace_id
|
236
|
-
# @param [String] seller_sku
|
237
|
-
# @return [Peddler::XMLParser]
|
238
|
-
def get_product_categories_for_sku(marketplace_id, seller_sku)
|
239
|
-
operation('GetProductCategoriesForSKU')
|
240
|
-
.add('MarketplaceId' => marketplace_id, 'SellerSKU' => seller_sku)
|
241
|
-
|
242
|
-
run
|
243
|
-
end
|
244
|
-
|
245
|
-
# Gets parent product categories that a product belongs to, based on ASIN
|
246
|
-
#
|
247
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetProductCategoriesForASIN.html
|
248
|
-
# @param [String] marketplace_id
|
249
|
-
# @param [String] asin
|
250
|
-
# @return [Peddler::XMLParser]
|
251
|
-
def get_product_categories_for_asin(marketplace_id, asin)
|
252
|
-
operation('GetProductCategoriesForASIN')
|
253
|
-
.add('MarketplaceId' => marketplace_id, 'ASIN' => asin)
|
254
|
-
|
255
|
-
run
|
256
|
-
end
|
257
|
-
|
258
|
-
# Gets the service status of the API
|
259
|
-
#
|
260
|
-
# @see https://docs.developer.amazonservices.com/en_US/products/Products_GetServiceStatus.html
|
261
|
-
# @return [Peddler::XMLParser]
|
262
|
-
def get_service_status
|
263
|
-
operation('GetServiceStatus')
|
264
|
-
run
|
265
|
-
end
|
266
|
-
end
|
267
|
-
end
|
268
|
-
end
|
data/lib/mws/products.rb
DELETED
@@ -1,72 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'peddler/client'
|
4
|
-
|
5
|
-
module MWS
|
6
|
-
module Recommendations
|
7
|
-
# The Recommendations API enables you to programmatically retrieve Amazon
|
8
|
-
# Selling Coach recommendations by recommendation category. A recommendation
|
9
|
-
# is an actionable, timely, and personalized opportunity to increase your
|
10
|
-
# sales and performance.
|
11
|
-
class Client < ::Peddler::Client
|
12
|
-
self.version = '2013-04-01'
|
13
|
-
self.path = "/Recommendations/#{version}"
|
14
|
-
|
15
|
-
# Checks whether there are active recommendations for each category for
|
16
|
-
# the given marketplace, and if there are, returns the time when
|
17
|
-
# recommendations were last updated for each category
|
18
|
-
#
|
19
|
-
# @see https://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_GetLastUpdatedTimeForRecommendations.html
|
20
|
-
# @param [String] marketplace_id
|
21
|
-
# @return [Peddler::XMLParser]
|
22
|
-
def get_last_updated_time_for_recommendations(marketplace_id)
|
23
|
-
operation('GetLastUpdatedTimeForRecommendations')
|
24
|
-
.add('MarketplaceId' => marketplace_id)
|
25
|
-
|
26
|
-
run
|
27
|
-
end
|
28
|
-
|
29
|
-
# Lists active recommendations for a specific category or for all
|
30
|
-
# categories for a specific marketplace
|
31
|
-
#
|
32
|
-
# @see https://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_ListRecommendations.html
|
33
|
-
# @param [String] marketplace_id
|
34
|
-
# @param [Hash] opts
|
35
|
-
# @option opts [String] :recommendation_category
|
36
|
-
# @option opts [Array<Struct, Hash>] :category_query_list
|
37
|
-
# @return [Peddler::XMLParser]
|
38
|
-
def list_recommendations(marketplace_id, opts = {})
|
39
|
-
operation('ListRecommendations')
|
40
|
-
.add(opts)
|
41
|
-
.add('MarketplaceId' => marketplace_id)
|
42
|
-
.structure!(
|
43
|
-
'CategoryQueryList', 'CategoryQuery', '1', 'FilterOptions',
|
44
|
-
'FilterOption'
|
45
|
-
)
|
46
|
-
|
47
|
-
run
|
48
|
-
end
|
49
|
-
|
50
|
-
# Lists the next page of active recommendations
|
51
|
-
#
|
52
|
-
# @see https://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_ListRecommendationsByNextToken.html
|
53
|
-
# @param [String] next_token
|
54
|
-
# @return [Peddler::XMLParser]
|
55
|
-
def list_recommendations_by_next_token(next_token)
|
56
|
-
operation('ListRecommendationsByNextToken')
|
57
|
-
.add('NextToken' => next_token)
|
58
|
-
|
59
|
-
run
|
60
|
-
end
|
61
|
-
|
62
|
-
# Gets the service status of the API
|
63
|
-
#
|
64
|
-
# @see https://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_GetServiceStatus.html
|
65
|
-
# @return [Peddler::XMLParser]
|
66
|
-
def get_service_status
|
67
|
-
operation('GetServiceStatus')
|
68
|
-
run
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
data/lib/mws/recommendations.rb
DELETED
data/lib/mws/reports/client.rb
DELETED
@@ -1,236 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'peddler/client'
|
4
|
-
|
5
|
-
module MWS
|
6
|
-
module Reports
|
7
|
-
# The Reports API lets you request reports about your inventory and orders.
|
8
|
-
class Client < ::Peddler::Client
|
9
|
-
self.version = '2009-01-01'
|
10
|
-
self.path = "/Reports/#{version}"
|
11
|
-
|
12
|
-
# Creates a report request
|
13
|
-
#
|
14
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_RequestReport.html
|
15
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
|
16
|
-
# @param [String] report_type
|
17
|
-
# @param [Hash] opts
|
18
|
-
# @option opts [String, #iso8601] :start_date
|
19
|
-
# @option opts [String, #iso8601] :end_date
|
20
|
-
# @option opts [String] :report_options
|
21
|
-
# @option opts [Array<String>, String] :marketplace_id_list
|
22
|
-
# @return [Peddler::XMLParser]
|
23
|
-
def request_report(report_type, opts = {})
|
24
|
-
operation('RequestReport')
|
25
|
-
.add(opts)
|
26
|
-
.add('ReportType' => report_type)
|
27
|
-
.structure!('MarketplaceIdList', 'Id')
|
28
|
-
|
29
|
-
run
|
30
|
-
end
|
31
|
-
|
32
|
-
# Lists report requests
|
33
|
-
#
|
34
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportRequestList.html
|
35
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
|
36
|
-
# @param [Hash] opts
|
37
|
-
# @option opts [Array<String>, String] :report_request_id_list
|
38
|
-
# @option opts [Array<String>, String] :report_type_list
|
39
|
-
# @option opts [Array<String>, String] :report_processing_status_list
|
40
|
-
# @option opts [Integer] :max_count
|
41
|
-
# @option opts [String, #iso8601] :requested_from_date
|
42
|
-
# @option opts [String, #iso8601] :requested_to_date
|
43
|
-
# @return [Peddler::XMLParser]
|
44
|
-
def get_report_request_list(opts = {})
|
45
|
-
operation('GetReportRequestList')
|
46
|
-
.add(opts)
|
47
|
-
.structure!('ReportRequestIdList', 'Id')
|
48
|
-
.structure!('ReportTypeList', 'Type')
|
49
|
-
.structure!('ReportProcessingStatusList', 'Status')
|
50
|
-
|
51
|
-
run
|
52
|
-
end
|
53
|
-
|
54
|
-
# Lists the next page of the report requests
|
55
|
-
#
|
56
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportRequestListByNextToken.html
|
57
|
-
# @param [String] next_token
|
58
|
-
# @return [Peddler::XMLParser]
|
59
|
-
def get_report_request_list_by_next_token(next_token)
|
60
|
-
operation('GetReportRequestListByNextToken')
|
61
|
-
.add('NextToken' => next_token)
|
62
|
-
|
63
|
-
run
|
64
|
-
end
|
65
|
-
|
66
|
-
# Counts requested reports
|
67
|
-
#
|
68
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportRequestCount.html
|
69
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
|
70
|
-
# @param [Hash] opts
|
71
|
-
# @option opts [Array<String>, String] :report_type_list
|
72
|
-
# @option opts [Array<String>, String] :report_processing_status_list
|
73
|
-
# @option opts [String, #iso8601] :requested_from_date
|
74
|
-
# @option opts [String, #iso8601] :requested_to_date
|
75
|
-
# @return [Peddler::XMLParser]
|
76
|
-
def get_report_request_count(opts = {})
|
77
|
-
operation('GetReportRequestCount')
|
78
|
-
.add(opts)
|
79
|
-
.structure!('ReportTypeList', 'Type')
|
80
|
-
.structure!('ReportProcessingStatusList', 'Status')
|
81
|
-
|
82
|
-
run
|
83
|
-
end
|
84
|
-
|
85
|
-
# Cancels one or more report requests
|
86
|
-
#
|
87
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_CancelReportRequests.html
|
88
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
|
89
|
-
# @param [Hash] opts
|
90
|
-
# @option opts [Array<String>, String] :report_type_list
|
91
|
-
# @option opts [Array<String>, String] :report_processing_status_list
|
92
|
-
# @option opts [String, #iso8601] :requested_from_date
|
93
|
-
# @option opts [String, #iso8601] :requested_to_date
|
94
|
-
# @return [Peddler::XMLParser]
|
95
|
-
def cancel_report_requests(opts = {})
|
96
|
-
operation('CancelReportRequests')
|
97
|
-
.add(opts)
|
98
|
-
.structure!('ReportTypeList', 'Type')
|
99
|
-
.structure!('ReportProcessingStatusList', 'Status')
|
100
|
-
|
101
|
-
run
|
102
|
-
end
|
103
|
-
|
104
|
-
# Lists reports
|
105
|
-
#
|
106
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportList.html
|
107
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
|
108
|
-
# @param [Hash] opts
|
109
|
-
# @option opts [Integer] :max_count
|
110
|
-
# @option opts [Array<String>, String] :report_type_list
|
111
|
-
# @option opts [Boolean] :acknowledged
|
112
|
-
# @option opts [String, #iso8601] :available_from_date
|
113
|
-
# @option opts [String, #iso8601] :available_to_date
|
114
|
-
# @option opts [Array<String>, String] :report_request_id_list
|
115
|
-
# @return [Peddler::XMLParser]
|
116
|
-
def get_report_list(opts = {})
|
117
|
-
operation('GetReportList')
|
118
|
-
.add(opts)
|
119
|
-
.structure!('ReportTypeList', 'Type')
|
120
|
-
.structure!('ReportRequestIdList', 'Id')
|
121
|
-
|
122
|
-
run
|
123
|
-
end
|
124
|
-
|
125
|
-
# Lists the next page of reports
|
126
|
-
#
|
127
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportListByNextToken.html
|
128
|
-
# @param [String] next_token
|
129
|
-
# @return [Peddler::XMLParser]
|
130
|
-
def get_report_list_by_next_token(next_token)
|
131
|
-
operation('GetReportListByNextToken')
|
132
|
-
.add('NextToken' => next_token)
|
133
|
-
|
134
|
-
run
|
135
|
-
end
|
136
|
-
|
137
|
-
# Counts reports
|
138
|
-
#
|
139
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportCount.html
|
140
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
|
141
|
-
# @param [Hash] opts
|
142
|
-
# @option opts [Array<String>, String] :report_type_list
|
143
|
-
# @option opts [Boolean] :acknowledged
|
144
|
-
# @option opts [String, #iso8601] :available_from_date
|
145
|
-
# @option opts [String, #iso8601] :available_to_date
|
146
|
-
# @return [Peddler::XMLParser]
|
147
|
-
def get_report_count(opts = {})
|
148
|
-
operation('GetReportCount')
|
149
|
-
.add(opts)
|
150
|
-
.structure!('ReportTypeList', 'Type')
|
151
|
-
|
152
|
-
run
|
153
|
-
end
|
154
|
-
|
155
|
-
# Gets a report and its Content-MD5 header
|
156
|
-
#
|
157
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_GetReport.html
|
158
|
-
# @param [String] report_id
|
159
|
-
# @return [Peddler::XMLParser] if report is in XML format
|
160
|
-
# @return [Peddler::FlatFileParser] if report is a flat file
|
161
|
-
def get_report(report_id, &blk)
|
162
|
-
operation('GetReport')
|
163
|
-
.add('ReportId' => report_id)
|
164
|
-
|
165
|
-
run(&blk)
|
166
|
-
end
|
167
|
-
|
168
|
-
# Creates, updates, or deletes a report request schedule
|
169
|
-
#
|
170
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ManageReportSchedule.html
|
171
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
|
172
|
-
# @param [String] report_type
|
173
|
-
# @param [String] schedule
|
174
|
-
# @param [Hash] opts
|
175
|
-
# @option opts [String, #iso8601] :schedule_date
|
176
|
-
# @return [Peddler::XMLParser]
|
177
|
-
def manage_report_schedule(report_type, schedule, opts = {})
|
178
|
-
operation('ManageReportSchedule')
|
179
|
-
.add(opts)
|
180
|
-
.add('ReportType' => report_type, 'Schedule' => schedule)
|
181
|
-
|
182
|
-
run
|
183
|
-
end
|
184
|
-
|
185
|
-
# Lists scheduled reports
|
186
|
-
#
|
187
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportScheduleList.html
|
188
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
|
189
|
-
# @param [Array<String>] report_type_list
|
190
|
-
# @return [Peddler::XMLParser]
|
191
|
-
def get_report_schedule_list(*report_type_list)
|
192
|
-
operation('GetReportScheduleList')
|
193
|
-
.add('ReportTypeList' => report_type_list)
|
194
|
-
.structure!('ReportTypeList', 'Type')
|
195
|
-
|
196
|
-
run
|
197
|
-
end
|
198
|
-
|
199
|
-
# Lists next page of scheduled reports
|
200
|
-
#
|
201
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportScheduleListByNextToken.html
|
202
|
-
# @raise [NotImplementedError]
|
203
|
-
def get_report_schedule_list_by_next_token(*)
|
204
|
-
raise NotImplementedError
|
205
|
-
end
|
206
|
-
|
207
|
-
# Counts scheduled reports
|
208
|
-
#
|
209
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportScheduleCount.html
|
210
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html
|
211
|
-
# @param [Array<String>] report_type_list
|
212
|
-
# @return [Peddler::XMLParser]
|
213
|
-
def get_report_schedule_count(*report_type_list)
|
214
|
-
operation('GetReportScheduleCount')
|
215
|
-
.add('ReportTypeList' => report_type_list)
|
216
|
-
.structure!('ReportTypeList', 'Type')
|
217
|
-
|
218
|
-
run
|
219
|
-
end
|
220
|
-
|
221
|
-
# Updates acknowledged status of one or more reports
|
222
|
-
#
|
223
|
-
# @see https://docs.developer.amazonservices.com/en_US/reports/Reports_UpdateReportAcknowledgements.html
|
224
|
-
# @param [Boolean] acknowledged
|
225
|
-
# @param [Array<String>] report_id_list
|
226
|
-
# @return [Peddler::XMLParser]
|
227
|
-
def update_report_acknowledgements(acknowledged, *report_id_list)
|
228
|
-
operation('UpdateReportAcknowledgements')
|
229
|
-
.add('ReportIdList' => report_id_list, 'Acknowledged' => acknowledged)
|
230
|
-
.structure!('ReportIdList', 'Id')
|
231
|
-
|
232
|
-
run
|
233
|
-
end
|
234
|
-
end
|
235
|
-
end
|
236
|
-
end
|
data/lib/mws/reports.rb
DELETED
data/lib/mws/sellers/client.rb
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'peddler/client'
|
4
|
-
|
5
|
-
module MWS
|
6
|
-
module Sellers
|
7
|
-
# The Sellers API lets sellers retrieve information about their seller
|
8
|
-
# account, such as the marketplaces they participate in.
|
9
|
-
class Client < ::Peddler::Client
|
10
|
-
self.version = '2011-07-01'
|
11
|
-
self.path = "/Sellers/#{version}"
|
12
|
-
|
13
|
-
# Lists the marketplaces the seller participates in
|
14
|
-
#
|
15
|
-
# @see https://docs.developer.amazonservices.com/en_US/sellers/Sellers_ListMarketplaceParticipations.html
|
16
|
-
# @return [Peddler::XMLParser]
|
17
|
-
def list_marketplace_participations
|
18
|
-
operation('ListMarketplaceParticipations')
|
19
|
-
run
|
20
|
-
end
|
21
|
-
|
22
|
-
# Lists the next page of marketplaces the seller participates in
|
23
|
-
#
|
24
|
-
# @see https://docs.developer.amazonservices.com/en_US/sellers/Sellers_ListMarketplaceParticipationsByNextToken.html
|
25
|
-
# @param [String] next_token
|
26
|
-
# @return [Peddler::XMLParser]
|
27
|
-
def list_marketplace_participations_by_next_token(next_token)
|
28
|
-
operation('ListMarketplaceParticipationsByNextToken')
|
29
|
-
.add('NextToken' => next_token)
|
30
|
-
|
31
|
-
run
|
32
|
-
end
|
33
|
-
|
34
|
-
# Gets the service status of the API
|
35
|
-
#
|
36
|
-
# @see https://docs.developer.amazonservices.com/en_US/sellers/Sellers_GetServiceStatus.html
|
37
|
-
# @return [Peddler::XMLParser]
|
38
|
-
def get_service_status
|
39
|
-
operation('GetServiceStatus')
|
40
|
-
run
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
data/lib/mws/sellers.rb
DELETED