peddler 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +15 -14
  4. data/lib/mws/cart_information/client.rb +72 -0
  5. data/lib/mws/cart_information.rb +1 -69
  6. data/lib/mws/customer_information/client.rb +79 -0
  7. data/lib/mws/customer_information.rb +1 -77
  8. data/lib/mws/feeds/client.rb +112 -0
  9. data/lib/mws/feeds.rb +1 -110
  10. data/lib/mws/fulfillment_inbound_shipment/client.rb +233 -0
  11. data/lib/mws/fulfillment_inbound_shipment.rb +1 -231
  12. data/lib/mws/fulfillment_inventory/client.rb +53 -0
  13. data/lib/mws/fulfillment_inventory.rb +1 -51
  14. data/lib/mws/fulfillment_outbound_shipment/client.rb +171 -0
  15. data/lib/mws/fulfillment_outbound_shipment.rb +1 -168
  16. data/lib/mws/off_amazon_payments/client.rb +362 -0
  17. data/lib/mws/off_amazon_payments.rb +1 -360
  18. data/lib/mws/orders/client.rb +102 -0
  19. data/lib/mws/orders.rb +1 -98
  20. data/lib/mws/products/client.rb +234 -0
  21. data/lib/mws/products.rb +1 -232
  22. data/lib/mws/recommendations/client.rb +71 -0
  23. data/lib/mws/recommendations.rb +1 -66
  24. data/lib/mws/reports/client.rb +220 -0
  25. data/lib/mws/reports.rb +1 -220
  26. data/lib/mws/sellers/client.rb +42 -0
  27. data/lib/mws/sellers.rb +1 -40
  28. data/lib/mws/subscriptions/client.rb +177 -0
  29. data/lib/mws/subscriptions.rb +1 -169
  30. data/lib/mws.rb +2 -2
  31. data/lib/peddler/client.rb +3 -3
  32. data/lib/peddler/flat_file_parser.rb +3 -3
  33. data/lib/peddler/operation.rb +2 -3
  34. data/lib/peddler/structured_list.rb +1 -3
  35. data/lib/peddler/version.rb +1 -1
  36. data/lib/peddler/xml_parser.rb +1 -1
  37. data/test/integration/test_cart_information.rb +2 -2
  38. data/test/integration/test_customer_information.rb +2 -2
  39. data/test/integration/test_feeds.rb +2 -2
  40. data/test/integration/test_fulfillment_inbound_shipment.rb +2 -2
  41. data/test/integration/test_fulfillment_inventory.rb +3 -7
  42. data/test/integration/test_fulfillment_outbound_shipment.rb +2 -49
  43. data/test/integration/test_off_amazon_payments.rb +2 -2
  44. data/test/integration/test_orders.rb +2 -13
  45. data/test/integration/test_products.rb +2 -2
  46. data/test/integration/test_recommendations.rb +2 -11
  47. data/test/integration/test_reports.rb +2 -3
  48. data/test/integration/test_sellers.rb +2 -9
  49. data/test/integration/test_subscriptions.rb +2 -2
  50. data/test/integration_test_helper.rb +49 -0
  51. data/test/mws.yml +16 -0
  52. data/test/mws.yml.bak +16 -0
  53. data/test/test_helper.rb +7 -0
  54. data/test/unit/mws/test_off_amazon_payments_client.rb +9 -0
  55. data/test/unit/mws/test_products_client.rb +9 -0
  56. data/test/unit/peddler/test_client.rb +2 -2
  57. data/test/unit/peddler/test_flat_file_parser.rb +2 -2
  58. data/test/unit/peddler/test_operation.rb +2 -2
  59. data/test/unit/peddler/test_parser.rb +2 -2
  60. data/test/unit/peddler/test_structured_list.rb +2 -2
  61. data/test/unit/peddler/test_xml_parser.rb +2 -2
  62. data/test/unit/test_mws.rb +3 -3
  63. data/test/vcr_cassettes/CartInformation.yml +37 -725
  64. data/test/vcr_cassettes/CustomerInformation.yml +37 -728
  65. data/test/vcr_cassettes/Feeds.yml +100 -528
  66. data/test/vcr_cassettes/FulfillmentInboundShipment.yml +39 -728
  67. data/test/vcr_cassettes/FulfillmentInventory.yml +96 -997
  68. data/test/vcr_cassettes/FulfillmentOutboundShipment.yml +39 -725
  69. data/test/vcr_cassettes/OffAmazonPayments.yml +36 -727
  70. data/test/vcr_cassettes/Orders.yml +38 -29855
  71. data/test/vcr_cassettes/Products.yml +1300 -3871
  72. data/test/vcr_cassettes/Recommendations.yml +8934 -15590
  73. data/test/vcr_cassettes/Reports.yml +288 -1326
  74. data/test/vcr_cassettes/Sellers.yml +38 -1178
  75. data/test/vcr_cassettes/Subscriptions.yml +244 -1066
  76. metadata +27 -98
  77. data/test/helper.rb +0 -3
  78. data/test/integration_helper.rb +0 -49
  79. data/test/mws.yml.1 +0 -32
  80. data/test/mws.yml.example +0 -4
  81. data/test/unit/mws/test_off_amazon_payments.rb +0 -9
  82. data/test/unit/mws/test_products.rb +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5bc49a3d30d5d0526341d23cc8ab18cbc9764cdf
