peddler 4.3.0 → 4.4.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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +328 -109
  3. data/lib/peddler/api.rb +11 -0
  4. data/lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb +7 -7
  5. data/lib/peddler/apis/aplus_content_2020_11_01.rb +10 -10
  6. data/lib/peddler/apis/application_integrations_2024_04_01.rb +1 -1
  7. data/lib/peddler/apis/catalog_items_2020_12_01.rb +8 -8
  8. data/lib/peddler/apis/catalog_items_2022_04_01.rb +9 -9
  9. data/lib/peddler/apis/data_kiosk_2023_11_15.rb +4 -4
  10. data/lib/peddler/apis/fba_inbound_eligibility_v1.rb +1 -1
  11. data/lib/peddler/apis/fba_inventory_v1.rb +3 -3
  12. data/lib/peddler/apis/feeds_2021_06_30.rb +6 -6
  13. data/lib/peddler/apis/finances_2024_06_01.rb +1 -1
  14. data/lib/peddler/apis/finances_v0.rb +2 -2
  15. data/lib/peddler/apis/fulfillment_inbound_2024_03_20.rb +40 -40
  16. data/lib/peddler/apis/fulfillment_inbound_v0.rb +8 -8
  17. data/lib/peddler/apis/fulfillment_outbound_2020_07_01.rb +7 -7
  18. data/lib/peddler/apis/invoices_2024_06_19.rb +4 -4
  19. data/lib/peddler/apis/listings_items_2020_09_01.rb +6 -6
  20. data/lib/peddler/apis/listings_items_2021_08_01.rb +20 -26
  21. data/lib/peddler/apis/listings_restrictions_2021_08_01.rb +1 -1
  22. data/lib/peddler/apis/merchant_fulfillment_v0.rb +2 -2
  23. data/lib/peddler/apis/messaging_v1.rb +26 -26
  24. data/lib/peddler/apis/notifications_v1.rb +6 -6
  25. data/lib/peddler/apis/orders_v0.rb +16 -16
  26. data/lib/peddler/apis/product_fees_v0.rb +2 -2
  27. data/lib/peddler/apis/product_pricing_v0.rb +6 -6
  28. data/lib/peddler/apis/product_type_definitions_2020_09_01.rb +4 -4
  29. data/lib/peddler/apis/reports_2021_06_30.rb +9 -9
  30. data/lib/peddler/apis/sales_v1.rb +7 -2
  31. data/lib/peddler/apis/seller_wallet_2024_03_01.rb +5 -5
  32. data/lib/peddler/apis/services_v1.rb +27 -27
  33. data/lib/peddler/apis/shipment_invoicing_v0.rb +3 -3
  34. data/lib/peddler/apis/shipping_v1.rb +5 -5
  35. data/lib/peddler/apis/shipping_v2.rb +6 -6
  36. data/lib/peddler/apis/solicitations_v1.rb +4 -4
  37. data/lib/peddler/apis/supply_sources_2020_07_01.rb +4 -4
  38. data/lib/peddler/apis/uploads_2020_11_01.rb +2 -2
  39. data/lib/peddler/apis/vendor_direct_fulfillment_inventory_v1.rb +1 -1
  40. data/lib/peddler/apis/vendor_direct_fulfillment_orders_2021_12_28.rb +1 -1
  41. data/lib/peddler/apis/vendor_direct_fulfillment_orders_v1.rb +1 -1
  42. data/lib/peddler/apis/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +1 -1
  43. data/lib/peddler/apis/vendor_direct_fulfillment_shipping_2021_12_28.rb +4 -4
  44. data/lib/peddler/apis/vendor_direct_fulfillment_shipping_v1.rb +3 -3
  45. data/lib/peddler/apis/vendor_direct_fulfillment_transactions_2021_12_28.rb +1 -1
  46. data/lib/peddler/apis/vendor_direct_fulfillment_transactions_v1.rb +1 -1
  47. data/lib/peddler/apis/vendor_orders_v1.rb +1 -1
  48. data/lib/peddler/apis/vendor_transaction_status_v1.rb +1 -1
  49. data/lib/peddler/error.rb +16 -4
  50. data/lib/peddler/token.rb +6 -11
  51. data/lib/peddler/version.rb +1 -1
  52. data/lib/peddler.rb +51 -0
  53. metadata +1 -3
  54. data/lib/peddler/parsers/openapi_parser_generator.rb +0 -550
  55. data/lib/peddler/parsers/smart_parser.rb +0 -199
@@ -72,10 +72,10 @@ module Peddler
72
72
  def get_content_document(content_reference_key, marketplace_id, included_data_set, rate_limit: 10.0)
73
73
  cannot_sandbox!
74
74
 
