peddler 3.0.0.beta1 → 4.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 (81) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +108 -110
  3. data/lib/peddler/api.rb +56 -18
  4. data/lib/peddler/{api → apis}/amazon_warehousing_and_distribution_2024_05_09.rb +38 -26
  5. data/lib/peddler/{api → apis}/aplus_content_2020_11_01.rb +97 -59
  6. data/lib/peddler/apis/application_integrations_2024_04_01.rb +56 -0
  7. data/lib/peddler/{api → apis}/application_management_2023_11_30.rb +14 -4
  8. data/lib/peddler/{api → apis}/catalog_items_2020_12_01.rb +34 -23
  9. data/lib/peddler/{api → apis}/catalog_items_2022_04_01.rb +39 -29
  10. data/lib/peddler/{api → apis}/catalog_items_v0.rb +43 -30
  11. data/lib/peddler/{api → apis}/data_kiosk_2023_11_15.rb +47 -31
  12. data/lib/peddler/apis/easy_ship_2022_03_23.rb +126 -0
  13. data/lib/peddler/{api → apis}/fba_inbound_eligibility_v1.rb +15 -7
  14. data/lib/peddler/{api → apis}/fba_inventory_v1.rb +45 -29
  15. data/lib/peddler/{api → apis}/feeds_2021_06_30.rb +54 -33
  16. data/lib/peddler/apis/finances_2024_06_19.rb +50 -0
  17. data/lib/peddler/{api → apis}/finances_v0.rb +50 -36
  18. data/lib/peddler/{api → apis}/fulfillment_inbound_2024_03_20.rb +384 -255
  19. data/lib/peddler/{api → apis}/fulfillment_inbound_v0.rb +138 -93
  20. data/lib/peddler/{api → apis}/fulfillment_outbound_2020_07_01.rb +105 -68
  21. data/lib/peddler/apis/invoices_2024_06_19.rb +180 -0
  22. data/lib/peddler/apis/listings_items_2020_09_01.rb +95 -0
  23. data/lib/peddler/apis/listings_items_2021_08_01.rb +136 -0
  24. data/lib/peddler/{api → apis}/listings_restrictions_2021_08_01.rb +21 -11
  25. data/lib/peddler/apis/merchant_fulfillment_v0.rb +80 -0
  26. data/lib/peddler/{api → apis}/messaging_v1.rb +107 -75
  27. data/lib/peddler/{api → apis}/notifications_v1.rb +63 -32
  28. data/lib/peddler/{api → apis}/orders_v0.rb +99 -84
  29. data/lib/peddler/apis/product_fees_v0.rb +77 -0
  30. data/lib/peddler/{api → apis}/product_pricing_2022_05_01.rb +24 -13
  31. data/lib/peddler/{api → apis}/product_pricing_v0.rb +70 -52
  32. data/lib/peddler/{api → apis}/product_type_definitions_2020_09_01.rb +32 -21
  33. data/lib/peddler/{api → apis}/replenishment_2022_11_07.rb +25 -13
  34. data/lib/peddler/{api → apis}/reports_2021_06_30.rb +71 -47
  35. data/lib/peddler/{api → apis}/sales_v1.rb +22 -14
  36. data/lib/peddler/{api → apis}/sellers_v1.rb +19 -7
  37. data/lib/peddler/{api → apis}/services_v1.rb +156 -116
  38. data/lib/peddler/apis/shipment_invoicing_v0.rb +59 -0
  39. data/lib/peddler/apis/shipping_v1.rb +132 -0
  40. data/lib/peddler/{api → apis}/shipping_v2.rb +150 -98
  41. data/lib/peddler/{api → apis}/solicitations_v1.rb +21 -11
  42. data/lib/peddler/apis/supply_sources_2020_07_01.rb +100 -0
  43. data/lib/peddler/{api → apis}/tokens_2021_03_01.rb +15 -7
  44. data/lib/peddler/{api → apis}/uploads_2020_11_01.rb +18 -8
  45. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_inventory_v1.rb +14 -6
  46. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_orders_2021_12_28.rb +33 -21
  47. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_orders_v1.rb +33 -21
  48. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_payments_v1.rb +13 -5
  49. data/lib/peddler/apis/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +45 -0
  50. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_shipping_2021_12_28.rb +86 -60
  51. data/lib/peddler/apis/vendor_direct_fulfillment_shipping_v1.rb +189 -0
  52. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_transactions_2021_12_28.rb +14 -6
  53. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_transactions_v1.rb +14 -6
  54. data/lib/peddler/apis/vendor_invoices_v1.rb +30 -0
  55. data/lib/peddler/{api → apis}/vendor_orders_v1.rb +59 -48
  56. data/lib/peddler/apis/vendor_shipments_v1.rb +132 -0
  57. data/lib/peddler/{api → apis}/vendor_transaction_status_v1.rb +14 -5
  58. data/lib/peddler/endpoint.rb +51 -0
  59. data/lib/peddler/error.rb +21 -11
  60. data/lib/peddler/helpers/feeds_2021_06_30.rb +26 -0
  61. data/lib/peddler/json_feed_document.rb +31 -0
  62. data/lib/peddler/marketplace.rb +93 -0
  63. data/lib/peddler/response.rb +46 -0
  64. data/lib/peddler/token.rb +70 -0
  65. data/lib/peddler/version.rb +1 -1
  66. data/lib/peddler.rb +55 -52
  67. metadata +64 -57
  68. data/lib/peddler/access_token.rb +0 -76
  69. data/lib/peddler/api/easy_ship_2022_03_23.rb +0 -108
  70. data/lib/peddler/api/listings_items_2020_09_01.rb +0 -84
  71. data/lib/peddler/api/listings_items_2021_08_01.rb +0 -154
  72. data/lib/peddler/api/merchant_fulfillment_v0.rb +0 -64
  73. data/lib/peddler/api/product_fees_v0.rb +0 -69
  74. data/lib/peddler/api/shipment_invoicing_v0.rb +0 -46
  75. data/lib/peddler/api/shipping_v1.rb +0 -107
  76. data/lib/peddler/api/supply_sources_2020_07_01.rb +0 -82
  77. data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +0 -35
  78. data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +0 -165
  79. data/lib/peddler/api/vendor_invoices_v1.rb +0 -22
  80. data/lib/peddler/api/vendor_shipments_v1.rb +0 -120
  81. data/lib/peddler/region.rb +0 -30
@@ -3,8 +3,14 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
- class API
7
- # The Selling Partner API for FBA inbound operations.
6
+ class << self
7
+ def fulfillment_inbound_2024_03_20(...)
8
+ APIs::FulfillmentInbound20240320.new(...)
9
+ end
10
+ end
11
+
12
+ module APIs
13
+ # Fulfillment Inbound v2024-03-20
8
14
  #
9
15
  # The Selling Partner API for Fulfillment By Amazon (FBA) Inbound. The FBA Inbound API enables building inbound
10
16
  # workflows to create, manage, and send shipments into Amazon's fulfillment network. The API has interoperability
@@ -12,15 +18,18 @@ module Peddler
12
18
  class FulfillmentInbound20240320 < API
13
19
  # Provides a list of inbound plans with minimal information.
14
20
  #
15
- # @param [Integer] page_size The number of inbound plans to return in the response matching the given query.
16
- # @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
21
+ # @note This operation can make a static sandbox call.
22
+ # @param page_size [Integer] The number of inbound plans to return in the response matching the given query.
23
+ # @param pagination_token [String] A token to fetch a certain page when there are multiple pages worth of results.
17
24
  # The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