4
- data.tar.gz: ebc222a8d014c5d2e452ca803f7ea96f7ccacd36
3
+ metadata.gz: cdf2a98543e5d180d51d96d113eaf62779875781
4
+ data.tar.gz: 530de23bf4d2017690289810d5d7ee002e6dbaad
5
5
  SHA512:
6
- metadata.gz: e4aeb6fc9528472d1f48abe3321cd50bdbd72439062bc5dc29b07fcc164fd72e80b1dab01450738d08dccf97fb5eb714398f95d20553f997625a04447b28b750
7
- data.tar.gz: 647d6c5ad8a20e8f3fcc40a9ddd60fec4b862a70959c89fe04625e28907ecc89917d4300741ede833d7d2c188e22000e48bd2f9c119c5137b0ea39df50a7323d
6
+ metadata.gz: 4a45fcb3f678c4b5415771300997d92c220d80f4a4eb8ddab6376de300020582749da5fef80b15acfa1f94ea2ed4f22e99a03a0e73ad820fc7efd8ac209f51f5
7
+ data.tar.gz: 7359d391a9a3a195d7a60ea983e6d2d239be4b430da8ba688617c52e784094f2a0c531aae3feff609b7b0d583b0b0d02a4dfee05c539e399ddeb4e464e514cb0
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2013 Hakan Ensari
3
+ Copyright (c) 2009-2014 Hakan Ensari
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
 
2
2
  # Peddler
3
3
 
