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 aplus_content_2020_11_01(...)
8
+ API::AplusContent20201101.new(...)
9
+ end
10
+ end
11
+
6
12
  class API
7
13
  # Selling Partner API for A+ Content Management
8
14
  #
@@ -15,92 +21,108 @@ module Peddler
15
21
  # metadata of the A+ Content documents. Call the getContentDocument operation to get the actual contents of the A+
16
22
  # Content documents.
17
23
  #
18
- # @param [String] marketplace_id The identifier for the marketplace where the A+ Content is published.
19
- # @param [String] page_token A page token from the nextPageToken response element returned by your previous call
24
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
25
+ # @param page_token [String] A page token from the nextPageToken response element returned by your previous call
20
26
  # to this operation. nextPageToken is returned when the results of a call exceed the page size. To get the next
21
27
  # page of results, call the operation and include pageToken as the only parameter. Specifying pageToken with any
22
28
  # other parameter will cause the request to fail. When no nextPageToken value is returned there are no more
23
29
  # pages to return. A pageToken value is not usable across different operations.
30
+ # @param rate_limit [Float] Requests per second
24
31
  # @return [Hash] The API response
25
- def search_content_documents(marketplace_id, page_token: nil)
32
+ def search_content_documents(marketplace_id, page_token: nil, rate_limit: 10.0)
33
+ cannot_sandbox!
34
+
26
35
  path = "/aplus/2020-11-01/contentDocuments"
27
36
  params = {
28
37
  "marketplaceId" => marketplace_id,
29
38
  "pageToken" => page_token,
30
39
  }.compact
31
40
 
32
- rate_limit(10.0).get(path, params:)
41
+ meter(rate_limit).get(path, params:)
33
42
  end
34
43
 
35
44
  # Creates a new A+ Content document.
36
45
  #
37
- # @param [String] marketplace_id The identifier for the marketplace where the A+ Content is published.
38
- # @param [Hash] post_content_document_request The content document request details.
46
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
47
+ # @param post_content_document_request [Hash] The content document request details.
48
+ # @param rate_limit [Float] Requests per second
39
49
  # @return [Hash] The API response
40
- def create_content_document(marketplace_id, post_content_document_request)
50
+ def create_content_document(marketplace_id, post_content_document_request, rate_limit: 10.0)
51
+ cannot_sandbox!
52
+
41
53
  path = "/aplus/2020-11-01/contentDocuments"
42
54
  body = post_content_document_request
43
55
  params = {
44
56
  "marketplaceId" => marketplace_id,
45
57
  }.compact
46
58
 
47
- rate_limit(10.0).post(path, body:, params:)
59
+ meter(rate_limit).post(path, body:, params:)
48
60
  end
49
61
 
50
62
  # Returns an A+ Content document, if available.
51
63
  #
52
- # @param [String] content_reference_key The unique reference key for the A+ Content document. A content reference
64
+ # @param content_reference_key [String] The unique reference key for the A+ Content document. A content reference
53
65
  # key cannot form a permalink and may change in the future. A content reference key is not guaranteed to match
54
66
  # any A+ Content identifier.
55
- # @param [String] marketplace_id The identifier for the marketplace where the A+ Content is published.
56
- # @param [Array<String>] included_data_set The set of A+ Content data types to include in the response.
67
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
68
+ # @param included_data_set [Array<String>] The set of A+ Content data types to include in the response.
69
+ # @param rate_limit [Float] Requests per second
57
70
  # @return [Hash] The API response
58
- def get_content_document(content_reference_key, marketplace_id, included_data_set)
71
+ def get_content_document(content_reference_key, marketplace_id, included_data_set, rate_limit: 10.0)
72
+ cannot_sandbox!
73
+
59
74
  path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}"
60
75
  params = {
61
76
  "marketplaceId" => marketplace_id,
62
77
  "includedDataSet" => included_data_set,
63
78
  }.compact
64
79
 
65
- rate_limit(10.0).get(path, params:)
80
+ meter(rate_limit).get(path, params:)
66
81
  end
67
82
 
68
83
  # Updates an existing A+ Content document.
69
84
  #
70
- # @param [String] content_reference_key The unique reference key for the A+ Content document. A content reference
85
+ # @param content_reference_key [String] The unique reference key for the A+ Content document. A content reference
71
86
  # key cannot form a permalink and may change in the future. A content reference key is not guaranteed to match