18
25
  # token value from the query parameter the API returns the first page of the result.
19
- # @param [String] status The status of an inbound plan.
20
- # @param [String] sort_by Sort by field.
21
- # @param [String] sort_order The sort order.
22
- # @return [Hash] The API response
23
- def list_inbound_plans(page_size: nil, pagination_token: nil, status: nil, sort_by: nil, sort_order: nil)
26
+ # @param status [String] The status of an inbound plan.
27
+ # @param sort_by [String] Sort by field.
28
+ # @param sort_order [String] The sort order.
29
+ # @param rate_limit [Float] Requests per second
30
+ # @return [Peddler::Response] The API response
31
+ def list_inbound_plans(page_size: 10, pagination_token: nil, status: nil, sort_by: nil, sort_order: nil,
32
+ rate_limit: 2.0)
24
33
  path = "/inbound/fba/2024-03-20/inboundPlans"
25
34
  params = {
26
35
  "pageSize" => page_size,
@@ -30,376 +39,431 @@ module Peddler
30
39
  "sortOrder" => sort_order,
31
40
  }.compact
32
41
 
33
- rate_limit(2.0).get(path, params:)
42
+ meter(rate_limit).get(path, params:)
34
43
  end
35
44
 
36
45
  # Creates an inbound plan. An inbound plan contains all the necessary information to send shipments into Amazon's
37
46
  # fufillment network.
38
47
  #
39
- # @param [Hash] body The body of the request to `createInboundPlan`.
40
- # @return [Hash] The API response
41
- def create_inbound_plan(body)
48
+ # @note This operation can make a static sandbox call.
49
+ # @param body [Hash] The body of the request to `createInboundPlan`.
50
+ # @param rate_limit [Float] Requests per second
51
+ # @return [Peddler::Response] The API response
52
+ def create_inbound_plan(body, rate_limit: 2.0)
42
53
  path = "/inbound/fba/2024-03-20/inboundPlans"
43
54
 
44
- rate_limit(2.0).post(path, body:)
55
+ meter(rate_limit).post(path, body:)
45
56
  end
46
57
 
47
58
  # Fetches the top level information about an inbound plan.
48
59
  #
49
- # @param [String] inbound_plan_id Identifier of an inbound plan.
50
- # @return [Hash] The API response
51
- def get_inbound_plan(inbound_plan_id)
60
+ # @note This operation can make a static sandbox call.
61
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
62
+ # @param rate_limit [Float] Requests per second
63
+ # @return [Peddler::Response] The API response
64
+ def get_inbound_plan(inbound_plan_id, rate_limit: 2.0)
52
65
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}"
53
66
 
54
- rate_limit(2.0).get(path)
67
+ meter(rate_limit).get(path)
55
68
  end
56
69
 
57
70
  # Provides a paginated list of box packages in an inbound plan.
58
71
  #
59
- # @param [String] inbound_plan_id Identifier of an inbound plan.
60
- # @param [Integer] page_size The number of boxes to return in the response matching the given query.
61
- # @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
72
+ # @note This operation can make a static sandbox call.
73
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
74
+ # @param page_size [Integer] The number of boxes to return in the response matching the given query.
75
+ # @param pagination_token [String] A token to fetch a certain page when there are multiple pages worth of results.
62
76
  # The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
63
77
  # token value from the query parameter the API returns the first page of the result.
64
- # @return [Hash] The API response
65
- def list_inbound_plan_boxes(inbound_plan_id, page_size: nil, pagination_token: nil)
78
+ # @param rate_limit [Float] Requests per second
79
+ # @return [Peddler::Response] The API response
80
+ def list_inbound_plan_boxes(inbound_plan_id, page_size: 10, pagination_token: nil, rate_limit: 2.0)
66
81
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/boxes"
67
82
  params = {
68
83
  "pageSize" => page_size,
69
84
  "paginationToken" => pagination_token,
70
85
  }.compact
71
86
 
72
- rate_limit(2.0).get(path, params:)
87
+ meter(rate_limit).get(path, params:)
73
88
  end
74
89
 
75
90
  # Cancels an Inbound Plan. Charges may apply if the cancellation is performed outside of a void window. The window
76
91
  # for Amazon Partnered Carriers is 24 hours for Small Parcel Delivery (SPD) and one hour for Less-Than-Truckload
77
92
  # (LTL) carrier shipments.
78
93
  #
79
- # @param [String] inbound_plan_id Identifier of an inbound plan.
80
- # @return [Hash] The API response
81
- def cancel_inbound_plan(inbound_plan_id)
94
+ # @note This operation can make a static sandbox call.
95
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
96
+ # @param rate_limit [Float] Requests per second
97
+ # @return [Peddler::Response] The API response
98
+ def cancel_inbound_plan(inbound_plan_id, rate_limit: 2.0)
82
99
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/cancellation"
83
100
 
84
- rate_limit(2.0).put(path)
101
+ meter(rate_limit).put(path)
85
102
  end
86
103
 
87
104
  # Provides a paginated list of item packages in an inbound plan.
88
105
  #
89
- # @param [String] inbound_plan_id Identifier of an inbound plan.
90
- # @param [Integer] page_size The number of items to return in the response matching the given query.
91
- # @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
106
+ # @note This operation can make a static sandbox call.
107
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
108
+ # @param page_size [Integer] The number of items to return in the response matching the given query.
109
+ # @param pagination_token [String] A token to fetch a certain page when there are multiple pages worth of results.
92
110
  # The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
93
111
  # token value from the query parameter the API returns the first page of the result.
94
- # @return [Hash] The API response
95
- def list_inbound_plan_items(inbound_plan_id, page_size: nil, pagination_token: nil)
112
+ # @param rate_limit [Float] Requests per second
113
+ # @return [Peddler::Response] The API response
114
+ def list_inbound_plan_items(inbound_plan_id, page_size: 10, pagination_token: nil, rate_limit: 2.0)
96
115
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/items"
97
116
  params = {
98
117
  "pageSize" => page_size,
99
118
  "paginationToken" => pagination_token,
100
119
  }.compact
101
120
 
102
- rate_limit(2.0).get(path, params:)
121
+ meter(rate_limit).get(path, params:)
103
122
  end
104
123
 
105
124
  # Updates the name of an existing inbound plan.
106
125
  #
107
- # @param [String] inbound_plan_id Identifier of an inbound plan.
108
- # @param [Hash] body The body of the request to `updateInboundPlanName`.
109
- # @return [Hash] The API response
110
- def update_inbound_plan_name(inbound_plan_id, body)
126
+ # @note This operation can make a static sandbox call.
127
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
128
+ # @param body [Hash] The body of the request to `updateInboundPlanName`.
129
+ # @param rate_limit [Float] Requests per second
130
+ # @return [Peddler::Response] The API response
131
+ def update_inbound_plan_name(inbound_plan_id, body, rate_limit: 2.0)
111
132
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/name"
112
133
 
113
- rate_limit(2.0).put(path, body:)
134
+ meter(rate_limit).put(path, body:)
114
135
  end
115
136
 
116
137
  # Retrieves a page of boxes from a given packing group. These boxes were previously provided through the
117
138
  # `setPackingInformation` operation. This API is used for workflows where boxes are packed before Amazon
118
139
  # determines shipment splits.
119
140
  #
