peddler 3.0.0.beta1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +96 -106
  3. data/lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb +34 -22
  4. data/lib/peddler/api/aplus_content_2020_11_01.rb +86 -48
  5. data/lib/peddler/api/application_integrations_2024_04_01.rb +56 -0
  6. data/lib/peddler/api/application_management_2023_11_30.rb +12 -2
  7. data/lib/peddler/api/catalog_items_2020_12_01.rb +31 -20
  8. data/lib/peddler/api/catalog_items_2022_04_01.rb +35 -25
  9. data/lib/peddler/api/catalog_items_v0.rb +39 -26
  10. data/lib/peddler/api/data_kiosk_2023_11_15.rb +41 -25
  11. data/lib/peddler/api/easy_ship_2022_03_23.rb +62 -43
  12. data/lib/peddler/api/fba_inbound_eligibility_v1.rb +13 -5
  13. data/lib/peddler/api/fba_inventory_v1.rb +40 -24
  14. data/lib/peddler/api/feeds_2021_06_30.rb +43 -25
  15. data/lib/peddler/api/finances_2024_06_19.rb +50 -0
  16. data/lib/peddler/api/finances_v0.rb +86 -59
  17. data/lib/peddler/api/fulfillment_inbound_2024_03_20.rb +304 -205
  18. data/lib/peddler/api/fulfillment_inbound_v0.rb +112 -74
  19. data/lib/peddler/api/fulfillment_outbound_2020_07_01.rb +90 -53
  20. data/lib/peddler/api/invoices_2024_06_19.rb +180 -0
  21. data/lib/peddler/api/listings_items_2020_09_01.rb +44 -33
  22. data/lib/peddler/api/listings_items_2021_08_01.rb +76 -60
  23. data/lib/peddler/api/listings_restrictions_2021_08_01.rb +19 -9
  24. data/lib/peddler/api/merchant_fulfillment_v0.rb +31 -15
  25. data/lib/peddler/api/messaging_v1.rb +93 -61
  26. data/lib/peddler/api/notifications_v1.rb +54 -23
  27. data/lib/peddler/api/orders_v0.rb +87 -72
  28. data/lib/peddler/api/product_fees_v0.rb +39 -31
  29. data/lib/peddler/api/product_pricing_2022_05_01.rb +17 -6
  30. data/lib/peddler/api/product_pricing_v0.rb +63 -45
  31. data/lib/peddler/api/product_type_definitions_2020_09_01.rb +29 -18
  32. data/lib/peddler/api/replenishment_2022_11_07.rb +21 -9
  33. data/lib/peddler/api/reports_2021_06_30.rb +60 -36
  34. data/lib/peddler/api/sales_v1.rb +20 -12
  35. data/lib/peddler/api/sellers_v1.rb +16 -4
  36. data/lib/peddler/api/services_v1.rb +138 -98
  37. data/lib/peddler/api/shipment_invoicing_v0.rb +25 -12
  38. data/lib/peddler/api/shipping_v1.rb +54 -29
  39. data/lib/peddler/api/shipping_v2.rb +132 -80
  40. data/lib/peddler/api/solicitations_v1.rb +18 -8
  41. data/lib/peddler/api/supply_sources_2020_07_01.rb +33 -15
  42. data/lib/peddler/api/tokens_2021_03_01.rb +13 -5
  43. data/lib/peddler/api/uploads_2020_11_01.rb +16 -6
  44. data/lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb +12 -4
  45. data/lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb +29 -17
  46. data/lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb +29 -17
  47. data/lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb +11 -3
  48. data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +14 -4
  49. data/lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb +74 -48
  50. data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +74 -50
  51. data/lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb +11 -3
  52. data/lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb +11 -3
  53. data/lib/peddler/api/vendor_invoices_v1.rb +11 -3
  54. data/lib/peddler/api/vendor_orders_v1.rb +54 -43
  55. data/lib/peddler/api/vendor_shipments_v1.rb +63 -51
  56. data/lib/peddler/api/vendor_transaction_status_v1.rb +12 -3
  57. data/lib/peddler/api.rb +41 -18
  58. data/lib/peddler/endpoint.rb +51 -0
  59. data/lib/peddler/error.rb +1 -0
  60. data/lib/peddler/marketplace.rb +49 -0
  61. data/lib/peddler/token.rb +70 -0
  62. data/lib/peddler/version.rb +1 -1
  63. data/lib/peddler.rb +56 -52
  64. metadata +10 -6
  65. data/lib/peddler/access_token.rb +0 -76
  66. data/lib/peddler/region.rb +0 -30