72
87
  # any A+ Content identifier.
73
- # @param [String] marketplace_id The identifier for the marketplace where the A+ Content is published.
74
- # @param [Hash] post_content_document_request The content document request details.
88
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
89
+ # @param post_content_document_request [Hash] The content document request details.
90
+ # @param rate_limit [Float] Requests per second
75
91
  # @return [Hash] The API response
76
- def update_content_document(content_reference_key, marketplace_id, post_content_document_request)
92
+ def update_content_document(content_reference_key, marketplace_id, post_content_document_request,
93
+ rate_limit: 10.0)
94
+ cannot_sandbox!
95
+
77
96
  path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}"
78
97
  body = post_content_document_request
79
98
  params = {
80
99
  "marketplaceId" => marketplace_id,
81
100
  }.compact
82
101
 
83
- rate_limit(10.0).post(path, body:, params:)
102
+ meter(rate_limit).post(path, body:, params:)
84
103
  end
85
104
 
86
105
  # Returns a list of ASINs related to the specified A+ Content document, if available. If you do not include the
87
106
  # asinSet parameter, the operation returns all ASINs related to the content document.
88
107
  #
89
- # @param [String] content_reference_key The unique reference key for the A+ Content document. A content reference
108
+ # @param content_reference_key [String] The unique reference key for the A+ Content document. A content reference
90
109
  # key cannot form a permalink and may change in the future. A content reference key is not guaranteed to match
91
110
  # any A+ Content identifier.
92
- # @param [String] marketplace_id The identifier for the marketplace where the A+ Content is published.
93
- # @param [Array<String>] included_data_set The set of A+ Content data types to include in the response. If you do
111
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
112
+ # @param included_data_set [Array<String>] The set of A+ Content data types to include in the response. If you do
94
113
  # not include this parameter, the operation returns the related ASINs without metadata.
95
- # @param [Array<String>] asin_set The set of ASINs.
96
- # @param [String] page_token A page token from the nextPageToken response element returned by your previous call
114
+ # @param asin_set [Array<String>] The set of ASINs.
115
+ # @param page_token [String] A page token from the nextPageToken response element returned by your previous call
97
116
  # to this operation. nextPageToken is returned when the results of a call exceed the page size. To get the next
98
117
  # page of results, call the operation and include pageToken as the only parameter. Specifying pageToken with any
99
118
  # other parameter will cause the request to fail. When no nextPageToken value is returned there are no more
100
119
  # pages to return. A pageToken value is not usable across different operations.
120
+ # @param rate_limit [Float] Requests per second
101
121
  # @return [Hash] The API response
102
122
  def list_content_document_asin_relations(content_reference_key, marketplace_id, included_data_set: nil,
103
- asin_set: nil, page_token: nil)
123
+ asin_set: nil, page_token: nil, rate_limit: 10.0)
124
+ cannot_sandbox!
125
+
104
126
  path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}/asins"
105
127
  params = {
106
128
  "marketplaceId" => marketplace_id,
@@ -109,37 +131,44 @@ module Peddler
109
131
  "pageToken" => page_token,
110
132
  }.compact
111
133
 
112
- rate_limit(10.0).get(path, params:)
134
+ meter(rate_limit).get(path, params:)
113
135
  end
114
136
 
115
137
  # Replaces all ASINs related to the specified A+ Content document, if available. This may add or remove ASINs,
116
138
  # depending on the current set of related ASINs. Removing an ASIN has the side effect of suspending the content
117
139
  # document from that ASIN.
118
140
  #
119
- # @param [String] content_reference_key The unique reference key for the A+ Content document. A content reference
141
+ # @param content_reference_key [String] The unique reference key for the A+ Content document. A content reference
120
142
  # key cannot form a permalink and may change in the future. A content reference key is not guaranteed to match
121
143
  # any A+ content identifier.
122
- # @param [String] marketplace_id The identifier for the marketplace where the A+ Content is published.
123
- # @param [Hash] post_content_document_asin_relations_request The content document ASIN relations request details.
144
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
145
+ # @param post_content_document_asin_relations_request [Hash] The content document ASIN relations request details.
146
+ # @param rate_limit [Float] Requests per second
124
147
  # @return [Hash] The API response