75
- path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}"
75
+ path = "/aplus/2020-11-01/contentDocuments/#{percent_encode(content_reference_key)}"
76
76
  params = {
77
77
  "marketplaceId" => marketplace_id,
78
- "includedDataSet" => included_data_set,
78
+ "includedDataSet" => stringify_array(included_data_set),
79
79
  }.compact
80
80
 
81
81
  meter(rate_limit).get(path, params:)
@@ -96,7 +96,7 @@ module Peddler
96
96
  rate_limit: 10.0)
97
97
  cannot_sandbox!
98
98
 
99
- path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}"
99
+ path = "/aplus/2020-11-01/contentDocuments/#{percent_encode(content_reference_key)}"
100
100
  body = post_content_document_request
101
101
  params = {
102
102
  "marketplaceId" => marketplace_id,
@@ -125,11 +125,11 @@ module Peddler
125
125
  asin_set: nil, page_token: nil, rate_limit: 10.0)
126
126
  cannot_sandbox!
127
127
 
128
- path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}/asins"
128
+ path = "/aplus/2020-11-01/contentDocuments/#{percent_encode(content_reference_key)}/asins"
129
129
  params = {
130
130
  "marketplaceId" => marketplace_id,
131
- "includedDataSet" => included_data_set,
132
- "asinSet" => asin_set,
131
+ "includedDataSet" => stringify_array(included_data_set),
132
+ "asinSet" => stringify_array(asin_set),
133
133
  "pageToken" => page_token,
134
134
  }.compact
135
135
 
@@ -154,7 +154,7 @@ module Peddler
154
154
  post_content_document_asin_relations_request, rate_limit: 10.0)
155
155
  cannot_sandbox!
156
156
 
157
- path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}/asins"
157
+ path = "/aplus/2020-11-01/contentDocuments/#{percent_encode(content_reference_key)}/asins"
158
158
  body = post_content_document_asin_relations_request
159
159
  params = {
160
160
  "marketplaceId" => marketplace_id,
@@ -180,7 +180,7 @@ module Peddler
180
180
  body = post_content_document_request
181
181
  params = {
182
182
  "marketplaceId" => marketplace_id,
183
- "asinSet" => asin_set,
183
+ "asinSet" => stringify_array(asin_set),
184
184
  }.compact
185
185
 
186
186
  meter(rate_limit).post(path, body:, params:)
@@ -223,7 +223,7 @@ module Peddler
223
223
  def post_content_document_approval_submission(content_reference_key, marketplace_id, rate_limit: 10.0)
224
224
  cannot_sandbox!
225
225
 
226
- path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}/approvalSubmissions"
226
+ path = "/aplus/2020-11-01/contentDocuments/#{percent_encode(content_reference_key)}/approvalSubmissions"
227
227
  params = {
228
228
  "marketplaceId" => marketplace_id,
229
229
  }.compact
@@ -244,7 +244,7 @@ module Peddler
244
244
  def post_content_document_suspend_submission(content_reference_key, marketplace_id, rate_limit: 10.0)
245
245
  cannot_sandbox!
246
246
 
247
- path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}/suspendSubmissions"
247
+ path = "/aplus/2020-11-01/contentDocuments/#{percent_encode(content_reference_key)}/suspendSubmissions"
248
248
  params = {
249
249
  "marketplaceId" => marketplace_id,
250
250
  }.compact
@@ -47,7 +47,7 @@ module Peddler
47
47
  # @param rate_limit [Float] Requests per second
48
48
  # @return [Peddler::Response] The API response
49
49
  def record_action_feedback(notification_id, body, rate_limit: 1.0)
50
- path = "/appIntegrations/2024-04-01/notifications/#{notification_id}/feedback"
50
+ path = "/appIntegrations/2024-04-01/notifications/#{percent_encode(notification_id)}/feedback"
51
51
 
52
52
  meter(rate_limit).post(path, body:)
53
53
  end
@@ -40,11 +40,11 @@ module Peddler
40
40
  classification_ids: nil, page_size: 10, page_token: nil, keywords_locale: nil, locale: nil, rate_limit: 2.0)
41
41
  path = "/catalog/2020-12-01/items"