120
- # @param [String] inbound_plan_id Identifier of an inbound plan.
121
- # @param [String] packing_group_id Identifier of a packing group.
122
- # @param [Integer] page_size The number of packing group boxes to return in the response matching the given query.
123
- # @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
141
+ # @note This operation can make a static sandbox call.
142
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
143
+ # @param packing_group_id [String] Identifier of a packing group.
144
+ # @param page_size [Integer] The number of packing group boxes to return in the response matching the given query.
145
+ # @param pagination_token [String] A token to fetch a certain page when there are multiple pages worth of results.
124
146
  # The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
125
147
  # token value from the query parameter the API returns the first page of the result.
126
- # @return [Hash] The API response
127
- def list_packing_group_boxes(inbound_plan_id, packing_group_id, page_size: nil, pagination_token: nil)
148
+ # @param rate_limit [Float] Requests per second
149
+ # @return [Peddler::Response] The API response
150
+ def list_packing_group_boxes(inbound_plan_id, packing_group_id, page_size: 10, pagination_token: nil,
151
+ rate_limit: 2.0)
128
152
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingGroups/#{packing_group_id}/boxes"
129
153
  params = {
130
154
  "pageSize" => page_size,
131
155
  "paginationToken" => pagination_token,
132
156
  }.compact
133
157
 
134
- rate_limit(2.0).get(path, params:)
158
+ meter(rate_limit).get(path, params:)
135
159
  end
136
160
 
137
161
  # Retrieves a page of items in a given packing group. Packing options must first be generated by the corresponding
138
162
  # operation before packing group items can be listed.
139
163
  #
140
- # @param [String] inbound_plan_id Identifier of an inbound plan.
141
- # @param [String] packing_group_id Identifier of a packing group.
142
- # @param [Integer] page_size The number of packing group items to return in the response matching the given query.
143
- # @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
164
+ # @note This operation can make a static sandbox call.
165
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
166
+ # @param packing_group_id [String] Identifier of a packing group.
167
+ # @param page_size [Integer] The number of packing group items to return in the response matching the given query.
168
+ # @param pagination_token [String] A token to fetch a certain page when there are multiple pages worth of results.
144
169
  # The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
145
170
  # token value from the query parameter the API returns the first page of the result.
146
- # @return [Hash] The API response
147
- def list_packing_group_items(inbound_plan_id, packing_group_id, page_size: nil, pagination_token: nil)
171
+ # @param rate_limit [Float] Requests per second
172
+ # @return [Peddler::Response] The API response
173
+ def list_packing_group_items(inbound_plan_id, packing_group_id, page_size: 10, pagination_token: nil,
174
+ rate_limit: 2.0)
148
175
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingGroups/#{packing_group_id}/items"
149
176
  params = {
150
177
  "pageSize" => page_size,
151
178
  "paginationToken" => pagination_token,
152
179
  }.compact
153
180
 
154
- rate_limit(2.0).get(path, params:)
181
+ meter(rate_limit).get(path, params:)
155
182
  end
156
183
 
157
184
  # Sets packing information for an inbound plan. This should be called after an inbound plan is created to populate
158
185
  # the box level information required for planning and transportation estimates.
159
186
  #
160
- # @param [String] inbound_plan_id Identifier of an inbound plan.
161
- # @param [Hash] body The body of the request to `setPackingInformation`.
162
- # @return [Hash] The API response
163
- def set_packing_information(inbound_plan_id, body)
187
+ # @note This operation can make a static sandbox call.
188
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
189
+ # @param body [Hash] The body of the request to `setPackingInformation`.
190
+ # @param rate_limit [Float] Requests per second
191
+ # @return [Peddler::Response] The API response
192
+ def set_packing_information(inbound_plan_id, body, rate_limit: 2.0)
164
193
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingInformation"
165
194
 
166
- rate_limit(2.0).post(path, body:)
195
+ meter(rate_limit).post(path, body:)
167
196
  end
168
197
 
169
198
  # Retrieves a list of all packing options for an inbound plan. Packing options must first be generated by the
170
199
  # corresponding operation before becoming available.
171
200
  #
172
- # @param [String] inbound_plan_id Identifier of an inbound plan.
173
- # @param [Integer] page_size The number of packing options to return in the response matching the given query.
174
- # @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
201
+ # @note This operation can make a static sandbox call.
202
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
203
+ # @param page_size [Integer] The number of packing options to return in the response matching the given query.
204
+ # @param pagination_token [String] A token to fetch a certain page when there are multiple pages worth of results.
175
205
  # The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
176
206
  # token value from the query parameter the API returns the first page of the result.
177
- # @return [Hash] The API response
178
- def list_packing_options(inbound_plan_id, page_size: nil, pagination_token: nil)
207
+ # @param rate_limit [Float] Requests per second
208
+ # @return [Peddler::Response] The API response
209
+ def list_packing_options(inbound_plan_id, page_size: 10, pagination_token: nil, rate_limit: 2.0)
179
210
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingOptions"
180
211
  params = {
181
212
  "pageSize" => page_size,
182
213
  "paginationToken" => pagination_token,
183
214
  }.compact
184
215
 
185
- rate_limit(2.0).get(path, params:)
216
+ meter(rate_limit).get(path, params:)
186
217
  end
187
218
 
188
219
  # Generates available packing options for the inbound plan.
189
220
  #
190
- # @param [String] inbound_plan_id Identifier of an inbound plan.
191
- # @return [Hash] The API response
192
- def generate_packing_options(inbound_plan_id)
221
+ # @note This operation can make a static sandbox call.
222
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
223
+ # @param rate_limit [Float] Requests per second
224
+ # @return [Peddler::Response] The API response
225
+ def generate_packing_options(inbound_plan_id, rate_limit: 2.0)
193
226
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingOptions"
194
227
 
195
- rate_limit(2.0).post(path)
228
+ meter(rate_limit).post(path)
196
229
  end
197
230
 
198
231
  # Confirms the packing option for an inbound plan.
199
232
  #
200
- # @param [String] inbound_plan_id Identifier of an inbound plan.
201
- # @param [String] packing_option_id Identifier of a packing option.
202
- # @return [Hash] The API response
203
- def confirm_packing_option(inbound_plan_id, packing_option_id)
233
+ # @note This operation can make a static sandbox call.
234
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
235
+ # @param packing_option_id [String] Identifier of a packing option.
236
+ # @param rate_limit [Float] Requests per second
237
+ # @return [Peddler::Response] The API response
238
+ def confirm_packing_option(inbound_plan_id, packing_option_id, rate_limit: 2.0)
204
239
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingOptions/#{packing_option_id}/confirmation"
205
240
 
206
- rate_limit(2.0).post(path)
241
+ meter(rate_limit).post(path)
207
242
  end
208
243
 
209
244
  # Provides a paginated list of pallet packages in an inbound plan. An inbound plan will have pallets when the
210
245
  # related details are provided after generating Less-Than-Truckload (LTL) carrier shipments.
211
246
  #
212
- # @param [String] inbound_plan_id Identifier of an inbound plan.
213
- # @param [Integer] page_size The number of pallets to return in the response matching the given query.
214
- # @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
247
+ # @note This operation can make a static sandbox call.
248
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
249
+ # @param page_size [Integer] The number of pallets to return in the response matching the given query.
250
+ # @param pagination_token [String] A token to fetch a certain page when there are multiple pages worth of results.
215
251
  # The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
216
252
  # token value from the query parameter the API returns the first page of the result.