125
148
  def post_content_document_asin_relations(content_reference_key, marketplace_id,
126
- post_content_document_asin_relations_request)
149
+ post_content_document_asin_relations_request, rate_limit: 10.0)
150
+ cannot_sandbox!
151
+
127
152
  path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}/asins"
128
153
  body = post_content_document_asin_relations_request
129
154
  params = {
130
155
  "marketplaceId" => marketplace_id,
131
156
  }.compact
132
157
 
133
- rate_limit(10.0).post(path, body:, params:)
158
+ meter(rate_limit).post(path, body:, params:)
134
159
  end
135
160
 
136
161
  # Checks if the A+ Content document is valid for use on a set of ASINs.
137
162
  #
138
- # @param [String] marketplace_id The identifier for the marketplace where the A+ Content is published.
139
- # @param [Array<String>] asin_set The set of ASINs.
140
- # @param [Hash] post_content_document_request The content document request details.
163
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
164
+ # @param asin_set [Array<String>] The set of ASINs.
165
+ # @param post_content_document_request [Hash] The content document request details.
166
+ # @param rate_limit [Float] Requests per second
141
167
  # @return [Hash] The API response
142
- def validate_content_document_asin_relations(marketplace_id, post_content_document_request, asin_set: nil)
168
+ def validate_content_document_asin_relations(marketplace_id, post_content_document_request, asin_set: nil,
169
+ rate_limit: 10.0)
170
+ cannot_sandbox!
171
+
143
172
  path = "/aplus/2020-11-01/contentAsinValidations"
144
173
  body = post_content_document_request
145
174
  params = {
@@ -147,20 +176,23 @@ module Peddler
147
176
  "asinSet" => asin_set,
148
177
  }.compact
149
178
 
150
- rate_limit(10.0).post(path, body:, params:)
179
+ meter(rate_limit).post(path, body:, params:)
151
180
  end
152
181
 
153
182
  # Searches for A+ Content publishing records, if available.
154
183
  #
155
- # @param [String] marketplace_id The identifier for the marketplace where the A+ Content is published.
156
- # @param [String] asin The Amazon Standard Identification Number (ASIN).
157
- # @param [String] page_token A page token from the nextPageToken response element returned by your previous call
184
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
185
+ # @param asin [String] The Amazon Standard Identification Number (ASIN).
186
+ # @param page_token [String] A page token from the nextPageToken response element returned by your previous call
158
187
  # to this operation. nextPageToken is returned when the results of a call exceed the page size. To get the next
159
188
  # page of results, call the operation and include pageToken as the only parameter. Specifying pageToken with any
160
189
  # other parameter will cause the request to fail. When no nextPageToken value is returned there are no more
161
190
  # pages to return. A pageToken value is not usable across different operations.
191
+ # @param rate_limit [Float] Requests per second
162
192
  # @return [Hash] The API response
163
- def search_content_publish_records(marketplace_id, asin, page_token: nil)
193
+ def search_content_publish_records(marketplace_id, asin, page_token: nil, rate_limit: 10.0)
194
+ cannot_sandbox!
195
+
164
196
  path = "/aplus/2020-11-01/contentPublishRecords"
165
197
  params = {
166
198
  "marketplaceId" => marketplace_id,
@@ -168,40 +200,46 @@ module Peddler
168
200
  "pageToken" => page_token,
169
201
  }.compact
170
202
 
171
- rate_limit(10.0).get(path, params:)
203
+ meter(rate_limit).get(path, params:)
172
204
  end
173
205
 
174
206
  # Submits an A+ Content document for review, approval, and publishing.
175
207
  #
176
- # @param [String] content_reference_key The unique reference key for the A+ Content document. A content reference
208
+ # @param content_reference_key [String] The unique reference key for the A+ Content document. A content reference
177
209
  # key cannot form a permalink and may change in the future. A content reference key is not guaranteed to match
178
210
  # any A+ content identifier.
179
- # @param [String] marketplace_id The identifier for the marketplace where the A+ Content is published.
211
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
212
+ # @param rate_limit [Float] Requests per second
180
213
  # @return [Hash] The API response
181
- def post_content_document_approval_submission(content_reference_key, marketplace_id)
214
+ def post_content_document_approval_submission(content_reference_key, marketplace_id, rate_limit: 10.0)
215
+ cannot_sandbox!
216
+
182
217
  path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}/approvalSubmissions"
