peddler 3.0.0.beta1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
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 sellers_v1(...)
8
+ API::SellersV1.new(...)
9
+ end
10
+ end
11
+
6
12
  class API
7
13
  # Selling Partner API for Sellers
8
14
  #
@@ -14,19 +20,25 @@ module Peddler
14
20
  class SellersV1 < API
15
21
  # Returns a list of marketplaces where the seller can list items and information about the seller's participation
16
22
  # in those marketplaces.
23
+ #
24
+ # @note This operation can make a static sandbox call.
25
+ # @param rate_limit [Float] Requests per second
17
26
  # @return [Hash] The API response
18
- def get_marketplace_participations
27
+ def get_marketplace_participations(rate_limit: 0.016)
19
28
  path = "/sellers/v1/marketplaceParticipations"
20
29
 
21
- rate_limit(0.016).get(path)
30
+ meter(rate_limit).get(path)
22
31
  end
23
32
 
24
33
  # Returns information about a seller account and its marketplaces.
34
+ #
35
+ # @note This operation can make a static sandbox call.
36
+ # @param rate_limit [Float] Requests per second
25
37
  # @return [Hash] The API response
26
- def get_account
38
+ def get_account(rate_limit: 0.016)
27
39
  path = "/sellers/v1/account"
28
40
 
29
- rate_limit(0.016).get(path)
41
+ meter(rate_limit).get(path)
30
42
  end
31
43
  end
32
44
  end
@@ -3,6 +3,12 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
+ class << self
7
+ def services_v1(...)
8
+ API::ServicesV1.new(...)
9
+ end
10
+ end
11
+
6
12
  class API
7
13
  # Selling Partner API for Services
8
14
  #
@@ -11,78 +17,84 @@ module Peddler
11
17
  class ServicesV1 < API
12
18
  # Gets details of service job indicated by the provided `serviceJobID`.
13
19
  #
14
- # @param [String] service_job_id A service job identifier.
20
+ # @note This operation can make a static sandbox call.
21
+ # @param service_job_id [String] A service job identifier.
22
+ # @param rate_limit [Float] Requests per second
15
23
  # @return [Hash] The API response
16
- def get_service_job_by_service_job_id(service_job_id)
24
+ def get_service_job_by_service_job_id(service_job_id, rate_limit: 20.0)
17
25
  path = "/service/v1/serviceJobs/#{service_job_id}"
18
26
 
19
- rate_limit(20.0).get(path)
27
+ meter(rate_limit).get(path)
20
28
  end
21
29
 
22
30
  # Cancels the service job indicated by the service job identifier specified.
23
31
  #
24
- # @param [String] service_job_id An Amazon defined service job identifier.
25
- # @param [String] cancellation_reason_code A cancel reason code that specifies the reason for cancelling a service
32
+ # @note This operation can make a static sandbox call.
33
+ # @param service_job_id [String] An Amazon defined service job identifier.
34
+ # @param cancellation_reason_code [String] A cancel reason code that specifies the reason for cancelling a service
26
35
  # job.
36
+ # @param rate_limit [Float] Requests per second
27
37
  # @return [Hash] The API response
28
- def cancel_service_job_by_service_job_id(service_job_id, cancellation_reason_code)
38
+ def cancel_service_job_by_service_job_id(service_job_id, cancellation_reason_code, rate_limit: 5.0)
29
39
  path = "/service/v1/serviceJobs/#{service_job_id}/cancellations"
30
40
  params = {
31
41
  "cancellationReasonCode" => cancellation_reason_code,
32
42
  }.compact
33
43
 
34
- rate_limit(5.0).put(path, params:)
44
+ meter(rate_limit).put(path, params:)
35
45
  end
36
46
 
37
47
  # Completes the service job indicated by the service job identifier specified.
38
48
  #
39
- # @param [String] service_job_id An Amazon defined service job identifier.
49
+ # @note This operation can make a static sandbox call.
50
+ # @param service_job_id [String] An Amazon defined service job identifier.
51
+ # @param rate_limit [Float] Requests per second
40
52
  # @return [Hash] The API response