217
- # @return [Hash] The API response
218
- def list_inbound_plan_pallets(inbound_plan_id, page_size: nil, pagination_token: nil)
253
+ # @param rate_limit [Float] Requests per second
254
+ # @return [Peddler::Response] The API response
255
+ def list_inbound_plan_pallets(inbound_plan_id, page_size: 10, pagination_token: nil, rate_limit: 2.0)
219
256
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/pallets"
220
257
  params = {
221
258
  "pageSize" => page_size,
222
259
  "paginationToken" => pagination_token,
223
260
  }.compact
224
261
 
225
- rate_limit(2.0).get(path, params:)
262
+ meter(rate_limit).get(path, params:)
226
263
  end
227
264
 
228
265
  # Provides a list of all placement options for an inbound plan. Placement options must first be generated by the
229
266
  # corresponding operation before becoming available.
230
267
  #
231
- # @param [String] inbound_plan_id Identifier of an inbound plan.
232
- # @param [Integer] page_size The number of placement options to return in the response matching the given query.
233
- # @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
268
+ # @note This operation can make a static sandbox call.
269
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
270
+ # @param page_size [Integer] The number of placement options to return in the response matching the given query.
271
+ # @param pagination_token [String] A token to fetch a certain page when there are multiple pages worth of results.
234
272
  # The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
235
273
  # token value from the query parameter the API returns the first page of the result.
236
- # @return [Hash] The API response
237
- def list_placement_options(inbound_plan_id, page_size: nil, pagination_token: nil)
274
+ # @param rate_limit [Float] Requests per second
275
+ # @return [Peddler::Response] The API response
276
+ def list_placement_options(inbound_plan_id, page_size: 10, pagination_token: nil, rate_limit: 2.0)
238
277
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/placementOptions"
239
278
  params = {
240
279
  "pageSize" => page_size,
241
280
  "paginationToken" => pagination_token,
242
281
  }.compact
243
282
 
244
- rate_limit(2.0).get(path, params:)
283
+ meter(rate_limit).get(path, params:)
245
284
  end
246
285
 
247
286
  # Generates placement options for the inbound plan.
248
287
  #
249
- # @param [String] inbound_plan_id Identifier of an inbound plan.
250
- # @param [Hash] body The body of the request to `generatePlacementOptions`.
251
- # @return [Hash] The API response
252
- def generate_placement_options(inbound_plan_id, body)
288
+ # @note This operation can make a static sandbox call.
289
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
290
+ # @param body [Hash] The body of the request to `generatePlacementOptions`.
291
+ # @param rate_limit [Float] Requests per second
292
+ # @return [Peddler::Response] The API response
293
+ def generate_placement_options(inbound_plan_id, body, rate_limit: 2.0)
253
294
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/placementOptions"
254
295
 
255
- rate_limit(2.0).post(path, body:)
296
+ meter(rate_limit).post(path, body:)
256
297
  end
257
298
 
258
299
  # Confirms the placement option for an inbound plan. Once confirmed, it cannot be changed for the Inbound Plan.
259
300
  #
260
- # @param [String] inbound_plan_id Identifier of an inbound plan.
261
- # @param [String] placement_option_id The identifier of a placement option. A placement option represents the
301
+ # @note This operation can make a static sandbox call.
302
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
303
+ # @param placement_option_id [String] The identifier of a placement option. A placement option represents the
262
304
  # shipment splits and destinations of SKUs.
263
- # @return [Hash] The API response
264
- def confirm_placement_option(inbound_plan_id, placement_option_id)
305
+ # @param rate_limit [Float] Requests per second
306
+ # @return [Peddler::Response] The API response
307
+ def confirm_placement_option(inbound_plan_id, placement_option_id, rate_limit: 2.0)
265
308
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/placementOptions/#{placement_option_id}/confirmation"
266
309
 
267
- rate_limit(2.0).post(path)
310
+ meter(rate_limit).post(path)
268
311
  end
269
312
 
270
313
  # Provides the full details for a specific shipment within an inbound plan. The `transportationOptionId` inside
271
314
  # `acceptedTransportationSelection` can be used to retrieve the transportation details for the shipment.
272
315
  #
273
- # @param [String] inbound_plan_id Identifier of an inbound plan.
274
- # @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
275
- # @return [Hash] The API response
276
- def get_shipment(inbound_plan_id, shipment_id)
316
+ # @note This operation can make a static sandbox call.
317
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
318
+ # @param shipment_id [String] Identifier of a shipment. A shipment contains the boxes and units being inbounded.
319
+ # @param rate_limit [Float] Requests per second
320
+ # @return [Peddler::Response] The API response
321
+ def get_shipment(inbound_plan_id, shipment_id, rate_limit: 2.0)
277
322
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}"
278
323
 
279
- rate_limit(2.0).get(path)
324
+ meter(rate_limit).get(path)
280
325
  end
281
326
 
282
327
  # Provides a paginated list of box packages in a shipment.
283
328
  #
284
- # @param [String] inbound_plan_id Identifier of an inbound plan.
285
- # @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
286
- # @param [Integer] page_size The number of boxes to return in the response matching the given query.
287
- # @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
329
+ # @note This operation can make a static sandbox call.
330
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
331
+ # @param shipment_id [String] Identifier of a shipment. A shipment contains the boxes and units being inbounded.
332
+ # @param page_size [Integer] The number of boxes to return in the response matching the given query.
333
+ # @param pagination_token [String] A token to fetch a certain page when there are multiple pages worth of results.
288
334
  # The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
289
335
  # token value from the query parameter the API returns the first page of the result.
290
- # @return [Hash] The API response
291
- def list_shipment_boxes(inbound_plan_id, shipment_id, page_size: nil, pagination_token: nil)
336
+ # @param rate_limit [Float] Requests per second
337
+ # @return [Peddler::Response] The API response
338
+ def list_shipment_boxes(inbound_plan_id, shipment_id, page_size: 10, pagination_token: nil, rate_limit: 2.0)
292
339
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/boxes"
293
340
  params = {
294
341
  "pageSize" => page_size,
295
342
  "paginationToken" => pagination_token,
296
343
  }.compact
297
344
 
298
- rate_limit(2.0).get(path, params:)
345
+ meter(rate_limit).get(path, params:)
299
346
  end
300
347
 
301
348
  # Retrieve a paginated list of shipment content update previews for a given shipment. The shipment content update
302
349
  # preview is a summary of the requested shipment content changes along with the transportation cost implications
303
350
  # of the change that can only be confirmed prior to the expiry date specified.
304
351
  #
305
- # @param [String] inbound_plan_id Identifier of an inbound plan.
306
- # @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
307
- # @param [Integer] page_size The number of content update previews to return.
308
- # @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
352
+ # @note This operation can make a static sandbox call.
353
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
354
+ # @param shipment_id [String] Identifier of a shipment. A shipment contains the boxes and units being inbounded.
355
+ # @param page_size [Integer] The number of content update previews to return.
356
+ # @param pagination_token [String] A token to fetch a certain page when there are multiple pages worth of results.
309
357
  # The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
310
358
  # token value from the query parameter the API returns the first page of the result.
311
- # @return [Hash] The API response
312
- def list_shipment_content_update_previews(inbound_plan_id, shipment_id, page_size: nil, pagination_token: nil)
359
+ # @param rate_limit [Float] Requests per second
360
+ # @return [Peddler::Response] The API response
361
+ def list_shipment_content_update_previews(inbound_plan_id, shipment_id, page_size: 10, pagination_token: nil,
362
+ rate_limit: 2.0)
313
363
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/contentUpdatePreviews"
314
364
  params = {
315
365
  "pageSize" => page_size,
316
366
  "paginationToken" => pagination_token,
317
367
  }.compact