42
42
  params = {
43
- "keywords" => keywords,
44
- "marketplaceIds" => marketplace_ids,
45
- "includedData" => included_data,
46
- "brandNames" => brand_names,
47
- "classificationIds" => classification_ids,
43
+ "keywords" => stringify_array(keywords),
44
+ "marketplaceIds" => stringify_array(marketplace_ids),
45
+ "includedData" => stringify_array(included_data),
46
+ "brandNames" => stringify_array(brand_names),
47
+ "classificationIds" => stringify_array(classification_ids),
48
48
  "pageSize" => page_size,
49
49
  "pageToken" => page_token,
50
50
  "keywordsLocale" => keywords_locale,
@@ -67,10 +67,10 @@ module Peddler
67
67
  # @param rate_limit [Float] Requests per second
68
68
  # @return [Peddler::Response] The API response
69
69
  def get_catalog_item(asin, marketplace_ids, included_data: "summaries", locale: nil, rate_limit: 2.0)
70
- path = "/catalog/2020-12-01/items/#{asin}"
70
+ path = "/catalog/2020-12-01/items/#{percent_encode(asin)}"
71
71
  params = {
72
- "marketplaceIds" => marketplace_ids,
73
- "includedData" => included_data,
72
+ "marketplaceIds" => stringify_array(marketplace_ids),
73
+ "includedData" => stringify_array(included_data),
74
74
  "locale" => locale,
75
75
  }.compact
76
76
 
@@ -50,15 +50,15 @@ module Peddler
50
50
  page_token: nil, keywords_locale: nil, rate_limit: 5.0)
51
51
  path = "/catalog/2022-04-01/items"
52
52
  params = {
53
- "identifiers" => identifiers,
53
+ "identifiers" => stringify_array(identifiers),
54
54
  "identifiersType" => identifiers_type,
55
- "marketplaceIds" => marketplace_ids,
56
- "includedData" => included_data,
55
+ "marketplaceIds" => stringify_array(marketplace_ids),
56
+ "includedData" => stringify_array(included_data),
57
57
  "locale" => locale,
58
58
  "sellerId" => seller_id,
59
- "keywords" => keywords,
60
- "brandNames" => brand_names,
61
- "classificationIds" => classification_ids,
59
+ "keywords" => stringify_array(keywords),
60
+ "brandNames" => stringify_array(brand_names),
61
+ "classificationIds" => stringify_array(classification_ids),
62
62
  "pageSize" => page_size,
63
63
  "pageToken" => page_token,
64
64
  "keywordsLocale" => keywords_locale,
@@ -80,10 +80,10 @@ module Peddler
80
80
  # @param rate_limit [Float] Requests per second
81
81
  # @return [Peddler::Response] The API response
82
82
  def get_catalog_item(asin, marketplace_ids, included_data: ["summaries"], locale: nil, rate_limit: 5.0)
83
- path = "/catalog/2022-04-01/items/#{asin}"
83
+ path = "/catalog/2022-04-01/items/#{percent_encode(asin)}"
84
84
  params = {
85
- "marketplaceIds" => marketplace_ids,
86
- "includedData" => included_data,
85
+ "marketplaceIds" => stringify_array(marketplace_ids),
86
+ "includedData" => stringify_array(included_data),
87
87
  "locale" => locale,
88
88
  }.compact
89
89
 
@@ -36,7 +36,7 @@ module Peddler
36
36
  pagination_token: nil, rate_limit: 0.0222)
37
37
  path = "/dataKiosk/2023-11-15/queries"
38
38
  params = {
39
- "processingStatuses" => processing_statuses,
39
+ "processingStatuses" => stringify_array(processing_statuses),
40
40
  "pageSize" => page_size,
41
41
  "createdSince" => created_since,
42
42
  "createdUntil" => created_until,
@@ -73,7 +73,7 @@ module Peddler
73
73
  # @param rate_limit [Float] Requests per second
74
74
  # @return [Peddler::Response] The API response
75
75
  def cancel_query(query_id, rate_limit: 0.0222)
76
- path = "/dataKiosk/2023-11-15/queries/#{query_id}"
76
+ path = "/dataKiosk/2023-11-15/queries/#{percent_encode(query_id)}"
77
77
 
78
78
  meter(rate_limit).delete(path)
79
79
  end
@@ -86,7 +86,7 @@ module Peddler
86
86
  # @param rate_limit [Float] Requests per second
87
87
  # @return [Peddler::Response] The API response
88
88
  def get_query(query_id, rate_limit: 2.0)
89
- path = "/dataKiosk/2023-11-15/queries/#{query_id}"
89
+ path = "/dataKiosk/2023-11-15/queries/#{percent_encode(query_id)}"
90
90
 
91
91
  meter(rate_limit).get(path)
92
92
  end
@@ -99,7 +99,7 @@ module Peddler
99
99
  # @param rate_limit [Float] Requests per second
100
100
  # @return [Peddler::Response] The API response
101
101
  def get_document(document_id, rate_limit: 0.0167)
102
- path = "/dataKiosk/2023-11-15/documents/#{document_id}"
102
+ path = "/dataKiosk/2023-11-15/documents/#{percent_encode(document_id)}"
103
103
 
104
104
  meter(rate_limit).get(path)
105
105
  end
@@ -32,7 +32,7 @@ module Peddler
32
32
  def get_item_eligibility_preview(asin, program, marketplace_ids: nil, rate_limit: 1.0)
33
33
  path = "/fba/inbound/v1/eligibility/itemPreview"
34
34
  params = {
35
- "marketplaceIds" => marketplace_ids,
35
+ "marketplaceIds" => stringify_array(marketplace_ids),
36
36
  "asin" => asin,
37
37
  "program" => program,
38
38
  }.compact
@@ -53,10 +53,10 @@ module Peddler
53
53
  "granularityType" => granularity_type,
54
54
  "granularityId" => granularity_id,
55
55
  "startDateTime" => start_date_time,
56
- "sellerSkus" => seller_skus,
56
+ "sellerSkus" => stringify_array(seller_skus),
57
57
  "sellerSku" => seller_sku,
58
58
  "nextToken" => next_token,
59
- "marketplaceIds" => marketplace_ids,
59
+ "marketplaceIds" => stringify_array(marketplace_ids),
60
60
  }.compact