41
- def complete_service_job_by_service_job_id(service_job_id)
53
+ def complete_service_job_by_service_job_id(service_job_id, rate_limit: 5.0)
42
54
  path = "/service/v1/serviceJobs/#{service_job_id}/completions"
43
55
 
44
- rate_limit(5.0).put(path)
56
+ meter(rate_limit).put(path)
45
57
  end
46
58
 
47
59
  # Gets service job details for the specified filter query.
48
60
  #
49
- # @param [Array<String>] service_order_ids List of service order ids for the query you want to perform.Max values
61
+ # @note This operation can make a static sandbox call.
62
+ # @param service_order_ids [Array<String>] List of service order ids for the query you want to perform.Max values
50
63
  # supported 20.
51
- # @param [Array<String>] service_job_status A list of one or more job status by which to filter the list of jobs.
52
- # @param [String] page_token String returned in the response of your previous request.
53
- # @param [Integer] page_size A non-negative integer that indicates the maximum number of jobs to return in the
64
+ # @param service_job_status [Array<String>] A list of one or more job status by which to filter the list of jobs.
65
+ # @param page_token [String] String returned in the response of your previous request.
66
+ # @param page_size [Integer] A non-negative integer that indicates the maximum number of jobs to return in the
54
67
  # list, Value must be 1 - 20. Default 20.
55
- # @param [String] sort_field Sort fields on which you want to sort the output.
56
- # @param [String] sort_order Sort order for the query you want to perform.
57
- # @param [String] created_after A date used for selecting jobs created at or after a specified time. Must be in
68
+ # @param sort_field [String] Sort fields on which you want to sort the output.
69
+ # @param sort_order [String] Sort order for the query you want to perform.
70
+ # @param created_after [String] A date used for selecting jobs created at or after a specified time. Must be in
58
71
  # ISO 8601 format. Required if `LastUpdatedAfter` is not specified. Specifying both `CreatedAfter` and
59
72
  # `LastUpdatedAfter` returns an error.
60
- # @param [String] created_before A date used for selecting jobs created at or before a specified time. Must be in
73
+ # @param created_before [String] A date used for selecting jobs created at or before a specified time. Must be in
61
74
  # ISO 8601 format.
62
- # @param [String] last_updated_after A date used for selecting jobs updated at or after a specified time. Must be
75
+ # @param last_updated_after [String] A date used for selecting jobs updated at or after a specified time. Must be
63
76
  # in ISO 8601 format. Required if `createdAfter` is not specified. Specifying both `CreatedAfter` and
64
77
  # `LastUpdatedAfter` returns an error.
65
- # @param [String] last_updated_before A date used for selecting jobs updated at or before a specified time. Must
78
+ # @param last_updated_before [String] A date used for selecting jobs updated at or before a specified time. Must
66
79
  # be in ISO 8601 format.
67
- # @param [String] schedule_start_date A date used for filtering jobs schedules at or after a specified time. Must
80
+ # @param schedule_start_date [String] A date used for filtering jobs schedules at or after a specified time. Must
68
81
  # be in ISO 8601 format. Schedule end date should not be earlier than schedule start date.
69
- # @param [String] schedule_end_date A date used for filtering jobs schedules at or before a specified time. Must
82
+ # @param schedule_end_date [String] A date used for filtering jobs schedules at or before a specified time. Must
70
83
  # be in ISO 8601 format. Schedule end date should not be earlier than schedule start date.
71
- # @param [Array<String>] marketplace_ids Used to select jobs that were placed in the specified marketplaces.
72
- # @param [Array<String>] asins List of Amazon Standard Identification Numbers (ASIN) of the items. Max values
84
+ # @param marketplace_ids [Array<String>] Used to select jobs that were placed in the specified marketplaces.
85
+ # @param asins [Array<String>] List of Amazon Standard Identification Numbers (ASIN) of the items. Max values
73
86
  # supported is 20.
74
- # @param [Array<String>] required_skills A defined set of related knowledge, skills, experience, tools, materials,
87
+ # @param required_skills [Array<String>] A defined set of related knowledge, skills, experience, tools, materials,
75
88
  # and work processes common to service delivery for a set of products and/or service scenarios. Max values
76
89
  # supported is 20.
