peddler 3.0.0.beta1 → 3.0.0

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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +96 -106
  3. data/lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb +34 -22
  4. data/lib/peddler/api/aplus_content_2020_11_01.rb +86 -48
  5. data/lib/peddler/api/application_integrations_2024_04_01.rb +56 -0
  6. data/lib/peddler/api/application_management_2023_11_30.rb +12 -2
  7. data/lib/peddler/api/catalog_items_2020_12_01.rb +31 -20
  8. data/lib/peddler/api/catalog_items_2022_04_01.rb +35 -25
  9. data/lib/peddler/api/catalog_items_v0.rb +39 -26
  10. data/lib/peddler/api/data_kiosk_2023_11_15.rb +41 -25
  11. data/lib/peddler/api/easy_ship_2022_03_23.rb +62 -43
  12. data/lib/peddler/api/fba_inbound_eligibility_v1.rb +13 -5
  13. data/lib/peddler/api/fba_inventory_v1.rb +40 -24
  14. data/lib/peddler/api/feeds_2021_06_30.rb +43 -25
  15. data/lib/peddler/api/finances_2024_06_19.rb +50 -0
  16. data/lib/peddler/api/finances_v0.rb +86 -59
  17. data/lib/peddler/api/fulfillment_inbound_2024_03_20.rb +304 -205
  18. data/lib/peddler/api/fulfillment_inbound_v0.rb +112 -74
  19. data/lib/peddler/api/fulfillment_outbound_2020_07_01.rb +90 -53
  20. data/lib/peddler/api/invoices_2024_06_19.rb +180 -0
  21. data/lib/peddler/api/listings_items_2020_09_01.rb +44 -33
  22. data/lib/peddler/api/listings_items_2021_08_01.rb +76 -60
  23. data/lib/peddler/api/listings_restrictions_2021_08_01.rb +19 -9
  24. data/lib/peddler/api/merchant_fulfillment_v0.rb +31 -15
  25. data/lib/peddler/api/messaging_v1.rb +93 -61
  26. data/lib/peddler/api/notifications_v1.rb +54 -23
  27. data/lib/peddler/api/orders_v0.rb +87 -72
  28. data/lib/peddler/api/product_fees_v0.rb +39 -31
  29. data/lib/peddler/api/product_pricing_2022_05_01.rb +17 -6
  30. data/lib/peddler/api/product_pricing_v0.rb +63 -45
  31. data/lib/peddler/api/product_type_definitions_2020_09_01.rb +29 -18
  32. data/lib/peddler/api/replenishment_2022_11_07.rb +21 -9
  33. data/lib/peddler/api/reports_2021_06_30.rb +60 -36
  34. data/lib/peddler/api/sales_v1.rb +20 -12
  35. data/lib/peddler/api/sellers_v1.rb +16 -4
  36. data/lib/peddler/api/services_v1.rb +138 -98
  37. data/lib/peddler/api/shipment_invoicing_v0.rb +25 -12
  38. data/lib/peddler/api/shipping_v1.rb +54 -29
  39. data/lib/peddler/api/shipping_v2.rb +132 -80
  40. data/lib/peddler/api/solicitations_v1.rb +18 -8
  41. data/lib/peddler/api/supply_sources_2020_07_01.rb +33 -15
  42. data/lib/peddler/api/tokens_2021_03_01.rb +13 -5
  43. data/lib/peddler/api/uploads_2020_11_01.rb +16 -6
  44. data/lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb +12 -4
  45. data/lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb +29 -17
  46. data/lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb +29 -17
  47. data/lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb +11 -3
  48. data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +14 -4
  49. data/lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb +74 -48
  50. data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +74 -50
  51. data/lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb +11 -3
  52. data/lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb +11 -3
  53. data/lib/peddler/api/vendor_invoices_v1.rb +11 -3
  54. data/lib/peddler/api/vendor_orders_v1.rb +54 -43
  55. data/lib/peddler/api/vendor_shipments_v1.rb +63 -51
  56. data/lib/peddler/api/vendor_transaction_status_v1.rb +12 -3
  57. data/lib/peddler/api.rb +41 -18
  58. data/lib/peddler/endpoint.rb +51 -0
  59. data/lib/peddler/error.rb +1 -0
  60. data/lib/peddler/marketplace.rb +49 -0
  61. data/lib/peddler/token.rb +70 -0
  62. data/lib/peddler/version.rb +1 -1
  63. data/lib/peddler.rb +56 -52
  64. metadata +10 -6
  65. data/lib/peddler/access_token.rb +0 -76
  66. data/lib/peddler/region.rb +0 -30
