peddler 2.4.5 → 3.0.0

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