183
218
  params = {
184
219
  "marketplaceId" => marketplace_id,
185
220
  }.compact
186
221
 
187
- rate_limit(10.0).post(path, params:)
222
+ meter(rate_limit).post(path, params:)
188
223
  end
189
224
 
190
225
  # Submits a request to suspend visible A+ Content. This neither deletes the content document nor the ASIN
191
226
  # relations.
192
227
  #
193
- # @param [String] content_reference_key The unique reference key for the A+ Content document. A content reference
228
+ # @param content_reference_key [String] The unique reference key for the A+ Content document. A content reference
194
229
  # key cannot form a permalink and may change in the future. A content reference key is not guaranteed to match
195
230
  # any A+ content identifier.
196
- # @param [String] marketplace_id The identifier for the marketplace where the A+ Content is published.
231
+ # @param marketplace_id [String] The identifier for the marketplace where the A+ Content is published.
232
+ # @param rate_limit [Float] Requests per second
197
233
  # @return [Hash] The API response
198
- def post_content_document_suspend_submission(content_reference_key, marketplace_id)
234
+ def post_content_document_suspend_submission(content_reference_key, marketplace_id, rate_limit: 10.0)
235
+ cannot_sandbox!
236
+
199
237
  path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}/suspendSubmissions"
200
238
  params = {
201
239
  "marketplaceId" => marketplace_id,
202
240
  }.compact
203
241
 
204
- rate_limit(10.0).post(path, params:)
242
+ meter(rate_limit).post(path, params:)
205
243
  end
206
244
  end
207
245
  end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "peddler/api"
4
+
5
+ module Peddler
6
+ class << self
7
+ def application_integrations_2024_04_01(...)
8
+ API::ApplicationIntegrations20240401.new(...)
9
+ end
10
+ end
11
+
12
+ class API
13
+ # The Selling Partner API for third party application integrations.
14
+ #
15
+ # With the AppIntegrations API v2024-04-01, you can send notifications to Amazon Selling Partners and display the
16
+ # notifications in Seller Central.
17
+ class ApplicationIntegrations20240401 < API
18
+ # Create a notification for sellers in Seller Central.
19
+ #
20
+ # @note This operation can make a static sandbox call.
21
+ # @param body [Hash] The request body for the `createNotification` operation.
22
+ # @param rate_limit [Float] Requests per second
23
+ # @return [Hash] The API response
24
+ def create_notification(body, rate_limit: 1.0)
25
+ path = "/appIntegrations/2024-04-01/notifications"
26
+
27
+ meter(rate_limit).post(path, body:)
28
+ end
29
+
30
+ # Remove your application's notifications from the Appstore notifications dashboard.
31
+ #
32
+ # @note This operation can make a static sandbox call.
33
+ # @param body [Hash] The request body for the `deleteNotifications` operation.
34
+ # @param rate_limit [Float] Requests per second
35
+ # @return [Hash] The API response
36
+ def delete_notifications(body, rate_limit: 1.0)
37
+ path = "/appIntegrations/2024-04-01/notifications/deletion"
38
+
39
+ meter(rate_limit).post(path, body:)
40
+ end
41
+
42
+ # Records the seller's response to a notification.
43
+ #
44
+ # @note This operation can make a static sandbox call.
45
+ # @param notification_id [String] A `notificationId` uniquely identifies a notification.
46
+ # @param body [Hash] The request body for the `recordActionFeedback` operation.
47
+ # @param rate_limit [Float] Requests per second
48
+ # @return [Hash] The API response
49
+ def record_action_feedback(notification_id, body, rate_limit: 1.0)
50
+ path = "/appIntegrations/2024-04-01/notifications/#{notification_id}/feedback"
51
+
52
+ meter(rate_limit).post(path, body:)
53
+ end
54
+ end
55
+ end
56
+ end
@@ -3,6 +3,12 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
+ class << self
7
+ def application_management_2023_11_30(...)
8
+ API::ApplicationManagement20231130.new(...)
9
+ end
10
+ end
11
+
6
12
  class API
7
13
  # Selling Partner API for Application Management
8
14
  #
@@ -14,11 +20,15 @@ module Peddler
14
20
  # generated and sent to the developer-registered queue. For more information, refer to [Rotate your application
15
21
  # client