@@ -3,6 +3,12 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
+ class << self
7
+ def feeds_2021_06_30(...)
8
+ API::Feeds20210630.new(...)
9
+ end
10
+ end
11
+
6
12
  class API
7
13
  # Selling Partner API for Feeds
8
14
  #
@@ -10,24 +16,26 @@ module Peddler
10
16
  class Feeds20210630 < API
11
17
  # Returns feed details for the feeds that match the filters that you specify.
12
18
  #
13
- # @param [Array<String>] feed_types A list of feed types used to filter feeds. When feedTypes is provided, the
19
+ # @note This operation can make a static sandbox call.
20
+ # @param feed_types [Array<String>] A list of feed types used to filter feeds. When feedTypes is provided, the
14
21
  # other filter parameters (processingStatuses, marketplaceIds, createdSince, createdUntil) and pageSize may also
15
22
  # be provided. Either feedTypes or nextToken is required.
16
- # @param [Array<String>] marketplace_ids A list of marketplace identifiers used to filter feeds. The feeds
23
+ # @param marketplace_ids [Array<String>] A list of marketplace identifiers used to filter feeds. The feeds
17
24
  # returned will match at least one of the marketplaces that you specify.
18
- # @param [Integer] page_size The maximum number of feeds to return in a single call.
19
- # @param [Array<String>] processing_statuses A list of processing statuses used to filter feeds.
20
- # @param [String] created_since The earliest feed creation date and time for feeds included in the response, in
25
+ # @param page_size [Integer] The maximum number of feeds to return in a single call.
26
+ # @param processing_statuses [Array<String>] A list of processing statuses used to filter feeds.
27
+ # @param created_since [String] The earliest feed creation date and time for feeds included in the response, in
21
28
  # ISO 8601 format. The default is 90 days ago. Feeds are retained for a maximum of 90 days.
22
- # @param [String] created_until The latest feed creation date and time for feeds included in the response, in ISO
29
+ # @param created_until [String] The latest feed creation date and time for feeds included in the response, in ISO
23
30
  # 8601 format. The default is now.
24
- # @param [String] next_token A string token returned in the response to your previous request. nextToken is
31
+ # @param next_token [String] A string token returned in the response to your previous request. nextToken is
25
32
  # returned when the number of results exceeds the specified pageSize value. To get the next page of results,
26
33
  # call the getFeeds operation and include this token as the only parameter. Specifying nextToken with any other
27
34
  # parameters will cause the request to fail.
35
+ # @param rate_limit [Float] Requests per second
28
36
  # @return [Hash] The API response
29
- def get_feeds(feed_types: nil, marketplace_ids: nil, page_size: nil, processing_statuses: nil,
30
- created_since: nil, created_until: nil, next_token: nil)
37
+ def get_feeds(feed_types: nil, marketplace_ids: nil, page_size: 10, processing_statuses: nil, created_since: nil,
38
+ created_until: nil, next_token: nil, rate_limit: 0.0222)
31
39
  path = "/feeds/2021-06-30/feeds"
32
40
  params = {
33
41
  "feedTypes" => feed_types,
@@ -39,17 +47,19 @@ module Peddler
39
47
  "nextToken" => next_token,
40
48
  }.compact
41
49
 
42
- rate_limit(0.0222).get(path, params:)
50
+ meter(rate_limit).get(path, params:)
43
51
  end
44
52
 
45
53
  # Creates a feed. Upload the contents of the feed document before calling this operation.
46
54
  #
47
- # @param [Hash] body Information required to create the feed.
55
+ # @note This operation can make a static sandbox call.
56
+ # @param body [Hash] Information required to create the feed.
57
+ # @param rate_limit [Float] Requests per second
48
58
  # @return [Hash] The API response
49
- def create_feed(body)
59
+ def create_feed(body, rate_limit: 0.0083)
50
60
  path = "/feeds/2021-06-30/feeds"
51
61
 
52
- rate_limit(0.0083).post(path, body:)
62
+ meter(rate_limit).post(path, body:)
53
63
  end
54
64
 
55
65
  # Cancels the feed that you specify. Only feeds with `processingStatus=IN_QUEUE` can be cancelled. Cancelled feeds
@@ -57,24 +67,28 @@ module Peddler
57
67
  # [`getFeed`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#getfeed) and
58
68
  # [`getFeeds`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#getfeeds) operations.