77
- # @param [Array<String>] store_ids List of Amazon-defined identifiers for the region scope. Max values supported
90
+ # @param store_ids [Array<String>] List of Amazon-defined identifiers for the region scope. Max values supported
78
91
  # is 50.
92
+ # @param rate_limit [Float] Requests per second
79
93
  # @return [Hash] The API response
80
- def get_service_jobs(
81
- marketplace_ids, service_order_ids: nil, service_job_status: nil, page_token: nil, page_size: nil,
82
- sort_field: nil, sort_order: nil, created_after: nil, created_before: nil, last_updated_after: nil,
83
- last_updated_before: nil, schedule_start_date: nil, schedule_end_date: nil, asins: nil, required_skills: nil,
84
- store_ids: nil
85
- )
94
+ def get_service_jobs(marketplace_ids, service_order_ids: nil, service_job_status: nil, page_token: nil,
95
+ page_size: 20, sort_field: nil, sort_order: nil, created_after: nil, created_before: nil,
96
+ last_updated_after: nil, last_updated_before: nil, schedule_start_date: nil, schedule_end_date: nil, asins: nil,
97
+ required_skills: nil, store_ids: nil, rate_limit: 10.0)
86
98
  path = "/service/v1/serviceJobs"
87
99
  params = {
88
100
  "serviceOrderIds" => service_order_ids,
@@ -103,162 +115,186 @@ module Peddler
103
115
  "storeIds" => store_ids,
104
116
  }.compact
105
117
 
106
- rate_limit(10.0).get(path, params:)
118
+ meter(rate_limit).get(path, params:)
107
119
  end
108
120
 
109
121
  # Adds an appointment to the service job indicated by the service job identifier specified.
110
122
  #
111
- # @param [String] service_job_id An Amazon defined service job identifier.
112
- # @param [Hash] body Add appointment operation input details.
123
+ # @note This operation can make a static sandbox call.
124
+ # @param service_job_id [String] An Amazon defined service job identifier.
125
+ # @param body [Hash] Add appointment operation input details.
126
+ # @param rate_limit [Float] Requests per second
113
127
  # @return [Hash] The API response
114
- def add_appointment_for_service_job_by_service_job_id(service_job_id, body)
128
+ def add_appointment_for_service_job_by_service_job_id(service_job_id, body, rate_limit: 5.0)
115
129
  path = "/service/v1/serviceJobs/#{service_job_id}/appointments"
116
130
 
117
- rate_limit(5.0).post(path, body:)
131
+ meter(rate_limit).post(path, body:)
118
132
  end
119
133
 
120
134
  # Reschedules an appointment for the service job indicated by the service job identifier specified.
121
135
  #
122
- # @param [String] service_job_id An Amazon defined service job identifier.
123
- # @param [String] appointment_id An existing appointment identifier for the Service Job.
124
- # @param [Hash] body Reschedule appointment operation input details.
136
+ # @note This operation can make a static sandbox call.
137
+ # @param service_job_id [String] An Amazon defined service job identifier.
138
+ # @param appointment_id [String] An existing appointment identifier for the Service Job.
139
+ # @param body [Hash] Reschedule appointment operation input details.
140
+ # @param rate_limit [Float] Requests per second
125
141
  # @return [Hash] The API response
126
- def reschedule_appointment_for_service_job_by_service_job_id(service_job_id, appointment_id, body)
142
+ def reschedule_appointment_for_service_job_by_service_job_id(service_job_id, appointment_id, body,
143
+ rate_limit: 5.0)
127
144
  path = "/service/v1/serviceJobs/#{service_job_id}/appointments/#{appointment_id}"
128
145
 
129
- rate_limit(5.0).post(path, body:)
146
+ meter(rate_limit).post(path, body:)
130
147
  end
131
148
 
132
149
  # Assigns new resource(s) or overwrite/update the existing one(s) to a service job appointment.
133
150
  #
134
- # @param [String] service_job_id An Amazon-defined service job identifier. Get this value by calling the
151
+ # @note This operation can make a static sandbox call.
152
+ # @param service_job_id [String] An Amazon-defined service job identifier. Get this value by calling the
135
153
  # `getServiceJobs` operation of the Services API.
