peddler 0.5.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +237 -8
  3. data/lib/mws/feeds.rb +1 -0
  4. data/lib/mws/feeds/client.rb +97 -0
  5. data/lib/mws/feeds/parsers/feed.rb +14 -0
  6. data/lib/mws/feeds/parsers/feed_submission.rb +25 -0
  7. data/lib/mws/feeds/parsers/feed_submission_count.rb +13 -0
  8. data/lib/mws/feeds/parsers/feed_submission_list.rb +20 -0
  9. data/lib/mws/feeds/parsers/feed_submission_result.rb +10 -0
  10. data/lib/mws/feeds/parsers/feed_submissions.rb +18 -0
  11. data/lib/mws/feeds/requests/feed.rb +38 -0
  12. data/lib/mws/feeds/requests/feed_submission_count.rb +20 -0
  13. data/lib/mws/feeds/requests/feed_submission_list.rb +28 -0
  14. data/lib/mws/feeds/requests/feed_submission_result.rb +18 -0
  15. data/lib/mws/feeds/requests/feed_submissions.rb +20 -0
  16. data/lib/mws/fulfillment_inbound_shipment/client.rb +7 -0
  17. data/lib/mws/fulfillment_inventory/client.rb +7 -0
  18. data/lib/mws/fulfillment_outbound_shipment/client.rb +7 -0
  19. data/lib/mws/off_amazon_payments/client.rb +7 -0
  20. data/lib/mws/orders.rb +1 -0
  21. data/lib/mws/orders/client.rb +88 -0
  22. data/lib/mws/orders/parsers/invoice_data.rb +25 -0
  23. data/lib/mws/orders/parsers/order.rb +113 -0
  24. data/lib/mws/orders/parsers/order_item.rb +110 -0
  25. data/lib/mws/orders/parsers/order_items.rb +20 -0
  26. data/lib/mws/orders/parsers/orders.rb +20 -0
  27. data/lib/mws/orders/parsers/payment_execution_detail.rb +20 -0
  28. data/lib/mws/orders/parsers/payment_execution_detail_item.rb +17 -0
  29. data/lib/mws/orders/parsers/service_status.rb +36 -0
  30. data/lib/mws/orders/parsers/service_status_message.rb +17 -0
  31. data/lib/mws/orders/parsers/shipping_address.rb +37 -0
  32. data/lib/mws/orders/requests/order_items.rb +26 -0
  33. data/lib/mws/orders/requests/orders.rb +39 -0
  34. data/lib/mws/orders/requests/service_status.rb +15 -0
  35. data/lib/mws/products/client.rb +7 -0
  36. data/lib/mws/recommendations/client.rb +7 -0
  37. data/lib/mws/reports/client.rb +6 -0
  38. data/lib/mws/sellers/client.rb +7 -0
  39. data/lib/mws/subscriptions/client.rb +7 -0
  40. data/lib/peddler.rb +11 -1
  41. data/lib/peddler/client.rb +62 -0
  42. data/lib/peddler/parsers/base.rb +15 -0
  43. data/lib/peddler/parsers/collection.rb +23 -0
  44. data/lib/peddler/parsers/model.rb +43 -0
  45. data/lib/peddler/parsers/text.rb +13 -0
  46. data/lib/peddler/parsers/xml.rb +25 -0
  47. data/lib/peddler/request.rb +50 -0
  48. data/lib/peddler/request/parameters.rb +56 -0
  49. data/lib/peddler/request/structured_list.rb +43 -0
  50. data/lib/peddler/response_wrapper.rb +32 -0
  51. data/lib/peddler/version.rb +1 -1
  52. data/test/fixtures/feeds/feed_submission.xml +14 -0
  53. data/test/fixtures/feeds/feed_submission_count.xml +9 -0
  54. data/test/fixtures/feeds/feed_submission_list.xml +17 -0
  55. data/test/fixtures/feeds/feed_submissions.xml +15 -0
  56. data/test/fixtures/mws.yml +8 -0
  57. data/test/fixtures/mws.yml.example +4 -0
  58. data/test/fixtures/orders/order_items.xml +83 -0
  59. data/test/fixtures/orders/orders.xml +109 -0
  60. data/test/fixtures/orders/service_status.xml +19 -0
  61. data/test/helper.rb +5 -0
  62. data/test/integration/feeds/test_feed_submission_count.rb +13 -0
  63. data/test/integration/feeds/test_feed_submission_list.rb +15 -0
  64. data/test/integration/feeds/test_feed_submission_result.rb +15 -0
  65. data/test/integration/orders/test_order_items.rb +19 -0
  66. data/test/integration/orders/test_orders.rb +20 -0
  67. data/test/integration/orders/test_service_status.rb +12 -0
  68. data/test/integration_helper.rb +16 -0
  69. data/test/mws/feeds/parsers/test_feed.rb +13 -0
  70. data/test/mws/feeds/parsers/test_feed_submission.rb +25 -0
  71. data/test/mws/feeds/parsers/test_feed_submission_count.rb +13 -0
  72. data/test/mws/feeds/parsers/test_feed_submission_list.rb +14 -0
  73. data/test/mws/feeds/parsers/test_feed_submission_result.rb +13 -0
  74. data/test/mws/feeds/parsers/test_feed_submissions.rb +17 -0
  75. data/test/mws/feeds/requests/test_feed.rb +63 -0
  76. data/test/mws/feeds/requests/test_feed_submission_count.rb +23 -0
  77. data/test/mws/feeds/requests/test_feed_submission_list.rb +40 -0
  78. data/test/mws/feeds/requests/test_feed_submissions.rb +29 -0
  79. data/test/mws/orders/parsers/test_order.rb +86 -0
  80. data/test/mws/orders/parsers/test_order_item.rb +69 -0
  81. data/test/mws/orders/parsers/test_order_items.rb +14 -0
  82. data/test/mws/orders/parsers/test_orders.rb +14 -0
  83. data/test/mws/orders/parsers/test_payment_execution_detail.rb +14 -0
  84. data/test/mws/orders/parsers/test_payment_execution_detail_item.rb +17 -0
  85. data/test/mws/orders/parsers/test_service_status.rb +39 -0
  86. data/test/mws/orders/parsers/test_service_status_message.rb +17 -0
  87. data/test/mws/orders/parsers/test_shipping_address.rb +36 -0
  88. data/test/mws/orders/requests/test_order_items.rb +39 -0
  89. data/test/mws/orders/requests/test_orders.rb +49 -0
  90. data/test/mws/orders/requests/test_service_status.rb +25 -0
  91. data/test/parser_helper.rb +11 -0
  92. data/test/peddler/parsers/test_collection.rb +8 -0
  93. data/test/peddler/parsers/test_model.rb +34 -0
  94. data/test/peddler/request/test_parameters.rb +35 -0
  95. data/test/peddler/request/test_structured_list.rb +18 -0
  96. data/test/peddler/test_client.rb +42 -0
  97. data/test/request_helper.rb +20 -0
  98. metadata +213 -10
  99. data/lib/peddler/apis.rb +0 -45
  100. data/lib/peddler/service.rb +0 -83
  101. data/test/service_test.rb +0 -42
  102. data/test/test_helper.rb +0 -3