61
61
 
62
62
  meter(rate_limit).get(path, params:)
@@ -89,7 +89,7 @@ module Peddler
89
89
  def delete_inventory_item(seller_sku, marketplace_id)
90
90
  must_sandbox!
91
91
 
92
- path = "/fba/inventory/v1/items/#{seller_sku}"
92
+ path = "/fba/inventory/v1/items/#{percent_encode(seller_sku)}"
93
93
  params = {
94
94
  "marketplaceId" => marketplace_id,
95
95
  }.compact
@@ -41,10 +41,10 @@ module Peddler
41
41
  created_until: nil, next_token: nil, rate_limit: 0.0222)
42
42
  path = "/feeds/2021-06-30/feeds"
43
43
  params = {
44
- "feedTypes" => feed_types,
45
- "marketplaceIds" => marketplace_ids,
44
+ "feedTypes" => stringify_array(feed_types),
45
+ "marketplaceIds" => stringify_array(marketplace_ids),
46
46
  "pageSize" => page_size,
47
- "processingStatuses" => processing_statuses,
47
+ "processingStatuses" => stringify_array(processing_statuses),
48
48
  "createdSince" => created_since,
49
49
  "createdUntil" => created_until,
50
50
  "nextToken" => next_token,
@@ -76,7 +76,7 @@ module Peddler
76
76
  # @param rate_limit [Float] Requests per second
77
77
  # @return [Peddler::Response] The API response
78
78
  def cancel_feed(feed_id, rate_limit: 2.0)
79
- path = "/feeds/2021-06-30/feeds/#{feed_id}"
79
+ path = "/feeds/2021-06-30/feeds/#{percent_encode(feed_id)}"
80
80
 
81
81
  meter(rate_limit).delete(path)
82
82
  end
@@ -89,7 +89,7 @@ module Peddler
89
89
  # @param rate_limit [Float] Requests per second
90
90
  # @return [Peddler::Response] The API response
91
91
  def get_feed(feed_id, rate_limit: 2.0)
92
- path = "/feeds/2021-06-30/feeds/#{feed_id}"
92
+ path = "/feeds/2021-06-30/feeds/#{percent_encode(feed_id)}"
93
93
 
94
94
  meter(rate_limit).get(path)
95
95
  end
@@ -116,7 +116,7 @@ module Peddler
116
116
  # @param rate_limit [Float] Requests per second
117
117
  # @return [Peddler::Response] The API response
118
118
  def get_feed_document(feed_document_id, rate_limit: 0.0222)
119
- path = "/feeds/2021-06-30/documents/#{feed_document_id}"
119
+ path = "/feeds/2021-06-30/documents/#{percent_encode(feed_document_id)}"
120
120
 
121
121
  meter(rate_limit).get(path)
122
122
  end
@@ -43,7 +43,7 @@ module Peddler
43
43
  path = "/finances/transfers/2024-06-01/paymentMethods"
44
44
  params = {
45
45
  "marketplaceId" => marketplace_id,
46
- "paymentMethodTypes" => payment_method_types,
46
+ "paymentMethodTypes" => stringify_array(payment_method_types),
47
47
  }.compact
48
48
 
49
49
  meter(rate_limit).get(path, params:)
@@ -69,7 +69,7 @@ module Peddler
69
69
  # @return [Peddler::Response] The API response
70
70
  def list_financial_events_by_group_id(event_group_id, max_results_per_page: 100, posted_after: nil,
71
71
  posted_before: nil, next_token: nil, rate_limit: 0.5)
72
- path = "/finances/v0/financialEventGroups/#{event_group_id}/financialEvents"
72
+ path = "/finances/v0/financialEventGroups/#{percent_encode(event_group_id)}/financialEvents"
73
73
  params = {
74
74
  "MaxResultsPerPage" => max_results_per_page,
75
75
  "PostedAfter" => posted_after,
@@ -91,7 +91,7 @@ module Peddler
91
91
  # @param rate_limit [Float] Requests per second
92
92
  # @return [Peddler::Response] The API response
93
93
  def list_financial_events_by_order_id(order_id, max_results_per_page: 100, next_token: nil, rate_limit: 0.5)
94
- path = "/finances/v0/orders/#{order_id}/financialEvents"
94
+ path = "/finances/v0/orders/#{percent_encode(order_id)}/financialEvents"
95
95
  params = {
96
96
  "MaxResultsPerPage" => max_results_per_page,
97
97
  "NextToken" => next_token,
@@ -62,7 +62,7 @@ module Peddler
62
62
  # @param rate_limit [Float] Requests per second
63
63
  # @return [Peddler::Response] The API response
64
64
  def get_inbound_plan(inbound_plan_id, rate_limit: 2.0)
65
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}"
65
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}"
66
66
 
67
67
  meter(rate_limit).get(path)
68
68
  end
@@ -78,7 +78,7 @@ module Peddler
78
78
  # @param rate_limit [Float] Requests per second
79
79
  # @return [Peddler::Response] The API response
80
80
  def list_inbound_plan_boxes(inbound_plan_id, page_size: 10, pagination_token: nil, rate_limit: 2.0)
81
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/boxes"
81
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/boxes"
82
82
  params = {
83
83
  "pageSize" => page_size,
84
84
  "paginationToken" => pagination_token,
@@ -96,7 +96,7 @@ module Peddler
96
96
  # @param rate_limit [Float] Requests per second
97
97
  # @return [Peddler::Response] The API response
98
98
  def cancel_inbound_plan(inbound_plan_id, rate_limit: 2.0)
99
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/cancellation"
99
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/cancellation"
100
100
 
101
101
  meter(rate_limit).put(path)
102
102
  end
@@ -112,7 +112,7 @@ module Peddler
112
112
  # @param rate_limit [Float] Requests per second
113
113
  # @return [Peddler::Response] The API response
114
114
  def list_inbound_plan_items(inbound_plan_id, page_size: 10, pagination_token: nil, rate_limit: 2.0)
115
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/items"
115
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/items"
116
116
  params = {
117
117
  "pageSize" => page_size,
118
118
  "paginationToken" => pagination_token,
@@ -129,7 +129,7 @@ module Peddler
129
129
  # @param rate_limit [Float] Requests per second
130
130
  # @return [Peddler::Response] The API response
131
131
  def update_inbound_plan_name(inbound_plan_id, body, rate_limit: 2.0)
132
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/name"
132
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/name"
133
133
 
134
134
  meter(rate_limit).put(path, body:)
135
135
  end
@@ -149,7 +149,7 @@ module Peddler
149
149
  # @return [Peddler::Response] The API response
150
150
  def list_packing_group_boxes(inbound_plan_id, packing_group_id, page_size: 10, pagination_token: nil,
151
151
  rate_limit: 2.0)
152
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingGroups/#{packing_group_id}/boxes"
152
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/packingGroups/#{percent_encode(packing_group_id)}/boxes"
153
153
  params = {
154
154
  "pageSize" => page_size,
155
155
  "paginationToken" => pagination_token,
@@ -172,7 +172,7 @@ module Peddler
172
172
  # @return [Peddler::Response] The API response
173
173
  def list_packing_group_items(inbound_plan_id, packing_group_id, page_size: 10, pagination_token: nil,
174
174
  rate_limit: 2.0)
175
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingGroups/#{packing_group_id}/items"
175
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/packingGroups/#{percent_encode(packing_group_id)}/items"
176
176
  params = {
177
177
  "pageSize" => page_size,
178
178
  "paginationToken" => pagination_token,
@@ -190,7 +190,7 @@ module Peddler
190
190
  # @param rate_limit [Float] Requests per second
191
191
  # @return [Peddler::Response] The API response
192
192
  def set_packing_information(inbound_plan_id, body, rate_limit: 2.0)
193
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingInformation"
193
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/packingInformation"
194
194
 
195
195
  meter(rate_limit).post(path, body:)
196
196
  end
@@ -207,7 +207,7 @@ module Peddler
207
207
  # @param rate_limit [Float] Requests per second
208
208
  # @return [Peddler::Response] The API response
209
209
  def list_packing_options(inbound_plan_id, page_size: 10, pagination_token: nil, rate_limit: 2.0)
210
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingOptions"
210
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/packingOptions"
211
211
  params = {
212
212
  "pageSize" => page_size,
213
213
  "paginationToken" => pagination_token,
@@ -223,7 +223,7 @@ module Peddler
223
223
  # @param rate_limit [Float] Requests per second
224
224
  # @return [Peddler::Response] The API response
225
225
  def generate_packing_options(inbound_plan_id, rate_limit: 2.0)
226
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingOptions"
226
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/packingOptions"
227
227
 
228
228
  meter(rate_limit).post(path)
229
229
  end
@@ -236,7 +236,7 @@ module Peddler
236
236
  # @param rate_limit [Float] Requests per second
237
237
  # @return [Peddler::Response] The API response
238
238
  def confirm_packing_option(inbound_plan_id, packing_option_id, rate_limit: 2.0)
239
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingOptions/#{packing_option_id}/confirmation"
239
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/packingOptions/#{percent_encode(packing_option_id)}/confirmation"
240
240
 
241
241
  meter(rate_limit).post(path)
242
242
  end
@@ -253,7 +253,7 @@ module Peddler
253
253
  # @param rate_limit [Float] Requests per second
254
254
  # @return [Peddler::Response] The API response
255
255
  def list_inbound_plan_pallets(inbound_plan_id, page_size: 10, pagination_token: nil, rate_limit: 2.0)
256
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/pallets"
256
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/pallets"
257
257
  params = {
258
258
  "pageSize" => page_size,
259
259
  "paginationToken" => pagination_token,
@@ -274,7 +274,7 @@ module Peddler
274
274
  # @param rate_limit [Float] Requests per second
275
275
  # @return [Peddler::Response] The API response
276
276
  def list_placement_options(inbound_plan_id, page_size: 10, pagination_token: nil, rate_limit: 2.0)
277
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/placementOptions"
277
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/placementOptions"
278
278
  params = {
279
279
  "pageSize" => page_size,
280
280
  "paginationToken" => pagination_token,
@@ -291,7 +291,7 @@ module Peddler
291
291
  # @param rate_limit [Float] Requests per second
292
292
  # @return [Peddler::Response] The API response
293
293
  def generate_placement_options(inbound_plan_id, body, rate_limit: 2.0)
294
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/placementOptions"
294
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/placementOptions"
295
295
 
296
296
  meter(rate_limit).post(path, body:)
297
297
  end
@@ -305,7 +305,7 @@ module Peddler
305
305
  # @param rate_limit [Float] Requests per second
306
306
  # @return [Peddler::Response] The API response
307
307
  def confirm_placement_option(inbound_plan_id, placement_option_id, rate_limit: 2.0)
308
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/placementOptions/#{placement_option_id}/confirmation"
308
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/placementOptions/#{percent_encode(placement_option_id)}/confirmation"
309
309
 
310
310
  meter(rate_limit).post(path)
311
311
  end
@@ -319,7 +319,7 @@ module Peddler
319
319
  # @param rate_limit [Float] Requests per second
320
320
  # @return [Peddler::Response] The API response
321
321
  def get_shipment(inbound_plan_id, shipment_id, rate_limit: 2.0)
322
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}"
322
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}"
323
323
 
324
324
  meter(rate_limit).get(path)
325
325
  end
@@ -336,7 +336,7 @@ module Peddler
336
336
  # @param rate_limit [Float] Requests per second
337
337
  # @return [Peddler::Response] The API response
338
338
  def list_shipment_boxes(inbound_plan_id, shipment_id, page_size: 10, pagination_token: nil, rate_limit: 2.0)
339
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/boxes"
339
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}/boxes"
340
340
  params = {
341
341
  "pageSize" => page_size,
342
342
  "paginationToken" => pagination_token,
@@ -360,7 +360,7 @@ module Peddler
360
360
  # @return [Peddler::Response] The API response
361
361
  def list_shipment_content_update_previews(inbound_plan_id, shipment_id, page_size: 10, pagination_token: nil,
362
362
  rate_limit: 2.0)
363
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/contentUpdatePreviews"
363
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}/contentUpdatePreviews"
364
364
  params = {
365
365
  "pageSize" => page_size,
366
366
  "paginationToken" => pagination_token,
@@ -380,7 +380,7 @@ module Peddler
380
380
  # @param rate_limit [Float] Requests per second
381
381
  # @return [Peddler::Response] The API response
382
382
  def generate_shipment_content_update_previews(inbound_plan_id, shipment_id, body, rate_limit: 2.0)
383
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/contentUpdatePreviews"
383
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}/contentUpdatePreviews"
384
384
 
385
385
  meter(rate_limit).post(path, body:)
386
386
  end
@@ -396,7 +396,7 @@ module Peddler
396
396
  # @param rate_limit [Float] Requests per second
397
397
  # @return [Peddler::Response] The API response
398
398
  def get_shipment_content_update_preview(inbound_plan_id, shipment_id, content_update_preview_id, rate_limit: 2.0)
399
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/contentUpdatePreviews/#{content_update_preview_id}"
399
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}/contentUpdatePreviews/#{percent_encode(content_update_preview_id)}"
400
400
 
401
401
  meter(rate_limit).get(path)
402
402
  end
@@ -411,7 +411,7 @@ module Peddler
411
411
  # @return [Peddler::Response] The API response
412
412
  def confirm_shipment_content_update_preview(inbound_plan_id, shipment_id, content_update_preview_id,
413
413
  rate_limit: 2.0)
414
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/contentUpdatePreviews/#{content_update_preview_id}/confirmation"
414
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}/contentUpdatePreviews/#{percent_encode(content_update_preview_id)}/confirmation"
415
415
 
416
416
  meter(rate_limit).post(path)
417
417
  end
@@ -424,7 +424,7 @@ module Peddler
424
424
  # @param rate_limit [Float] Requests per second
425
425
  # @return [Peddler::Response] The API response
426
426
  def get_delivery_challan_document(inbound_plan_id, shipment_id, rate_limit: 2.0)
427
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/deliveryChallanDocument"
427
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}/deliveryChallanDocument"
428
428
 
429
429
  meter(rate_limit).get(path)
430
430
  end
@@ -444,7 +444,7 @@ module Peddler
444
444
  # @return [Peddler::Response] The API response
445
445
  def list_delivery_window_options(inbound_plan_id, shipment_id, page_size: 10, pagination_token: nil,
446
446
  rate_limit: 2.0)
447
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/deliveryWindowOptions"
447
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}/deliveryWindowOptions"
448
448
  params = {
449
449
  "pageSize" => page_size,
450
450
  "paginationToken" => pagination_token,
@@ -461,7 +461,7 @@ module Peddler
461
461
  # @param rate_limit [Float] Requests per second
462
462
  # @return [Peddler::Response] The API response
463
463
  def generate_delivery_window_options(inbound_plan_id, shipment_id, rate_limit: 2.0)
464
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/deliveryWindowOptions"
464
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}/deliveryWindowOptions"
465
465
 
466
466
  meter(rate_limit).post(path)
467
467
  end
@@ -480,7 +480,7 @@ module Peddler
480
480
  # @param rate_limit [Float] Requests per second
481
481
  # @return [Peddler::Response] The API response
482
482
  def confirm_delivery_window_options(inbound_plan_id, shipment_id, delivery_window_option_id, rate_limit: 2.0)
483
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/deliveryWindowOptions/#{delivery_window_option_id}/confirmation"
483
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}/deliveryWindowOptions/#{percent_encode(delivery_window_option_id)}/confirmation"
484
484
 