@@ -3,6 +3,12 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
+ class << self
7
+ def messaging_v1(...)
8
+ API::MessagingV1.new(...)
9
+ end
10
+ end
11
+
6
12
  class API
7
13
  # Selling Partner API for Messaging
8
14
  #
@@ -15,220 +21,246 @@ module Peddler
15
21
  # by an actions object, which contains a path and query parameter(s). You can use the path and parameter(s) to
16
22
  # call an operation that sends a message.
17
23
  #
18
- # @param [String] amazon_order_id An Amazon order identifier. This specifies the order for which you want a list
24
+ # @note This operation can make a static sandbox call.
25
+ # @param amazon_order_id [String] An Amazon order identifier. This specifies the order for which you want a list
19
26
  # of available message types.
20
- # @param [Array<String>] marketplace_ids A marketplace identifier. This specifies the marketplace in which the
27
+ # @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
21
28
  # order was placed. Only one marketplace can be specified.
29
+ # @param rate_limit [Float] Requests per second
22
30
  # @return [Hash] The API response
23
- def get_messaging_actions_for_order(amazon_order_id, marketplace_ids)
31
+ def get_messaging_actions_for_order(amazon_order_id, marketplace_ids, rate_limit: 1.0)
24
32
  path = "/messaging/v1/orders/#{amazon_order_id}"
25
33
  params = {
26
34
  "marketplaceIds" => marketplace_ids,
27
35
  }.compact
28
36
 
29
- rate_limit(1.0).get(path, params:)
37
+ meter(rate_limit).get(path, params:)
30
38
  end
31
39
 
32
40
  # Sends a message asking a buyer to provide or verify customization details such as name spelling, images,
33
41
  # initials, etc.
34
42
  #
35
- # @param [String] amazon_order_id An Amazon order identifier. This specifies the order for which a message is
43
+ # @note This operation can make a static sandbox call.
44
+ # @param amazon_order_id [String] An Amazon order identifier. This specifies the order for which a message is
36
45
  # sent.
37
- # @param [Array<String>] marketplace_ids A marketplace identifier. This specifies the marketplace in which the
46
+ # @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
38
47
  # order was placed. Only one marketplace can be specified.
39
- # @param [Hash] body
48
+ # @param body [Hash]
49
+ # @param rate_limit [Float] Requests per second
40
50
  # @return [Hash] The API response
41
- def confirm_customization_details(amazon_order_id, marketplace_ids, body)
51
+ def confirm_customization_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
42
52
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmCustomizationDetails"
43
53
  params = {
44
54
  "marketplaceIds" => marketplace_ids,
45
55
  }.compact
46
56
 
47
- rate_limit(1.0).post(path, body:, params:)
57
+ meter(rate_limit).post(path, body:, params:)
48
58
  end
49
59
 
50
60
  # Sends a message to a buyer to arrange a delivery or to confirm contact information for making a delivery.
51
61
  #
52
- # @param [String] amazon_order_id An Amazon order identifier. This specifies the order for which a message is
62
+ # @note This operation can make a static sandbox call.
63
+ # @param amazon_order_id [String] An Amazon order identifier. This specifies the order for which a message is
53
64
  # sent.
54
- # @param [Array<String>] marketplace_ids A marketplace identifier. This specifies the marketplace in which the
65
+ # @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
55
66
  # order was placed. Only one marketplace can be specified.