318
368
 
319
- rate_limit(2.0).get(path, params:)
369
+ meter(rate_limit).get(path, params:)
320
370
  end
321
371
 
322
372
  # Generate a shipment content update preview given a set of intended boxes and/or items for a shipment with a
323
373
  # confirmed carrier. The shipment content update preview will be viewable with the updated costs and contents
324
374
  # prior to confirmation.
325
375
  #
326
- # @param [String] inbound_plan_id Identifier of an inbound plan.
327
- # @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
328
- # @param [Hash] body The body of the request to `generateShipmentContentUpdatePreviews`.
329
- # @return [Hash] The API response
330
- def generate_shipment_content_update_previews(inbound_plan_id, shipment_id, body)
376
+ # @note This operation can make a static sandbox call.
377
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
378
+ # @param shipment_id [String] Identifier of a shipment. A shipment contains the boxes and units being inbounded.
379
+ # @param body [Hash] The body of the request to `generateShipmentContentUpdatePreviews`.
380
+ # @param rate_limit [Float] Requests per second
381
+ # @return [Peddler::Response] The API response
382
+ def generate_shipment_content_update_previews(inbound_plan_id, shipment_id, body, rate_limit: 2.0)
331
383
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/contentUpdatePreviews"
332
384
 
333
- rate_limit(2.0).post(path, body:)
385
+ meter(rate_limit).post(path, body:)
334
386
  end
335
387
 
336
388
  # Retrieve a shipment content update preview which provides a summary of the requested shipment content changes
337
389
  # along with the transportation cost implications of the change that can only be confirmed prior to the expiry
338
390
  # date specified.
339
391
  #
340
- # @param [String] inbound_plan_id Identifier of an inbound plan.
341
- # @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
342
- # @param [String] content_update_preview_id Identifier of a content update preview.
343
- # @return [Hash] The API response
344
- def get_shipment_content_update_preview(inbound_plan_id, shipment_id, content_update_preview_id)
392
+ # @note This operation can make a static sandbox call.
393
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
394
+ # @param shipment_id [String] Identifier of a shipment. A shipment contains the boxes and units being inbounded.
395
+ # @param content_update_preview_id [String] Identifier of a content update preview.
396
+ # @param rate_limit [Float] Requests per second
397
+ # @return [Peddler::Response] The API response
398
+ def get_shipment_content_update_preview(inbound_plan_id, shipment_id, content_update_preview_id, rate_limit: 2.0)
345
399
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/contentUpdatePreviews/#{content_update_preview_id}"
346
400
 
347
- rate_limit(2.0).get(path)
401
+ meter(rate_limit).get(path)
348
402
  end
349
403
 
350
404
  # Confirm a shipment content update preview and accept the changes in transportation cost.
351
405
  #
352
- # @param [String] inbound_plan_id Identifier of an inbound plan.
353
- # @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
354
- # @param [String] content_update_preview_id Identifier of a content update preview.
355
- # @return [Hash] The API response
356
- def confirm_shipment_content_update_preview(inbound_plan_id, shipment_id, content_update_preview_id)
406
+ # @note This operation can make a static sandbox call.
407
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
408
+ # @param shipment_id [String] Identifier of a shipment. A shipment contains the boxes and units being inbounded.
409
+ # @param content_update_preview_id [String] Identifier of a content update preview.
410
+ # @param rate_limit [Float] Requests per second
411
+ # @return [Peddler::Response] The API response
412
+ def confirm_shipment_content_update_preview(inbound_plan_id, shipment_id, content_update_preview_id,
413
+ rate_limit: 2.0)
357
414
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/contentUpdatePreviews/#{content_update_preview_id}/confirmation"
358
415
 
359
- rate_limit(2.0).post(path)
416
+ meter(rate_limit).post(path)
360
417
  end
361
418
 
362
419
  # Provide delivery challan document for PCP transportation in IN marketplace.
363
420
  #
364
- # @param [String] inbound_plan_id Identifier of an inbound plan.
365
- # @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
366
- # @return [Hash] The API response
367
- def get_delivery_challan_document(inbound_plan_id, shipment_id)
421
+ # @note This operation can make a static sandbox call.
422
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
423
+ # @param shipment_id [String] Identifier of a shipment. A shipment contains the boxes and units being inbounded.
424
+ # @param rate_limit [Float] Requests per second
425
+ # @return [Peddler::Response] The API response
426
+ def get_delivery_challan_document(inbound_plan_id, shipment_id, rate_limit: 2.0)
368
427
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/deliveryChallanDocument"
369
428
 
370
- rate_limit(2.0).get(path)
429
+ meter(rate_limit).get(path)
371
430
  end
372
431
 
373
432
  # Retrieves all delivery window options for a shipment. Delivery window options must first be generated by the
374
433
  # `generateDeliveryWindowOptions` operation before becoming available.
375
434
  #
376
- # @param [String] inbound_plan_id Identifier of an inbound plan.
377
- # @param [String] shipment_id The shipment to get delivery window options for.
378
- # @param [Integer] page_size The number of delivery window options to return in the response matching the given
435
+ # @note This operation can make a static sandbox call.
436
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
437
+ # @param shipment_id [String] The shipment to get delivery window options for.
438
+ # @param page_size [Integer] The number of delivery window options to return in the response matching the given
379
439
  # query.
380
- # @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
440
+ # @param pagination_token [String] A token to fetch a certain page when there are multiple pages worth of results.
381
441
  # The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
382
442
  # token value from the query parameter the API returns the first page of the result.
383
- # @return [Hash] The API response
384
- def list_delivery_window_options(inbound_plan_id, shipment_id, page_size: nil, pagination_token: nil)
443
+ # @param rate_limit [Float] Requests per second
444
+ # @return [Peddler::Response] The API response
445
+ def list_delivery_window_options(inbound_plan_id, shipment_id, page_size: 10, pagination_token: nil,
446
+ rate_limit: 2.0)
385
447
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/deliveryWindowOptions"
386
448
  params = {
387
449
  "pageSize" => page_size,
388
450
  "paginationToken" => pagination_token,
389
451
  }.compact
390
452
 
391
- rate_limit(2.0).get(path, params:)
453
+ meter(rate_limit).get(path, params:)
392
454
  end
393
455
 
394
456
  # Generates available delivery window options for a given shipment.
395
457
  #
396
- # @param [String] inbound_plan_id Identifier of an inbound plan.
397
- # @param [String] shipment_id The shipment to generate delivery window options for.
398
- # @return [Hash] The API response
399
- def generate_delivery_window_options(inbound_plan_id, shipment_id)
458
+ # @note This operation can make a static sandbox call.
459
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
460
+ # @param shipment_id [String] The shipment to generate delivery window options for.
461
+ # @param rate_limit [Float] Requests per second
462
+ # @return [Peddler::Response] The API response
463
+ def generate_delivery_window_options(inbound_plan_id, shipment_id, rate_limit: 2.0)
400
464
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/deliveryWindowOptions"
401
465
 
402
- rate_limit(2.0).post(path)
466
+ meter(rate_limit).post(path)
403
467
  end
404
468
 
405
469
  # Confirms the delivery window option for chosen shipment within an inbound plan. A placement option must be
@@ -409,122 +473,139 @@ module Peddler
409
473
  # `CONFIRMED_DELIVERY_WINDOW` require a delivery window to be confirmed prior to transportation option