485
485
  meter(rate_limit).post(path)
486
486
  end
@@ -497,7 +497,7 @@ module Peddler
497
497
  # @param rate_limit [Float] Requests per second
498
498
  # @return [Peddler::Response] The API response
499
499
  def list_shipment_items(inbound_plan_id, shipment_id, page_size: 10, pagination_token: nil, rate_limit: 2.0)
500
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/items"
500
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}/items"
501
501
  params = {
502
502
  "pageSize" => page_size,
503
503
  "paginationToken" => pagination_token,
@@ -515,7 +515,7 @@ module Peddler
515
515
  # @param rate_limit [Float] Requests per second
516
516
  # @return [Peddler::Response] The API response
517
517
  def update_shipment_name(inbound_plan_id, shipment_id, body, rate_limit: 2.0)
518
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/name"
518
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}/name"
519
519
 
520
520
  meter(rate_limit).put(path, body:)
521
521
  end
@@ -533,7 +533,7 @@ module Peddler
533
533
  # @param rate_limit [Float] Requests per second
534
534
  # @return [Peddler::Response] The API response
535
535
  def list_shipment_pallets(inbound_plan_id, shipment_id, page_size: 10, pagination_token: nil, rate_limit: 2.0)
536
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/pallets"
536
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}/pallets"
537
537
  params = {
538
538
  "pageSize" => page_size,
539
539
  "paginationToken" => pagination_token,
@@ -552,7 +552,7 @@ module Peddler
552
552
  # @param rate_limit [Float] Requests per second
553
553
  # @return [Peddler::Response] The API response
554
554
  def cancel_self_ship_appointment(inbound_plan_id, shipment_id, body, rate_limit: 2.0)
555
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/selfShipAppointmentCancellation"
555
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}/selfShipAppointmentCancellation"
556
556
 