56
- # @param [Hash] body
67
+ # @param body [Hash]
68
+ # @param rate_limit [Float] Requests per second
57
69
  # @return [Hash] The API response
58
- def create_confirm_delivery_details(amazon_order_id, marketplace_ids, body)
70
+ def create_confirm_delivery_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
59
71
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmDeliveryDetails"
60
72
  params = {
61
73
  "marketplaceIds" => marketplace_ids,
62
74
  }.compact
63
75
 
64
- rate_limit(1.0).post(path, body:, params:)
76
+ meter(rate_limit).post(path, body:, params:)
65
77
  end
66
78
 
67
79
  # Sends a critical message that contains documents that a seller is legally obligated to provide to the buyer.
68
80
  # This message should only be used to deliver documents that are required by law.
69
81
  #
70
- # @param [String] amazon_order_id An Amazon order identifier. This specifies the order for which a message is
82
+ # @note This operation can make a static sandbox call.
83
+ # @param amazon_order_id [String] An Amazon order identifier. This specifies the order for which a message is
71
84
  # sent.
72
- # @param [Array<String>] marketplace_ids A marketplace identifier. This specifies the marketplace in which the
85
+ # @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
73
86
  # order was placed. Only one marketplace can be specified.
74
- # @param [Hash] body
87
+ # @param body [Hash]
88
+ # @param rate_limit [Float] Requests per second
75
89
  # @return [Hash] The API response