410
474
  # confirmation.
411
475
  #
412
- # @param [String] inbound_plan_id Identifier of an inbound plan.
413
- # @param [String] shipment_id The shipment to confirm the delivery window option for.
414
- # @param [String] delivery_window_option_id The id of the delivery window option to be confirmed.
415
- # @return [Hash] The API response
416
- def confirm_delivery_window_options(inbound_plan_id, shipment_id, delivery_window_option_id)
476
+ # @note This operation can make a static sandbox call.
477
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
478
+ # @param shipment_id [String] The shipment to confirm the delivery window option for.
479
+ # @param delivery_window_option_id [String] The id of the delivery window option to be confirmed.
480
+ # @param rate_limit [Float] Requests per second
481
+ # @return [Peddler::Response] The API response
482
+ def confirm_delivery_window_options(inbound_plan_id, shipment_id, delivery_window_option_id, rate_limit: 2.0)
417
483
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/deliveryWindowOptions/#{delivery_window_option_id}/confirmation"
418
484
 
419
- rate_limit(2.0).post(path)
485
+ meter(rate_limit).post(path)
420
486
  end
421
487
 
422
488
  # Provides a paginated list of item packages in a shipment.
423
489
  #
424
- # @param [String] inbound_plan_id Identifier of an inbound plan.
425
- # @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
426
- # @param [Integer] page_size The number of items to return in the response matching the given query.
427
- # @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
490
+ # @note This operation can make a static sandbox call.
491
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
492
+ # @param shipment_id [String] Identifier of a shipment. A shipment contains the boxes and units being inbounded.
493
+ # @param page_size [Integer] The number of items to return in the response matching the given query.
494
+ # @param pagination_token [String] A token to fetch a certain page when there are multiple pages worth of results.
428
495
  # The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
429
496
  # token value from the query parameter the API returns the first page of the result.
430
- # @return [Hash] The API response
431
- def list_shipment_items(inbound_plan_id, shipment_id, page_size: nil, pagination_token: nil)
497
+ # @param rate_limit [Float] Requests per second
498
+ # @return [Peddler::Response] The API response
499
+ def list_shipment_items(inbound_plan_id, shipment_id, page_size: 10, pagination_token: nil, rate_limit: 2.0)
432
500
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/items"
433
501
  params = {
434
502
  "pageSize" => page_size,
435
503
  "paginationToken" => pagination_token,
436
504
  }.compact
437
505
 
438
- rate_limit(2.0).get(path, params:)
506
+ meter(rate_limit).get(path, params:)
439
507
  end
440
508
 
441
509
  # Updates the name of an existing shipment.
442
510
  #
443
- # @param [String] inbound_plan_id Identifier of an inbound plan.
444
- # @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
445
- # @param [Hash] body The body of the request to `updateShipmentName`.
446
- # @return [Hash] The API response
447
- def update_shipment_name(inbound_plan_id, shipment_id, body)
511
+ # @note This operation can make a static sandbox call.
512
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
513
+ # @param shipment_id [String] Identifier of a shipment. A shipment contains the boxes and units being inbounded.
514
+ # @param body [Hash] The body of the request to `updateShipmentName`.
515
+ # @param rate_limit [Float] Requests per second
516
+ # @return [Peddler::Response] The API response
517
+ def update_shipment_name(inbound_plan_id, shipment_id, body, rate_limit: 2.0)
448
518
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/name"
449
519
 
450
- rate_limit(2.0).put(path, body:)
520
+ meter(rate_limit).put(path, body:)
451
521
  end
452
522
 
453
523
  # Provides a paginated list of pallet packages in a shipment. A palletized shipment will have pallets when the
454
524
  # related details are provided after generating Less-Than-Truckload (LTL) carrier shipments.
455
525
  #
456
- # @param [String] inbound_plan_id Identifier of an inbound plan.
457
- # @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
458
- # @param [Integer] page_size The number of pallets to return in the response matching the given query.
459
- # @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
526
+ # @note This operation can make a static sandbox call.
527
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
528
+ # @param shipment_id [String] Identifier of a shipment. A shipment contains the boxes and units being inbounded.
529
+ # @param page_size [Integer] The number of pallets to return in the response matching the given query.
530
+ # @param pagination_token [String] A token to fetch a certain page when there are multiple pages worth of results.
460
531
  # The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
461
532
  # token value from the query parameter the API returns the first page of the result.
462
- # @return [Hash] The API response
463
- def list_shipment_pallets(inbound_plan_id, shipment_id, page_size: nil, pagination_token: nil)
533
+ # @param rate_limit [Float] Requests per second
534
+ # @return [Peddler::Response] The API response
535
+ def list_shipment_pallets(inbound_plan_id, shipment_id, page_size: 10, pagination_token: nil, rate_limit: 2.0)
464
536
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/pallets"
465
537
  params = {
466
538
  "pageSize" => page_size,
467
539
  "paginationToken" => pagination_token,
468
540
  }.compact
469
541
 
470
- rate_limit(2.0).get(path, params:)
542
+ meter(rate_limit).get(path, params:)
471
543
  end
472
544
 
473
545
  # Cancels a self-ship appointment slot against a shipment.
474
546
  #
475
- # @param [String] inbound_plan_id Identifier of an inbound plan.
476
- # @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
477
- # @param [Hash] body The body of the request to `cancelSelfShipAppointment`.
478
- # @return [Hash] The API response
479
- def cancel_self_ship_appointment(inbound_plan_id, shipment_id, body)
547
+ # @note This operation can make a static sandbox call.
548
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
549
+ # @param shipment_id [String] Identifier of a shipment. A shipment contains the boxes and units being inbounded.
550
+ # @param body [Hash] The body of the request to `cancelSelfShipAppointment`.
551
+ # @param rate_limit [Float] Requests per second
552
+ # @return [Peddler::Response] The API response
553
+ def cancel_self_ship_appointment(inbound_plan_id, shipment_id, body, rate_limit: 2.0)
480
554
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/selfShipAppointmentCancellation"
481
555
 
482
- rate_limit(2.0).put(path, body:)
556
+ meter(rate_limit).put(path, body:)
483
557
  end
484
558
 
485
559
  # Retrieves a list of available self-ship appointment slots used to drop off a shipment at a warehouse.
486
560
  #
487
- # @param [String] inbound_plan_id Identifier of an inbound plan.
488
- # @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
489
- # @param [Integer] page_size The number of self ship appointment slots to return in the response matching the
561
+ # @note This operation can make a static sandbox call.
562
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
563
+ # @param shipment_id [String] Identifier of a shipment. A shipment contains the boxes and units being inbounded.
564
+ # @param page_size [Integer] The number of self ship appointment slots to return in the response matching the
490
565
  # given query.
491
- # @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
566
+ # @param pagination_token [String] A token to fetch a certain page when there are multiple pages worth of results.
492
567
  # The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
493
568
  # token value from the query parameter the API returns the first page of the result.
494
- # @return [Hash] The API response
495
- def get_self_ship_appointment_slots(inbound_plan_id, shipment_id, page_size: nil, pagination_token: nil)
569
+ # @param rate_limit [Float] Requests per second
570
+ # @return [Peddler::Response] The API response
571
+ def get_self_ship_appointment_slots(inbound_plan_id, shipment_id, page_size: 10, pagination_token: nil,
572
+ rate_limit: 2.0)
496
573
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/selfShipAppointmentSlots"
497
574
  params = {
498
575
  "pageSize" => page_size,
499
576
  "paginationToken" => pagination_token,
500
577
  }.compact
