peddler 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +48 -145
- data/lib/mws/feeds/client.rb +7 -1
- data/lib/mws/feeds/parsers/feed.rb +3 -3
- data/lib/mws/feeds/parsers/feed_submission_count.rb +2 -5
- data/lib/mws/feeds/parsers/{feed_submission.rb → feed_submission_info.rb} +1 -1
- data/lib/mws/feeds/parsers/feed_submission_list.rb +6 -3
- data/lib/mws/feeds/parsers/feed_submissions.rb +2 -2
- data/lib/mws/feeds/requests/feed_submission_list.rb +4 -2
- data/lib/mws/orders/client.rb +12 -2
- data/lib/mws/orders/parsers/order_items.rb +3 -0
- data/lib/mws/orders/parsers/orders.rb +6 -3
- data/lib/mws/orders/requests/order_items.rb +4 -2
- data/lib/mws/orders/requests/orders.rb +4 -2
- data/lib/mws/reports/client.rb +243 -0
- data/lib/mws/reports/parsers/report.rb +10 -0
- data/lib/mws/reports/parsers/report_acknowledgements.rb +20 -0
- data/lib/mws/reports/parsers/report_count.rb +10 -0
- data/lib/mws/reports/parsers/report_info.rb +29 -0
- data/lib/mws/reports/parsers/report_list.rb +23 -0
- data/lib/mws/reports/parsers/report_request_count.rb +10 -0
- data/lib/mws/reports/parsers/report_request_info.rb +49 -0
- data/lib/mws/reports/parsers/report_request_list.rb +23 -0
- data/lib/mws/reports/parsers/report_requests.rb +18 -0
- data/lib/mws/reports/parsers/report_schedule.rb +21 -0
- data/lib/mws/reports/parsers/report_schedule_count.rb +10 -0
- data/lib/mws/reports/parsers/report_schedule_list.rb +23 -0
- data/lib/mws/reports/parsers/report_scheduler.rb +19 -0
- data/lib/mws/reports/requests/report.rb +18 -0
- data/lib/mws/reports/requests/report_acknowledgements.rb +27 -0
- data/lib/mws/reports/requests/report_count.rb +20 -0
- data/lib/mws/reports/requests/report_list.rb +30 -0
- data/lib/mws/reports/requests/report_request_count.rb +20 -0
- data/lib/mws/reports/requests/report_request_info.rb +21 -0
- data/lib/mws/reports/requests/report_request_list.rb +30 -0
- data/lib/mws/reports/requests/report_requests.rb +20 -0
- data/lib/mws/reports/requests/report_schedule_count.rb +19 -0
- data/lib/mws/reports/requests/report_schedule_list.rb +23 -0
- data/lib/mws/reports/requests/report_scheduler.rb +29 -0
- data/lib/mws/sellers/client.rb +46 -0
- data/lib/mws/sellers/parsers/marketplace.rb +33 -0
- data/lib/mws/sellers/parsers/marketplace_participations.rb +32 -0
- data/lib/mws/sellers/parsers/participation.rb +21 -0
- data/lib/mws/sellers/parsers/service_status.rb +36 -0
- data/lib/mws/sellers/parsers/service_status_message.rb +17 -0
- data/lib/mws/sellers/requests/marketplace_participations.rb +27 -0
- data/lib/mws/sellers/requests/service_status.rb +15 -0
- data/lib/peddler/parsers/base.rb +2 -2
- data/lib/peddler/parsers/counter.rb +13 -0
- data/lib/peddler/parsers/model.rb +4 -5
- data/lib/peddler/parsers/text.rb +0 -5
- data/lib/peddler/parsers/tokenable.rb +13 -0
- data/lib/peddler/parsers/xml.rb +10 -5
- data/lib/peddler/request/parameters.rb +2 -1
- data/lib/peddler/request/structured_list.rb +5 -0
- data/lib/peddler/request.rb +13 -15
- data/lib/peddler/response/base.rb +0 -0
- data/lib/peddler/response/payload/base.rb +0 -0
- data/lib/peddler/response/payload/csv.rb +0 -0
- data/lib/peddler/response/payload/xml.rb +0 -0
- data/lib/peddler/{response_wrapper.rb → response.rb} +6 -11
- data/lib/peddler/version.rb +1 -1
- data/test/fixtures/mws.yml +4 -0
- data/test/fixtures/reports/report.xml +8 -0
- data/test/fixtures/reports/report_acknowledgements.xml +18 -0
- data/test/fixtures/reports/report_count.xml +9 -0
- data/test/fixtures/reports/report_list.xml +17 -0
- data/test/fixtures/reports/report_request_count.xml +9 -0
- data/test/fixtures/reports/report_request_list.xml +24 -0
- data/test/fixtures/reports/report_requests.xml +19 -0
- data/test/fixtures/reports/report_schedule_count.xml +10 -0
- data/test/fixtures/reports/report_schedule_list.xml +16 -0
- data/test/fixtures/reports/report_scheduler.xml +15 -0
- data/test/fixtures/sellers/market_participations.xml +27 -0
- data/test/fixtures/sellers/service_status.xml +9 -0
- data/test/integration/feeds/test_feed_submission_list.rb +2 -0
- data/test/integration/orders/test_orders.rb +3 -0
- data/test/integration/reports/test_report.rb +15 -0
- data/test/integration/reports/test_report_count.rb +13 -0
- data/test/integration/reports/test_report_list.rb +17 -0
- data/test/integration/reports/test_report_request_count.rb +13 -0
- data/test/integration/reports/test_report_request_list.rb +17 -0
- data/test/integration/reports/test_report_schedule_count.rb +13 -0
- data/test/integration/reports/test_report_schedule_list.rb +13 -0
- data/test/integration/reports/test_report_scheduler.rb +16 -0
- data/test/integration/sellers/test_marketplace_participations.rb +13 -0
- data/test/integration/sellers/test_service_status.rb +12 -0
- data/test/integration_helper.rb +3 -0
- data/test/mws/feeds/parsers/test_feed.rb +2 -2
- data/test/mws/feeds/parsers/{test_feed_submission.rb → test_feed_submission_info.rb} +3 -3
- data/test/mws/feeds/parsers/test_feed_submission_list.rb +5 -1
- data/test/mws/feeds/parsers/test_feed_submission_result.rb +1 -1
- data/test/mws/feeds/requests/test_feed_submission_list.rb +3 -6
- data/test/mws/orders/parsers/test_order_items.rb +4 -0
- data/test/mws/orders/parsers/test_orders.rb +4 -0
- data/test/mws/orders/parsers/test_service_status.rb +1 -1
- data/test/mws/orders/requests/test_order_items.rb +3 -6
- data/test/mws/orders/requests/test_orders.rb +3 -6
- data/test/mws/reports/parsers/test_report_acknowledgments.rb +14 -0
- data/test/mws/reports/parsers/test_report_count.rb +13 -0
- data/test/mws/reports/parsers/test_report_info.rb +29 -0
- data/test/mws/reports/parsers/test_report_list.rb +18 -0
- data/test/mws/reports/parsers/test_report_request_count.rb +13 -0
- data/test/mws/reports/parsers/test_report_request_info.rb +49 -0
- data/test/mws/reports/parsers/test_report_request_list.rb +18 -0
- data/test/mws/reports/parsers/test_report_requests.rb +17 -0
- data/test/mws/reports/parsers/test_report_schedule_count.rb +13 -0
- data/test/mws/reports/parsers/test_report_schedule_list.rb +18 -0
- data/test/mws/reports/parsers/test_report_scheduler.rb +17 -0
- data/test/mws/reports/requests/test_acknowledgements.rb +36 -0
- data/test/mws/reports/requests/test_report_count.rb +23 -0
- data/test/mws/reports/requests/test_report_info.rb +29 -0
- data/test/mws/reports/requests/test_report_list.rb +39 -0
- data/test/mws/reports/requests/test_report_request_count.rb +23 -0
- data/test/mws/reports/requests/test_report_request_list.rb +44 -0
- data/test/mws/reports/requests/test_report_requests.rb +29 -0
- data/test/mws/reports/requests/test_report_schedule_count.rb +22 -0
- data/test/mws/reports/requests/test_report_schedule_list.rb +36 -0
- data/test/mws/reports/requests/test_report_scheduler.rb +33 -0
- data/test/mws/sellers/parsers/test_market_participations.rb +19 -0
- data/test/mws/sellers/parsers/test_service_status.rb +35 -0
- data/test/mws/sellers/requests/test_marketplace_participation_list.rb +39 -0
- data/test/mws/sellers/requests/test_service_status.rb +25 -0
- data/test/peddler/parsers/test_model.rb +36 -0
- data/test/request_helper.rb +1 -1
- metadata +171 -42
- data/test/peddler/test_request.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 480feed5c44724e4f6ef152ec3c1da23075f4a11
|
4
|
+
data.tar.gz: d1e0ddcb314cd41e28f143f3f0304706f25f0af3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58305a7973578fb6ca7153a28319db391b5075f76d9efe988a9a14dfe16a4c576249e26de4ad7e28f31b1a6a7971a4228f7e804b1a24411eaaf1e78e52f1b768
|
7
|
+
data.tar.gz: 500bbaf3efcf364737439c20518a84b5191788a12f4f10bb25fb9636f86fdcf72a1720b5bf11a686fa338da07c4a0dc4adf9e498b090d956469fa8ca7de420fd
|
data/README.md
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
# Peddler
|
2
2
|
|
3
|
-
![
|
3
|
+
[![Build Status][travis]][badge]
|
4
4
|
|
5
|
-
|
6
|
-
Service (MWS) APIs][2].
|
5
|
+
![Peddler][mussels]
|
7
6
|
|
8
|
-
|
7
|
+
**Peddler** is a full-featured Ruby interface to the [Amazon Marketplace Web Service (MWS) APIs][docs].
|
8
|
+
|
9
|
+
## Configuration
|
9
10
|
|
10
11
|
Require the library:
|
11
12
|
|
@@ -13,20 +14,19 @@ Require the library:
|
|
13
14
|
require 'peddler'
|
14
15
|
```
|
15
16
|
|
16
|
-
|
17
|
+
Or require an individual API:
|
17
18
|
|
18
19
|
```ruby
|
19
20
|
require 'mws/orders'
|
20
21
|
```
|
21
22
|
|
22
|
-
Instantiate a client with the ISO 3166-1 two-letter country code of the
|
23
|
-
marketplace and your seller credentials:
|
23
|
+
Instantiate a client to a particular API with the ISO 3166-1 two-letter country code of the marketplace and your seller credentials:
|
24
24
|
|
25
25
|
```ruby
|
26
26
|
client = MWS::Orders::Client.new('GB', 'key', 'secret', 'merchant_id')
|
27
27
|
```
|
28
28
|
|
29
|
-
|
29
|
+
You may also set the credentials as environment variables in your shell:
|
30
30
|
|
31
31
|
```sh
|
32
32
|
export AWS_ACCESS_KEY_ID=key
|
@@ -40,69 +40,21 @@ Then, instantiate with the country code:
|
|
40
40
|
client = MWS::Orders::Client.new('US')
|
41
41
|
```
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
The MWS Feeds API lets you upload inventory and order data to Amazon. You can
|
46
|
-
also use this API to get information about the processing of feeds.
|
47
|
-
|
48
|
-
[API methods are available on the client][3].
|
49
|
-
|
50
|
-
Instantiate a client:
|
51
|
-
|
52
|
-
```ruby
|
53
|
-
client = MWS::Feeds::Client.new('GB')
|
54
|
-
```
|
55
|
-
|
56
|
-
#### Submit Feed
|
57
|
-
|
58
|
-
Submit a feed:
|
59
|
-
|
60
|
-
```ruby
|
61
|
-
client.submit_feed(xml, '_POST_PRODUCT_DATA_')
|
62
|
-
```
|
63
|
-
|
64
|
-
#### Feed Submission List
|
65
|
-
|
66
|
-
List past feed submissions:
|
67
|
-
|
68
|
-
```ruby
|
69
|
-
# See the API for all available parameters for this and other methods.
|
70
|
-
client.get_feed_submissions
|
71
|
-
```
|
72
|
-
|
73
|
-
List the next page of feed submissions:
|
74
|
-
|
75
|
-
```ruby
|
76
|
-
client.get_feed_submissions_by_next_token
|
77
|
-
```
|
78
|
-
|
79
|
-
#### Feed Submission Count
|
43
|
+
When developing, you may set the `EXCON_DEBUG` environment variable to debug the HTTP exchange.
|
80
44
|
|
81
|
-
|
82
|
-
|
83
|
-
```ruby
|
84
|
-
client.get_feed_submission_count(submitted_from_date: 1.day.ago)
|
85
|
-
```
|
86
|
-
|
87
|
-
#### Feed Submission Result
|
88
|
-
|
89
|
-
Get the processing report for a submitted feed:
|
90
|
-
|
91
|
-
```ruby
|
92
|
-
client.feed_submission_result('123456')
|
93
|
-
```
|
45
|
+
## Usage
|
94
46
|
|
95
|
-
|
47
|
+
### Feeds
|
96
48
|
|
97
|
-
|
49
|
+
The MWS Feeds API lets you upload inventory and order data to Amazon. You can also use this API to get information about the processing of feeds.
|
98
50
|
|
99
|
-
|
100
|
-
client.cancel_feed_submissions(submitted_to_date: 1.day.ago)
|
101
|
-
``
|
51
|
+
[Read the client API methods.][feeds-api]
|
102
52
|
|
103
53
|
### Fulfillment Inbound Shipment
|
104
54
|
|
105
|
-
|
55
|
+
With the Fulfillment Inbound Shipment API, you can create and update inbound shipments of inventory in the Amazon Fulfillment Network. You can also request lists of inbound shipments or inbound shipment items based on criteria that you specify.
|
56
|
+
|
57
|
+
While this API is not implemented yet, you may still use the raw client like so:
|
106
58
|
|
107
59
|
```ruby
|
108
60
|
client = MWS::FulfillmentInboundShipment::Client.new('GB')
|
@@ -112,7 +64,9 @@ Pull requests are welcome!
|
|
112
64
|
|
113
65
|
### Fulfillment Inventory
|
114
66
|
|
115
|
-
|
67
|
+
The Fulfillment Inventory API lets you see what is available in your inventory. It's a real-time reporting mechanism that returns your current or recently-changed inventory supply in the Amazon fulfillment network.
|
68
|
+
|
69
|
+
While this API is not implemented yet, you may still use the raw client like so:
|
116
70
|
|
117
71
|
```ruby
|
118
72
|
client = MWS::FulfillmentInventory::Client.new('GB')
|
@@ -122,7 +76,9 @@ Pull requests are welcome!
|
|
122
76
|
|
123
77
|
### Fulfillment Outbound Shipment
|
124
78
|
|
125
|
-
|
79
|
+
The Fulfillment Outbound Shipment API is designed to help you integrate Fulfillment by Amazon with any payment processing application or inventory management system currently in use.
|
80
|
+
|
81
|
+
While this API is not implemented yet, you may still use the raw client like so:
|
126
82
|
|
127
83
|
```ruby
|
128
84
|
client = MWS::FulfillmentOutboundShipment::Client.new('GB')
|
@@ -132,7 +88,9 @@ Pull requests are welcome!
|
|
132
88
|
|
133
89
|
### Off Amazon Payments
|
134
90
|
|
135
|
-
|
91
|
+
The Off-Amazon Payments API helps you to process payments for purchases made by buyers using Amazon Payments on your website. This API enables you to programmatically retrieve shipping and payment information provided by the buyer from their Amazon account and to authorize, capture, and refund funds to enable a variety of payments scenarios.
|
92
|
+
|
93
|
+
While this API is not implemented yet, you may still use the raw client like so:
|
136
94
|
|
137
95
|
```ruby
|
138
96
|
client = MWS::OffAmazonPayments::Client.new('GB')
|
@@ -142,70 +100,15 @@ Pull requests are welcome!
|
|
142
100
|
|
143
101
|
### Orders
|
144
102
|
|
145
|
-
With the MWS Orders API, you can list orders created or updated during a time
|
146
|
-
frame you specify or retrieve information about specific orders.
|
147
|
-
|
148
|
-
[API methods are available on the client][4].
|
103
|
+
With the MWS Orders API, you can list orders created or updated during a time frame you specify or retrieve information about specific orders.
|
149
104
|
|
150
|
-
|
151
|
-
|
152
|
-
```ruby
|
153
|
-
client = MWS::Orders::Client.new('GB')
|
154
|
-
```
|
155
|
-
|
156
|
-
#### Orders
|
157
|
-
|
158
|
-
List orders:
|
159
|
-
|
160
|
-
```ruby
|
161
|
-
# See the API for all available parameters.
|
162
|
-
client.list_orders(
|
163
|
-
created_after: 1.week.ago,
|
164
|
-
order_status: %w(Pending Unshipped)
|
165
|
-
)
|
166
|
-
```
|
167
|
-
|
168
|
-
List the next page of orders:
|
169
|
-
|
170
|
-
```ruby
|
171
|
-
client.list_orders_by_next_token
|
172
|
-
```
|
173
|
-
|
174
|
-
Get one or more orders based on their order numbers:
|
175
|
-
|
176
|
-
```ruby
|
177
|
-
client.get_order('123-1234567-1234567')
|
178
|
-
```
|
179
|
-
|
180
|
-
All above queries will return an enumerable list of orders.
|
181
|
-
|
182
|
-
#### Order Items
|
183
|
-
|
184
|
-
List order items based on an order number you specify:
|
185
|
-
|
186
|
-
```ruby
|
187
|
-
client.list_order_items('123-1234567-1234567')
|
188
|
-
```
|
189
|
-
|
190
|
-
List the next page of order items:
|
191
|
-
|
192
|
-
```ruby
|
193
|
-
client.list_order_items_by_next_token
|
194
|
-
```
|
195
|
-
|
196
|
-
All above queries will return an enumerable list of order items.
|
197
|
-
|
198
|
-
#### Service Status
|
199
|
-
|
200
|
-
Check the operational status of the API:
|
201
|
-
|
202
|
-
```ruby
|
203
|
-
client.get_service_status
|
204
|
-
```
|
105
|
+
[Read the client API methods.][orders-api]
|
205
106
|
|
206
107
|
### Products
|
207
108
|
|
208
|
-
|
109
|
+
The Products API helps you get information to match your products to existing product listings on Amazon Marketplace websites and to make sourcing and pricing decisions for listing those products on Amazon Marketplace websites.
|
110
|
+
|
111
|
+
While this API is not implemented yet, you may still use the raw client like so:
|
209
112
|
|
210
113
|
```ruby
|
211
114
|
client = MWS::Products::Client.new('GB')
|
@@ -215,7 +118,9 @@ Pull requests are welcome!
|
|
215
118
|
|
216
119
|
### Recommendations
|
217
120
|
|
218
|
-
|
121
|
+
The Recommendations API enables you to programmatically retrieve Amazon Selling Coach recommendations by recommendation category. A recommendation is an actionable, timely, and personalized opportunity to increase your sales and performance.
|
122
|
+
|
123
|
+
While this API is not implemented yet, you may still use the raw client like so:
|
219
124
|
|
220
125
|
```ruby
|
221
126
|
client = MWS::Recommendations::Client.new('GB')
|
@@ -225,27 +130,21 @@ Pull requests are welcome!
|
|
225
130
|
|
226
131
|
### Reports
|
227
132
|
|
228
|
-
|
133
|
+
The Reports API lets you request reports about your inventory and orders.
|
229
134
|
|
230
|
-
|
231
|
-
client = MWS::Reports::Client.new('GB')
|
232
|
-
```
|
233
|
-
|
234
|
-
Pull requests are welcome!
|
135
|
+
[Read the client API methods.][reports-api]
|
235
136
|
|
236
137
|
### Sellers
|
237
138
|
|
238
|
-
|
139
|
+
The Sellers API lets sellers retrieve information about their seller account, such as the marketplaces they participate in.
|
239
140
|
|
240
|
-
|
241
|
-
client = MWS::Sellers::Client.new('GB')
|
242
|
-
```
|
243
|
-
|
244
|
-
Pull requests are welcome!
|
141
|
+
[Read the client API methods.][sellers-api]
|
245
142
|
|
246
143
|
### Subscriptions
|
247
144
|
|
248
|
-
|
145
|
+
The Amazon MWS Subscriptions API enables you to subscribe to receive notifications that are relevant to your business with Amazon. With the operations in the Subscriptions API section, you can register to receive important information from Amazon without having to poll the Amazon MWS service. Instead, the information is sent directly to you when an event occurs to which you are subscribed.
|
146
|
+
|
147
|
+
While this API is not implemented yet, you may still use the raw client like so:
|
249
148
|
|
250
149
|
```ruby
|
251
150
|
client = MWS::Subscriptions::Client.new('GB')
|
@@ -253,7 +152,11 @@ client = MWS::Subscriptions::Client.new('GB')
|
|
253
152
|
|
254
153
|
Pull requests are welcome!
|
255
154
|
|
256
|
-
[
|
257
|
-
[
|
258
|
-
[
|
259
|
-
[
|
155
|
+
[travis]: https://travis-ci.org/papercavalier/peddler.png
|
156
|
+
[badge]:https://travis-ci.org/papercavalier/peddler
|
157
|
+
[mussels]: http://f.cl.ly/items/0W3V0A1Z110Q0x461b3H/mussels.jpeg
|
158
|
+
[docs]: https://developer.amazonservices.com/gp/mws/docs.html
|
159
|
+
[feeds-api]: https://github.com/papercavalier/peddler/blob/master/lib/mws/feeds/client.rb
|
160
|
+
[orders-api]: https://github.com/papercavalier/peddler/blob/master/lib/mws/orders/client.rb
|
161
|
+
[reports-api]: https://github.com/papercavalier/peddler/blob/master/lib/mws/reports/client.rb
|
162
|
+
[sellers-api]: https://github.com/papercavalier/peddler/blob/master/lib/mws/sellers/client.rb
|
data/lib/mws/feeds/client.rb
CHANGED
@@ -7,6 +7,8 @@ require 'peddler/client'
|
|
7
7
|
|
8
8
|
module MWS
|
9
9
|
module Feeds
|
10
|
+
# The MWS Feeds API lets you upload inventory and order data to Amazon. You
|
11
|
+
# can also use this API to get information about the processing of feeds.
|
10
12
|
class Client < ::Peddler::Client
|
11
13
|
# Public: Upload a feed for processing by Amazon MWS.
|
12
14
|
#
|
@@ -44,11 +46,15 @@ module MWS
|
|
44
46
|
|
45
47
|
# Public: List the next page of the list of feed submissions.
|
46
48
|
#
|
49
|
+
# token - A String token (default: The token returned in the last
|
50
|
+
# request).
|
51
|
+
#
|
47
52
|
# Examples
|
48
53
|
#
|
49
54
|
# client.get_feed_submission_list_by_next_token
|
50
55
|
#
|
51
|
-
# Returns an enumerable Feed Submission List
|
56
|
+
# Returns an enumerable Feed Submission List or false if there are no more
|
57
|
+
# pages left.
|
52
58
|
def_delegator :feed_submission_list, :get_by_next_token, :get_feed_submission_list_by_next_token
|
53
59
|
|
54
60
|
# Public: Get a count of the feeds submitted during a specified time
|
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'peddler/parsers/model'
|
2
|
-
require 'mws/feeds/parsers/
|
2
|
+
require 'mws/feeds/parsers/feed_submission_info'
|
3
3
|
|
4
4
|
module MWS
|
5
5
|
module Feeds
|
6
6
|
module Parsers
|
7
7
|
class Feed < Peddler::Parsers::Model
|
8
|
-
value :
|
9
|
-
|
8
|
+
value :submission_info do
|
9
|
+
FeedSubmissionInfo.new(at_xpath('FeedSubmissionInfo'))
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -1,12 +1,9 @@
|
|
1
|
-
require 'peddler/parsers/
|
1
|
+
require 'peddler/parsers/counter'
|
2
2
|
|
3
3
|
module MWS
|
4
4
|
module Feeds
|
5
5
|
module Parsers
|
6
|
-
class FeedSubmissionCount < ::Peddler::Parsers::
|
7
|
-
value :count do
|
8
|
-
integer_at_xpath('Count')
|
9
|
-
end
|
6
|
+
class FeedSubmissionCount < ::Peddler::Parsers::Counter
|
10
7
|
end
|
11
8
|
end
|
12
9
|
end
|
@@ -1,17 +1,20 @@
|
|
1
1
|
require 'peddler/parsers/collection'
|
2
|
-
require 'mws/feeds/parsers/
|
2
|
+
require 'mws/feeds/parsers/feed_submission_info'
|
3
|
+
require 'peddler/parsers/tokenable'
|
3
4
|
|
4
5
|
module MWS
|
5
6
|
module Feeds
|
6
7
|
module Parsers
|
7
8
|
class FeedSubmissionList < ::Peddler::Parsers::Collection
|
9
|
+
include ::Peddler::Parsers::Tokenable
|
10
|
+
|
8
11
|
def each(&blk)
|
9
|
-
|
12
|
+
feed_submission_info_nodes.each { |node| yield FeedSubmissionInfo.new(node) }
|
10
13
|
end
|
11
14
|
|
12
15
|
private
|
13
16
|
|
14
|
-
def
|
17
|
+
def feed_submission_info_nodes
|
15
18
|
xpath('FeedSubmissionInfo')
|
16
19
|
end
|
17
20
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'peddler/parsers/model'
|
2
|
-
require 'mws/feeds/parsers/
|
2
|
+
require 'mws/feeds/parsers/feed_submission_info'
|
3
3
|
|
4
4
|
module MWS
|
5
5
|
module Feeds
|
@@ -10,7 +10,7 @@ module MWS
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def feed_submissions
|
13
|
-
xpath('FeedSubmissionInfo').map { |node|
|
13
|
+
xpath('FeedSubmissionInfo').map { |node| FeedSubmissionInfo.new(node) }
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -15,9 +15,11 @@ module MWS
|
|
15
15
|
execute
|
16
16
|
end
|
17
17
|
|
18
|
-
def get_by_next_token
|
18
|
+
def get_by_next_token(token = next_token)
|
19
|
+
return false unless token
|
20
|
+
|
19
21
|
parameters(:get_feed_submission_list_by_next_token)
|
20
|
-
.update(next_token:
|
22
|
+
.update(next_token: token)
|
21
23
|
.camelize_keys!
|
22
24
|
|
23
25
|
execute
|
data/lib/mws/orders/client.rb
CHANGED
@@ -5,6 +5,8 @@ require 'peddler/client'
|
|
5
5
|
|
6
6
|
module MWS
|
7
7
|
module Orders
|
8
|
+
# With the MWS Orders API, you can list orders created or updated during a
|
9
|
+
# time frame you specify or retrieve information about specific orders.
|
8
10
|
class Client < ::Peddler::Client
|
9
11
|
path 'Orders/2011-01-01'
|
10
12
|
|
@@ -33,11 +35,15 @@ module MWS
|
|
33
35
|
|
34
36
|
# Public: List the next page of orders using the NextToken parameter.
|
35
37
|
#
|
38
|
+
# token - A String token (default: The token returned in the last
|
39
|
+
# request).
|
40
|
+
#
|
36
41
|
# Examples
|
37
42
|
#
|
38
43
|
# client.list_orders_by_next_token
|
39
44
|
#
|
40
|
-
# Returns an enumerable list of Orders
|
45
|
+
# Returns an enumerable list of Orders or false if there are no more pages
|
46
|
+
# left.
|
41
47
|
def_delegator :orders, :list_by_next_token, :list_orders_by_next_token
|
42
48
|
|
43
49
|
# Public: List order items for an amazon order.
|
@@ -54,11 +60,15 @@ module MWS
|
|
54
60
|
# Public: List the next page of order items using the NextToken
|
55
61
|
# parameter.
|
56
62
|
#
|
63
|
+
# token - A String token (default: The token returned in the last
|
64
|
+
# request).
|
65
|
+
#
|
57
66
|
# Examples
|
58
67
|
#
|
59
68
|
# client.list_order_items_by_next_token
|
60
69
|
#
|
61
|
-
# Returns an enumerable list of Order Items
|
70
|
+
# Returns an enumerable list of Order Items or false if there are no more
|
71
|
+
# pages left.
|
62
72
|
def_delegator :order_items, :list_by_next_token, :list_order_items_by_next_token
|
63
73
|
|
64
74
|
# Public: Get the service status of the API.
|
@@ -1,10 +1,13 @@
|
|
1
1
|
require 'mws/orders/parsers/order_item'
|
2
2
|
require 'peddler/parsers/collection'
|
3
|
+
require 'peddler/parsers/tokenable'
|
3
4
|
|
4
5
|
module MWS
|
5
6
|
module Orders
|
6
7
|
module Parsers
|
7
8
|
class OrderItems < ::Peddler::Parsers::Collection
|
9
|
+
include ::Peddler::Parsers::Tokenable
|
10
|
+
|
8
11
|
def each(&blk)
|
9
12
|
order_item_nodes.each { |node| yield OrderItem.new(node) }
|
10
13
|
end
|
@@ -1,18 +1,21 @@
|
|
1
1
|
require 'mws/orders/parsers/order'
|
2
2
|
require 'peddler/parsers/collection'
|
3
|
+
require 'peddler/parsers/tokenable'
|
3
4
|
|
4
5
|
module MWS
|
5
6
|
module Orders
|
6
7
|
module Parsers
|
7
8
|
class Orders < ::Peddler::Parsers::Collection
|
8
|
-
|
9
|
+
include ::Peddler::Parsers::Tokenable
|
9
10
|
|
10
|
-
|
11
|
+
def each(&blk)
|
12
|
+
order_nodes.each { |node| yield Order.new(node) }
|
13
|
+
end
|
11
14
|
|
12
15
|
private
|
13
16
|
|
14
17
|
def order_nodes
|
15
|
-
xpath('Orders/Order')
|
18
|
+
xpath('Orders/Order')
|
16
19
|
end
|
17
20
|
end
|
18
21
|
end
|
@@ -13,9 +13,11 @@ module MWS
|
|
13
13
|
execute
|
14
14
|
end
|
15
15
|
|
16
|
-
def list_by_next_token
|
16
|
+
def list_by_next_token(token = next_token)
|
17
|
+
return unless token
|
18
|
+
|
17
19
|
parameters(:list_order_items_by_next_token)
|
18
|
-
.update(next_token:
|
20
|
+
.update(next_token: token)
|
19
21
|
.camelize_keys!
|
20
22
|
|
21
23
|
execute
|
@@ -26,9 +26,11 @@ module MWS
|
|
26
26
|
execute
|
27
27
|
end
|
28
28
|
|
29
|
-
def list_by_next_token
|
29
|
+
def list_by_next_token(token = next_token)
|
30
|
+
return unless token
|
31
|
+
|
30
32
|
parameters(:list_orders_by_next_token)
|
31
|
-
.update(next_token:
|
33
|
+
.update(next_token: token)
|
32
34
|
.camelize_keys!
|
33
35
|
|
34
36
|
execute
|