59
69
  #
60
- # @param [String] feed_id The identifier for the feed. This identifier is unique only in combination with a seller
70
+ # @note This operation can make a static sandbox call.
71
+ # @param feed_id [String] The identifier for the feed. This identifier is unique only in combination with a seller
61
72
  # ID.
73
+ # @param rate_limit [Float] Requests per second
62
74
  # @return [Hash] The API response
63
- def cancel_feed(feed_id)
75
+ def cancel_feed(feed_id, rate_limit: 2.0)
64
76
  path = "/feeds/2021-06-30/feeds/#{feed_id}"
65
77
 
66
- rate_limit(2.0).delete(path)
78
+ meter(rate_limit).delete(path)
67
79
  end
68
80
 
69
81
  # Returns feed details (including the `resultDocumentId`, if available) for the feed that you specify.
70
82
  #
71
- # @param [String] feed_id The identifier for the feed. This identifier is unique only in combination with a seller
83
+ # @note This operation can make a static sandbox call.
84
+ # @param feed_id [String] The identifier for the feed. This identifier is unique only in combination with a seller
72
85
  # ID.
86
+ # @param rate_limit [Float] Requests per second
73
87
  # @return [Hash] The API response
74
- def get_feed(feed_id)
88
+ def get_feed(feed_id, rate_limit: 2.0)
75
89
  path = "/feeds/2021-06-30/feeds/#{feed_id}"
76
90
 
77
- rate_limit(2.0).get(path)
91
+ meter(rate_limit).get(path)
78
92
  end
79
93
 
80
94
  # Creates a feed document for the feed type that you specify. This operation returns a presigned URL for uploading
@@ -82,22 +96,26 @@ module Peddler
82
96
  # to the [`createFeed`](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#createfeed)
83
97
  # operation.
84
98
  #
85
- # @param [Hash] body Specifies the content type for the createFeedDocument operation.
99
+ # @note This operation can make a static sandbox call.
100
+ # @param body [Hash] Specifies the content type for the createFeedDocument operation.
101
+ # @param rate_limit [Float] Requests per second
86
102
  # @return [Hash] The API response
87
- def create_feed_document(body)
103
+ def create_feed_document(body, rate_limit: 0.5)
88
104
  path = "/feeds/2021-06-30/documents"
89
105
 
90
- rate_limit(0.5).post(path, body:)
106
+ meter(rate_limit).post(path, body:)
91
107
  end
92
108
 
93
109
  # Returns the information required for retrieving a feed document's contents.
94
110
  #
95
- # @param [String] feed_document_id The identifier of the feed document.
111
+ # @note This operation can make a static sandbox call.
112
+ # @param feed_document_id [String] The identifier of the feed document.
113
+ # @param rate_limit [Float] Requests per second
96
114
  # @return [Hash] The API response
97
- def get_feed_document(feed_document_id)
115
+ def get_feed_document(feed_document_id, rate_limit: 0.0222)
98
116
  path = "/feeds/2021-06-30/documents/#{feed_document_id}"
99
117
 
100
- rate_limit(0.0222).get(path)
118
+ meter(rate_limit).get(path)
101
119
  end
102
120
  end
103
121
  end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def finances_2024_06_19(...)
8
+ API::Finances20240619.new(...)
9
+ end
10
+ end
11
+
12
+ class API
13
+ # The Selling Partner API for Finances
14
+ #
15
+ # The Selling Partner API for Finances provides financial information relevant to a seller's business. You can
16
+ # obtain financial events for a given order or date range without having to wait until a statement period closes.
17
+ class Finances20240619 < API
18
+ # Returns transactions for the given parameters. Orders from the last 48 hours might not be included in financial
19
+ # events.
20
+ #
21
+ # @note This operation can make a static sandbox call.
22
+ # @param posted_after [String] The response includes financial events posted after (or on) this date. This date
23
+ # must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time
24
+ # must be more than two minutes before the time of the request.
25
+ # @param posted_before [String] The response includes financial events posted before (but not on) this date. This
26
+ # date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The
27
+ # date-time must be later than `PostedAfter` and more than two minutes before the request was submitted. If
28
+ # `PostedAfter` and `PostedBefore` are more than 180 days apart, the response is empty. **Default:** Two minutes
29
+ # before the time of the request.
30
+ # @param marketplace_id [String] The ID of the marketplace from which you want to retrieve transactions.
31
+ # @param next_token [String] The response includes `nextToken` when the number of results exceeds the specified
32
+ # `pageSize` value. To get the next page of results, call the operation with this token and include the same
33
+ # arguments as the call that produced the token. To get a complete list, call this operation until `nextToken`
34
+ # is null. Note that this operation can return empty pages.
35
+ # @param rate_limit [Float] Requests per second
36
+ # @return [Hash] The API response
37
+ def list_transactions(posted_after, posted_before: nil, marketplace_id: nil, next_token: nil, rate_limit: 0.5)
38
+ path = "/finances/2024-06-19/transactions"
39
+ params = {
40
+ "postedAfter" => posted_after,
41
+ "postedBefore" => posted_before,
42
+ "marketplaceId" => marketplace_id,
43
+ "nextToken" => next_token,
44
+ }.compact
45
+
46
+ meter(rate_limit).get(path, params:)
47
+ end
48
+ end
49
+ end
50
+ end
@@ -3,31 +3,42 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
+ class << self
7
+ def finances_v0(...)
8
+ API::FinancesV0.new(...)
9
+ end
10
+ end
11
+
6
12
  class API