501
578
 
502
- rate_limit(2.0).get(path, params:)
579
+ meter(rate_limit).get(path, params:)
503
580
  end
504
581
 
505
582
  # Initiates the process of generating the appointment slots list.
506
583
  #
507
- # @param [String] inbound_plan_id Identifier of an inbound plan.
508
- # @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
509
- # @param [Hash] body The body of the request to `generateSelfShipAppointmentSlots`.
510
- # @return [Hash] The API response
511
- def generate_self_ship_appointment_slots(inbound_plan_id, shipment_id, body)
584
+ # @note This operation can make a static sandbox call.
585
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
586
+ # @param shipment_id [String] Identifier of a shipment. A shipment contains the boxes and units being inbounded.
587
+ # @param body [Hash] The body of the request to `generateSelfShipAppointmentSlots`.
588
+ # @param rate_limit [Float] Requests per second
589
+ # @return [Peddler::Response] The API response
590
+ def generate_self_ship_appointment_slots(inbound_plan_id, shipment_id, body, rate_limit: 2.0)
512
591
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/selfShipAppointmentSlots"
513
592
 
514
- rate_limit(2.0).post(path, body:)
593
+ meter(rate_limit).post(path, body:)
515
594
  end
516
595
 
517
596
  # Confirms or reschedules a self-ship appointment slot against a shipment.
518
597
  #
519
- # @param [String] inbound_plan_id Identifier of an inbound plan.
520
- # @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
521
- # @param [String] slot_id An identifier to a self-ship appointment slot.
522
- # @param [Hash] body The body of the request to `scheduleSelfShipAppointment`.
523
- # @return [Hash] The API response
524
- def schedule_self_ship_appointment(inbound_plan_id, shipment_id, slot_id, body)
598
+ # @note This operation can make a static sandbox call.
599
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
600
+ # @param shipment_id [String] Identifier of a shipment. A shipment contains the boxes and units being inbounded.
601
+ # @param slot_id [String] An identifier to a self-ship appointment slot.
602
+ # @param body [Hash] The body of the request to `scheduleSelfShipAppointment`.
603
+ # @param rate_limit [Float] Requests per second
604
+ # @return [Peddler::Response] The API response
605
+ def schedule_self_ship_appointment(inbound_plan_id, shipment_id, slot_id, body, rate_limit: 2.0)
525
606
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/selfShipAppointmentSlots/#{slot_id}/schedule"
526
607
 
527
- rate_limit(2.0).post(path, body:)
608
+ meter(rate_limit).post(path, body:)
528
609
  end
529
610
 
530
611
  # Updates the source address of an existing shipment. The shipment source address can only be updated prior to the
@@ -532,44 +613,50 @@ module Peddler
532
613
  # options will be invalidated and will need to be regenerated to capture the potential difference in
533
614
  # transportation options and quotes due to the new source address.
534
615
  #
535
- # @param [String] inbound_plan_id Identifier of an inbound plan.
536
- # @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
537
- # @param [Hash] body The body of the request to `updateShipmentSourceAddress`.
538
- # @return [Hash] The API response
539
- def update_shipment_source_address(inbound_plan_id, shipment_id, body)
616
+ # @note This operation can make a static sandbox call.
617
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
618
+ # @param shipment_id [String] Identifier of a shipment. A shipment contains the boxes and units being inbounded.
619
+ # @param body [Hash] The body of the request to `updateShipmentSourceAddress`.
620
+ # @param rate_limit [Float] Requests per second
621
+ # @return [Peddler::Response] The API response
622
+ def update_shipment_source_address(inbound_plan_id, shipment_id, body, rate_limit: 2.0)
540
623
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/sourceAddress"
541
624
 
542
- rate_limit(2.0).put(path, body:)
625
+ meter(rate_limit).put(path, body:)
543
626
  end
544
627
 
545
628
  # Updates a shipment's tracking details.
546
629
  #
547
- # @param [String] inbound_plan_id Identifier of an inbound plan.
548
- # @param [String] shipment_id Identifier of a shipment. A shipment contains the boxes and units being inbounded.
549
- # @param [Hash] body The body of the request to `updateShipmentTrackingDetails`.
550
- # @return [Hash] The API response
551
- def update_shipment_tracking_details(inbound_plan_id, shipment_id, body)
630
+ # @note This operation can make a static sandbox call.
631
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
632
+ # @param shipment_id [String] Identifier of a shipment. A shipment contains the boxes and units being inbounded.
633
+ # @param body [Hash] The body of the request to `updateShipmentTrackingDetails`.
634
+ # @param rate_limit [Float] Requests per second
635
+ # @return [Peddler::Response] The API response
636
+ def update_shipment_tracking_details(inbound_plan_id, shipment_id, body, rate_limit: 2.0)
552
637
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/trackingDetails"
553
638
 
554
- rate_limit(2.0).put(path, body:)
639
+ meter(rate_limit).put(path, body:)
555
640
  end
556
641
 
557
642
  # Retrieves all transportation options for a shipment. Transportation options must first be generated by the
558
643
  # `generateTransportationOptions` operation before becoming available.
559
644
  #
560
- # @param [String] inbound_plan_id Identifier of an inbound plan.
561
- # @param [Integer] page_size The number of transportation options to return in the response matching the given
645
+ # @note This operation can make a static sandbox call.
646
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
647
+ # @param page_size [Integer] The number of transportation options to return in the response matching the given
562
648
  # query.
563
- # @param [String] pagination_token A token to fetch a certain page when there are multiple pages worth of results.
649
+ # @param pagination_token [String] A token to fetch a certain page when there are multiple pages worth of results.
564
650
  # The value of this token is fetched from the `pagination` returned in the API response. In the absence of the
565
651
  # token value from the query parameter the API returns the first page of the result.
566
- # @param [String] placement_option_id The placement option to get transportation options for. Either
652
+ # @param placement_option_id [String] The placement option to get transportation options for. Either
567
653
  # `placementOptionId` or `shipmentId` must be specified.
568
- # @param [String] shipment_id The shipment to get transportation options for. Either `placementOptionId` or
654
+ # @param shipment_id [String] The shipment to get transportation options for. Either `placementOptionId` or
569
655
  # `shipmentId` must be specified.
570
- # @return [Hash] The API response
571
- def list_transportation_options(inbound_plan_id, page_size: nil, pagination_token: nil,
572
- placement_option_id: nil, shipment_id: nil)
656
+ # @param rate_limit [Float] Requests per second
657
+ # @return [Peddler::Response] The API response
658
+ def list_transportation_options(inbound_plan_id, page_size: 10, pagination_token: nil, placement_option_id: nil,
659
+ shipment_id: nil, rate_limit: 2.0)
573
660
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/transportationOptions"
574
661
  params = {
575
662
  "pageSize" => page_size,
@@ -578,82 +665,124 @@ module Peddler
578
665
  "shipmentId" => shipment_id,
579
666
  }.compact
580
667
 
581
- rate_limit(2.0).get(path, params:)
668
+ meter(rate_limit).get(path, params:)
582
669
  end
583
670
 
584
671
  # Generates available transportation options for a given placement option.
585
672
  #