16
22
  # secret](https://developer-docs.amazon.com/sp-api/v0/docs/application-management-api-v2023-11-30-use-case-guide#tutorial-rotate-your-applications-client-secret).
23
+ #
24
+ # @param rate_limit [Float] Requests per second
17
25
  # @return [Hash] The API response
18
- def rotate_application_client_secret
26
+ def rotate_application_client_secret(rate_limit: 0.0167)
27
+ cannot_sandbox!
28
+
19
29
  path = "/applications/2023-11-30/clientSecret"
20
30
 
21
- rate_limit(0.0167).post(path)
31
+ meter(rate_limit).post(path)
22
32
  end
23
33
  end
24
34
  end
@@ -3,32 +3,41 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
+ class << self
7
+ def catalog_items_2020_12_01(...)
8
+ API::CatalogItems20201201.new(...)
9
+ end
10
+ end
11
+
6
12
  class API
7
13
  # Selling Partner API for Catalog Items
8
14
  #
9
15
  # The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon
10
- # catalog. For more information, see the [Catalog Items API Use Case
11
- # Guide](doc:catalog-items-api-v2020-12-01-use-case-guide).
16
+ # catalog. For more information, see the
17
+ # {https://developer-docs.amazon.com/sp-api/docs/catalog-items-api-v2020-12-01-use-case-guide Catalog Items API Use
18
+ # Case Guide}.
12
19
  class CatalogItems20201201 < API
13
20
  # Search for and return a list of Amazon catalog items and associated information.
14
21
  #
15
- # @param [Array<String>] keywords A comma-delimited list of words or item identifiers to search the Amazon catalog
22
+ # @note This operation can make a static sandbox call.
23
+ # @param keywords [Array<String>] A comma-delimited list of words or item identifiers to search the Amazon catalog
16
24
  # for.
17
- # @param [Array<String>] marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request.
18
- # @param [Array<String>] included_data A comma-delimited list of data sets to include in the response. Default:
25
+ # @param marketplace_ids [Array<String>] A comma-delimited list of Amazon marketplace identifiers for the request.
26
+ # @param included_data [Array<String>] A comma-delimited list of data sets to include in the response. Default:
19
27
  # summaries.
20
- # @param [Array<String>] brand_names A comma-delimited list of brand names to limit the search to.
21
- # @param [Array<String>] classification_ids A comma-delimited list of classification identifiers to limit the
28
+ # @param brand_names [Array<String>] A comma-delimited list of brand names to limit the search to.
29
+ # @param classification_ids [Array<String>] A comma-delimited list of classification identifiers to limit the
22
30
  # search to.
23
- # @param [Integer] page_size Number of results to be returned per page.
24
- # @param [String] page_token A token to fetch a certain page when there are multiple pages worth of results.
25
- # @param [String] keywords_locale The language the keywords are provided in. Defaults to the primary locale of the
31
+ # @param page_size [Integer] Number of results to be returned per page.
32
+ # @param page_token [String] A token to fetch a certain page when there are multiple pages worth of results.
33
+ # @param keywords_locale [String] The language the keywords are provided in. Defaults to the primary locale of the
26
34
  # marketplace.
27
- # @param [String] locale Locale for retrieving localized summaries. Defaults to the primary locale of the
35
+ # @param locale [String] Locale for retrieving localized summaries. Defaults to the primary locale of the
28
36
  # marketplace.
37
+ # @param rate_limit [Float] Requests per second
29
38
  # @return [Hash] The API response
30
- def search_catalog_items(keywords, marketplace_ids, included_data: nil, brand_names: nil,
31
- classification_ids: nil, page_size: nil, page_token: nil, keywords_locale: nil, locale: nil)
39
+ def search_catalog_items(keywords, marketplace_ids, included_data: "summaries", brand_names: nil,
40
+ classification_ids: nil, page_size: 10, page_token: nil, keywords_locale: nil, locale: nil, rate_limit: 2.0)
32
41
  path = "/catalog/2020-12-01/items"
33
42
  params = {
34
43
  "keywords" => keywords,
@@ -42,20 +51,22 @@ module Peddler
42
51
  "locale" => locale,
43
52
  }.compact
44
53
 
45
- rate_limit(2.0).get(path, params:)
54
+ meter(rate_limit).get(path, params:)
46
55
  end
47
56
 
48
57
  # Retrieves details for an item in the Amazon catalog.