7
13
  # Selling Partner API for Finances
8
14
  #
9
- # The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You
15
+ # The Selling Partner API for Finances provides financial information that is relevant to a seller's business. You
10
16
  # can obtain financial events for a given order, financial event group, or date range without having to wait until a
11
17
  # statement period closes. You can also obtain financial event groups for a given date range.
12
18
  class FinancesV0 < API
13
- # Returns financial event groups for a given date range. It may take up to 48 hours for orders to appear in your
19
+ # Returns financial event groups for a given date range. Orders from the last 48 hours might not be included in
14
20
  # financial events.
15
21
  #
16
- # @param [Integer] max_results_per_page The maximum number of results to return per page. If the response exceeds
17
- # the maximum number of transactions or 10 MB, the API responds with 'InvalidInput'.
18
- # @param [String] financial_event_group_started_before A date used for selecting financial event groups that
19
- # opened before (but not at) a specified date and time, in [ISO
20
- # 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. The date-time must be later than
21
- # FinancialEventGroupStartedAfter and no later than two minutes before the request was submitted. If
22
- # FinancialEventGroupStartedAfter and FinancialEventGroupStartedBefore are more than 180 days apart, no
22
+ # @note This operation can make a static sandbox call.
23
+ # @param max_results_per_page [Integer] The maximum number of results per page. If the response exceeds the
24
+ # maximum number of transactions or 10 MB, the response is `InvalidInput`.
25
+ # @param financial_event_group_started_before [String] A date that selects financial event groups that opened
26
+ # before (but not at) a specified date and time, in [ISO
27
+ # 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. The date-time must be after
28
+ # `FinancialEventGroupStartedAfter` and more than two minutes before the time of request. If
29
+ # `FinancialEventGroupStartedAfter` and `FinancialEventGroupStartedBefore` are more than 180 days apart, no
23
30
  # financial event groups are returned.
24
- # @param [String] financial_event_group_started_after A date used for selecting financial event groups that opened
25
- # after (or at) a specified date and time, in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
26
- # format. The date-time must be no later than two minutes before the request was submitted.
27
- # @param [String] next_token A string token returned in the response of your previous request.
31
+ # @param financial_event_group_started_after [String] A date that selects financial event groups that opened after
32
+ # (or at) a specified date and time, in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
33
+ # format. The date-time must be more than two minutes before you submit the request.
34
+ # @param next_token [String] The response includes `nextToken` when the number of results exceeds the specified
35
+ # `pageSize` value. To get the next page of results, call the operation with this token and include the same
36
+ # arguments as the call that produced the token. To get a complete list, call this operation until `nextToken`
37
+ # is null. Note that this operation can return empty pages.
38
+ # @param rate_limit [Float] Requests per second
28
39
  # @return [Hash] The API response
29
- def list_financial_event_groups(max_results_per_page: nil, financial_event_group_started_before: nil,
30
- financial_event_group_started_after: nil, next_token: nil)
40
+ def list_financial_event_groups(max_results_per_page: 10, financial_event_group_started_before: nil,
41
+ financial_event_group_started_after: nil, next_token: nil, rate_limit: 0.5)
31
42
  path = "/finances/v0/financialEventGroups"
32
43
  params = {
33
44
  "MaxResultsPerPage" => max_results_per_page,
@@ -36,30 +47,34 @@ module Peddler
36
47
  "NextToken" => next_token,
37
48
  }.compact
38
49
 
