peddler 0.6.2 → 0.6.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bdbdbadbc77d0e1c57afaacfa57e344d14869ae7
4
- data.tar.gz: 950b15c911072ed15db770c3e4d94649ef848f91
3
+ metadata.gz: ffb13ba94f5eab718c1f2cfc69623dd750881210
4
+ data.tar.gz: 9b14e23a9da75b89fecee7b8d6c240028af41c4c
5
5
  SHA512:
6
- metadata.gz: 554533d9843842ce088b6a774be620c7cbfb0f50793f8f76fd362f84a07ff0eff340905abc6b7e6e31d5e1a8ffccdb5a25197e0044548b2ea374ae7e60282e65
7
- data.tar.gz: eaf56dbb783c01f3afe7a9dc5911fb709e2bc61ed0def3dbe2db869124652a53cbe4d22c0f0c4f4264af9d9304a0717860d845b8ce7b53dcec1548691095d649
6
+ metadata.gz: 27c7939f8cc25e527e2c828807c319283b0e9ab60b0fa0aee4bda064a121b64e1f13f816f601b62c3838404f243f89dbf337185e02b05be2fb696ecfc7fd7e33
7
+ data.tar.gz: 62fc940d7d6c6a5ffe3231782bce08edc07267f4b663acbb09215261bbbb176d12d8a67e2b582a07413dc956cc70cb01f5929e9b5f867cee7a98787290bbf921
data/README.md CHANGED
@@ -86,12 +86,20 @@ client.get_feed_submission_count(submitted_from_date: 1.day.ago)
86
86
 
87
87
  #### Feed Submission Result
88
88
 
89
- Get the processing report for a submitted feed.
89
+ Get the processing report for a submitted feed:
90
90
 
91
91
  ```ruby
92
92
  client.feed_submission_result('123456')
93
93
  ```
94
94
 
95
+ #### Feed Submissions
96
+
97
+ Cancel one or more feed submissions:
98
+
99
+ ```ruby
100
+ client.cancel_feed_submissions(submitted_to_date: 1.day.ago)
101
+ ``
102
+
95
103
  ### Fulfillment Inbound Shipment
96
104
 
97
105
  This API is not implemented yet. You can still use the raw client like so:
@@ -2,6 +2,7 @@ require 'mws/feeds/requests/feed'
2
2
  require 'mws/feeds/requests/feed_submission_list'
3
3
  require 'mws/feeds/requests/feed_submission_count'
4
4
  require 'mws/feeds/requests/feed_submission_result'
5
+ require 'mws/feeds/requests/feed_submissions'
5
6
  require 'peddler/client'
6
7
 
7
8
  module MWS
@@ -50,7 +51,7 @@ module MWS
50
51
  # Returns an enumerable Feed Submission List.
51
52
  def_delegator :feed_submission_list, :get_by_next_token, :get_feed_submission_list_by_next_token
52
53
 
53
- # Public: Returns a count of the feeds submitted during a specified time
54
+ # Public: Get a count of the feeds submitted during a specified time
54
55
  # frame.
55
56
  #
56
57
  # options - The Hash query parameters used to narrow the list. Refer to
@@ -63,7 +64,7 @@ module MWS
63
64
  # Returns the Feed Submission Count.
64
65
  def_delegator :feed_submission_count, :get, :get_feed_submission_count
65
66
 
66
- # Public: Gets the feed processing report and the Content-MD5 header for
67
+ # Public: Get the feed processing report and the Content-MD5 header for
67
68
  # the returned HTTP body.
68
69
  #
69
70
  # feed_submission_id - The String Feed Submission Id.
@@ -75,6 +76,14 @@ module MWS
75
76
  # Returns the Feed Submission Result.
76
77
  def_delegator :feed_submission_result, :get, :get_feed_submission_result
77
78
 
79
+ # Public: Cancel one or more feed submissions.
80
+ #
81
+ # options - The Hash query parameters used to narrow the list. Refer to
82
+ # the MWS Feeds API for available parameters.
83
+ #
84
+ # Returns the canceled Feed Submissions and their count.
85
+ def_delegator :feed_submissions, :cancel, :cancel_feed_submissions
86
+
78
87
  private
79
88
 
80
89
  def feed
@@ -92,6 +101,10 @@ module MWS
92
101
  def feed_submission_result
93
102
  @feed_submission_result ||= Requests::FeedSubmissionResult.new(self)
94
103
  end
104
+
105
+ def feed_submissions
106
+ @feed_submissions ||= Requests::FeedSubmissions.new(self)
107
+ end
95
108
  end
96
109
  end
97
110
  end
@@ -29,6 +29,10 @@ module Peddler
29
29
  parse
30
30
  end
31
31
 
32
+ def has_next_token?
33
+ !!next_token
34
+ end
35
+
32
36
  private
33
37
 
34
38
  def parser
@@ -1,3 +1,3 @@
1
1
  module Peddler
2
- VERSION = '0.6.2'
2
+ VERSION = '0.6.3'
3
3
  end
@@ -0,0 +1,18 @@
1
+ require 'helper'
2
+ require 'peddler/request'
3
+
4
+ class PeddlerRequestTest < MiniTest::Test
5
+ def setup
6
+ @request = Peddler::Request.new(nil)
7
+ end
8
+
9
+ def test_has_next_token?
10
+ response = MiniTest::Mock.new
11
+ @request.last_response = response
12
+
13
+ response.expect(:next_token, nil)
14
+ assert_equal false, @request.has_next_token?
15
+ response.expect(:next_token, '123')
16
+ assert_equal true, @request.has_next_token?
17
+ end
18
+ 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.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hakan Ensari
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-04 00:00:00.000000000 Z
11
+ date: 2013-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jeff
@@ -234,6 +234,7 @@ files:
234
234
  - test/peddler/request/test_parameters.rb
235
235
  - test/peddler/request/test_structured_list.rb
236
236
  - test/peddler/test_client.rb
237
+ - test/peddler/test_request.rb
237
238
  - test/request_helper.rb
238
239
  - test/test_peddler.rb
239
240
  homepage: http://github.com/papercavalier/peddler
@@ -305,5 +306,6 @@ test_files:
305
306
  - test/peddler/request/test_parameters.rb
306
307
  - test/peddler/request/test_structured_list.rb
307
308
  - test/peddler/test_client.rb
309
+ - test/peddler/test_request.rb
308
310
  - test/request_helper.rb
309
311
  - test/test_peddler.rb