4
- [![Travis](https://travis-ci.org/hakanensari/peddler.svg)](https://travis-ci.org/hakanensari/peddler)
4
+ [![Build Status](https://travis-ci.org/hakanensari/peddler.svg)](https://travis-ci.org/hakanensari/peddler)
5
5
  [![Code Climate](http://img.shields.io/codeclimate/github/hakanensari/peddler.svg)](https://codeclimate.com/github/hakanensari/peddler)
6
+ [![Coverage Status](http://img.shields.io/coveralls/hakanensari/peddler/master.svg)](https://coveralls.io/r/hakanensari/peddler)
6
7
 
7
8
  **Peddler** is a Ruby interface to the [Amazon MWS API](https://developer.amazonservices.com/), a collection of web services that help Amazon sellers programmatically exchange data on their listings, orders, payments, reports, and more.
8
9
 
@@ -45,31 +46,31 @@ export AWS_SECRET_ACCESS_KEY="rOMa3ydPBTJ3AD0bxERTOX0Fv0fAC6Q0s6/czMZO"
45
46
 
46
47
  With the MWS Cart Information API, you can retrieve shopping carts that your Amazon Webstore customers have created. The Cart Information API enables you to programmatically integrate Amazon Webstore cart information with your CRM systems, marketing applications, and other systems that require cart data.
47
48
 
48
- [Read more](http://rubydoc.info/github/hakanensari/peddler/MWS/CartInformation)
49
+ [Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/CartInformation/Client)
49
50
 
50
51
  ### Customer Information
51
52
 
52
53
  With the MWS Customer Information API, you can retrieve information from the customer accounts of your Amazon Webstore customers. This customer information includes customer name, contact information, customer account type, and associated Amazon Webstore marketplaces. The Customer Information API enables you to programmatically integrate Amazon Webstore customer account information with your CRM systems, marketing applications, and other systems that require customer data.
53
54
 
54
- [Read more](http://rubydoc.info/github/hakanensari/peddler/MWS/CustomerInformation)
55
+ [Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/CustomerInformation/Client)
55
56
 
56
57
  ### Feeds
57
58
 
58
59
  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.
59
60
 
60
- [Read more](http://rubydoc.info/github/hakanensari/peddler/MWS/Feeds)
61
+ [Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/Feeds/Client)
61
62
 
62
63
  ### Fulfillment Inbound Shipment
63
64
 
64
65
  With the MWS Fulfillment Inbound Shipment API, you can create and update inbound shipments of inventory in the Amazon Fulfillment Network. You can also also request lists of inbound shipments or inbound shipment items based on criteria that you specify.
65
66
 
66
- [Read more](http://rubydoc.info/github/hakanensari/peddler/MWS/FulfillmentInboundShipment)
67
+ [Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/FulfillmentInboundShipment/Client)
67
68
 
68
69
  ### Fulfillment Inventory
69
70
 
70
71
  The MWS Fulfillment Inventory API can help you stay up-to-date on the availability of your inventory in the Amazon Fulfillment Network. The Fulfillment Inventory API reports real-time availability information for your Amazon Fulfillment Network inventory regardless of whether you are selling your inventory on Amazon's retail web site or through other retail channels.
71
72
 
72
- [Read more](http://rubydoc.info/github/hakanensari/peddler/MWS/FulfillmentInventory)
73
+ [Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/FulfillmentInventory/Client)
73
74
 
74
75
  ### Fulfillment Outbound Shipment
75
76
 
@@ -77,7 +78,7 @@ The MWS Fulfillment Outbound Shipment API enables you to fulfill orders placed t
77
78
 
78
79
  Support for creating and cancelling fulfillment orders has been implemented, but the rest of the API is not supported yet.
79
80
 
80
- [Read more](http://rubydoc.info/github/hakanensari/peddler/MWS/FulfillmentOutboundShipment)
81
+ [Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/FulfillmentOutboundShipment/Client)
81
82
 
82
83
  ### Off Amazon Payments
83
84
 
@@ -89,40 +90,40 @@ You can switch the client to the sandbox environment:
89
90
  client = MWS.off_amazon_payments.sandbox
90
91
  ```
91
92
 
92
- [Read more](http://rubydoc.info/github/hakanensari/peddler/MWS/OffAmazonPayments)
93
+ [Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/OffAmazonPayments/Client)
93
94
 
94
95
  ### Orders
95
96
 
96
97
  With the MWS Orders API, you can list orders created or updated during a time frame you specify or retrieve information about specific orders.
97
98
 
98
- [Read more](http://rubydoc.info/github/hakanensari/peddler/MWS/Orders)
99
+ [Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/Orders/Client)
99
100
 
100
101
  ### Products
101
102
 
102
103
  The MWS 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.
103
104
 
104
- [Read more](http://rubydoc.info/github/hakanensari/peddler/MWS/Products)
105
+ [Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/Products/Client)
105
106
 
106
107
  ### Recommendations
107
108
 
108
109
  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.
109
110
 
110
- [Read more](http://rubydoc.info/github/hakanensari/peddler/MWS/Recommendations)
111
+ [Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/Recommendations/Client)
111
112
 
112
113
  ### Reports
113
114
 
114
115
  The Reports API lets you request reports about your inventory and orders.
115
116
 
116
- [Read more](http://rubydoc.info/github/hakanensari/peddler/MWS/Reports)
117
+ [Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/Reports/Client)
117
118
 
118
119
  ### Sellers
119
120
 
120
121
  The Sellers API lets sellers retrieve information about their seller account, such as the marketplaces they participate in.
121
122
 
122
- [Read more](http://rubydoc.info/github/hakanensari/peddler/MWS/Sellers)
123
+ [Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/Sellers/Client)
123
124
 
124
125
  ### Subscriptions
125
126
 
126
127
  The Amazon MWS Subscriptions API section 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.
127
128
 
128
- [Read more](http://rubydoc.info/github/hakanensari/peddler/MWS/Subscriptions)
129
+ [Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/Subscriptions/Client)
@@ -0,0 +1,72 @@
1
+ require 'peddler/client'
2
+
3
+ module MWS
4
+ module CartInformation
5
+ # With the Cart Information API, you can retrieve shopping carts that your
6
+ # Amazon Webstore customers have created. The Cart Information API enables
7
+ # you to programmatically integrate Amazon Webstore cart information with
8
+ # your CRM systems, marketing applications, and other systems that require
9
+ # cart data
10
+ #
11
+ # @note The Cart Information API only returns cart information for Webstores
12
+ # with Seller-Branded Checkout. No cart information is returned for Amazon
13
+ # Webstores with Amazon.com checkout. If your Webstore offers both
14
+ # checkout options, cart information is returned only for Seller-Branded
15
+ # Checkout accounts.
16
+ # @note In addition to registering for Amazon MWS, you must also request
17
+ # authorization to use the Cart Information API section.
18
+ class Client < ::Peddler::Client
19
+ path '/CartInformation/2014-03-01'
20
+
21
+ # Lists shopping carts
22
+ #
23
+ # @see http://docs.developer.amazonservices.com/en_US/cart_info/CartInfo_ListCarts.html
24
+ # @param date_range_start [String, #iso8601]
25
+ # @param opts [Hash]
26
+ # @option opts [String] :marketplace_id
27
+ # @option opts [String, #iso8601] :date_range_end
28
+ # @return [Peddler::XMLParser]
29
+ def list_carts(date_range_start, opts = {})
30
+ operation('ListCarts')
31
+ .add(opts.merge('DateRangeStart' => date_range_start))
32
+
33
+ run
34
+ end
35
+
36
+ # Lists the next page of shopping carts
37
+ #
38
+ # @see http://docs.developer.amazonservices.com/en_US/cart_info/CartInfo_ListCartsByNextToken.html
39
+ # @param next_token [String]
40
+ # @return [Peddler::XMLParser]
41
+ def list_carts_by_next_token(next_token)
42
+ operation('ListCartsByNextToken')
43
+ .add('NextToken' => next_token)
44
+
45
+ run
46
+ end
47
+
48
+ # Returns shopping carts based on specified values
49
+ #
50
+ # @see http://docs.developer.amazonservices.com/en_US/cart_info/CartInfo_GetCarts.html
51
+ # @param marketplace_id [String]
52
+ # @param cart_id_list [Array<String>]
53
+ # @return [Peddler::XMLParser]
54
+ def get_carts(marketplace_id, *cart_id_list)
55
+ operation('GetCarts')
56
+ .add('MarketplaceId' => marketplace_id, 'CartIdList' => cart_id_list)
57
+ .structure!('CartIdList', 'CartId')
58
+
59
+ run
60
+ end
61
+
62
+ # Gets the service status of the API
63
+ #
64
+ # @see http://docs.developer.amazonservices.com/en_US/cart_info/MWS_GetServiceStatus.html
65
+ # @return [Peddler::XMLParser]
66
+ def get_service_status
67
+ operation('GetServiceStatus')
68
+ run
69
+ end
70
+ end
71
+ end
72
+ end
@@ -1,69 +1 @@
1
- require 'peddler/client'
2
-
3
- module MWS
4
- # With the Cart Information API, you can retrieve shopping carts that your
5
- # Amazon Webstore customers have created. The Cart Information API enables you
6
- # to programmatically integrate Amazon Webstore cart information with your CRM
7
- # systems, marketing applications, and other systems that require cart data
8
- #
9
- # @note The Cart Information API only returns cart information for Webstores
10
- # with Seller-Branded Checkout. No cart information is returned for Amazon
11
- # Webstores with Amazon.com checkout. If your Webstore offers both checkout
12
- # options, cart information is returned only for Seller-Branded Checkout
13
- # accounts.
14
- # @note In addition to registering for Amazon MWS, you must also request
15
- # authorization to use the Cart Information API section.
16
- class CartInformation < ::Peddler::Client
17
- path '/CartInformation/2014-03-01'
18
-
19
- # Lists shopping carts
20
- #
21
- # @see http://docs.developer.amazonservices.com/en_US/cart_info/CartInfo_ListCarts.html
22
- # @param date_range_start [String, #iso8601]
23
- # @param opts [Hash]
24
- # @option opts [String] :marketplace_id
25
- # @option opts [String, #iso8601] :date_range_end
26
- # @return [Peddler::XMLParser]
27
- def list_carts(date_range_start, opts = {})
28
- operation('ListCarts')
29
- .add(opts.merge('DateRangeStart' => date_range_start))
30
-
31
- run
32
- end
33
-
34
- # Lists the next page of shopping carts
35
- #
36
- # @see http://docs.developer.amazonservices.com/en_US/cart_info/CartInfo_ListCartsByNextToken.html
37
- # @param next_token [String]
38
- # @return [Peddler::XMLParser]
39
- def list_carts_by_next_token(next_token)
40
- operation('ListCartsByNextToken')
41
- .add('NextToken' => next_token)
42
-
43
- run
44
- end
45
-
46
- # Returns shopping carts based on specified values
47
- #
48
- # @see http://docs.developer.amazonservices.com/en_US/cart_info/CartInfo_GetCarts.html
49
- # @param marketplace_id [String]
50
- # @param cart_id_list [Array<String>]
51
- # @return [Peddler::XMLParser]
52
- def get_carts(marketplace_id, *cart_id_list)
53
- operation('GetCarts')
54
- .add('MarketplaceId' => marketplace_id, 'CartIdList' => cart_id_list)
55
- .structure!('CartIdList', 'CartId')
56
-
57
- run
58
- end
59
-
60
- # Gets the service status of the API
61
- #
62
- # @see http://docs.developer.amazonservices.com/en_US/cart_info/MWS_GetServiceStatus.html
63
- # @return [Peddler::XMLParser]
64
- def get_service_status
65
- operation('GetServiceStatus')
66
- run
67
- end
68
- end
69
- end
1
+ require 'mws/cart_information/client'
@@ -0,0 +1,79 @@
1
+ require 'peddler/client'
2
+
3
+ module MWS
4
+ module CustomerInformation
5
+ # With the Customer Information API, you can retrieve information from the
6
+ # customer accounts of your Amazon Webstore customers. This customer
7
+ # information includes customer name, contact information, customer account
8
+ # type, and associated Amazon Webstore marketplaces. The Customer
9
+ # Information API enables you to programmatically integrate Amazon Webstore
10
+ # customer account information with your CRM systems, marketing
11
+ # applications, and other systems that require customer data.
12
+ #
13
+ # @note The Customer Information API section only returns customer
14
+ # information for Webstores with Seller-Branded Checkout. No customer
15
+ # information is returned for Webstores with Amazon.com checkout. If your
16
+ # Webstore offers both checkout options, customer information is returned
17
+ # only for Seller-Branded Checkout accounts.
18
+ # @note In addition to registering for Amazon MWS, you must request
19
+ # authorization to use the Customer Information API.
20
+ class Client < ::Peddler::Client
21
+ path '/CustomerInformation/2014-03-01'
22
+
23
+ # Lists customer accounts based on search criteria that you specify
24
+ #
25
+ # @see http://docs.developer.amazonservices.com/en_US/customer_info/CustomerInfo_ListCustomers.html
26
+ # @param opts [Hash]
27
+ # @option opts [String] :marketplace_id
28
+ # @option opts [String, #iso8601] :date_range_start
29
+ # @option opts [String, #iso8601] :date_range_end
30
+ # @option opts [String] :date_range_type
31
+ # @return [Peddler::XMLParser]
32
+ def list_customers(opts = {})
33
+ operation('ListCarts')
34
+ .add(opts)
35
+
36
+ run
37
+ end
38
+
39
+ # Lists the next page of customer accounts
40
+ #
41
+ # @see http://docs.developer.amazonservices.com/en_US/customer_info/CustomerInfo_ListCustomersByNextToken.html
42
+ # @param next_token [String]
43
+ # @return [Peddler::XMLParser]
44
+ def list_customers_by_next_token(next_token)
45
+ operation('ListCustomersByNextToken')
46
+ .add('NextToken' => next_token)
47
+
48
+ run
49
+ end
50
+
51
+ # Returns customer accounts based on the CustomerId values that you
52
+ # specify
53
+ #
54
+ # @see http://docs.developer.amazonservices.com/en_US/customer_info/CustomerInfo_GetCustomersForCustomerId.html
55
+ # @overload get_customers_for_customer_id(*customer_id_list, opts = {})
56
+ # @param customer_id_list [Array<String>]
57
+ # @param opts [Hash]
58
+ # @option opts [String] :marketplace_id
59
+ # @return [Peddler::XMLParser]
60
+ def get_customers_for_customer_id(*customer_id_list)
61
+ opts = extract_options(id_list)
62
+ operation('GetCustomersForCustomerId')
63
+ .add(opts.merge('CustomerIdList' => customer_id_list))
64
+ .structure!('CustomerIdList', 'CustomerId')
65
+
66
+ run
67
+ end
68
+
69
+ # Gets the service status of the API
70
+ #
71
+ # @see http://docs.developer.amazonservices.com/en_US/customer_info/MWS_GetServiceStatus.html
72
+ # @return [Peddler::XMLParser]
73
+ def get_service_status
74
+ operation('GetServiceStatus')
75
+ run
76
+ end
77
+ end
78
+ end
79
+ end
@@ -1,77 +1 @@
1
- require 'peddler/client'
2
-
3
- module MWS
4
- # With the Customer Information API, you can retrieve information from the
5
- # customer accounts of your Amazon Webstore customers. This customer
6
- # information includes customer name, contact information, customer account
7
- # type, and associated Amazon Webstore marketplaces. The Customer Information
8
- # API enables you to programmatically integrate Amazon Webstore customer
9
- # account information with your CRM systems, marketing applications, and other
10
- # systems that require customer data.
11
- #
12
- # @note The Customer Information API section only returns customer information
13
- # for Webstores with Seller-Branded Checkout. No customer information is
14
- # returned for Webstores with Amazon.com checkout. If your Webstore offers
15
- # both checkout options, customer information is returned only for
16
- # Seller-Branded Checkout accounts.
17
- # @note In addition to registering for Amazon MWS, you must request
18
- # authorization to use the Customer Information API.
19
- class CustomerInformation < ::Peddler::Client
20
- path '/CustomerInformation/2014-03-01'
21
-
22
- # Lists customer accounts based on search criteria that you specify
23
- #
24
- # @see http://docs.developer.amazonservices.com/en_US/customer_info/CustomerInfo_ListCustomers.html
25
- # @param opts [Hash]
26
- # @option opts [String] :marketplace_id
27
- # @option opts [String, #iso8601] :date_range_start
28
- # @option opts [String, #iso8601] :date_range_end
29
- # @option opts [String] :date_range_type
30
- # @return [Peddler::XMLParser]
31
- def list_customers(opts = {})
32
- operation('ListCarts')
33
- .add(opts)
34
-
35
- run
36
- end
37
-
38
- # Lists the next page of customer accounts
39
- #
40
- # @see http://docs.developer.amazonservices.com/en_US/customer_info/CustomerInfo_ListCustomersByNextToken.html
41
- # @param next_token [String]
42
- # @return [Peddler::XMLParser]
43
- def list_customers_by_next_token(next_token)
44
- operation('ListCustomersByNextToken')
45
- .add('NextToken' => next_token)
46
-
47
- run
48
- end
49
-
50
- # Returns customer accounts based on the CustomerId values that you specify
51
- #
52
- # @see http://docs.developer.amazonservices.com/en_US/customer_info/CustomerInfo_GetCustomersForCustomerId.html
53
- # @overload get_customers_for_customer_id(*customer_id_list, opts = {})
54
- # @param customer_id_list [Array<String>]
55
- # @param opts [Hash]
56
- # @option opts [String] :marketplace_id
57
- # @return [Peddler::XMLParser]
58
- def get_customers_for_customer_id(*customer_id_list)
59
- opts = extract_options(id_list)
60
- operation('GetCustomersForCustomerId')
61
- .add(opts.merge('CustomerIdList' => customer_id_list))
62
- .structure!('CustomerIdList', 'CustomerId')
63
-
64
- run
65
- end
66
-
67
- # Gets the service status of the API
68
- #
69
- # @see http://docs.developer.amazonservices.com/en_US/customer_info/MWS_GetServiceStatus.html
70
- # @return [Peddler::XMLParser]
71
- def get_service_status
72
- operation('GetServiceStatus')
73
- run
74
- end
75
-
76
- end
77
- end
1
+ require 'mws/customer_information/client'
@@ -0,0 +1,112 @@
1
+ require 'peddler/client'
2
+
3
+ module MWS
4
+ module Feeds
5
+ # The MWS Feeds API lets you upload inventory and order data to Amazon. You
6
+ # can also use this API to get information about the processing of feeds.
7
+ class Client < ::Peddler::Client
8
+ # Uploads a feed
9
+ #
10
+ # @note Feed size is limited to 2,147,483,647 bytes (2^31 -1) per feed
11
+ # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_SubmitFeed.html
12
+ # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_FeedType.html
13
+ # @param feed_content [String] an XML or flat file feed
14
+ # @param feed_type [String] the feed type
15
+ # @param opts [Hash]
16
+ # @option opts [Array<String>, String] :marketplace_id_list
17
+ # @option opts [Boolean] :purge_and_replace
18
+ # @return [Peddler::XMLParser]
19
+ def submit_feed(feed_content, feed_type, opts = {})
20
+ self.body = feed_content
21
+ operation('SubmitFeed')
22
+ .add(opts.merge('FeedType' => feed_type))
23
+ .structure!('MarketplaceId', 'Id')
24
+
25
+ run
26
+ end
27
+
28
+ # List feed submissions
29
+ #
30
+ # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionList.html
31
+ # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_FeedType.html
32
+ # @param opts [Hash]
33
+ # @option opts [Array<String>, String] :feed_submission_id_list
34
+ # @option opts [Integer] :max_count
35
+ # @option opts [Array<String>, String] :feed_type_list
36
+ # @option opts [Array<String>, String] :feed_processing_status_list
37
+ # @option opts [String, #iso8601] :submitted_from_date
38
+ # @option opts [String, #iso8601] :submitted_to_date
39
+ # @return [Peddler::XMLParser]
40
+ def get_feed_submission_list(opts = {})
41
+ operation('GetFeedSubmissionList')
42
+ .add(opts)
43
+ .structure!('FeedSubmissionIdList', 'Id')
44
+ .structure!('FeedTypeList', 'Type')
45
+ .structure!('FeedProcessingStatusList', 'Status')
46
+
47
+ run
48
+ end
49
+
50
+ # List the next page of feed submissions
51
+ #
52
+ # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionListByNextToken.html
53
+ # @param next_token [String]
54
+ # @return [Peddler::XMLParser]
55
+ def get_feed_submission_list_by_next_token(next_token)
56
+ operation('GetFeedSubmissionListByNextToken')
57
+ .add('NextToken' => next_token)
58
+
59
+ run
60
+ end
61
+
62
+ # Counts submitted feeds
63
+ #
64
+ # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionCount.html
65
+ # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_FeedType.html
66
+ # @param opts [Hash]
67
+ # @option opts [Array<String>, String] :feed_type_list
68
+ # @option opts [Array<String>, String] :feed_processing_status_list
69
+ # @option opts [String, #iso8601] :submitted_from_date
70
+ # @option opts [String, #iso8601] :submitted_to_date
71
+ # @return [Peddler::XMLParser]
72
+ def get_feed_submission_count(opts = {})
73
+ operation('GetFeedSubmissionCount')
74
+ .add(opts)
75
+ .structure!('FeedTypeList', 'Type')
76
+ .structure!('FeedProcessingStatusList', 'Status')
77
+
78
+ run
79
+ end
80
+
81
+ # Cancel one or more feed submissions
82
+ #
83
+ # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_CancelFeedSubmissions.html
84
+ # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_FeedType.html
85
+ # @param opts [Hash]
86
+ # @option opts [Array<String>, String] :feed_submission_id_list
87
+ # @option opts [Array<String>, String] :feed_type_list
88
+ # @option opts [String, #iso8601] :submitted_from_date
89
+ # @option opts [String, #iso8601] :submitted_to_date
90
+ # @return [Peddler::XMLParser]
91
+ def cancel_feed_submissions(opts = {})
92
+ operation('CancelFeedSubmissions')
93
+ .add(opts)
94
+
95
+ run
96
+ end
97
+
98
+ # Gets the processing report for a feed and its Content-MD5 header
99
+ #
100
+ # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionResult.html
101
+ # @param feed_submission_id [Integer, String]
102
+ # @return [Peddler::XMLParser] if the report is in XML format
103
+ # @return [Peddler::CSVParser] if the report is a flat file
104
+ def get_feed_submission_result(feed_submission_id)
105
+ operation('GetFeedSubmissionResult')
106
+ .add('FeedSubmissionId' => feed_submission_id)
107
+
108
+ run
109
+ end
110
+ end
111
+ end
112
+ end
data/lib/mws/feeds.rb CHANGED
@@ -1,110 +1 @@
1
- require 'peddler/client'
2
-
3
- module MWS
4
- # The MWS Feeds API lets you upload inventory and order data to Amazon. You
5
- # can also use this API to get information about the processing of feeds.
6
- class Feeds < ::Peddler::Client
7
- # Uploads a feed
8
- #
9
- # @note Feed size is limited to 2,147,483,647 bytes (2^31 -1) per feed
10
- # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_SubmitFeed.html
11
- # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_FeedType.html
12
- # @param feed_content [String] an XML or flat file feed
13
- # @param feed_type [String] the feed type
14
- # @param opts [Hash]
15
- # @option opts [Array<String>, String] :marketplace_id_list
16
- # @option opts [Boolean] :purge_and_replace
17
- # @return [Peddler::XMLParser]
18
- def submit_feed(feed_content, feed_type, opts = {})
19
- self.body = feed_content
20
- operation('SubmitFeed')
21
- .add(opts.merge('FeedType' => feed_type))
22
- .structure!('MarketplaceId', 'Id')
23
-
24
- run
25
- end
26
-
27
- # List feed submissions
28
- #
29
- # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionList.html
30
- # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_FeedType.html
31
- # @param opts [Hash]
32
- # @option opts [Array<String>, String] :feed_submission_id_list
33
- # @option opts [Integer] :max_count
34
- # @option opts [Array<String>, String] :feed_type_list
35
- # @option opts [Array<String>, String] :feed_processing_status_list
36
- # @option opts [String, #iso8601] :submitted_from_date
37
- # @option opts [String, #iso8601] :submitted_to_date
38
- # @return [Peddler::XMLParser]
39
- def get_feed_submission_list(opts = {})
40
- operation('GetFeedSubmissionList')
41
- .add(opts)
42
- .structure!('FeedSubmissionIdList', 'Id')
43
- .structure!('FeedTypeList', 'Type')
44
- .structure!('FeedProcessingStatusList', 'Status')
45
-
46
- run
47
- end
48
-
49
- # List the next page of feed submissions
50
- #
51
- # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionListByNextToken.html
52
- # @param next_token [String]
53
- # @return [Peddler::XMLParser]
54
- def get_feed_submission_list_by_next_token(next_token)
55
- operation('GetFeedSubmissionListByNextToken')
56
- .add('NextToken' => next_token)
57
-
58
- run
59
- end
60
-
61
- # Counts submitted feeds
62
- #
63
- # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionCount.html
64
- # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_FeedType.html
65
- # @param opts [Hash]
66
- # @option opts [Array<String>, String] :feed_type_list
67
- # @option opts [Array<String>, String] :feed_processing_status_list
68
- # @option opts [String, #iso8601] :submitted_from_date
69
- # @option opts [String, #iso8601] :submitted_to_date
70
- # @return [Peddler::XMLParser]
71
- def get_feed_submission_count(opts = {})
72
- operation('GetFeedSubmissionCount')
73
- .add(opts)
74
- .structure!('FeedTypeList', 'Type')
75
- .structure!('FeedProcessingStatusList', 'Status')
76
-
77
- run
78
- end
79
-
80
- # Cancel one or more feed submissions
81
- #
82
- # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_CancelFeedSubmissions.html
83
- # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_FeedType.html
84
- # @param opts [Hash]
85
- # @option opts [Array<String>, String] :feed_submission_id_list
86
- # @option opts [Array<String>, String] :feed_type_list
87
- # @option opts [String, #iso8601] :submitted_from_date
88
- # @option opts [String, #iso8601] :submitted_to_date
89
- # @return [Peddler::XMLParser]
90
- def cancel_feed_submissions(opts = {})
91
- operation('CancelFeedSubmissions')
92
- .add(opts)
93
-
94
- run
95
- end
96
-
97
- # Gets the processing report for a feed and its Content-MD5 header
98
- #
99
- # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionResult.html
100
- # @param feed_submission_id [Integer, String]
101
- # @return [Peddler::XMLParser] if the report is in XML format
102
- # @return [Peddler::CSVParser] if the report is a flat file
103
- def get_feed_submission_result(feed_submission_id)
104
- operation('GetFeedSubmissionResult')
105
- .add('FeedSubmissionId' => feed_submission_id)
106
-
107
- run
108
- end
109
- end
110
- end
1
+ require 'mws/feeds/client'