39
- rate_limit(0.5).get(path, params:)
50
+ meter(rate_limit).get(path, params:)
40
51
  end
41
52
 
42
- # Returns all financial events for the specified financial event group. It may take up to 48 hours for orders to
43
- # appear in your financial events.
44
- # @note This operation will only retrieve group's data for the past two years. If a request is submitted for data
45
- # spanning more than two years, an empty response is returned.
53
+ # Returns all financial events for the specified financial event group. Orders from the last 48 hours might not be
54
+ # included in financial events. **Note:** This operation only retrieves a group's data for the past two years. A
55
+ # request for data spanning more than two years produces an empty response.
46
56
  #
47
- # @param [Integer] max_results_per_page The maximum number of results to return per page. If the response exceeds
48
- # the maximum number of transactions or 10 MB, the API responds with 'InvalidInput'.
49
- # @param [String] posted_after A date used for selecting financial events posted after (or at) a specified time.
50
- # The date-time **must** be more than two minutes before the time of the request, in [ISO
51
- # 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format.
52
- # @param [String] posted_before A date used for selecting financial events posted before (but not at) a specified
53
- # time. The date-time must be later than `PostedAfter` and no later than two minutes before the request was
54
- # submitted, in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. If
55
- # `PostedAfter` and `PostedBefore` are more than 180 days apart, no financial events are returned. You must
56
- # specify the `PostedAfter` parameter if you specify the `PostedBefore` parameter. Default: Now minus two
57
- # minutes.
58
- # @param [String] event_group_id The identifier of the financial event group to which the events belong.
59
- # @param [String] next_token A string token returned in the response of your previous request.
57
+ # @note This operation can make a static sandbox call.
58
+ # @param max_results_per_page [Integer] The maximum number of results to return per page. If the response exceeds
59
+ # the maximum number of transactions or 10 MB, the response is `InvalidInput`.
60
+ # @param posted_after [String] The response includes financial events posted after (or on) this date. This date
61
+ # must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time
62
+ # must be more than two minutes before the time of the request.
63
+ # @param posted_before [String] The response includes financial events posted before (but not on) this date. This
64
+ # date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The
65
+ # date-time must be later than `PostedAfter` and more than two minutes before the requestd was submitted. If
66
+ # `PostedAfter` and `PostedBefore` are more than 180 days apart, the response is empty. If you include the
67
+ # `PostedBefore` parameter in your request, you must also specify the `PostedAfter` parameter. **Default:** Two
68
+ # minutes before the time of the request.
69
+ # @param event_group_id [String] The identifier of the financial event group to which the events belong.
70
+ # @param next_token [String] The response includes `nextToken` when the number of results exceeds the specified
71
+ # `pageSize` value. To get the next page of results, call the operation with this token and include the same
72
+ # arguments as the call that produced the token. To get a complete list, call this operation until `nextToken`
73
+ # is null. Note that this operation can return empty pages.
74
+ # @param rate_limit [Float] Requests per second
60
75
  # @return [Hash] The API response
61
- def list_financial_events_by_group_id(event_group_id, max_results_per_page: nil, posted_after: nil,
62
- posted_before: nil, next_token: nil)
76
+ def list_financial_events_by_group_id(event_group_id, max_results_per_page: 100, posted_after: nil,
77
+ posted_before: nil, next_token: nil, rate_limit: 0.5)
63
78
  path = "/finances/v0/financialEventGroups/#{event_group_id}/financialEvents"
64
79
  params = {
65
80
  "MaxResultsPerPage" => max_results_per_page,
@@ -68,44 +83,56 @@ module Peddler
68
83
  "NextToken" => next_token,
69
84
  }.compact
70
85
 
71
- rate_limit(0.5).get(path, params:)
86
+ meter(rate_limit).get(path, params:)
72
87
  end
73
88
 
74
- # Returns all financial events for the specified order. It may take up to 48 hours for orders to appear in your
89
+ # Returns all financial events for the specified order. Orders from the last 48 hours might not be included in
75
90
  # financial events.
76
91
  #