586
- # @param [String] inbound_plan_id Identifier of an inbound plan.
587
- # @param [Hash] body The body of the request to `generateTransportationOptions`.
588
- # @return [Hash] The API response
589
- def generate_transportation_options(inbound_plan_id, body)
673
+ # @note This operation can make a static sandbox call.
674
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
675
+ # @param body [Hash] The body of the request to `generateTransportationOptions`.
676
+ # @param rate_limit [Float] Requests per second
677
+ # @return [Peddler::Response] The API response
678
+ def generate_transportation_options(inbound_plan_id, body, rate_limit: 2.0)
590
679
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/transportationOptions"
591
680
 
592
- rate_limit(2.0).post(path, body:)
681
+ meter(rate_limit).post(path, body:)
593
682
  end
594
683
 
595
684
  # Confirms all the transportation options for an inbound plan. A placement option must be confirmed prior to use
596
685
  # of this API. Once confirmed, new transportation options can not be generated or confirmed for the Inbound Plan.
597
686
  #
598
- # @param [String] inbound_plan_id Identifier of an inbound plan.
599
- # @param [Hash] body The body of the request to `confirmTransportationOptions`.
600
- # @return [Hash] The API response
601
- def confirm_transportation_options(inbound_plan_id, body)
687
+ # @note This operation can make a static sandbox call.
688
+ # @param inbound_plan_id [String] Identifier of an inbound plan.
689
+ # @param body [Hash] The body of the request to `confirmTransportationOptions`.
690
+ # @param rate_limit [Float] Requests per second
691
+ # @return [Peddler::Response] The API response
692
+ def confirm_transportation_options(inbound_plan_id, body, rate_limit: 2.0)
602
693
  path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/transportationOptions/confirmation"
603
694
 
604
- rate_limit(2.0).post(path, body:)
695
+ meter(rate_limit).post(path, body:)
605
696
  end
606
697
 
607
698
  # List the inbound compliance details for MSKUs in a given marketplace.
608
699
  #
609
- # @param [Array<String>] mskus List of merchant SKUs - a merchant-supplied identifier for a specific SKU.
610
- # @param [String] marketplace_id The Marketplace ID. Refer to [Marketplace
611
- # IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a list of possible values.
612
- # @return [Hash] The API response
613
- def list_item_compliance_details(mskus, marketplace_id)
700
+ # @note This operation can make a static sandbox call.
701
+ # @param mskus [Array<String>] A list of merchant SKUs, a merchant-supplied identifier of a specific SKU.
702
+ # @param marketplace_id [String] The Marketplace ID. For a list of possible values, refer to [Marketplace
703
+ # IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
704
+ # @param rate_limit [Float] Requests per second
705
+ # @return [Peddler::Response] The API response
706
+ def list_item_compliance_details(mskus, marketplace_id, rate_limit: 2.0)
614
707
  path = "/inbound/fba/2024-03-20/items/compliance"
615
708
  params = {
616
709
  "mskus" => mskus,
617
710
  "marketplaceId" => marketplace_id,
618
711
  }.compact
619
712
 
620
- rate_limit(2.0).get(path, params:)
713
+ meter(rate_limit).get(path, params:)
621
714
  end
622
715
 
623
- # Update compliance details for list of MSKUs. The details provided here are only used for the IN marketplace
624
- # compliance validation.
716
+ # Update compliance details for a list of MSKUs. The details provided here are only used for the India (IN -
717
+ # A21TJRUUN4KGV) marketplace compliance validation.
625
718
  #
626
- # @param [String] marketplace_id The Marketplace ID. Refer to [Marketplace
627
- # IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a list of possible values.
628
- # @param [Hash] body The body of the request to `updateItemComplianceDetails`.
629
- # @return [Hash] The API response
630
- def update_item_compliance_details(marketplace_id, body)
719
+ # @note This operation can make a static sandbox call.
720
+ # @param marketplace_id [String] The Marketplace ID. For a list of possible values, refer to [Marketplace
721
+ # IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
722
+ # @param body [Hash] The body of the request to `updateItemComplianceDetails`.
723
+ # @param rate_limit [Float] Requests per second
724
+ # @return [Peddler::Response] The API response
725
+ def update_item_compliance_details(marketplace_id, body, rate_limit: 2.0)
631
726
  path = "/inbound/fba/2024-03-20/items/compliance"
632
727
  params = {
633
728
  "marketplaceId" => marketplace_id,
634
729
  }.compact
635
730
 
636
- rate_limit(2.0).put(path, body:, params:)
731
+ meter(rate_limit).put(path, body:, params:)
637
732
  end
638
733
 
639
- # For a given marketplace - creates labels for a list of mskus.
734
+ # For a given marketplace - creates labels for a list of MSKUs.
640
735
  #
641
- # @param [Hash] body The body of the request to `createMarketplaceItemLabels`.
642
- # @return [Hash] The API response
643
- def create_marketplace_item_labels(body)
736
+ # @note This operation can make a static sandbox call.
737
+ # @param body [Hash] The body of the request to `createMarketplaceItemLabels`.
738
+ # @param rate_limit [Float] Requests per second
739
+ # @return [Peddler::Response] The API response
740
+ def create_marketplace_item_labels(body, rate_limit: 2.0)
644
741
  path = "/inbound/fba/2024-03-20/items/labels"
645
742
 
646
- rate_limit(2.0).post(path, body:)
743
+ meter(rate_limit).post(path, body:)
744
+ end
745
+
746
+ # Get preparation details for a list of MSKUs in a specified marketplace.
747
+ #
748
+ # @note This operation can make a static sandbox call.
749
+ # @param marketplace_id [String] The marketplace ID. For a list of possible values, refer to [Marketplace
750
+ # IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
751
+ # @param mskus [Array<String>] A list of merchant SKUs, a merchant-supplied identifier of a specific SKU.
752
+ # @param rate_limit [Float] Requests per second
753
+ # @return [Peddler::Response] The API response
754
+ def list_prep_details(marketplace_id, mskus, rate_limit: 2.0)
755
+ path = "/inbound/fba/2024-03-20/items/prepDetails"
756
+ params = {
757
+ "marketplaceId" => marketplace_id,
758
+ "mskus" => mskus,
759
+ }.compact
760
+
761
+ meter(rate_limit).get(path, params:)
762
+ end
763
+
764
+ # Set the preparation details for a list of MSKUs in a specified marketplace.
765
+ #
766
+ # @note This operation can make a static sandbox call.
767
+ # @param body [Hash] The body of the request to `setPrepDetails`.
768
+ # @param rate_limit [Float] Requests per second
769
+ # @return [Peddler::Response] The API response
770
+ def set_prep_details(body, rate_limit: 2.0)
771
+ path = "/inbound/fba/2024-03-20/items/prepDetails"
772
+
773
+ meter(rate_limit).post(path, body:)
647
774
  end
648
775
 
649
776
  # Gets the status of the processing of an asynchronous API call.
650
777
  #
651
- # @param [String] operation_id Identifier of an asynchronous operation.
652
- # @return [Hash] The API response
653
- def get_inbound_operation_status(operation_id)
778
+ # @note This operation can make a static sandbox call.
779
+ # @param operation_id [String] Identifier of an asynchronous operation.
780
+ # @param rate_limit [Float] Requests per second
781
+ # @return [Peddler::Response] The API response
782
+ def get_inbound_operation_status(operation_id, rate_limit: 2.0)
654
783
  path = "/inbound/fba/2024-03-20/operations/#{operation_id}"
655
784
 
656
- rate_limit(2.0).get(path)
785
+ meter(rate_limit).get(path)
657
786
  end
658
787
  end
659
788
  end