data/test/service_test.rb DELETED
@@ -1,42 +0,0 @@
1
- require_relative 'test_helper'
2
-
3
- class ServiceTest < MiniTest::Test
4
- def setup
5
- @klass = Class.new(Peddler::Service)
6
- @service = @klass.new('US', 'key', 'secret', 'seller_id')
7
- end
8
-
9
- def test_configures_path
10
- @klass.path('Foo')
11
- assert @service.endpoint.match(/Foo$/)
12
- end
13
-
14
- def test_has_user_agent
15
- refute @service.connection.data[:headers].empty?
16
- end
17
-
18
- def test_gets_marketplace_ids
19
- refute_equal @service.marketplace_id('US'), @service.marketplace_id('GB')
20
- end
21
-
22
- def test_inherits_parent_params
23
- assert_equal Peddler::Service.params, @klass.params
24
- end
25
-
26
- def test_inherits_parent_path
27
- @klass.path 'foo'
28
- assert_equal @klass.path, Class.new(@klass).path
29
- end
30
-
31
- def test_defines_constants_on_service
32
- refute_nil @klass.const_get(:HOSTS)
33
- end
34
-
35
- def test_has_a_key
36
- refute_nil @service.aws_access_key_id
37
- end
38
-
39
- def test_has_a_secret
40
- refute_nil @service.aws_secret_access_key
41
- end
42
- end
data/test/test_helper.rb DELETED
@@ -1,3 +0,0 @@
1
- $:.unshift(File.expand_path('../../lib', __FILE__))
2
- require 'peddler'
3
- require 'minitest/autorun'