peddler 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 978fab72406158760e9606e86cc0de2447e69cda
4
- data.tar.gz: 319ef1c73de0d04380c26803cfb0769520f5dc44
3
+ metadata.gz: b23af9259fc451eaf2efbf47b7c03a45b46714d7
4
+ data.tar.gz: 147618f91b42b19bfb6a34be99774c277ccd8dac
5
5
  SHA512:
6
- metadata.gz: 6a26b4759845d63041ad84ad50a8c945ddabb2eb258f26df0274bb31de4e2e22ded66717643fa9c9dd644dae75e24e06a3fe42401a8136744b014a6528bc6f4b
7
- data.tar.gz: ddf1a2946fc222ff841903d537ada2cec094d5296996995cd0f179321c64ebb057c58e88733e87506290eb8f33ba43cd5e0cc0e2f17fb6ad53b5fa90519ae7fe
6
+ metadata.gz: 73627f0730df844e71038dede262611b70fd9f26ad9756c3e5f43756dd53ec2bf7589ce12dc5abd3e1be0d46f6085146768726675b083a5eb44009d6fe0b5a23
7
+ data.tar.gz: b40bfcce330e6ee41f26da68c4f342960a636e9193d315d808ecb273d9b41ca12f0ff670e8e58646330535d132b6005da80d9408bb79cb2d6f00208edea16077
data/README.md CHANGED
@@ -113,8 +113,6 @@ The MWS Products API helps you get information to match your products to existin
113
113
 
114
114
  ### Recommendations
115
115
 
116
- **Not implemented**
117
-
118
116
  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.
119
117
 
