peddler 0.6.5 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +62 -81
- data/lib/mws/cart_information.rb +13 -0
- data/lib/mws/customer_information.rb +16 -0
- data/lib/mws/feeds.rb +110 -1
- data/lib/mws/fulfillment_inbound_shipment.rb +13 -1
- data/lib/mws/fulfillment_inventory.rb +15 -1
- data/lib/mws/fulfillment_outbound_shipment.rb +17 -1
- data/lib/mws/off_amazon_payments.rb +15 -1
- data/lib/mws/orders.rb +100 -1
- data/lib/mws/products.rb +238 -1
- data/lib/mws/recommendations.rb +13 -1
- data/lib/mws/reports.rb +221 -1
- data/lib/mws/sellers.rb +40 -1
- data/lib/mws/subscriptions.rb +175 -1
- data/lib/peddler/client.rb +77 -37
- data/lib/peddler/csv_parser.rb +42 -0
- data/lib/peddler/operation.rb +44 -0
- data/lib/peddler/parser.rb +21 -0
- data/lib/peddler/structured_list.rb +22 -0
- data/lib/peddler/version.rb +1 -1
- data/lib/peddler/xml_parser.rb +25 -0
- data/lib/peddler.rb +2 -0
- data/test/helper.rb +1 -1
- data/test/integration/test_feeds.rb +18 -0
- data/test/integration/test_orders.rb +22 -0
- data/test/integration/test_products.rb +53 -0
- data/test/integration/test_reports.rb +47 -0
- data/test/integration/test_sellers.rb +18 -0
- data/test/integration/test_subscriptions.rb +26 -0
- data/test/integration_helper.rb +41 -8
- data/test/mws.yml +32 -0
- data/test/mws.yml.example +4 -0
- data/test/unit/peddler/test_client.rb +97 -0
- data/test/unit/peddler/test_csv_parser.rb +24 -0
- data/test/unit/peddler/test_operation.rb +34 -0
- data/test/{peddler/request → unit/peddler}/test_structured_list.rb +5 -5
- data/test/unit/peddler/test_xml_parser.rb +19 -0
- data/test/{test_peddler.rb → unit/test_peddler.rb} +2 -2
- data/test/vcr_cassettes/Feeds.yml +695 -0
- data/test/vcr_cassettes/Orders.yml +29855 -0
- data/test/vcr_cassettes/Products.yml +8597 -0
- data/test/vcr_cassettes/Reports.yml +1881 -0
- data/test/vcr_cassettes/Sellers.yml +697 -0
- data/test/vcr_cassettes/Subscriptions.yml +1369 -0
- metadata +91 -297
- data/lib/mws/feeds/client.rb +0 -116
- data/lib/mws/feeds/parsers/feed.rb +0 -14
- data/lib/mws/feeds/parsers/feed_submission_count.rb +0 -10
- data/lib/mws/feeds/parsers/feed_submission_info.rb +0 -25
- data/lib/mws/feeds/parsers/feed_submission_list.rb +0 -23
- data/lib/mws/feeds/parsers/feed_submission_result.rb +0 -10
- data/lib/mws/feeds/parsers/feed_submissions.rb +0 -18
- data/lib/mws/feeds/requests/feed.rb +0 -38
- data/lib/mws/feeds/requests/feed_submission_count.rb +0 -20
- data/lib/mws/feeds/requests/feed_submission_list.rb +0 -30
- data/lib/mws/feeds/requests/feed_submission_result.rb +0 -18
- data/lib/mws/feeds/requests/feed_submissions.rb +0 -20
- data/lib/mws/fulfillment_inbound_shipment/client.rb +0 -7
- data/lib/mws/fulfillment_inventory/client.rb +0 -7
- data/lib/mws/fulfillment_outbound_shipment/client.rb +0 -7
- data/lib/mws/off_amazon_payments/client.rb +0 -7
- data/lib/mws/orders/client.rb +0 -98
- data/lib/mws/orders/parsers/invoice_data.rb +0 -25
- data/lib/mws/orders/parsers/order.rb +0 -113
- data/lib/mws/orders/parsers/order_item.rb +0 -110
- data/lib/mws/orders/parsers/order_items.rb +0 -23
- data/lib/mws/orders/parsers/orders.rb +0 -23
- data/lib/mws/orders/parsers/payment_execution_detail.rb +0 -20
- data/lib/mws/orders/parsers/payment_execution_detail_item.rb +0 -17
- data/lib/mws/orders/parsers/service_status.rb +0 -36
- data/lib/mws/orders/parsers/service_status_message.rb +0 -17
- data/lib/mws/orders/parsers/shipping_address.rb +0 -37
- data/lib/mws/orders/requests/order_items.rb +0 -28
- data/lib/mws/orders/requests/orders.rb +0 -41
- data/lib/mws/orders/requests/service_status.rb +0 -15
- data/lib/mws/products/client.rb +0 -7
- data/lib/mws/recommendations/client.rb +0 -7
- data/lib/mws/reports/client.rb +0 -249
- data/lib/mws/reports/parsers/report.rb +0 -10
- data/lib/mws/reports/parsers/report_acknowledgements.rb +0 -20
- data/lib/mws/reports/parsers/report_count.rb +0 -10
- data/lib/mws/reports/parsers/report_info.rb +0 -29
- data/lib/mws/reports/parsers/report_list.rb +0 -23
- data/lib/mws/reports/parsers/report_request.rb +0 -14
- data/lib/mws/reports/parsers/report_request_count.rb +0 -10
- data/lib/mws/reports/parsers/report_request_info.rb +0 -49
- data/lib/mws/reports/parsers/report_request_list.rb +0 -23
- data/lib/mws/reports/parsers/report_requests.rb +0 -18
- data/lib/mws/reports/parsers/report_schedule.rb +0 -21
- data/lib/mws/reports/parsers/report_schedule_count.rb +0 -10
- data/lib/mws/reports/parsers/report_schedule_list.rb +0 -23
- data/lib/mws/reports/parsers/report_scheduler.rb +0 -19
- data/lib/mws/reports/requests/report.rb +0 -18
- data/lib/mws/reports/requests/report_acknowledgements.rb +0 -27
- data/lib/mws/reports/requests/report_count.rb +0 -20
- data/lib/mws/reports/requests/report_list.rb +0 -30
- data/lib/mws/reports/requests/report_request.rb +0 -21
- data/lib/mws/reports/requests/report_request_count.rb +0 -20
- data/lib/mws/reports/requests/report_request_list.rb +0 -30
- data/lib/mws/reports/requests/report_requests.rb +0 -20
- data/lib/mws/reports/requests/report_schedule_count.rb +0 -19
- data/lib/mws/reports/requests/report_schedule_list.rb +0 -23
- data/lib/mws/reports/requests/report_scheduler.rb +0 -29
- data/lib/mws/sellers/client.rb +0 -53
- data/lib/mws/sellers/parsers/marketplace.rb +0 -33
- data/lib/mws/sellers/parsers/marketplace_participations.rb +0 -32
- data/lib/mws/sellers/parsers/participation.rb +0 -21
- data/lib/mws/sellers/parsers/service_status.rb +0 -36
- data/lib/mws/sellers/parsers/service_status_message.rb +0 -17
- data/lib/mws/sellers/requests/marketplace_participations.rb +0 -27
- data/lib/mws/sellers/requests/service_status.rb +0 -15
- data/lib/mws/subscriptions/client.rb +0 -7
- data/lib/peddler/parsers/base.rb +0 -15
- data/lib/peddler/parsers/collection.rb +0 -23
- data/lib/peddler/parsers/counter.rb +0 -13
- data/lib/peddler/parsers/model.rb +0 -42
- data/lib/peddler/parsers/text.rb +0 -8
- data/lib/peddler/parsers/tokenable.rb +0 -13
- data/lib/peddler/parsers/xml.rb +0 -30
- data/lib/peddler/request/parameters.rb +0 -57
- data/lib/peddler/request/structured_list.rb +0 -48
- data/lib/peddler/request.rb +0 -52
- data/lib/peddler/response/base.rb +0 -0
- data/lib/peddler/response/payload/base.rb +0 -0
- data/lib/peddler/response/payload/csv.rb +0 -0
- data/lib/peddler/response/payload/xml.rb +0 -0
- data/lib/peddler/response.rb +0 -27
- data/test/fixtures/feeds/feed_submission.xml +0 -14
- data/test/fixtures/feeds/feed_submission_count.xml +0 -9
- data/test/fixtures/feeds/feed_submission_list.xml +0 -17
- data/test/fixtures/feeds/feed_submissions.xml +0 -15
- data/test/fixtures/mws.yml +0 -12
- data/test/fixtures/mws.yml.example +0 -4
- data/test/fixtures/orders/order_items.xml +0 -83
- data/test/fixtures/orders/orders.xml +0 -109
- data/test/fixtures/orders/service_status.xml +0 -19
- data/test/fixtures/reports/report.xml +0 -8
- data/test/fixtures/reports/report_acknowledgements.xml +0 -18
- data/test/fixtures/reports/report_count.xml +0 -9
- data/test/fixtures/reports/report_list.xml +0 -17
- data/test/fixtures/reports/report_request_count.xml +0 -9
- data/test/fixtures/reports/report_request_list.xml +0 -24
- data/test/fixtures/reports/report_requests.xml +0 -19
- data/test/fixtures/reports/report_schedule_count.xml +0 -10
- data/test/fixtures/reports/report_schedule_list.xml +0 -16
- data/test/fixtures/reports/report_scheduler.xml +0 -15
- data/test/fixtures/sellers/market_participations.xml +0 -27
- data/test/fixtures/sellers/service_status.xml +0 -9
- data/test/integration/feeds/test_feed_submission_count.rb +0 -13
- data/test/integration/feeds/test_feed_submission_list.rb +0 -17
- data/test/integration/feeds/test_feed_submission_result.rb +0 -15
- data/test/integration/orders/test_order_items.rb +0 -19
- data/test/integration/orders/test_orders.rb +0 -23
- data/test/integration/orders/test_service_status.rb +0 -12
- data/test/integration/reports/test_report.rb +0 -15
- data/test/integration/reports/test_report_count.rb +0 -13
- data/test/integration/reports/test_report_list.rb +0 -17
- data/test/integration/reports/test_report_request_count.rb +0 -13
- data/test/integration/reports/test_report_request_list.rb +0 -17
- data/test/integration/reports/test_report_schedule_count.rb +0 -13
- data/test/integration/reports/test_report_schedule_list.rb +0 -13
- data/test/integration/reports/test_report_scheduler.rb +0 -16
- data/test/integration/sellers/test_marketplace_participations.rb +0 -13
- data/test/integration/sellers/test_service_status.rb +0 -12
- data/test/mws/feeds/parsers/test_feed.rb +0 -13
- data/test/mws/feeds/parsers/test_feed_submission_count.rb +0 -13
- data/test/mws/feeds/parsers/test_feed_submission_info.rb +0 -25
- data/test/mws/feeds/parsers/test_feed_submission_list.rb +0 -18
- data/test/mws/feeds/parsers/test_feed_submission_result.rb +0 -13
- data/test/mws/feeds/parsers/test_feed_submissions.rb +0 -17
- data/test/mws/feeds/requests/test_feed.rb +0 -63
- data/test/mws/feeds/requests/test_feed_submission_count.rb +0 -23
- data/test/mws/feeds/requests/test_feed_submission_list.rb +0 -37
- data/test/mws/feeds/requests/test_feed_submissions.rb +0 -29
- data/test/mws/orders/parsers/test_order.rb +0 -86
- data/test/mws/orders/parsers/test_order_item.rb +0 -69
- data/test/mws/orders/parsers/test_order_items.rb +0 -18
- data/test/mws/orders/parsers/test_orders.rb +0 -18
- data/test/mws/orders/parsers/test_payment_execution_detail.rb +0 -14
- data/test/mws/orders/parsers/test_payment_execution_detail_item.rb +0 -17
- data/test/mws/orders/parsers/test_service_status.rb +0 -39
- data/test/mws/orders/parsers/test_service_status_message.rb +0 -17
- data/test/mws/orders/parsers/test_shipping_address.rb +0 -36
- data/test/mws/orders/requests/test_order_items.rb +0 -36
- data/test/mws/orders/requests/test_orders.rb +0 -46
- data/test/mws/orders/requests/test_service_status.rb +0 -25
- data/test/mws/reports/parsers/test_report_acknowledgments.rb +0 -14
- data/test/mws/reports/parsers/test_report_count.rb +0 -13
- data/test/mws/reports/parsers/test_report_info.rb +0 -29
- data/test/mws/reports/parsers/test_report_list.rb +0 -18
- data/test/mws/reports/parsers/test_report_request.rb +0 -13
- data/test/mws/reports/parsers/test_report_request_count.rb +0 -13
- data/test/mws/reports/parsers/test_report_request_info.rb +0 -49
- data/test/mws/reports/parsers/test_report_request_list.rb +0 -18
- data/test/mws/reports/parsers/test_report_requests.rb +0 -17
- data/test/mws/reports/parsers/test_report_schedule_count.rb +0 -13
- data/test/mws/reports/parsers/test_report_schedule_list.rb +0 -18
- data/test/mws/reports/parsers/test_report_scheduler.rb +0 -17
- data/test/mws/reports/requests/test_acknowledgements.rb +0 -36
- data/test/mws/reports/requests/test_report_count.rb +0 -23
- data/test/mws/reports/requests/test_report_list.rb +0 -39
- data/test/mws/reports/requests/test_report_request.rb +0 -31
- data/test/mws/reports/requests/test_report_request_count.rb +0 -23
- data/test/mws/reports/requests/test_report_request_list.rb +0 -44
- data/test/mws/reports/requests/test_report_requests.rb +0 -29
- data/test/mws/reports/requests/test_report_schedule_count.rb +0 -22
- data/test/mws/reports/requests/test_report_schedule_list.rb +0 -36
- data/test/mws/reports/requests/test_report_scheduler.rb +0 -33
- data/test/mws/sellers/parsers/test_market_participations.rb +0 -19
- data/test/mws/sellers/parsers/test_service_status.rb +0 -35
- data/test/mws/sellers/requests/test_marketplace_participation_list.rb +0 -39
- data/test/mws/sellers/requests/test_service_status.rb +0 -25
- data/test/parser_helper.rb +0 -11
- data/test/peddler/parsers/test_collection.rb +0 -8
- data/test/peddler/parsers/test_model.rb +0 -70
- data/test/peddler/request/test_parameters.rb +0 -35
- data/test/peddler/test_client.rb +0 -42
- data/test/request_helper.rb +0 -20
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'peddler/parsers/model'
|
2
|
-
|
3
|
-
module MWS
|
4
|
-
module Orders
|
5
|
-
module Parsers
|
6
|
-
class ServiceStatusMessage < ::Peddler::Parsers::Model
|
7
|
-
value :locale do
|
8
|
-
text_at_xpath('Locale')
|
9
|
-
end
|
10
|
-
|
11
|
-
value :text do
|
12
|
-
text_at_xpath('Text')
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'peddler/parsers/model'
|
2
|
-
|
3
|
-
module MWS
|
4
|
-
module Orders
|
5
|
-
module Parsers
|
6
|
-
class ShippingAddress < ::Peddler::Parsers::Model
|
7
|
-
value :name do
|
8
|
-
text_at_xpath('Name')
|
9
|
-
end
|
10
|
-
|
11
|
-
value :address_lines do
|
12
|
-
1.upto(3).map { |i| text_at_xpath("AddressLine#{i}") }.compact
|
13
|
-
end
|
14
|
-
|
15
|
-
value :city do
|
16
|
-
text_at_xpath('City')
|
17
|
-
end
|
18
|
-
|
19
|
-
value :state_or_region do
|
20
|
-
text_at_xpath('StateOrRegion')
|
21
|
-
end
|
22
|
-
|
23
|
-
value :postal_code do
|
24
|
-
text_at_xpath('PostalCode')
|
25
|
-
end
|
26
|
-
|
27
|
-
value :country_code do
|
28
|
-
text_at_xpath('CountryCode')
|
29
|
-
end
|
30
|
-
|
31
|
-
value :phone do
|
32
|
-
text_at_xpath('Phone')
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
require 'peddler/request'
|
2
|
-
require 'mws/orders/parsers/order_items'
|
3
|
-
|
4
|
-
module MWS
|
5
|
-
module Orders
|
6
|
-
module Requests
|
7
|
-
class OrderItems < ::Peddler::Request
|
8
|
-
def list(amazon_order_id)
|
9
|
-
parameters(:list_order_items)
|
10
|
-
.update(amazon_order_id: amazon_order_id)
|
11
|
-
.camelize_keys!
|
12
|
-
|
13
|
-
execute
|
14
|
-
end
|
15
|
-
|
16
|
-
def list_by_next_token(token = next_token)
|
17
|
-
return unless token
|
18
|
-
|
19
|
-
parameters(:list_order_items_by_next_token)
|
20
|
-
.update(next_token: token)
|
21
|
-
.camelize_keys!
|
22
|
-
|
23
|
-
execute
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
require 'peddler/request'
|
2
|
-
require 'mws/orders/parsers/orders'
|
3
|
-
|
4
|
-
module MWS
|
5
|
-
module Orders
|
6
|
-
module Requests
|
7
|
-
class Orders < ::Peddler::Request
|
8
|
-
def get(*amazon_order_ids)
|
9
|
-
parameters(:get_order)
|
10
|
-
.update(amazon_order_id: amazon_order_ids)
|
11
|
-
.format_structured_lists!
|
12
|
-
.camelize_keys!
|
13
|
-
|
14
|
-
execute
|
15
|
-
end
|
16
|
-
|
17
|
-
def list(options)
|
18
|
-
options[:marketplace_id] ||= client.marketplace_id
|
19
|
-
|
20
|
-
parameters(:list_orders)
|
21
|
-
.update(options)
|
22
|
-
.timestamp!
|
23
|
-
.format_structured_lists!
|
24
|
-
.camelize_keys!
|
25
|
-
|
26
|
-
execute
|
27
|
-
end
|
28
|
-
|
29
|
-
def list_by_next_token(token = next_token)
|
30
|
-
return unless token
|
31
|
-
|
32
|
-
parameters(:list_orders_by_next_token)
|
33
|
-
.update(next_token: token)
|
34
|
-
.camelize_keys!
|
35
|
-
|
36
|
-
execute
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'peddler/request'
|
2
|
-
require 'mws/orders/parsers/service_status'
|
3
|
-
|
4
|
-
module MWS
|
5
|
-
module Orders
|
6
|
-
module Requests
|
7
|
-
class ServiceStatus < ::Peddler::Request
|
8
|
-
def get
|
9
|
-
parameters(:get_service_status)
|
10
|
-
execute
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
data/lib/mws/products/client.rb
DELETED
data/lib/mws/reports/client.rb
DELETED
@@ -1,249 +0,0 @@
|
|
1
|
-
require 'mws/reports/requests/report_request'
|
2
|
-
require 'mws/reports/requests/report_request_list'
|
3
|
-
require 'mws/reports/requests/report_request_count'
|
4
|
-
require 'mws/reports/requests/report_requests'
|
5
|
-
require 'mws/reports/requests/report_list'
|
6
|
-
require 'mws/reports/requests/report_count'
|
7
|
-
require 'mws/reports/requests/report'
|
8
|
-
require 'mws/reports/requests/report_scheduler'
|
9
|
-
require 'mws/reports/requests/report_schedule_list'
|
10
|
-
require 'mws/reports/requests/report_schedule_count'
|
11
|
-
require 'mws/reports/requests/report_acknowledgements'
|
12
|
-
require 'peddler/client'
|
13
|
-
|
14
|
-
module MWS
|
15
|
-
module Reports
|
16
|
-
# The Reports API lets you request reports about your inventory and orders.
|
17
|
-
class Client < ::Peddler::Client
|
18
|
-
# Public: Create a report request.
|
19
|
-
#
|
20
|
-
# type - The String type of report to request.
|
21
|
-
# options - The Hash query parameters used to narrow the list. Refer to
|
22
|
-
# the MWS Reports API for available parameters.
|
23
|
-
#
|
24
|
-
# Examples
|
25
|
-
#
|
26
|
-
# client.request_report('_GET_ORDERS_DATA_')
|
27
|
-
#
|
28
|
-
# Returns the Report Request Info.
|
29
|
-
def_delegator :report_request, :submit, :request_report
|
30
|
-
|
31
|
-
# Public: Get a list of report requests submitted during a specified time
|
32
|
-
# frame.
|
33
|
-
#
|
34
|
-
# options - The Hash query parameters used to narrow the list. Refer to
|
35
|
-
# the MWS Reports API for available parameters.
|
36
|
-
#
|
37
|
-
# Examples
|
38
|
-
#
|
39
|
-
# client.get_report_request_list(submitted_from_date: 1.week.ago)
|
40
|
-
#
|
41
|
-
# Returns an enumerable Report Request List.
|
42
|
-
def_delegator :report_request_list, :get, :get_report_request_list
|
43
|
-
|
44
|
-
# Public: List the next page of the list of report requests.
|
45
|
-
#
|
46
|
-
# token - A String token (default: The token returned in the last
|
47
|
-
# request).
|
48
|
-
#
|
49
|
-
# Examples
|
50
|
-
#
|
51
|
-
# client.get_report_request_list_by_next_token
|
52
|
-
#
|
53
|
-
# Returns an enumerable Report Request List.
|
54
|
-
def_delegator :report_request_list, :get_by_next_token, :get_report_request_list_by_next_token
|
55
|
-
|
56
|
-
# Public: Get a count of the reports requested during a specified time
|
57
|
-
# frame.
|
58
|
-
#
|
59
|
-
# options - The Hash query parameters used to narrow the list. Refer to
|
60
|
-
# the MWS Reports API for available parameters.
|
61
|
-
#
|
62
|
-
# Examples
|
63
|
-
#
|
64
|
-
# client.get_report_request_count(submitted_from_date: 1.week.ago)
|
65
|
-
#
|
66
|
-
# Returns the Report Request Count.
|
67
|
-
def_delegator :report_request_count, :get, :get_report_request_count
|
68
|
-
|
69
|
-
# Public: Cancel one or more report requests.
|
70
|
-
#
|
71
|
-
# options - The Hash query parameters used to narrow the list. Refer to
|
72
|
-
# the MWS Reports API for available parameters.
|
73
|
-
#
|
74
|
-
# Examples
|
75
|
-
#
|
76
|
-
# client.cancel_report_requests(submitted_to_date: 1.hour.ago)
|
77
|
-
#
|
78
|
-
# Returns the canceled report requests and their count.
|
79
|
-
def_delegator :report_requests, :cancel, :cancel_report_requests
|
80
|
-
|
81
|
-
# Public: Get a list of reports created during a specified time frame.
|
82
|
-
#
|
83
|
-
# options - The Hash query parameters used to narrow the list. Refer to
|
84
|
-
# the MWS Reports API for available parameters.
|
85
|
-
#
|
86
|
-
# Examples
|
87
|
-
#
|
88
|
-
# client.get_report_list
|
89
|
-
#
|
90
|
-
# Returns an enumerable Report List.
|
91
|
-
def_delegator :report_list, :get, :get_report_list
|
92
|
-
|
93
|
-
# Public: List the next page of the list of reports.
|
94
|
-
#
|
95
|
-
# token - A String token (default: The token returned in the last
|
96
|
-
# request).
|
97
|
-
#
|
98
|
-
# Examples
|
99
|
-
#
|
100
|
-
# client.get_report_list_by_next_token
|
101
|
-
#
|
102
|
-
# Returns an enumerable Report List.
|
103
|
-
def_delegator :report_list, :get_by_next_token, :get_report_list_by_next_token
|
104
|
-
|
105
|
-
# Public: Get a count of the reports created during a specified time
|
106
|
-
# frame, with a status of _DONE_ and that are available for download.
|
107
|
-
#
|
108
|
-
# options - The Hash query parameters used to narrow the list. Refer to
|
109
|
-
# the MWS Reports API for available parameters.
|
110
|
-
#
|
111
|
-
# Examples
|
112
|
-
#
|
113
|
-
# client.get_report_count
|
114
|
-
#
|
115
|
-
# Returns a Report Count.
|
116
|
-
def_delegator :report_count, :get, :get_report_count
|
117
|
-
|
118
|
-
# Public: Get the contents of a report and the Content-MD5 header for the
|
119
|
-
# returned report body.
|
120
|
-
#
|
121
|
-
# id - The String generated report id.
|
122
|
-
#
|
123
|
-
# Examples
|
124
|
-
#
|
125
|
-
# client.get_report('123456')
|
126
|
-
#
|
127
|
-
# Returns a Report.
|
128
|
-
def_delegator :report, :get, :get_report
|
129
|
-
|
130
|
-
# Public: Create, update, or delete a report request schedule.
|
131
|
-
#
|
132
|
-
# type - The String report type.
|
133
|
-
# schedule - The String value that indicates how often a report
|
134
|
-
# request should be created.
|
135
|
-
# scheduled_at - The Time when the next report request is scheduled to be
|
136
|
-
# submitted (default: Now).
|
137
|
-
#
|
138
|
-
# Examples
|
139
|
-
#
|
140
|
-
# client.manage_report_schedule('_GET_ORDERS_DATA_', '_1_HOUR_')
|
141
|
-
#
|
142
|
-
# Returns a Report Schedule.
|
143
|
-
def_delegator :report_scheduler, :manage, :manage_report_schedule
|
144
|
-
|
145
|
-
# Public: Delete a report request schedule.
|
146
|
-
#
|
147
|
-
# type - The String report type.
|
148
|
-
#
|
149
|
-
# Examples
|
150
|
-
#
|
151
|
-
# client.delete_report_schedule('_GET_ORDERS_DATA_')
|
152
|
-
#
|
153
|
-
# Returns a Report Schedule.
|
154
|
-
def_delegator :report_scheduler, :delete, :delete_report_schedule
|
155
|
-
|
156
|
-
# Public: Get a list of order report requests that are scheduled to be
|
157
|
-
# submitted to MWS for processing.
|
158
|
-
#
|
159
|
-
# types - One or more String report types (default: all report types).
|
160
|
-
#
|
161
|
-
# Examples
|
162
|
-
#
|
163
|
-
# client.get_report_schedule_list
|
164
|
-
#
|
165
|
-
# Returns a Report Schedule List.
|
166
|
-
def_delegator :report_schedule_list, :get, :get_report_schedule_list
|
167
|
-
|
168
|
-
# Public: Get a count of order report requests that are scheduled to be
|
169
|
-
# submitted to MWS.
|
170
|
-
#
|
171
|
-
# types - One or more String report types (default: all report types).
|
172
|
-
#
|
173
|
-
# Examples
|
174
|
-
#
|
175
|
-
# client.get_report_schedule_count
|
176
|
-
#
|
177
|
-
# Returns the Report Schedule Count.
|
178
|
-
def_delegator :report_schedule_count, :get, :get_report_schedule_count
|
179
|
-
|
180
|
-
# Public: Update acknowledged status of one or more reports to true.
|
181
|
-
#
|
182
|
-
# ids - One or more Integer report ids.
|
183
|
-
#
|
184
|
-
# Examples
|
185
|
-
#
|
186
|
-
# client.acknowledge_reports(123)
|
187
|
-
#
|
188
|
-
# Returns Report Acknowledgements.
|
189
|
-
def_delegator :report_acknowledgements, :acknowledge, :acknowledge_reports
|
190
|
-
|
191
|
-
# Public: Update acknowledged status of one or more reports to false.
|
192
|
-
#
|
193
|
-
# ids - One or more Integer report ids.
|
194
|
-
#
|
195
|
-
# Examples
|
196
|
-
#
|
197
|
-
# client.unacknowledge_reports(123)
|
198
|
-
#
|
199
|
-
# Returns Report Acknowledgements.
|
200
|
-
def_delegator :report_acknowledgements, :unacknowledge, :unacknowledge_reports
|
201
|
-
|
202
|
-
private
|
203
|
-
|
204
|
-
def report_request
|
205
|
-
@report_request ||= Requests::ReportRequest.new(self)
|
206
|
-
end
|
207
|
-
|
208
|
-
def report_request_list
|
209
|
-
@report_request_list ||= Requests::ReportRequestList.new(self)
|
210
|
-
end
|
211
|
-
|
212
|
-
def report_request_count
|
213
|
-
@report_request_count ||= Requests::ReportRequestCount.new(self)
|
214
|
-
end
|
215
|
-
|
216
|
-
def report_requests
|
217
|
-
@report_requests ||= Requests::ReportRequests.new(self)
|
218
|
-
end
|
219
|
-
|
220
|
-
def report_list
|
221
|
-
@report_list ||= Requests::ReportList.new(self)
|
222
|
-
end
|
223
|
-
|
224
|
-
def report_count
|
225
|
-
@report_count ||= Requests::ReportCount.new(self)
|
226
|
-
end
|
227
|
-
|
228
|
-
def report
|
229
|
-
@report ||= Requests::Report.new(self)
|
230
|
-
end
|
231
|
-
|
232
|
-
def report_scheduler
|
233
|
-
@report_scheduler ||= Requests::ReportScheduler.new(self)
|
234
|
-
end
|
235
|
-
|
236
|
-
def report_schedule_list
|
237
|
-
@report_schedule_list ||= Requests::ReportScheduleList.new(self)
|
238
|
-
end
|
239
|
-
|
240
|
-
def report_schedule_count
|
241
|
-
@report_schedule_count ||= Requests::ReportScheduleCount.new(self)
|
242
|
-
end
|
243
|
-
|
244
|
-
def report_acknowledgements
|
245
|
-
@report_acknowledgements ||= Requests::ReportAcknowledgements.new(self)
|
246
|
-
end
|
247
|
-
end
|
248
|
-
end
|
249
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'peddler/parsers/collection'
|
2
|
-
require 'mws/reports/parsers/report_info'
|
3
|
-
|
4
|
-
module MWS
|
5
|
-
module Reports
|
6
|
-
module Parsers
|
7
|
-
class ReportAcknowledgements < ::Peddler::Parsers::Collection
|
8
|
-
def each(&blk)
|
9
|
-
report_info_nodes.each { |node| yield ReportInfo.new(node) }
|
10
|
-
end
|
11
|
-
|
12
|
-
private
|
13
|
-
|
14
|
-
def report_info_nodes
|
15
|
-
xpath('ReportInfo')
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'peddler/parsers/model'
|
2
|
-
|
3
|
-
module MWS
|
4
|
-
module Reports
|
5
|
-
module Parsers
|
6
|
-
class ReportInfo < ::Peddler::Parsers::Model
|
7
|
-
value :id do
|
8
|
-
text_at_xpath('ReportId')
|
9
|
-
end
|
10
|
-
|
11
|
-
value :type do
|
12
|
-
text_at_xpath('ReportType')
|
13
|
-
end
|
14
|
-
|
15
|
-
value :request_id do
|
16
|
-
text_at_xpath('ReportRequestId')
|
17
|
-
end
|
18
|
-
|
19
|
-
value :available_at do
|
20
|
-
time_at_xpath('AvailableDate')
|
21
|
-
end
|
22
|
-
|
23
|
-
value :acknowledged? do
|
24
|
-
boolean_at_xpath('Acknowledged')
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'peddler/parsers/collection'
|
2
|
-
require 'mws/reports/parsers/report_info'
|
3
|
-
require 'peddler/parsers/tokenable'
|
4
|
-
|
5
|
-
module MWS
|
6
|
-
module Reports
|
7
|
-
module Parsers
|
8
|
-
class ReportList < ::Peddler::Parsers::Collection
|
9
|
-
include ::Peddler::Parsers::Tokenable
|
10
|
-
|
11
|
-
def each(&blk)
|
12
|
-
report_info_nodes.each { |node| yield ReportInfo.new(node) }
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def report_info_nodes
|
18
|
-
xpath('ReportInfo')
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,14 +0,0 @@
|
|
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,49 +0,0 @@
|
|
1
|
-
require 'peddler/parsers/model'
|
2
|
-
|
3
|
-
module MWS
|
4
|
-
module Reports
|
5
|
-
module Parsers
|
6
|
-
class ReportRequestInfo < ::Peddler::Parsers::Model
|
7
|
-
value :id do
|
8
|
-
text_at_xpath('ReportRequestId')
|
9
|
-
end
|
10
|
-
|
11
|
-
value :type do
|
12
|
-
text_at_xpath('ReportType')
|
13
|
-
end
|
14
|
-
|
15
|
-
value :started_at do
|
16
|
-
time_at_xpath('StartDate')
|
17
|
-
end
|
18
|
-
|
19
|
-
value :ended_at do
|
20
|
-
time_at_xpath('EndDate')
|
21
|
-
end
|
22
|
-
|
23
|
-
value :scheduled? do
|
24
|
-
boolean_at_xpath('Scheduled')
|
25
|
-
end
|
26
|
-
|
27
|
-
value :submitted_at do
|
28
|
-
time_at_xpath('SubmittedDate')
|
29
|
-
end
|
30
|
-
|
31
|
-
value :processing_status do
|
32
|
-
text_at_xpath('ReportProcessingStatus')
|
33
|
-
end
|
34
|
-
|
35
|
-
value :generated_report_id do
|
36
|
-
text_at_xpath('GeneratedReportId')
|
37
|
-
end
|
38
|
-
|
39
|
-
value :started_processing_at do
|
40
|
-
time_at_xpath('StartedProcessingDate')
|
41
|
-
end
|
42
|
-
|
43
|
-
value :completed_at do
|
44
|
-
time_at_xpath('CompletedDate')
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'peddler/parsers/collection'
|
2
|
-
require 'mws/reports/parsers/report_request_info'
|
3
|
-
require 'peddler/parsers/tokenable'
|
4
|
-
|
5
|
-
module MWS
|
6
|
-
module Reports
|
7
|
-
module Parsers
|
8
|
-
class ReportRequestList < ::Peddler::Parsers::Collection
|
9
|
-
include ::Peddler::Parsers::Tokenable
|
10
|
-
|
11
|
-
def each(&blk)
|
12
|
-
report_request_info_nodes.each { |node| yield ReportRequestInfo.new(node) }
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def report_request_info_nodes
|
18
|
-
xpath('ReportRequestInfo')
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,18 +0,0 @@
|
|
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 ReportRequests < ::Peddler::Parsers::Model
|
8
|
-
value :count do
|
9
|
-
integer_at_xpath('Count')
|
10
|
-
end
|
11
|
-
|
12
|
-
def report_request_infos
|
13
|
-
xpath('ReportRequestInfo').map { |node| ReportRequestInfo.new(node) }
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'peddler/parsers/model'
|
2
|
-
|
3
|
-
module MWS
|
4
|
-
module Reports
|
5
|
-
module Parsers
|
6
|
-
class ReportSchedule < ::Peddler::Parsers::Model
|
7
|
-
value :type do
|
8
|
-
text_at_xpath('ReportType')
|
9
|
-
end
|
10
|
-
|
11
|
-
value :schedule do
|
12
|
-
text_at_xpath('Schedule')
|
13
|
-
end
|
14
|
-
|
15
|
-
value :scheduled_at do
|
16
|
-
time_at_xpath('ScheduledDate')
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'peddler/parsers/collection'
|
2
|
-
require 'mws/reports/parsers/report_schedule'
|
3
|
-
require 'peddler/parsers/tokenable'
|
4
|
-
|
5
|
-
module MWS
|
6
|
-
module Reports
|
7
|
-
module Parsers
|
8
|
-
class ReportScheduleList < ::Peddler::Parsers::Collection
|
9
|
-
include ::Peddler::Parsers::Tokenable
|
10
|
-
|
11
|
-
def each(&blk)
|
12
|
-
report_schedule_nodes.each { |node| yield ReportSchedule.new(node) }
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def report_schedule_nodes
|
18
|
-
xpath('ReportSchedule')
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|