557
557
  meter(rate_limit).put(path, body:)
558
558
  end
@@ -573,7 +573,7 @@ module Peddler
573
573
  # @return [Peddler::Response] The API response
574
574
  def get_self_ship_appointment_slots(inbound_plan_id, shipment_id, page_size: 10, pagination_token: nil,
575
575
  rate_limit: 2.0)
576
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/selfShipAppointmentSlots"
576
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}/selfShipAppointmentSlots"
577
577
  params = {
578
578
  "pageSize" => page_size,
579
579
  "paginationToken" => pagination_token,
@@ -592,7 +592,7 @@ module Peddler
592
592
  # @param rate_limit [Float] Requests per second
593
593
  # @return [Peddler::Response] The API response
594
594
  def generate_self_ship_appointment_slots(inbound_plan_id, shipment_id, body, rate_limit: 2.0)
595
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/selfShipAppointmentSlots"
595
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}/selfShipAppointmentSlots"
596
596
 
597
597
  meter(rate_limit).post(path, body:)
598
598
  end
@@ -608,7 +608,7 @@ module Peddler
608
608
  # @param rate_limit [Float] Requests per second
609
609
  # @return [Peddler::Response] The API response
610
610
  def schedule_self_ship_appointment(inbound_plan_id, shipment_id, slot_id, body, rate_limit: 2.0)