120
118
  [Read more](http://rubydoc.info/gems/peddler/MWS/Recommendations)
data/lib/mws/feeds.rb CHANGED
@@ -14,9 +14,9 @@ module MWS
14
14
  # @param opts [Hash]
15
15
  # @option opts [Array<String>, String] :marketplace_id_list
16
16
  # @option opts [Boolean] :purge_and_replace
17
- # @return [Peddler::Parser]
18
- def submit_feed(content, feed_type, opts = {})
19
- self.body = content
17
+ # @return [Peddler::XMLParser]
18
+ def submit_feed(feed_content, feed_type, opts = {})
19
+ self.body = feed_content
20
20
  operation('SubmitFeed')
21
21
  .add(opts.merge('FeedType' => feed_type))
22
22
  .structure!('MarketplaceId', 'Id')
@@ -35,7 +35,7 @@ module MWS
35
35
  # @option opts [Array<String>, String] :feed_processing_status_list
36
36
  # @option opts [String, #iso8601] :submitted_from_date
37
37
  # @option opts [String, #iso8601] :submitted_to_date
38
- # @return [Peddler::Parser]
38
+ # @return [Peddler::XMLParser]
39
39
  def get_feed_submission_list(opts = {})
40
40
  operation('GetFeedSubmissionList')
41
41
  .add(opts)
@@ -50,8 +50,7 @@ module MWS
50
50
  #
51
51
  # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionListByNextToken.html
52
52
  # @param next_token [String]
53
- # @return [Peddler::Parser]
54
- # @return false if there are no more pages
53
+ # @return [Peddler::XMLParser]
55
54
  def get_feed_submission_list_by_next_token(next_token)
56
55
  operation('GetFeedSubmissionListByNextToken')
57
56
  .add('NextToken' => next_token)
@@ -68,7 +67,7 @@ module MWS
68
67
  # @option opts [Array<String>, String] :feed_processing_status_list
69
68
  # @option opts [String, #iso8601] :submitted_from_date
70
69
  # @option opts [String, #iso8601] :submitted_to_date
71
- # @return [Peddler::Parser]
70
+ # @return [Peddler::XMLParser]
72
71
  def get_feed_submission_count(opts = {})
73
72
  operation('GetFeedSubmissionCount')
74
73
  .add(opts)
@@ -87,7 +86,7 @@ module MWS
87
86
  # @option opts [Array<String>, String] :feed_type_list
88
87
  # @option opts [String, #iso8601] :submitted_from_date
89
88
  # @option opts [String, #iso8601] :submitted_to_date
90
- # @return [Peddler::Parser]
89
+ # @return [Peddler::XMLParser]
91
90
  def cancel_feed_submissions(opts = {})
92
91
  operation('CancelFeedSubmissions')
93
92
  .add(opts)
@@ -99,7 +98,8 @@ module MWS
99
98
  #
100
99
  # @see http://docs.developer.amazonservices.com/en_US/feeds/Feeds_GetFeedSubmissionResult.html
101
100
  # @param feed_submission_id [Integer, String]
102
- # @return Peddler::Parser
101
+ # @return [Peddler::XMLParser] if the report is in XML format
102
+ # @return [Peddler::CSVParser] if the report is a flat file
103
103
  def get_feed_submission_result(feed_submission_id)
104
104
  operation('GetFeedSubmissionResult')
105
105
  .add('FeedSubmissionId' => feed_submission_id)
data/lib/mws/orders.rb CHANGED
@@ -22,7 +22,7 @@ module MWS
22
22
  # @option opts [String] :seller_order_id
23
23
  # @option opts [String] :max_results_per_page
24
24
  # @option opts [String] :tfm_shipment_status
25
- # @return [Peddler::Parser]
25
+ # @return [Peddler::XMLParser]
26
26
  def list_orders(opts = {})
27
27
  opts[:marketplace_id] ||= marketplace_id
28
28
  opts['TFMShipmentStatus'] = opts.delete(:tfm_shipment_status) if opts.has_key?(:tfm_shipment_status)
@@ -41,8 +41,7 @@ module MWS
41
41
  #
42
42
  # @see http://docs.developer.amazonservices.com/en_US/orders/2013-09-01/Orders_ListOrdersByNextToken.html
43
43
  # @param next_token [String]
44
- # @return [Peddler::Parser]
45
- # @return false if there are no more pages
44
+ # @return [Peddler::XMLParser]
46
45
  def list_orders_by_next_token(next_token)
47
46
  operation('ListOrdersByNextToken')
48
47
  .add('NextToken' => next_token)
@@ -54,7 +53,7 @@ module MWS
54
53
  #
55
54
  # @see http://docs.developer.amazonservices.com/en_US/orders/2013-09-01/Orders_GetOrder.html
56
55
  # @param amazon_order_ids [Array<String>]
57
- # @return [Peddler::Parser]
56
+ # @return [Peddler::XMLParser]
58
57
  def get_order(*amazon_order_ids)
59
58
  operation('GetOrder')
60
59
  .add('AmazonOrderId' => amazon_order_ids)
@@ -67,7 +66,7 @@ module MWS
67
66
  #
68
67
  # @see http://docs.developer.amazonservices.com/en_US/orders/2013-09-01/Orders_ListOrderItems.html
69
68
  # @param amazon_order_id [String]
70
- # @return [Peddler::Parser]
69
+ # @return [Peddler::XMLParser]
71
70
  def list_order_items(amazon_order_id)
72
71
  operation('ListOrderItems')
73
72
  .add('AmazonOrderId' => amazon_order_id)
@@ -79,8 +78,7 @@ module MWS
79
78
  #
80
79
  # @see http://docs.developer.amazonservices.com/en_US/orders/2013-09-01/Orders_ListOrderItemsByNextToken.html
81
80
  # @param next_token [String]
82
- # @return [Peddler::Parser]
83
- # @return false if there are no more pages
81
+ # @return [Peddler::XMLParser]
84
82
  def list_order_items_by_next_token(next_token)
85
83
  operation('ListOrderItemsByNextToken')
86
84
  .add('NextToken' => next_token)
@@ -91,7 +89,7 @@ module MWS
91
89
  # Gets the service status of the API
92
90
  #
93
91
  # @see http://docs.developer.amazonservices.com/en_US/orders/2013-09-01/MWS_GetServiceStatus.html
94
- # @return Peddler::Parser
92
+ # @return [Peddler::XMLParser]
95
93
  def get_service_status
96
94
  operation('GetServiceStatus')
97
95
  run
data/lib/mws/products.rb CHANGED
@@ -11,13 +11,12 @@ module MWS
11
11
  # Lists products and their attributes, based on a search query
12
12
  #
13
13
  # @see http://docs.developer.amazonservices.com/en_US/products/Products_ListMatchingProducts.html
14
- # @method list_matching_products
15
14
  # @overload list_matching_products(query, opts = { marketplace_id: marketplace_id })
16
15
  # @param query [String]
17
16
  # @param opts [Hash]
18
17
  # @option opts [String] :marketplace_id
19
18
  # @option opts [String] :query_context_id
20
- # @return [Peddler::Parser]
19
+ # @return [Peddler::XMLParser]
21
20
  def list_matching_products(query, opts = {})
22
21
  opts[:marketplace_id] ||= marketplace_id
23
22
 
@@ -36,7 +35,7 @@ module MWS
36
35
  # @param id_list [Array<String>]
37
36
  # @param opts [Hash]
38
37
  # @option opts [String] :marketplace_id
39
- # @return [Peddler::Parser]
38
+ # @return [Peddler::XMLParser]
40
39
  def get_matching_product_for_id(id_type, *id_list)
41
40
  opts = extract_options(id_list)
42
41
  opts[:marketplace_id] ||= marketplace_id
@@ -55,7 +54,7 @@ module MWS
55
54
  # @param asins [Array<String>]
56
55
  # @param opts [Hash]
57
56
  # @option opts [String] :marketplace_id
58
- # @return [Peddler::Parser]
57
+ # @return [Peddler::XMLParser]
59
58
  def get_matching_product(*asins)
60
59
  opts = extract_options(asins)
61
60
  opts[:marketplace_id] ||= marketplace_id
@@ -74,7 +73,7 @@ module MWS
74
73
  # @param skus [Array<String>]
75
74
  # @param opts [Hash]
76
75
  # @option opts [String] :marketplace_id
77
- # @return [Peddler::Parser]
76
+ # @return [Peddler::XMLParser]
78
77
  def get_competitive_pricing_for_sku(*skus)
79
78
  opts = extract_options(skus)
80
79
  opts[:marketplace_id] ||= marketplace_id
@@ -93,7 +92,7 @@ module MWS
93
92
  # @param asins [Array<String>]
94
93
  # @param opts [Hash]
95
94
  # @option opts [String] :marketplace_id
96
- # @return [Peddler::Parser]
95
+ # @return [Peddler::XMLParser]
97
96
  def get_competitive_pricing_for_asin(*asins)
98
97
  opts = extract_options(asins)
99
98
  opts[:marketplace_id] ||= marketplace_id
@@ -115,7 +114,7 @@ module MWS
115
114
  # @option opts [String] :marketplace_id
116
115
  # @option opts [String] :item_condition
117
116
  # @option opts [Boolean] :exclude_me
118
- # @return [Peddler::Parser]
117
+ # @return [Peddler::XMLParser]
119
118
  def get_lowest_offer_listings_for_sku(*skus)
120
119
  opts = extract_options(skus)
121
120
  opts[:marketplace_id] ||= marketplace_id
@@ -137,7 +136,7 @@ module MWS
137
136
  # @option opts [String] :marketplace_id
138
137
  # @option opts [String] :item_condition
139
138
  # @option opts [Boolean] :exclude_me
140
- # @return [Peddler::Parser]
139
+ # @return [Peddler::XMLParser]
141
140
  def get_lowest_offer_listings_for_asin(*asins)
142
141
  opts = extract_options(asins)
143
142
  opts[:marketplace_id] ||= marketplace_id
@@ -158,7 +157,7 @@ module MWS
158
157
  # @param opts [Hash]
159
158
  # @option opts [String] :marketplace_id
160
159
  # @option opts [String] :item_condition
161
- # @return [Peddler::Parser]
160
+ # @return [Peddler::XMLParser]
162
161
  def get_my_price_for_sku(*skus)
163
162
  opts = extract_options(skus)
164
163
  opts[:marketplace_id] ||= marketplace_id
@@ -179,7 +178,7 @@ module MWS
179
178
  # @param opts [Hash]
180
179
  # @option opts [String] :marketplace_id
181
180
  # @option opts [String] :item_condition
182
- # @return [Peddler::Parser]
181
+ # @return [Peddler::XMLParser]
183
182
  def get_my_price_for_asin(*asins)
184
183
  opts = extract_options(asins)
185
184
  opts[:marketplace_id] ||= marketplace_id
@@ -199,7 +198,7 @@ module MWS
199
198
  # @param sku [String]
200
199
  # @param opts [Hash]
201
200
  # @option opts [String] :marketplace_id
202
- # @return [Peddler::Parser]
201
+ # @return [Peddler::XMLParser]
203
202
  def get_product_categories_for_sku(sku, opts = {})
204
203
  opts[:marketplace_id] ||= marketplace_id
205
204
 
@@ -216,7 +215,7 @@ module MWS
216
215
  # @param asin [String]
217
216
  # @param opts [Hash]
218
217
  # @option opts [String] :marketplace_id
219
- # @return [Peddler::Parser]
218
+ # @return [Peddler::XMLParser]
220
219
  def get_product_categories_for_asin(asin, opts = {})
221
220
  opts[:marketplace_id] ||= marketplace_id
222
221
 
@@ -229,7 +228,7 @@ module MWS
229
228
  # Gets the service status of the API
230
229
  #
231
230
  # @see http://docs.developer.amazonservices.com/en_US/products/Products_GetServiceStatus.html
232
- # @return Peddler::Parser
231
+ # @return [Peddler::XMLParser]
233
232
  def get_service_status
234
233
  operation('GetServiceStatus')
235
234
  run
@@ -5,9 +5,62 @@ module MWS
5
5
  # Selling Coach recommendations by recommendation category. A recommendation
6
6
  # is an actionable, timely, and personalized opportunity to increase your
7
7
  # sales and performance.
8
- #
9
- # @todo Not implemented
10
8
  class Recommendations < ::Peddler::Client
11
9
  path 'Recommendations/2013-04-01'
10
+
11
+ # Checks whether there are active recommendations for each category for the
12
+ # given marketplace, and if there are, returns the time when recommendations
13
+ # were last updated for each category
14
+ #
15
+ # @see http://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_GetLastUpdatedTimeForRecommendations.html
16
+ # @param marketplace_id [String]
17
+ # @return [Peddler::XMLParser]
18
+ def get_last_updated_time_for_recommendations(marketplace_id = marketplace_id)
19
+ operation('GetLastUpdatedTimeForRecommendations')
20
+ .add('MarketplaceId' => marketplace_id)
21
+
22
+ run
23
+ end
24
+
25
+ # Lists active recommendations for a specific category or for all categories
26
+ # for a specific marketplace
27
+ #
28
+ # @see http://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_ListRecommendations.html
29
+ # @overload list_recommendations(opts = { marketplace_id: marketplace_id })
30
+ # @param opts [Hash]
31
+ # @option opts [String] :marketplace_id
32
+ # @option opts [String] :recommendation_category
33
+ # @option opts [String] :category_query_list
34
+ # @return [Peddler::XMLParser]
35
+ def list_recommendations(opts = {})
36
+ opts[:marketplace_id] ||= marketplace_id
37
+
38
+ operation('ListRecommendations')
39
+ .add(opts)
40
+ .structure!('CategoryQueryList', 'CategoryQuery', '1', 'FilterOptions', 'FilterOption')
41
+
42
+ run
43
+ end
44
+
45
+ # Lists the next page of active recommendations
46
+ #
47
+ # @see http://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_ListRecommendationsByNextToken.html
48
+ # @param next_token [String]
49
+ # @return [Peddler::XMLParser]
50
+ def list_recommendations_by_next_token(next_token)
51
+ operation('ListRecommendationsByNextToken')
52
+ .add('NextToken' => next_token)
53
+
54
+ run
55
+ end
56
+
57
+ # Gets the service status of the API
58
+ #
59
+ # @see http://docs.developer.amazonservices.com/en_US/recommendations/Recommendations_GetServiceStatus.html
60
+ # @return [Peddler::XMLParser]
61
+ def get_service_status
62
+ operation('GetServiceStatus')
63
+ run
64
+ end
12
65
  end
13
66
  end
data/lib/mws/reports.rb CHANGED
@@ -12,7 +12,7 @@ module MWS
12
12
  # @option opts [String, #iso8601] :end_date
13
13
  # @option opts [String] :report_options
14
14
  # @option opts [Array<String>, String] :marketplace_id
15
- # @return [Peddler::Parser]
15
+ # @return [Peddler::XMLParser]
16
16
  def request_report(report_type, opts = {})
17
17
  operation('RequestReport')
18
18
  .add(opts.merge('ReportType' => report_type))
@@ -31,7 +31,7 @@ module MWS
31
31
  # @option opts [Integer] :max_count
32
32
  # @option opts [String, #iso8601] :requested_from_date
33
33
  # @option opts [String, #iso8601] :requested_to_date
34
- # @return [Peddler::Parser]
34
+ # @return [Peddler::XMLParser]
35
35
  def get_report_request_list(opts = {})
36
36
  operation('GetReportRequestList')
37
37
  .add(opts)
@@ -46,8 +46,7 @@ module MWS
46
46
  #
47
47
  # @see http://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportRequestListByNextToken.html
48
48
  # @param next_token [String]
49
- # @return [Peddler::Parser]
50
- # @return false if there are no more pages
49
+ # @return [Peddler::XMLParser]
51
50
  def get_report_request_list_by_next_token(next_token)
52
51
  operation('GetReportRequestListByNextToken')
53
52
  .add('NextToken' => next_token)
@@ -63,7 +62,7 @@ module MWS
63
62
  # @option opts [Array<String>, String] :report_processing_status_list
64
63
  # @option opts [String, #iso8601] :requested_from_date
65
64
  # @option opts [String, #iso8601] :requested_to_date
66
- # @return [Peddler::Parser]
65
+ # @return [Peddler::XMLParser]
67
66
  def get_report_request_count(opts = {})
68
67
  operation('GetReportRequestCount')
69
68
  .add(opts)
@@ -81,7 +80,7 @@ module MWS
81
80
  # @option opts [Array<String>, String] :report_processing_status_list
82
81
  # @option opts [String, #iso8601] :requested_from_date
83
82
  # @option opts [String, #iso8601] :requested_to_date
84
- # @return [Peddler::Parser]
83
+ # @return [Peddler::XMLParser]
85
84
  def cancel_report_requests(opts = {})
86
85
  operation('CancelReportRequests')
87
86
  .add(opts)
@@ -101,7 +100,7 @@ module MWS
101
100
  # @option opts [String, #iso8601] :available_from_date
102
101
  # @option opts [String, #iso8601] :available_to_date
103
102
  # @option opts [Array<String>, String] :report_request_id_list
104
- # @return [Peddler::Parser]
103
+ # @return [Peddler::XMLParser]
105
104
  def get_report_list(opts = {})
106
105
  operation('GetReportList')
107
106
  .add(opts)
@@ -115,8 +114,7 @@ module MWS
115
114
  #
116
115
  # @see http://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportListByNextToken.html
117
116
  # @param next_token [String]
118
- # @return [Peddler::Parser]
119
- # @return false if there are no more pages
117
+ # @return [Peddler::XMLParser]
120
118
  def get_report_list_by_next_token(next_token)
121
119
  operation('GetReportListByNextToken')
122
120
  .add('NextToken' => next_token)
@@ -132,7 +130,7 @@ module MWS
132
130
  # @option opts [Boolean] :acknowledged
133
131
  # @option opts [String, #iso8601] :available_from_date
134
132
  # @option opts [String, #iso8601] :available_to_date
135
- # @return [Peddler::Parser]
133
+ # @return [Peddler::XMLParser]
136
134
  def get_report_count(opts = {})
137
135
  operation('GetReportCount')
138
136
  .add(opts)
@@ -145,7 +143,8 @@ module MWS
145
143
  #
146
144
  # @see http://docs.developer.amazonservices.com/en_US/reports/Reports_GetReport.html
147
145
  # @param report_id [String]
148
- # @return [Peddler::Parser]
146
+ # @return [Peddler::XMLParser] if report is in XML format
147
+ # @return [Peddler::CSVParser] if report is a flat file
149
148
  def get_report(report_id, &blk)
150
149
  operation('GetReport')
151
150
  .add('ReportId' => report_id)
@@ -161,7 +160,7 @@ module MWS
161
160
  # @param schedule [String]
162
161
  # @param opts [Hash]
163
162
  # @option opts [String, #iso8601] :schedule_date
164
- # @return [Peddler::Parser]
163
+ # @return [Peddler::XMLParser]
165
164
  def manage_report_schedule(report_type, schedule, opts = {})
166
165
  operation('ManageReportSchedule')
167
166
  .add(opts.merge('ReportType' => report_type, 'Schedule' => schedule))
@@ -173,7 +172,7 @@ module MWS
173
172
  #
174
173
  # @see http://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportScheduleList.html
175
174
  # @param report_type_list [*Array<String>]
176
- # @return [Peddler::Parser]
175
+ # @return [Peddler::XMLParser]
177
176
  def get_report_schedule_list(*report_type_list)
178
177
  operation('GetReportScheduleList')
179
178
  .add('ReportTypeList' => report_type_list)
@@ -187,7 +186,7 @@ module MWS
187
186
  # @see http://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportScheduleListByNextToken.html
188
187
  # @param next_token [String]
189
188
  # @raise [NotImplementedError]
190
- def get_report_schedule_list_by_next_token(token = next_token)
189
+ def get_report_schedule_list_by_next_token(next_token)
191
190
  raise NotImplementedError
192
191
  end
193
192
 
@@ -195,7 +194,7 @@ module MWS
195
194
  #
196
195
  # @see http://docs.developer.amazonservices.com/en_US/reports/Reports_GetReportScheduleCount.html
197
196
  # @param report_type_list [Array<String>]
198
- # @return [Peddler::Parser]
197
+ # @return [Peddler::XMLParser]
199
198
  def get_report_schedule_count(*report_type_list)
200
199
  operation('GetReportScheduleCount')
201
200
  .add('ReportTypeList' => report_type_list)
@@ -209,7 +208,7 @@ module MWS
209
208
  # @see http://docs.developer.amazonservices.com/en_US/reports/Reports_UpdateReportAcknowledgements.html
210
209
  # @param acknowledged [Boolean]
211
210
  # @param report_id_list [Array<String>]
212
- # @return [Peddler::Parser]
211
+ # @return [Peddler::XMLParser]
213
212
  def update_report_acknowledgements(acknowledged, *report_id_list)
214
213
  operation('UpdateReportAcknowledgement')
215
214
  .add('ReportIdList' => report_id_list, 'Acknowledged' => acknowledged)
data/lib/mws/sellers.rb CHANGED
@@ -10,7 +10,7 @@ module MWS
10
10
  #
11
11
  # @see http://docs.developer.amazonservices.com/en_US/sellers/Sellers_ListMarketplaceParticipations.html
12
12
  # @param next_token [String]
13
- # @return [Peddler::Parser]
13
+ # @return [Peddler::XMLParser]
14
14
  def list_marketplace_participations
15
15
  operation('ListMarketplaceParticipations')
16
16
  run
@@ -20,7 +20,7 @@ module MWS
20
20
  #
21
21
  # @see http://docs.developer.amazonservices.com/en_US/sellers/Sellers_ListMarketplaceParticipationsByNextToken.html
22
22
  # @param next_token [String]
23
- # @return [Peddler::Parser]
23
+ # @return [Peddler::XMLParser]
24
24
  def list_marketplace_participations_by_next_token(next_token)
25
25
  operation('ListMarketplaceParticipationsByNextToken')
26
26
  .add('NextToken' => next_token)
@@ -31,7 +31,7 @@ module MWS
31
31
  # Gets the service status of the API
32
32
  #
33
33
  # @see http://docs.developer.amazonservices.com/en_US/sellers/MWS_GetServiceStatus.html
34
- # @return [Peddler::Parser]
34
+ # @return [Peddler::XMLParser]
35
35
  def get_service_status
36
36
  operation('GetServiceStatus')
37
37
  run
@@ -13,11 +13,9 @@ module MWS
13
13
  # Registers a new destination to receive notifications
14
14
  #
15
15
  # @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_RegisterDestination.html
16
- # @method register_destination
17
- # @overload register_destination(sqs_queue_url, marketplace_id = marketplace_id)
18
- # @param sqs_queue_url [String]
19
- # @param marketplace_id [String]
20
- # @return [Peddler::Parser]
16
+ # @param sqs_queue_url [String]
17
+ # @param marketplace_id [String]
18
+ # @return [Peddler::XMLParser]
21
19
  def register_destination(sqs_queue_url, marketplace_id = marketplace_id)
22
20
  operation('RegisterDestination')
23
21
  .add('MarketplaceId' => marketplace_id)
@@ -29,11 +27,9 @@ module MWS
29
27
  # Removes an existing destination from the list of registered destinations
30
28
  #
31
29
  # @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_DeregisterDestination.html
32
- # @method deregister_destination
33
- # @overload deregister_destination(sqs_queue_url, marketplace_id = marketplace_id)
34
- # @param sqs_queue_url [String]
35
- # @param marketplace_id [String]
36
- # @return [Peddler::Parser]
30
+ # @param sqs_queue_url [String]
31
+ # @param marketplace_id [String]
32
+ # @return [Peddler::XMLParser]
37
33
  def deregister_destination(sqs_queue_url, marketplace_id = marketplace_id)
38
34
  operation('DeregisterDestination')
39
35
  .add('MarketplaceId' => marketplace_id)
@@ -46,7 +42,7 @@ module MWS
46
42
  #
47
43
  # @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_ListRegisteredDestinations.html
48
44
  # @param marketplace_id [String]
49
- # @return [Peddler::Parser]
45
+ # @return [Peddler::XMLParser]
50
46
  def list_registered_destinations( marketplace_id = marketplace_id)
51
47
  operation('ListRegisteredDestinations')
52
48
  .add('MarketplaceId' => marketplace_id)
@@ -57,11 +53,9 @@ module MWS
57
53
  # Sends a test notification to an existing destination
58
54
  #
59
55
  # @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_SendTestNotificationToDestination.html
60
- # @method send_test_notification_to_destination
61
- # @overload send_test_notification_to_destination(sqs_queue_url, marketplace_id = marketplace_id)
62
- # @param sqs_queue_url [String]
63
- # @param marketplace_id [String]
64
- # @return [Peddler::Parser]
56
+ # @param sqs_queue_url [String]
57
+ # @param marketplace_id [String]
58
+ # @return [Peddler::XMLParser]
65
59
  def send_test_notification_to_destination(sqs_queue_url, marketplace_id = marketplace_id)
66
60
  operation('SendTestNotificationToDestination')
67
61
  .add('MarketplaceId' => marketplace_id)
@@ -76,7 +70,7 @@ module MWS
76
70
  # @param notification_type [String]
77
71
  # @param sqs_queue_url [String]
78
72
  # @param marketplace_id [String]
79
- # @return [Peddler::Parser]
73
+ # @return [Peddler::XMLParser]
80
74
  def create_subscription(notification_type, sqs_queue_url, marketplace_id = marketplace_id)
81
75
  operation('CreateSubscription')
82
76
  .add('MarketplaceId' => marketplace_id)
@@ -91,7 +85,7 @@ module MWS
91
85
  # @param notification_type [String]
92
86
  # @param sqs_queue_url [String]
93
87
  # @param marketplace_id [String]
94
- # @return [Peddler::Parser]
88
+ # @return [Peddler::XMLParser]
95
89
  def get_subscription(notification_type, sqs_queue_url, marketplace_id = marketplace_id)
96
90
  operation('GetSubscription')
97
91
  .add('MarketplaceId' => marketplace_id, 'NotificationType' => notification_type)
@@ -106,7 +100,7 @@ module MWS
106
100
  # @param notification_type [String]
107
101
  # @param sqs_queue_url [String]
108
102
  # @param marketplace_id [String]
109
- # @return [Peddler::Parser]
103
+ # @return [Peddler::XMLParser]
110
104
  def delete_subscription(notification_type, sqs_queue_url, marketplace_id = marketplace_id)
111
105
  operation('DeleteSubscription')
112
106
  .add('MarketplaceId' => marketplace_id, 'NotificationType' => notification_type)
@@ -119,7 +113,7 @@ module MWS
119
113
  #
120
114
  # @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_ListSubscriptions.html
121
115
  # @param marketplace_id [String]
122
- # @return [Peddler::Parser]
116
+ # @return [Peddler::XMLParser]
123
117
  def list_subscriptions(marketplace_id = marketplace_id)
124
118
  operation('ListSubscriptions')
125
119
  .add('MarketplaceId' => marketplace_id)
@@ -134,7 +128,7 @@ module MWS
134
128
  # @param sqs_queue_url [String]
135
129
  # @param enabled [Boolean]
136
130
  # @param marketplace_id [String]
137
- # @return [Peddler::Parser]
131
+ # @return [Peddler::XMLParser]
138
132
  def update_subscription(notification_type, sqs_queue_url, enabled, marketplace_id = marketplace_id)
139
133
  operation('CreateSubscription')
140
134
  .add('MarketplaceId' => marketplace_id)
@@ -146,7 +140,7 @@ module MWS
146
140
  # Gets the service status of the API
147
141
  #
148
142
  # @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_GetServiceStatus.html
149
- # @return [Peddler::Parser]
143
+ # @return [Peddler::XMLParser]
150
144
  def get_service_status
151
145
  operation('GetServiceStatus')
152
146
  run
@@ -1,3 +1,3 @@
1
1
  module Peddler
2
- VERSION = '0.7.0'
2
+ VERSION = '0.7.1'
3
3
  end
@@ -0,0 +1,25 @@
1
+ require 'integration_helper'
2
+ require 'mws/recommendations'
3
+
4
+ class RecommendationsTest < IntegrationTest
5
+ def test_gets_last_updated_time_for_recommendations
6
+ clients.each do |client|
7
+ res = client.get_last_updated_time_for_recommendations
8
+ refute_empty res.parse
9
+ end
10
+ end
11
+
12
+ def test_lists_recommendations
13
+ clients.each do |client|
14
+ res = client.list_recommendations
15
+ refute_empty res.parse
16
+ end
17
+ end
18
+
19
+ def test_gets_service_status
20
+ clients.each do |client|
21
+ res = client.get_service_status
22
+ refute_empty res.parse
23
+ end
24
+ end
25
+ end
@@ -89,7 +89,7 @@ class ClientTest < MiniTest::Test
89
89
 
90
90
  def test_streams_response
91
91
  chunks = ''
92
- streamer = -> (chunk, _, _) { chunks << chunk }
92
+ streamer = ->(chunk, _, _) { chunks << chunk }
93
93
  @client.run(Parser, &streamer)
94
94
 
95
95
  assert_equal @body, chunks
@@ -15,4 +15,11 @@ class StructuredListTest < MiniTest::Test
15
15
  exp = { 'OrderStatus.Status.1' => 'foo', 'OrderStatus.Status.2' => 'bar' }
16
16
  assert_equal exp, @list.build(%w(foo bar))
17
17
  end
18
+
19
+ def test_handles_more_than_two_keys
20
+ list = Peddler::StructuredList.new('QueryList', 'Query', '1', 'FilterOptions', 'FilterOption')
21
+ exp = { 'QueryList.Query.1.FilterOptions.FilterOption.1' => 'foo' }
22
+
23
+ assert_equal exp, list.build('foo')
24
+ end
18
25
  end