136
- # @param [String] appointment_id An Amazon-defined identifier of active service job appointment.
137
- # @param [Hash] body
154
+ # @param appointment_id [String] An Amazon-defined identifier of active service job appointment.
155
+ # @param body [Hash]
156
+ # @param rate_limit [Float] Requests per second
138
157
  # @return [Hash] The API response
139
- def assign_appointment_resources(service_job_id, appointment_id, body)
158
+ def assign_appointment_resources(service_job_id, appointment_id, body, rate_limit: 1.0)
140
159
  path = "/service/v1/serviceJobs/#{service_job_id}/appointments/#{appointment_id}/resources"
141
160
 
142
- rate_limit(1.0).put(path, body:)
161
+ meter(rate_limit).put(path, body:)
143
162
  end
144
163
 
145
164
  # Updates the appointment fulfillment data related to a given `jobID` and `appointmentID`.
146
165
  #
147
- # @param [String] service_job_id An Amazon-defined service job identifier. Get this value by calling the
166
+ # @note This operation can make a static sandbox call.
167
+ # @param service_job_id [String] An Amazon-defined service job identifier. Get this value by calling the
148
168
  # `getServiceJobs` operation of the Services API.
149
- # @param [String] appointment_id An Amazon-defined identifier of active service job appointment.
150
- # @param [Hash] body Appointment fulfillment data collection details.
169
+ # @param appointment_id [String] An Amazon-defined identifier of active service job appointment.
170
+ # @param body [Hash] Appointment fulfillment data collection details.
171
+ # @param rate_limit [Float] Requests per second
151
172
  # @return [Hash] The API response
152
- def set_appointment_fulfillment_data(service_job_id, appointment_id, body)
173
+ def set_appointment_fulfillment_data(service_job_id, appointment_id, body, rate_limit: 5.0)
153
174
  path = "/service/v1/serviceJobs/#{service_job_id}/appointments/#{appointment_id}/fulfillment"
154
175
 
155
- rate_limit(5.0).put(path, body:)
176
+ meter(rate_limit).put(path, body:)
156
177
  end
157
178
 
158
179
  # Provides capacity slots in a format similar to availability records.
159
180
  #
160
- # @param [String] resource_id Resource Identifier.
161
- # @param [Hash] body Request body.
162
- # @param [Array<String>] marketplace_ids An identifier for the marketplace in which the resource operates.
163
- # @param [String] next_page_token Next page token returned in the response of your previous request.
181
+ # @note This operation can make a static sandbox call.
182
+ # @param resource_id [String] Resource Identifier.
183
+ # @param body [Hash] Request body.
184
+ # @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
185
+ # @param next_page_token [String] Next page token returned in the response of your previous request.
186
+ # @param rate_limit [Float] Requests per second
164
187
  # @return [Hash] The API response
165
- def get_range_slot_capacity(resource_id, body, marketplace_ids, next_page_token: nil)
188
+ def get_range_slot_capacity(resource_id, body, marketplace_ids, next_page_token: nil, rate_limit: 5.0)
166
189
  path = "/service/v1/serviceResources/#{resource_id}/capacity/range"
167
190
  params = {
168
191
  "marketplaceIds" => marketplace_ids,
169
192
  "nextPageToken" => next_page_token,
170
193
  }.compact
171
194
 
172
- rate_limit(5.0).post(path, body:, params:)
195
+ meter(rate_limit).post(path, body:, params:)
173
196
  end
174
197
 
175
198
  # Provides capacity in fixed-size slots.
176
199
  #
177
- # @param [String] resource_id Resource Identifier.
178
- # @param [Hash] body Request body.
179
- # @param [Array<String>] marketplace_ids An identifier for the marketplace in which the resource operates.
180
- # @param [String] next_page_token Next page token returned in the response of your previous request.
200
+ # @note This operation can make a static sandbox call.
201
+ # @param resource_id [String] Resource Identifier.
202
+ # @param body [Hash] Request body.
203
+ # @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
204
+ # @param next_page_token [String] Next page token returned in the response of your previous request.
205
+ # @param rate_limit [Float] Requests per second
181
206
  # @return [Hash] The API response