611
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/selfShipAppointmentSlots/#{slot_id}/schedule"
611
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}/selfShipAppointmentSlots/#{percent_encode(slot_id)}/schedule"
612
612
 
613
613
  meter(rate_limit).post(path, body:)
614
614
  end
@@ -625,7 +625,7 @@ module Peddler
625
625
  # @param rate_limit [Float] Requests per second
626
626
  # @return [Peddler::Response] The API response
627
627
  def update_shipment_source_address(inbound_plan_id, shipment_id, body, rate_limit: 2.0)
628
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/sourceAddress"
628
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}/sourceAddress"
629
629
 
630
630
  meter(rate_limit).put(path, body:)
631
631
  end
@@ -639,7 +639,7 @@ module Peddler
639
639
  # @param rate_limit [Float] Requests per second
640
640
  # @return [Peddler::Response] The API response
641
641
  def update_shipment_tracking_details(inbound_plan_id, shipment_id, body, rate_limit: 2.0)
642
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/trackingDetails"
642
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/shipments/#{percent_encode(shipment_id)}/trackingDetails"
643
643
 
644
644
  meter(rate_limit).put(path, body:)
645
645
  end
@@ -662,7 +662,7 @@ module Peddler
662
662
  # @return [Peddler::Response] The API response
663
663
  def list_transportation_options(inbound_plan_id, page_size: 10, pagination_token: nil, placement_option_id: nil,
664
664
  shipment_id: nil, rate_limit: 2.0)
