peddler 0.6.4 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mws/reports/client.rb +4 -4
- data/lib/mws/reports/parsers/report_request.rb +14 -0
- data/lib/mws/reports/requests/{report_request_info.rb → report_request.rb} +4 -4
- data/lib/peddler/version.rb +1 -1
- data/test/mws/feeds/requests/test_feed.rb +2 -2
- data/test/mws/feeds/requests/test_feed_submission_count.rb +2 -2
- data/test/mws/feeds/requests/test_feed_submission_list.rb +2 -2
- data/test/mws/feeds/requests/test_feed_submissions.rb +2 -2
- data/test/mws/reports/parsers/test_report_request.rb +13 -0
- data/test/mws/reports/requests/test_acknowledgements.rb +2 -2
- data/test/mws/reports/requests/test_report_count.rb +2 -2
- data/test/mws/reports/requests/test_report_request.rb +31 -0
- data/test/mws/reports/requests/test_report_scheduler.rb +2 -2
- metadata +8 -5
- data/test/mws/reports/requests/test_report_info.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62f6b3aebec5618ad516b43e57dff82844a884a9
|
4
|
+
data.tar.gz: 24fd012b9a57b57b7a1d159f9ca4c80bfba988d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52dad3122e6cbcba62d4633c170605d7f139246fe0d1ce82745778c86af8894e4b7e602fe0b0f5497e7579a0736f1531818cf16309e9ca0f6773e71e8b590ff6
|
7
|
+
data.tar.gz: e00f2f55e5a88ebad2080c9b17c41f1d86b6e4fbabf293ba64b32dad0a7a05e37f245321edccd5617b92cb858f6bf7698e65214cf56b9edbba3c7b8e3a13cd6d
|
data/lib/mws/reports/client.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
+
require 'mws/reports/requests/report_request'
|
1
2
|
require 'mws/reports/requests/report_request_list'
|
2
|
-
require 'mws/reports/requests/report_request_info'
|
3
3
|
require 'mws/reports/requests/report_request_count'
|
4
4
|
require 'mws/reports/requests/report_requests'
|
5
5
|
require 'mws/reports/requests/report_list'
|
@@ -26,7 +26,7 @@ module MWS
|
|
26
26
|
# client.request_report('_GET_ORDERS_DATA_')
|
27
27
|
#
|
28
28
|
# Returns the Report Request Info.
|
29
|
-
def_delegator :
|
29
|
+
def_delegator :report_request, :submit, :request_report
|
30
30
|
|
31
31
|
# Public: Get a list of report requests submitted during a specified time
|
32
32
|
# frame.
|
@@ -201,8 +201,8 @@ module MWS
|
|
201
201
|
|
202
202
|
private
|
203
203
|
|
204
|
-
def
|
205
|
-
@
|
204
|
+
def report_request
|
205
|
+
@report_request ||= Requests::ReportRequest.new(self)
|
206
206
|
end
|
207
207
|
|
208
208
|
def report_request_list
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'peddler/parsers/model'
|
2
|
+
require 'mws/reports/parsers/report_request_info'
|
3
|
+
|
4
|
+
module MWS
|
5
|
+
module Reports
|
6
|
+
module Parsers
|
7
|
+
class ReportRequest < Peddler::Parsers::Model
|
8
|
+
value :info do
|
9
|
+
ReportRequestInfo.new(at_xpath('ReportRequestInfo'))
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
require 'peddler/request'
|
2
|
-
require 'mws/reports/parsers/
|
2
|
+
require 'mws/reports/parsers/report_request'
|
3
3
|
|
4
4
|
module MWS
|
5
5
|
module Reports
|
6
6
|
module Requests
|
7
|
-
class
|
8
|
-
def
|
7
|
+
class ReportRequest < ::Peddler::Request
|
8
|
+
def submit(type, options = {})
|
9
9
|
parameters(:request_report)
|
10
|
-
.update(
|
10
|
+
.update(report_type: type)
|
11
11
|
.update(options)
|
12
12
|
.timestamp!
|
13
13
|
.format_structured_lists!
|
data/lib/peddler/version.rb
CHANGED
@@ -13,8 +13,8 @@ class FeedSubmissionListRequestTest < RequestTest
|
|
13
13
|
<SubmittedDate>2009-02-20T02:10:35+00:00</SubmittedDate>
|
14
14
|
<FeedProcessingStatus>_SUBMITTED_</FeedProcessingStatus>
|
15
15
|
</FeedSubmissionInfo>
|
16
|
-
</
|
17
|
-
</
|
16
|
+
</Result>
|
17
|
+
</Response>
|
18
18
|
EOF
|
19
19
|
end
|
20
20
|
|
@@ -13,8 +13,8 @@ class FeedSubmissionsRequesttTest < RequestTest
|
|
13
13
|
<SubmittedDate>2009-02-20T02:10:35+00:00</SubmittedDate>
|
14
14
|
<FeedProcessingStatus>_CANCELLED_</FeedProcessingStatus>
|
15
15
|
</FeedSubmissionInfo>
|
16
|
-
</
|
17
|
-
</
|
16
|
+
</Result>
|
17
|
+
</Response>
|
18
18
|
EOF
|
19
19
|
end
|
20
20
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'parser_helper'
|
2
|
+
require 'mws/reports/parsers/report_request'
|
3
|
+
|
4
|
+
class ReportRequestParserTest < ParserTest
|
5
|
+
def setup
|
6
|
+
node = fixture('reports/report_request_list').xpath('//xmlns:GetReportRequestListResult')
|
7
|
+
@request = MWS::Reports::Parsers::ReportRequest.new(node)
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_report_request_info
|
11
|
+
refute_nil @request.info
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'request_helper'
|
2
|
+
require 'mws/reports/requests/report_request'
|
3
|
+
|
4
|
+
class ReportRequestSubmitTest < RequestTest
|
5
|
+
def mock_response_body
|
6
|
+
<<-EOF
|
7
|
+
<Response xmlns="ns">
|
8
|
+
<Result>
|
9
|
+
<ReportRequestInfo>
|
10
|
+
<ReportRequestId>2291326454</ReportRequestId>
|
11
|
+
<ReportType>_GET_MERCHANT_LISTINGS_DATA_</ReportType>
|
12
|
+
<StartDate>2009-01-21T02:10:39+00:00</StartDate>
|
13
|
+
<EndDate>2009-02-13T02:10:39+00:00</EndDate>
|
14
|
+
<Scheduled>false</Scheduled>
|
15
|
+
<SubmittedDate>2009-02-20T02:10:39+00:00</SubmittedDate>
|
16
|
+
<ReportProcessingStatus>_SUBMITTED_</ReportProcessingStatus>
|
17
|
+
</ReportRequestInfo>
|
18
|
+
</Result>
|
19
|
+
</Response>
|
20
|
+
EOF
|
21
|
+
end
|
22
|
+
|
23
|
+
def setup
|
24
|
+
@report_request = MWS::Reports::Requests::ReportRequest.new(mock_client)
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_submits_report_request
|
28
|
+
res = @report_request.submit('_GET_MERCHANT_LISTINGS_DATA_')
|
29
|
+
assert_kind_of MWS::Reports::Parsers::ReportRequest, res
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: peddler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hakan Ensari
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jeff
|
@@ -178,6 +178,7 @@ files:
|
|
178
178
|
- lib/mws/reports/parsers/report_count.rb
|
179
179
|
- lib/mws/reports/parsers/report_info.rb
|
180
180
|
- lib/mws/reports/parsers/report_list.rb
|
181
|
+
- lib/mws/reports/parsers/report_request.rb
|
181
182
|
- lib/mws/reports/parsers/report_request_count.rb
|
182
183
|
- lib/mws/reports/parsers/report_request_info.rb
|
183
184
|
- lib/mws/reports/parsers/report_request_list.rb
|
@@ -190,8 +191,8 @@ files:
|
|
190
191
|
- lib/mws/reports/requests/report_acknowledgements.rb
|
191
192
|
- lib/mws/reports/requests/report_count.rb
|
192
193
|
- lib/mws/reports/requests/report_list.rb
|
194
|
+
- lib/mws/reports/requests/report_request.rb
|
193
195
|
- lib/mws/reports/requests/report_request_count.rb
|
194
|
-
- lib/mws/reports/requests/report_request_info.rb
|
195
196
|
- lib/mws/reports/requests/report_request_list.rb
|
196
197
|
- lib/mws/reports/requests/report_requests.rb
|
197
198
|
- lib/mws/reports/requests/report_schedule_count.rb
|
@@ -291,6 +292,7 @@ files:
|
|
291
292
|
- test/mws/reports/parsers/test_report_count.rb
|
292
293
|
- test/mws/reports/parsers/test_report_info.rb
|
293
294
|
- test/mws/reports/parsers/test_report_list.rb
|
295
|
+
- test/mws/reports/parsers/test_report_request.rb
|
294
296
|
- test/mws/reports/parsers/test_report_request_count.rb
|
295
297
|
- test/mws/reports/parsers/test_report_request_info.rb
|
296
298
|
- test/mws/reports/parsers/test_report_request_list.rb
|
@@ -300,8 +302,8 @@ files:
|
|
300
302
|
- test/mws/reports/parsers/test_report_scheduler.rb
|
301
303
|
- test/mws/reports/requests/test_acknowledgements.rb
|
302
304
|
- test/mws/reports/requests/test_report_count.rb
|
303
|
-
- test/mws/reports/requests/test_report_info.rb
|
304
305
|
- test/mws/reports/requests/test_report_list.rb
|
306
|
+
- test/mws/reports/requests/test_report_request.rb
|
305
307
|
- test/mws/reports/requests/test_report_request_count.rb
|
306
308
|
- test/mws/reports/requests/test_report_request_list.rb
|
307
309
|
- test/mws/reports/requests/test_report_requests.rb
|
@@ -409,6 +411,7 @@ test_files:
|
|
409
411
|
- test/mws/reports/parsers/test_report_count.rb
|
410
412
|
- test/mws/reports/parsers/test_report_info.rb
|
411
413
|
- test/mws/reports/parsers/test_report_list.rb
|
414
|
+
- test/mws/reports/parsers/test_report_request.rb
|
412
415
|
- test/mws/reports/parsers/test_report_request_count.rb
|
413
416
|
- test/mws/reports/parsers/test_report_request_info.rb
|
414
417
|
- test/mws/reports/parsers/test_report_request_list.rb
|
@@ -418,8 +421,8 @@ test_files:
|
|
418
421
|
- test/mws/reports/parsers/test_report_scheduler.rb
|
419
422
|
- test/mws/reports/requests/test_acknowledgements.rb
|
420
423
|
- test/mws/reports/requests/test_report_count.rb
|
421
|
-
- test/mws/reports/requests/test_report_info.rb
|
422
424
|
- test/mws/reports/requests/test_report_list.rb
|
425
|
+
- test/mws/reports/requests/test_report_request.rb
|
423
426
|
- test/mws/reports/requests/test_report_request_count.rb
|
424
427
|
- test/mws/reports/requests/test_report_request_list.rb
|
425
428
|
- test/mws/reports/requests/test_report_requests.rb
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'request_helper'
|
2
|
-
require 'mws/reports/requests/report_request_info'
|
3
|
-
|
4
|
-
class ReportRequestInfoTest < RequestTest
|
5
|
-
def mock_response_body
|
6
|
-
<<-EOF
|
7
|
-
<Result xmlns="ns">
|
8
|
-
<ReportRequestInfo>
|
9
|
-
<ReportRequestId>2291326454</ReportRequestId>
|
10
|
-
<ReportType>_GET_MERCHANT_LISTINGS_DATA_</ReportType>
|
11
|
-
<StartDate>2009-01-21T02:10:39+00:00</StartDate>
|
12
|
-
<EndDate>2009-02-13T02:10:39+00:00</EndDate>
|
13
|
-
<Scheduled>false</Scheduled>
|
14
|
-
<SubmittedDate>2009-02-20T02:10:39+00:00</SubmittedDate>
|
15
|
-
<ReportProcessingStatus>_SUBMITTED_</ReportProcessingStatus>
|
16
|
-
</ReportRequestInfo>
|
17
|
-
</Result>
|
18
|
-
EOF
|
19
|
-
end
|
20
|
-
|
21
|
-
def setup
|
22
|
-
@report = MWS::Reports::Requests::ReportRequestInfo.new(mock_client)
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_requests_report
|
26
|
-
res = @report.request('_GET_FLAT_FILE_OPEN_LISTINGS_DATA_')
|
27
|
-
assert_kind_of MWS::Reports::Parsers::ReportRequestInfo, res
|
28
|
-
end
|
29
|
-
end
|