49
58
  #
50
- # @param [String] asin The Amazon Standard Identification Number (ASIN) of the item.
51
- # @param [Array<String>] marketplace_ids A comma-delimited list of Amazon marketplace identifiers. Data sets in
59
+ # @note This operation can make a static sandbox call.
60
+ # @param asin [String] The Amazon Standard Identification Number (ASIN) of the item.
61
+ # @param marketplace_ids [Array<String>] A comma-delimited list of Amazon marketplace identifiers. Data sets in
52
62
  # the response contain data only for the specified marketplaces.
53
- # @param [Array<String>] included_data A comma-delimited list of data sets to include in the response. Default:
63
+ # @param included_data [Array<String>] A comma-delimited list of data sets to include in the response. Default:
54
64
  # summaries.
55
- # @param [String] locale Locale for retrieving localized summaries. Defaults to the primary locale of the
65
+ # @param locale [String] Locale for retrieving localized summaries. Defaults to the primary locale of the
56
66
  # marketplace.
67
+ # @param rate_limit [Float] Requests per second
57
68
  # @return [Hash] The API response
58
- def get_catalog_item(asin, marketplace_ids, included_data: nil, locale: nil)
69
+ def get_catalog_item(asin, marketplace_ids, included_data: "summaries", locale: nil, rate_limit: 2.0)
59
70
  path = "/catalog/2020-12-01/items/#{asin}"
60
71
  params = {
61
72
  "marketplaceIds" => marketplace_ids,
@@ -63,7 +74,7 @@ module Peddler
63
74
  "locale" => locale,
64
75
  }.compact
65
76
 
66
- rate_limit(2.0).get(path, params:)
77
+ meter(rate_limit).get(path, params:)
67
78
  end
68
79
  end
69
80
  end
@@ -3,42 +3,50 @@
3
3
  require "peddler/api"
4
4
 
5
5
  module Peddler
6
+ class << self
7
+ def catalog_items_2022_04_01(...)
8
+ API::CatalogItems20220401.new(...)
9
+ end
10
+ end
11
+
6
12
  class API
7
13
  # Selling Partner API for Catalog Items
8
14
  #
9
15
  # The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon
10
- # catalog. For more information, refer to the [Catalog Items API Use Case
11
- # Guide](doc:catalog-items-api-v2022-04-01-use-case-guide).
16
+ # catalog. For more information, refer to the
17
+ # {https://developer-docs.amazon.com/sp-api/docs/catalog-items-api-v2022-04-01-use-case-guide Catalog Items API Use
18
+ # Case Guide}.
12
19
  class CatalogItems20220401 < API
13
20
  # Search for and return a list of Amazon catalog items and associated information either by identifier or by
14
21
  # keywords.
15
22
  #
16
- # @param [Array<String>] identifiers A comma-delimited list of product identifiers to search the Amazon catalog
23
+ # @note This operation can make a static sandbox call.
24
+ # @param identifiers [Array<String>] A comma-delimited list of product identifiers to search the Amazon catalog
17
25
  # for. **Note:** Cannot be used with `keywords`.
18
- # @param [String] identifiers_type Type of product identifiers to search the Amazon catalog for. **Note:**
26
+ # @param identifiers_type [String] Type of product identifiers to search the Amazon catalog for. **Note:**
19
27
  # Required when `identifiers` are provided.
20
- # @param [Array<String>] marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request.
21
- # @param [Array<String>] included_data A comma-delimited list of data sets to include in the response. Default:
28
+ # @param marketplace_ids [Array<String>] A comma-delimited list of Amazon marketplace identifiers for the request.
29
+ # @param included_data [Array<String>] A comma-delimited list of data sets to include in the response. Default:
22
30
  # `summaries`.
23
- # @param [String] locale Locale for retrieving localized summaries. Defaults to the primary locale of the
31
+ # @param locale [String] Locale for retrieving localized summaries. Defaults to the primary locale of the
24
32
  # marketplace.
25
- # @param [String] seller_id A selling partner identifier, such as a seller account or vendor code. **Note:**
33
+ # @param seller_id [String] A selling partner identifier, such as a seller account or vendor code. **Note:**
26
34
  # Required when `identifiersType` is `SKU`.