182
- def get_fixed_slot_capacity(resource_id, body, marketplace_ids, next_page_token: nil)
207
+ def get_fixed_slot_capacity(resource_id, body, marketplace_ids, next_page_token: nil, rate_limit: 5.0)
183
208
  path = "/service/v1/serviceResources/#{resource_id}/capacity/fixed"
184
209
  params = {
185
210
  "marketplaceIds" => marketplace_ids,
186
211
  "nextPageToken" => next_page_token,
187
212
  }.compact
188
213
 
189
- rate_limit(5.0).post(path, body:, params:)
214
+ meter(rate_limit).post(path, body:, params:)
190
215
  end
191
216
 
192
217
  # Update the schedule of the given resource.
193
218
  #
194
- # @param [String] resource_id Resource (store) Identifier
195
- # @param [Hash] body Schedule details
196
- # @param [Array<String>] marketplace_ids An identifier for the marketplace in which the resource operates.
219
+ # @note This operation can make a static sandbox call.
220
+ # @param resource_id [String] Resource (store) Identifier
221
+ # @param body [Hash] Schedule details
222
+ # @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
223
+ # @param rate_limit [Float] Requests per second
197
224
  # @return [Hash] The API response
198
- def update_schedule(resource_id, body, marketplace_ids)
225
+ def update_schedule(resource_id, body, marketplace_ids, rate_limit: 5.0)
199
226
  path = "/service/v1/serviceResources/#{resource_id}/schedules"
200
227
  params = {
201
228
  "marketplaceIds" => marketplace_ids,
202
229
  }.compact
203
230
 
204
- rate_limit(5.0).put(path, body:, params:)
231
+ meter(rate_limit).put(path, body:, params:)
205
232
  end
206
233
 
207
234
  # Create a reservation.
208
235
  #
209
- # @param [Hash] body Reservation details
210
- # @param [Array<String>] marketplace_ids An identifier for the marketplace in which the resource operates.
236
+ # @note This operation can make a static sandbox call.
237
+ # @param body [Hash] Reservation details
238
+ # @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
239
+ # @param rate_limit [Float] Requests per second
211
240
  # @return [Hash] The API response
212
- def create_reservation(body, marketplace_ids)
241
+ def create_reservation(body, marketplace_ids, rate_limit: 5.0)
213
242
  path = "/service/v1/reservation"
214
243
  params = {
215
244
  "marketplaceIds" => marketplace_ids,
216
245
  }.compact
217
246
 
218
- rate_limit(5.0).post(path, body:, params:)
247
+ meter(rate_limit).post(path, body:, params:)
219
248
  end
220
249
 
221
250
  # Update a reservation.
222
251
  #
223
- # @param [String] reservation_id Reservation Identifier
224
- # @param [Hash] body Reservation details
225
- # @param [Array<String>] marketplace_ids An identifier for the marketplace in which the resource operates.
252
+ # @note This operation can make a static sandbox call.
253
+ # @param reservation_id [String] Reservation Identifier
254
+ # @param body [Hash] Reservation details
255
+ # @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
256
+ # @param rate_limit [Float] Requests per second
226
257
  # @return [Hash] The API response
227
- def update_reservation(reservation_id, body, marketplace_ids)
258
+ def update_reservation(reservation_id, body, marketplace_ids, rate_limit: 5.0)
228
259
  path = "/service/v1/reservation/#{reservation_id}"
229
260
  params = {
230
261
  "marketplaceIds" => marketplace_ids,
231
262
  }.compact
232
263
 
233
- rate_limit(5.0).put(path, body:, params:)
264
+ meter(rate_limit).put(path, body:, params:)
234
265
  end
235
266
 
236
267
  # Cancel a reservation.
237
268
  #
238
- # @param [String] reservation_id Reservation Identifier
239
- # @param [Array<String>] marketplace_ids An identifier for the marketplace in which the resource operates.
269
+ # @note This operation can make a static sandbox call.
270
+ # @param reservation_id [String] Reservation Identifier
271
+ # @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
272
+ # @param rate_limit [Float] Requests per second
240
273
  # @return [Hash] The API response