665
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/transportationOptions"
665
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/transportationOptions"
666
666
  params = {
667
667
  "pageSize" => page_size,
668
668
  "paginationToken" => pagination_token,
@@ -681,7 +681,7 @@ module Peddler
681
681
  # @param rate_limit [Float] Requests per second
682
682
  # @return [Peddler::Response] The API response
683
683
  def generate_transportation_options(inbound_plan_id, body, rate_limit: 2.0)
684
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/transportationOptions"
684
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/transportationOptions"
685
685
 
686
686
  meter(rate_limit).post(path, body:)
687
687
  end
@@ -695,7 +695,7 @@ module Peddler
695
695
  # @param rate_limit [Float] Requests per second
696
696
  # @return [Peddler::Response] The API response
697
697
  def confirm_transportation_options(inbound_plan_id, body, rate_limit: 2.0)
698
- path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/transportationOptions/confirmation"
698
+ path = "/inbound/fba/2024-03-20/inboundPlans/#{percent_encode(inbound_plan_id)}/transportationOptions/confirmation"
699
699
 
700
700
  meter(rate_limit).post(path, body:)
701
701
  end
@@ -711,7 +711,7 @@ module Peddler
711
711
  def list_item_compliance_details(mskus, marketplace_id, rate_limit: 2.0)
712
712
  path = "/inbound/fba/2024-03-20/items/compliance"
713
713
  params = {
714
- "mskus" => mskus,
714
+ "mskus" => stringify_array(mskus),
715
715
  "marketplaceId" => marketplace_id,
716
716
  }.compact
717
717
 
@@ -760,7 +760,7 @@ module Peddler
760
760
  path = "/inbound/fba/2024-03-20/items/prepDetails"
761
761
  params = {
762
762
  "marketplaceId" => marketplace_id,
763
- "mskus" => mskus,
763
+ "mskus" => stringify_array(mskus),
764
764
  }.compact
765
765
 
766
766
  meter(rate_limit).get(path, params:)
@@ -785,7 +785,7 @@ module Peddler
785
785
  # @param rate_limit [Float] Requests per second
786
786
  # @return [Peddler::Response] The API response
787
787
  def get_inbound_operation_status(operation_id, rate_limit: 2.0)
788
- path = "/inbound/fba/2024-03-20/operations/#{operation_id}"
788
+ path = "/inbound/fba/2024-03-20/operations/#{percent_encode(operation_id)}"
789
789
 
790
790
  meter(rate_limit).get(path)
791
791
  end