76
- def create_legal_disclosure(amazon_order_id, marketplace_ids, body)
90
+ def create_legal_disclosure(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
77
91
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/legalDisclosure"
78
92
  params = {
79
93
  "marketplaceIds" => marketplace_ids,
80
94
  }.compact
81
95
 
82
- rate_limit(1.0).post(path, body:, params:)
96
+ meter(rate_limit).post(path, body:, params:)
83
97
  end
84
98
 
85
99
  # Sends a non-critical message that asks a buyer to remove their negative feedback. This message should only be
86
100
  # sent after the seller has resolved the buyer's problem.
87
101
  #
88
- # @param [String] amazon_order_id An Amazon order identifier. This specifies the order for which a message is
102
+ # @note This operation can make a static sandbox call.
103
+ # @param amazon_order_id [String] An Amazon order identifier. This specifies the order for which a message is
89
104
  # sent.
90
- # @param [Array<String>] marketplace_ids A marketplace identifier. This specifies the marketplace in which the
105
+ # @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
91
106
  # order was placed. Only one marketplace can be specified.
107
+ # @param rate_limit [Float] Requests per second
92
108
  # @return [Hash] The API response
93
- def create_negative_feedback_removal(amazon_order_id, marketplace_ids)
109
+ def create_negative_feedback_removal(amazon_order_id, marketplace_ids, rate_limit: 1.0)
94
110
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/negativeFeedbackRemoval"
95
111
  params = {
96
112
  "marketplaceIds" => marketplace_ids,
97
113
  }.compact
98
114
 
99
- rate_limit(1.0).post(path, params:)
115
+ meter(rate_limit).post(path, params:)
100
116
  end
101
117
 
102
118
  # Sends a message to ask a buyer an order-related question prior to shipping their order.
103
119
  #
104
- # @param [String] amazon_order_id An Amazon order identifier. This specifies the order for which a message is
120
+ # @note This operation can make a static sandbox call.
121
+ # @param amazon_order_id [String] An Amazon order identifier. This specifies the order for which a message is
105
122
  # sent.
106
- # @param [Array<String>] marketplace_ids A marketplace identifier. This specifies the marketplace in which the
123
+ # @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
107
124
  # order was placed. Only one marketplace can be specified.
108
- # @param [Hash] body
125
+ # @param body [Hash]
126
+ # @param rate_limit [Float] Requests per second
109
127
  # @return [Hash] The API response
110
- def create_confirm_order_details(amazon_order_id, marketplace_ids, body)
128
+ def create_confirm_order_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
111
129
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmOrderDetails"
112
130
  params = {
113
131
  "marketplaceIds" => marketplace_ids,
114
132
  }.compact
115
133
 
116
- rate_limit(1.0).post(path, body:, params:)
134
+ meter(rate_limit).post(path, body:, params:)
117
135
  end
118
136
 
119
137
  # Sends a message to contact a Home Service customer to arrange a service call or to gather information prior to a
120
138
  # service call.
121
139
  #
122
- # @param [String] amazon_order_id An Amazon order identifier. This specifies the order for which a message is
140
+ # @note This operation can make a static sandbox call.
141
+ # @param amazon_order_id [String] An Amazon order identifier. This specifies the order for which a message is
123
142
  # sent.
124
- # @param [Array<String>] marketplace_ids A marketplace identifier. This specifies the marketplace in which the
143
+ # @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
125
144
  # order was placed. Only one marketplace can be specified.
126
- # @param [Hash] body
145
+ # @param body [Hash]
146
+ # @param rate_limit [Float] Requests per second
127
147
  # @return [Hash] The API response
128
- def create_confirm_service_details(amazon_order_id, marketplace_ids, body)
148
+ def create_confirm_service_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
129
149
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmServiceDetails"
130
150
  params = {
131
151
  "marketplaceIds" => marketplace_ids,
132
152
  }.compact
133
153
 
134
- rate_limit(1.0).post(path, body:, params:)
154
+ meter(rate_limit).post(path, body:, params:)
135
155
  end
136
156
 
137
157
  # Sends a message to a buyer to provide details about an Amazon Motors order. This message can only be sent by
138
158
  # Amazon Motors sellers.
139
159
  #
140
- # @param [String] amazon_order_id An Amazon order identifier. This specifies the order for which a message is
160
+ # @note This operation can make a static sandbox call.
161
+ # @param amazon_order_id [String] An Amazon order identifier. This specifies the order for which a message is
141
162
  # sent.
142
- # @param [Array<String>] marketplace_ids A marketplace identifier. This specifies the marketplace in which the
163
+ # @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
143
164
  # order was placed. Only one marketplace can be specified.
144
- # @param [Hash] body
165
+ # @param body [Hash]
166
+ # @param rate_limit [Float] Requests per second
145
167
  # @return [Hash] The API response
146
- def create_amazon_motors(amazon_order_id, marketplace_ids, body)
168
+ def create_amazon_motors(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
147
169
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/amazonMotors"
148
170
  params = {
149
171
  "marketplaceIds" => marketplace_ids,
150
172
  }.compact
151
173
 
152
- rate_limit(1.0).post(path, body:, params:)
174
+ meter(rate_limit).post(path, body:, params:)
153
175
  end
154
176
 
155
177
  # Sends a message to a buyer to provide details about warranty information on a purchase in their order.
156
178
  #
157
- # @param [String] amazon_order_id An Amazon order identifier. This specifies the order for which a message is
179
+ # @note This operation can make a static sandbox call.
180
+ # @param amazon_order_id [String] An Amazon order identifier. This specifies the order for which a message is
158
181
  # sent.
159
- # @param [Array<String>] marketplace_ids A marketplace identifier. This specifies the marketplace in which the
182
+ # @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
160
183
  # order was placed. Only one marketplace can be specified.
161
- # @param [Hash] body
184
+ # @param body [Hash]
185
+ # @param rate_limit [Float] Requests per second
162
186
  # @return [Hash] The API response
163
- def create_warranty(amazon_order_id, marketplace_ids, body)
187
+ def create_warranty(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
164
188
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/warranty"
165
189
  params = {
166
190
  "marketplaceIds" => marketplace_ids,
167
191
  }.compact
168
192
 
169
- rate_limit(1.0).post(path, body:, params:)
193
+ meter(rate_limit).post(path, body:, params:)
170
194
  end
171
195
 
172
196
  # Returns a response containing attributes related to an order. This includes buyer preferences.
173
197
  #
174
- # @param [String] amazon_order_id An Amazon order identifier. This specifies the order for which a message is
198
+ # @note This operation can make a static sandbox call.
199
+ # @param amazon_order_id [String] An Amazon order identifier. This specifies the order for which a message is
175
200
  # sent.
176
- # @param [Array<String>] marketplace_ids A marketplace identifier. This specifies the marketplace in which the
201
+ # @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
177
202
  # order was placed. Only one marketplace can be specified.
203
+ # @param rate_limit [Float] Requests per second
178
204
  # @return [Hash] The API response
179
- def get_attributes(amazon_order_id, marketplace_ids)
205
+ def get_attributes(amazon_order_id, marketplace_ids, rate_limit: 1.0)
180
206
  path = "/messaging/v1/orders/#{amazon_order_id}/attributes"
181
207
  params = {
182
208
  "marketplaceIds" => marketplace_ids,
183
209
  }.compact
184
210
 
185
- rate_limit(1.0).get(path, params:)
211
+ meter(rate_limit).get(path, params:)
186
212
  end
187
213
 
188
214
  # Sends a message to a buyer to share a digital access key needed to utilize digital content in their order.
189
215
  #
190
- # @param [String] amazon_order_id An Amazon order identifier. This specifies the order for which a message is
216
+ # @note This operation can make a static sandbox call.
217
+ # @param amazon_order_id [String] An Amazon order identifier. This specifies the order for which a message is
191
218
  # sent.
192
- # @param [Array<String>] marketplace_ids A marketplace identifier. This specifies the marketplace in which the
219
+ # @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
193
220
  # order was placed. Only one marketplace can be specified.
194
- # @param [Hash] body
221
+ # @param body [Hash]
222
+ # @param rate_limit [Float] Requests per second
195
223
  # @return [Hash] The API response
196
- def create_digital_access_key(amazon_order_id, marketplace_ids, body)
224
+ def create_digital_access_key(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
197
225
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/digitalAccessKey"
198
226
  params = {
199
227
  "marketplaceIds" => marketplace_ids,
200
228
  }.compact
201
229
 
202
- rate_limit(1.0).post(path, body:, params:)
230
+ meter(rate_limit).post(path, body:, params:)
203
231
  end
204
232
 
205
233
  # Sends a critical message to a buyer that an unexpected problem was encountered affecting the completion of the
206
234
  # order.
207
235
  #
208
- # @param [String] amazon_order_id An Amazon order identifier. This specifies the order for which a message is
236
+ # @note This operation can make a static sandbox call.
237
+ # @param amazon_order_id [String] An Amazon order identifier. This specifies the order for which a message is
209
238
  # sent.
210
- # @param [Array<String>] marketplace_ids A marketplace identifier. This specifies the marketplace in which the
239
+ # @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
211
240
  # order was placed. Only one marketplace can be specified.
212
- # @param [Hash] body
241
+ # @param body [Hash]
242
+ # @param rate_limit [Float] Requests per second
213
243
  # @return [Hash] The API response
214
- def create_unexpected_problem(amazon_order_id, marketplace_ids, body)
244
+ def create_unexpected_problem(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
215
245
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/unexpectedProblem"
216
246
  params = {
217
247
  "marketplaceIds" => marketplace_ids,
218
248
  }.compact
219
249
 
220
- rate_limit(1.0).post(path, body:, params:)
250
+ meter(rate_limit).post(path, body:, params:)
221
251
  end
222
252
 
223
253
  # Sends a message providing the buyer an invoice
224
254
  #
225
- # @param [String] amazon_order_id An Amazon order identifier. This specifies the order for which a message is
255
+ # @note This operation can make a static sandbox call.
256
+ # @param amazon_order_id [String] An Amazon order identifier. This specifies the order for which a message is
226
257
  # sent.
227
- # @param [Array<String>] marketplace_ids A marketplace identifier. This specifies the marketplace in which the
258
+ # @param marketplace_ids [Array<String>] A marketplace identifier. This specifies the marketplace in which the
228
259
  # order was placed. Only one marketplace can be specified.
229
- # @param [Hash] body
260
+ # @param body [Hash]
261
+ # @param rate_limit [Float] Requests per second
230
262
  # @return [Hash] The API response
231
- def send_invoice(amazon_order_id, marketplace_ids, body)
263
+ def send_invoice(amazon_order_id, marketplace_ids, body, rate_limit: nil)
232
264
  path = "/messaging/v1/orders/#{amazon_order_id}/messages/invoice"
233
265
  params = {
234
266
  "marketplaceIds" => marketplace_ids,
@@ -3,6 +3,12 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
+ class << self
7
+ def notifications_v1(...)
8
+ API::NotificationsV1.new(...)
9
+ end
10
+ end
11
+
6
12
  class API
7
13
  # Selling Partner API for Notifications
8
14
  #
@@ -16,15 +22,19 @@ module Peddler
16
22
  # subscription's information. You can use this API to get subscription information when you do not have a
17
23
  # subscription identifier.
18
24
  #
19
- # @param [String] payload_version The version of the payload object to be used in the notification.
25
+ # @note This operation can make a static sandbox call.
26
+ # @param payload_version [String] The version of the payload object to be used in the notification.
27
+ # @param rate_limit [Float] Requests per second
28
+ # @param notification_type [String] The type of notification. For more information about notification types, refer
29
+ # to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
20
30
  # @return [Hash] The API response
21
- def get_subscription(payload_version: nil)
31
+ def get_subscription(notification_type, payload_version: nil, rate_limit: 1.0)
22
32
  path = "/notifications/v1/subscriptions/#{notification_type}"
23
33
  params = {
24
34
  "payloadVersion" => payload_version,
25
35
  }.compact
26
36
 
27
- rate_limit(1.0).get(path, params:)
37
+ meter(rate_limit).get(path, params:)
28
38
  end
29
39
 
30
40
  # Creates a subscription for the specified notification type to be delivered to the specified destination. Before
@@ -32,24 +42,32 @@ module Peddler
32
42
  # where the specified notification type supports multiple payload versions, you can utilize this API to subscribe
33
43
  # to a different payload version if you already have an existing subscription for a different payload version.
34
44
  #
35
- # @param [Hash] body
45
+ # @note This operation can make a static sandbox call.
46
+ # @param body [Hash]
47
+ # @param rate_limit [Float] Requests per second
48
+ # @param notification_type [String] The type of notification. For more information about notification types, refer
49
+ # to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
36
50
  # @return [Hash] The API response
37
- def create_subscription(body)
51
+ def create_subscription(body, notification_type, rate_limit: 1.0)
38
52
  path = "/notifications/v1/subscriptions/#{notification_type}"
39
53
 
40
- rate_limit(1.0).post(path, body:)
54
+ meter(rate_limit).post(path, body:)
41
55
  end
42
56
 
43
57
  # Returns information about a subscription for the specified notification type. The `getSubscriptionById`
44
58
  # operation is grantless. For more information, refer to [Grantless
45
59
  # operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations).
46
60
  #
47
- # @param [String] subscription_id The identifier for the subscription that you want to get.
61
+ # @note This operation can make a static sandbox call.
62
+ # @param subscription_id [String] The identifier for the subscription that you want to get.
63
+ # @param rate_limit [Float] Requests per second
64
+ # @param notification_type [String] The type of notification. For more information about notification types, refer
65
+ # to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
48
66
  # @return [Hash] The API response
49
- def get_subscription_by_id(subscription_id)
67
+ def get_subscription_by_id(subscription_id, notification_type, rate_limit: 1.0)
50
68
  path = "/notifications/v1/subscriptions/#{notification_type}/#{subscription_id}"
51
69
 
52
- rate_limit(1.0).get(path)
70
+ meter(rate_limit).get(path)
53
71
  end
54
72
 
55
73
  # Deletes the subscription indicated by the subscription identifier and notification type that you specify. The
@@ -58,56 +76,69 @@ module Peddler
58
76
  # `deleteSubscriptionById` operation is grantless. For more information, refer to [Grantless
59
77
  # operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations).
60
78
  #
61
- # @param [String] subscription_id The identifier for the subscription that you want to delete.
79
+ # @note This operation can make a static sandbox call.
80
+ # @param subscription_id [String] The identifier for the subscription that you want to delete.
81
+ # @param rate_limit [Float] Requests per second
82
+ # @param notification_type [String] The type of notification. For more information about notification types, refer
83
+ # to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
62
84
  # @return [Hash] The API response
63
- def delete_subscription_by_id(subscription_id)
85
+ def delete_subscription_by_id(subscription_id, notification_type, rate_limit: 1.0)
64
86
  path = "/notifications/v1/subscriptions/#{notification_type}/#{subscription_id}"
65
87
 
66
- rate_limit(1.0).delete(path)
88
+ meter(rate_limit).delete(path)
67
89
  end
68
90
 
69
91
  # Returns information about all destinations. The `getDestinations` operation is grantless. For more information,
70
92
  # refer to [Grantless operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations).
93
+ #
94
+ # @note This operation can make a static sandbox call.
95
+ # @param rate_limit [Float] Requests per second
71
96
  # @return [Hash] The API response
72
- def get_destinations
97
+ def get_destinations(rate_limit: 1.0)
73
98
  path = "/notifications/v1/destinations"
74
99
 
75
- rate_limit(1.0).get(path)
100
+ meter(rate_limit).get(path)
76
101
  end
77
102
 
78
103
  # Creates a destination resource to receive notifications. The `createDestination` operation is grantless. For
79
104
  # more information, refer to [Grantless
80
105
  # operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations).
81
106
  #
82
- # @param [Hash] body
107
+ # @note This operation can make a static sandbox call.
108
+ # @param body [Hash]
109
+ # @param rate_limit [Float] Requests per second
83
110
  # @return [Hash] The API response
84
- def create_destination(body)
111
+ def create_destination(body, rate_limit: 1.0)
85
112
  path = "/notifications/v1/destinations"
86
113
 
87
- rate_limit(1.0).post(path, body:)
114
+ meter(rate_limit).post(path, body:)
88
115
  end
89
116
 
90
117
  # Returns information about the destination that you specify. The `getDestination` operation is grantless. For
91
118
  # more information, refer to [Grantless
92
119
  # operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations).
93
120
  #
94
- # @param [String] destination_id The identifier generated when you created the destination.
121
+ # @note This operation can make a static sandbox call.
122
+ # @param destination_id [String] The identifier generated when you created the destination.
123
+ # @param rate_limit [Float] Requests per second
95
124
  # @return [Hash] The API response
96
- def get_destination(destination_id)
125
+ def get_destination(destination_id, rate_limit: 1.0)
97
126
  path = "/notifications/v1/destinations/#{destination_id}"
98
127
 
99
- rate_limit(1.0).get(path)
128
+ meter(rate_limit).get(path)
100
129
  end
101
130
 
102
131
  # Deletes the destination that you specify. The `deleteDestination` operation is grantless. For more information,
103
132
  # refer to [Grantless operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations).
104
133
  #
105
- # @param [String] destination_id The identifier for the destination that you want to delete.
134
+ # @note This operation can make a static sandbox call.
135
+ # @param destination_id [String] The identifier for the destination that you want to delete.
136
+ # @param rate_limit [Float] Requests per second
106
137
  # @return [Hash] The API response
107
- def delete_destination(destination_id)
138
+ def delete_destination(destination_id, rate_limit: 1.0)
108
139
  path = "/notifications/v1/destinations/#{destination_id}"
109
140
 
110
- rate_limit(1.0).delete(path)
141
+ meter(rate_limit).delete(path)
111
142
  end
112
143
  end
113
144
  end