77
- # @param [String] order_id An Amazon-defined order identifier, in 3-7-7 format.
78
- # @param [Integer] max_results_per_page The maximum number of results to return per page. If the response exceeds
79
- # the maximum number of transactions or 10 MB, the API responds with 'InvalidInput'.
80
- # @param [String] next_token A string token returned in the response of your previous request.
92
+ # @note This operation can make a static sandbox call.
93
+ # @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format.
94
+ # @param max_results_per_page [Integer] The maximum number of results to return per page. If the response exceeds
95
+ # the maximum number of transactions or 10 MB, the response is `InvalidInput`.
96
+ # @param next_token [String] The response includes `nextToken` when the number of results exceeds the specified
97
+ # `pageSize` value. To get the next page of results, call the operation with this token and include the same
98
+ # arguments as the call that produced the token. To get a complete list, call this operation until `nextToken`
99
+ # is null. Note that this operation can return empty pages.
100
+ # @param rate_limit [Float] Requests per second
81
101
  # @return [Hash] The API response
82
- def list_financial_events_by_order_id(order_id, max_results_per_page: nil, next_token: nil)
102
+ def list_financial_events_by_order_id(order_id, max_results_per_page: 100, next_token: nil, rate_limit: 0.5)
83
103
  path = "/finances/v0/orders/#{order_id}/financialEvents"
84
104
  params = {
85
105
  "MaxResultsPerPage" => max_results_per_page,
86
106
  "NextToken" => next_token,
87
107
  }.compact
88
108
 
89
- rate_limit(0.5).get(path, params:)
109
+ meter(rate_limit).get(path, params:)
90
110
  end
91
111
 
92
- # Returns financial events for the specified data range. It may take up to 48 hours for orders to appear in your
93
- # financial events.
94
- # @note in `ListFinancialEvents`, deferred events don't show up in responses until in they are released.
112
+ # Returns financial events for the specified data range. Orders from the last 48 hours might not be included in
113
+ # financial events. **Note:** in `ListFinancialEvents`, deferred events don't show up in responses until in they
114
+ # are released.
95
115
  #
96
- # @param [Integer] max_results_per_page The maximum number of results to return per page. If the response exceeds
97
- # the maximum number of transactions or 10 MB, the API responds with 'InvalidInput'.
98
- # @param [String] posted_after A date used for selecting financial events posted after (or at) a specified time.
99
- # The date-time must be no later than two minutes before the request was submitted, in [ISO
100
- # 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format.
101
- # @param [String] posted_before A date used for selecting financial events posted before (but not at) a specified
102
- # time. The date-time must be later than PostedAfter and no later than two minutes before the request was
103
- # submitted, in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. If
104
- # PostedAfter and PostedBefore are more than 180 days apart, no financial events are returned. You must specify
105
- # the PostedAfter parameter if you specify the PostedBefore parameter. Default: Now minus two minutes.
106
- # @param [String] next_token A string token returned in the response of your previous request.
116
+ # @note This operation can make a static sandbox call.
117
+ # @param max_results_per_page [Integer] The maximum number of results to return per page. If the response exceeds
118
+ # the maximum number of transactions or 10 MB, the response is `InvalidInput`.
119
+ # @param posted_after [String] The response includes financial events posted after (or on) this date. This date
120
+ # must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time
121
+ # must be more than two minutes before the time of the request.
122
+ # @param posted_before [String] The response includes financial events posted before (but not on) this date. This
123
+ # date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The
124
+ # date-time must be later than `PostedAfter` and more than two minutes before the request was submitted. If
125
+ # `PostedAfter` and `PostedBefore` are more than 180 days apart, the response is empty. If you include the
126
+ # `PostedBefore` parameter in your request, you must also specify the `PostedAfter` parameter. **Default:** Two
127
+ # minutes before the time of the request.
128
+ # @param next_token [String] The response includes `nextToken` when the number of results exceeds the specified
129
+ # `pageSize` value. To get the next page of results, call the operation with this token and include the same
130
+ # arguments as the call that produced the token. To get a complete list, call this operation until `nextToken`
131
+ # is null. Note that this operation can return empty pages.
132
+ # @param rate_limit [Float] Requests per second
107
133
  # @return [Hash] The API response
108
- def list_financial_events(max_results_per_page: nil, posted_after: nil, posted_before: nil, next_token: nil)
134
+ def list_financial_events(max_results_per_page: 100, posted_after: nil, posted_before: nil, next_token: nil,
135
+ rate_limit: 0.5)
109
136
  path = "/finances/v0/financialEvents"
110
137
  params = {
111
138
  "MaxResultsPerPage" => max_results_per_page,
@@ -114,7 +141,7 @@ module Peddler
114
141
  "NextToken" => next_token,
115
142
  }.compact
116
143
 
117
- rate_limit(0.5).get(path, params:)
144
+ meter(rate_limit).get(path, params:)
118
145
  end
119
146
  end
120
147
  end