241
- def cancel_reservation(reservation_id, marketplace_ids)
274
+ def cancel_reservation(reservation_id, marketplace_ids, rate_limit: 5.0)
242
275
  path = "/service/v1/reservation/#{reservation_id}"
243
276
  params = {
244
277
  "marketplaceIds" => marketplace_ids,
245
278
  }.compact
246
279
 
247
- rate_limit(5.0).delete(path, params:)
280
+ meter(rate_limit).delete(path, params:)
248
281
  end
249
282
 
250
283
  # Gets appointment slots for the service associated with the service job id specified.
251
284
  #
252
- # @param [String] service_job_id A service job identifier to retrive appointment slots for associated service.
253
- # @param [Array<String>] marketplace_ids An identifier for the marketplace in which the resource operates.
254
- # @param [String] start_time A time from which the appointment slots will be retrieved. The specified time must be
285
+ # @note This operation can make a static sandbox call.
286
+ # @param service_job_id [String] A service job identifier to retrive appointment slots for associated service.
287
+ # @param marketplace_ids [Array<String>] An identifier for the marketplace in which the resource operates.
288
+ # @param start_time [String] A time from which the appointment slots will be retrieved. The specified time must be
255
289
  # in ISO 8601 format. If `startTime` is provided, `endTime` should also be provided. Default value is as per
256
290
  # business configuration.
257
- # @param [String] end_time A time up to which the appointment slots will be retrieved. The specified time must be
291
+ # @param end_time [String] A time up to which the appointment slots will be retrieved. The specified time must be
258
292
  # in ISO 8601 format. If `endTime` is provided, `startTime` should also be provided. Default value is as per
259
293
  # business configuration. Maximum range of appointment slots can be 90 days.
294
+ # @param rate_limit [Float] Requests per second
260
295
  # @return [Hash] The API response
261
- def get_appointmment_slots_by_job_id(service_job_id, marketplace_ids, start_time: nil, end_time: nil)
296
+ def get_appointmment_slots_by_job_id(service_job_id, marketplace_ids, start_time: nil, end_time: nil,
297
+ rate_limit: 5.0)
262
298
  path = "/service/v1/serviceJobs/#{service_job_id}/appointmentSlots"
263
299
  params = {
264
300
  "marketplaceIds" => marketplace_ids,
@@ -266,22 +302,24 @@ module Peddler
266
302
  "endTime" => end_time,
267
303
  }.compact
268
304
 
269
- rate_limit(5.0).get(path, params:)
305
+ meter(rate_limit).get(path, params:)
270
306
  end
271
307
 
272
308
  # Gets appointment slots as per the service context specified.
273
309
  #
274
- # @param [String] asin ASIN associated with the service.
275
- # @param [String] store_id Store identifier defining the region scope to retrive appointment slots.
276
- # @param [Array<String>] marketplace_ids An identifier for the marketplace for which appointment slots are queried
277
- # @param [String] start_time A time from which the appointment slots will be retrieved. The specified time must be
310
+ # @note This operation can make a static sandbox call.
311
+ # @param asin [String] ASIN associated with the service.
312
+ # @param store_id [String] Store identifier defining the region scope to retrive appointment slots.
313
+ # @param marketplace_ids [Array<String>] An identifier for the marketplace for which appointment slots are queried
314
+ # @param start_time [String] A time from which the appointment slots will be retrieved. The specified time must be
278
315
  # in ISO 8601 format. If `startTime` is provided, `endTime` should also be provided. Default value is as per
279
316
  # business configuration.
280
- # @param [String] end_time A time up to which the appointment slots will be retrieved. The specified time must be
317
+ # @param end_time [String] A time up to which the appointment slots will be retrieved. The specified time must be
281
318
  # in ISO 8601 format. If `endTime` is provided, `startTime` should also be provided. Default value is as per
282
319
  # business configuration. Maximum range of appointment slots can be 90 days.
320
+ # @param rate_limit [Float] Requests per second
283
321
  # @return [Hash] The API response
284
- def get_appointment_slots(asin, store_id, marketplace_ids, start_time: nil, end_time: nil)
322
+ def get_appointment_slots(asin, store_id, marketplace_ids, start_time: nil, end_time: nil, rate_limit: 20.0)
285
323
  path = "/service/v1/appointmentSlots"