27
- # @param [Array<String>] keywords A comma-delimited list of words to search the Amazon catalog for. **Note:**
35
+ # @param keywords [Array<String>] A comma-delimited list of words to search the Amazon catalog for. **Note:**
28
36
  # Cannot be used with `identifiers`.
29
- # @param [Array<String>] brand_names A comma-delimited list of brand names to limit the search for
37
+ # @param brand_names [Array<String>] A comma-delimited list of brand names to limit the search for
30
38
  # `keywords`-based queries. **Note:** Cannot be used with `identifiers`.
31
- # @param [Array<String>] classification_ids A comma-delimited list of classification identifiers to limit the
39
+ # @param classification_ids [Array<String>] A comma-delimited list of classification identifiers to limit the
32
40
  # search for `keywords`-based queries. **Note:** Cannot be used with `identifiers`.
33
- # @param [Integer] page_size Number of results to be returned per page.
34
- # @param [String] page_token A token to fetch a certain page when there are multiple pages worth of results.
35
- # @param [String] keywords_locale The language of the keywords provided for `keywords`-based queries. Defaults to
41
+ # @param page_size [Integer] Number of results to be returned per page.
42
+ # @param page_token [String] A token to fetch a certain page when there are multiple pages worth of results.
43
+ # @param keywords_locale [String] The language of the keywords provided for `keywords`-based queries. Defaults to
36
44
  # the primary locale of the marketplace. **Note:** Cannot be used with `identifiers`.
45
+ # @param rate_limit [Float] Requests per second
37
46
  # @return [Hash] The API response
38
- def search_catalog_items(
39
- marketplace_ids, identifiers: nil, identifiers_type: nil, included_data: nil, locale: nil, seller_id: nil,
40
- keywords: nil, brand_names: nil, classification_ids: nil, page_size: nil, page_token: nil, keywords_locale: nil
41
- )
47
+ def search_catalog_items(marketplace_ids, identifiers: nil, identifiers_type: nil, included_data: ["summaries"],
48
+ locale: nil, seller_id: nil, keywords: nil, brand_names: nil, classification_ids: nil, page_size: 10,
49
+ page_token: nil, keywords_locale: nil, rate_limit: 2.0)
42
50
  path = "/catalog/2022-04-01/items"
43
51
  params = {
44
52
  "identifiers" => identifiers,
@@ -55,20 +63,22 @@ module Peddler
55
63
  "keywordsLocale" => keywords_locale,
56
64
  }.compact
57
65
 
58
- rate_limit(2.0).get(path, params:)
66
+ meter(rate_limit).get(path, params:)
59
67
  end
60
68
 
61
69
  # Retrieves details for an item in the Amazon catalog.
62
70
  #
63
- # @param [String] asin The Amazon Standard Identification Number (ASIN) of the item.
64
- # @param [Array<String>] marketplace_ids A comma-delimited list of Amazon marketplace identifiers. Data sets in
71
+ # @note This operation can make a static sandbox call.
72
+ # @param asin [String] The Amazon Standard Identification Number (ASIN) of the item.
73
+ # @param marketplace_ids [Array<String>] A comma-delimited list of Amazon marketplace identifiers. Data sets in
65
74
  # the response contain data only for the specified marketplaces.
66
- # @param [Array<String>] included_data A comma-delimited list of data sets to include in the response. Default:
75
+ # @param included_data [Array<String>] A comma-delimited list of data sets to include in the response. Default:
67
76
  # `summaries`.
68
- # @param [String] locale Locale for retrieving localized summaries. Defaults to the primary locale of the
77
+ # @param locale [String] Locale for retrieving localized summaries. Defaults to the primary locale of the
69
78
  # marketplace.
79
+ # @param rate_limit [Float] Requests per second
70
80
  # @return [Hash] The API response
71
- def get_catalog_item(asin, marketplace_ids, included_data: nil, locale: nil)
81
+ def get_catalog_item(asin, marketplace_ids, included_data: ["summaries"], locale: nil, rate_limit: 2.0)
72
82
  path = "/catalog/2022-04-01/items/#{asin}"
73
83
  params = {
74
84
  "marketplaceIds" => marketplace_ids,
@@ -76,7 +86,7 @@ module Peddler
76
86
  "locale" => locale,
77
87
  }.compact
78
88
 
79
- rate_limit(2.0).get(path, params:)
89
+ meter(rate_limit).get(path, params:)
80
90
  end
81
91
  end
82
92
  end