286
324
  params = {
287
325
  "asin" => asin,
@@ -291,17 +329,19 @@ module Peddler
291
329
  "endTime" => end_time,
292
330
  }.compact
293
331
 
294
- rate_limit(20.0).get(path, params:)
332
+ meter(rate_limit).get(path, params:)
295
333
  end
296
334
 
297
335
  # Creates an upload destination.
298
336
  #
299
- # @param [Hash] body Upload document operation input details.
337
+ # @note This operation can make a static sandbox call.
338
+ # @param body [Hash] Upload document operation input details.
339
+ # @param rate_limit [Float] Requests per second
300
340
  # @return [Hash] The API response
301
- def create_service_document_upload_destination(body)
341
+ def create_service_document_upload_destination(body, rate_limit: 5.0)
302
342
  path = "/service/v1/documents"
303
343
 
304
- rate_limit(5.0).post(path, body:)
344
+ meter(rate_limit).post(path, body:)
305
345
  end
306
346
  end
307
347
  end
@@ -3,6 +3,12 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
+ class << self
7
+ def shipment_invoicing_v0(...)
8
+ API::ShipmentInvoicingV0.new(...)
9
+ end
10
+ end
11
+
6
12
  class API
7
13
  # Selling Partner API for Shipment Invoicing
8
14
  #
@@ -11,35 +17,42 @@ module Peddler
11
17
  class ShipmentInvoicingV0 < API
12
18
  # Returns the shipment details required to issue an invoice for the specified shipment.
13
19
  #
14
- # @param [String] shipment_id The identifier for the shipment. Get this value from the FBAOutboundShipmentStatus
15
- # notification. For information about subscribing to notifications, see the [Notifications API Use Case
16
- # Guide](doc:notifications-api-v1-use-case-guide).
20
+ # @note This operation can make a static sandbox call.
21
+ # @param shipment_id [String] The identifier for the shipment. Get this value from the FBAOutboundShipmentStatus
22
+ # notification. For information about subscribing to notifications, see the
23
+ # {https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide Notifications API Use Case
24
+ # Guide}.
25
+ # @param rate_limit [Float] Requests per second
17
26
  # @return [Hash] The API response
18
- def get_shipment_details(shipment_id)
27
+ def get_shipment_details(shipment_id, rate_limit: 1.133)
19
28
  path = "/fba/outbound/brazil/v0/shipments/#{shipment_id}"
20
29
 
21
- rate_limit(1.133).get(path)
30
+ meter(rate_limit).get(path)
22
31
  end
23
32
 
24
33
  # Submits a shipment invoice document for a given shipment.
25
34
  #
26
- # @param [String] shipment_id The identifier for the shipment.
27
- # @param [Hash] body
35
+ # @note This operation can make a static sandbox call.
36
+ # @param shipment_id [String] The identifier for the shipment.
37
+ # @param body [Hash]
38
+ # @param rate_limit [Float] Requests per second
28
39
  # @return [Hash] The API response
29
- def submit_invoice(shipment_id, body)
40
+ def submit_invoice(shipment_id, body, rate_limit: 1.133)
30
41
  path = "/fba/outbound/brazil/v0/shipments/#{shipment_id}/invoice"
31
42
 
32
- rate_limit(1.133).post(path, body:)
43
+ meter(rate_limit).post(path, body:)
33
44
  end
34
45
 
35
46
  # Returns the invoice status for the shipment you specify.
36
47
  #
37
- # @param [String] shipment_id The shipment identifier for the shipment.
48
+ # @note This operation can make a static sandbox call.
49
+ # @param shipment_id [String] The shipment identifier for the shipment.
50
+ # @param rate_limit [Float] Requests per second
38
51
  # @return [Hash] The API response
39
- def get_invoice_status(shipment_id)
52
+ def get_invoice_status(shipment_id, rate_limit: 1.133)
40
53
  path = "/fba/outbound/brazil/v0/shipments/#{shipment_id}/invoice/status"
41
54
 
42
- rate_limit(1.133).get(path)
55
+ meter(rate_limit).get(path)
43
56
  end
44
57
  end
45
58
  end