From 0e58e2c46d3b9ad71d007e91207e5afc4fd21109 Mon Sep 17 00:00:00 2001 From: Hakan Ensari Date: Thu, 12 Sep 2024 22:11:56 +0200 Subject: [PATCH] More intuitive #rate_limit --- bin/generate-code | 16 +--- bin/templates/api.rb.erb | 4 +- lib/peddler/api.rb | 6 +- ...warehousing_and_distribution_2024_05_09.rb | 4 +- lib/peddler/api/aplus_content_2020_11_01.rb | 20 ++--- .../api/application_management_2023_11_30.rb | 2 +- lib/peddler/api/catalog_items_2020_12_01.rb | 4 +- lib/peddler/api/catalog_items_2022_04_01.rb | 4 +- lib/peddler/api/data_kiosk_2023_11_15.rb | 10 +-- lib/peddler/api/fba_inventory_v1.rb | 2 +- lib/peddler/api/feeds_2021_06_30.rb | 12 +-- lib/peddler/api/finances_v0.rb | 8 +- .../api/fulfillment_inbound_2024_03_20.rb | 86 +++++++++---------- lib/peddler/api/fulfillment_inbound_v0.rb | 32 +++---- .../api/fulfillment_outbound_2020_07_01.rb | 26 +++--- lib/peddler/api/listings_items_2020_09_01.rb | 6 +- lib/peddler/api/listings_items_2021_08_01.rb | 8 +- .../api/listings_restrictions_2021_08_01.rb | 2 +- lib/peddler/api/merchant_fulfillment_v0.rb | 2 +- lib/peddler/api/orders_v0.rb | 20 ++--- lib/peddler/api/product_fees_v0.rb | 2 +- lib/peddler/api/product_pricing_2022_05_01.rb | 4 +- lib/peddler/api/product_pricing_v0.rb | 10 +-- .../product_type_definitions_2020_09_01.rb | 4 +- lib/peddler/api/reports_2021_06_30.rb | 18 ++-- lib/peddler/api/sales_v1.rb | 2 +- lib/peddler/api/sellers_v1.rb | 4 +- lib/peddler/api/services_v1.rb | 32 +++---- lib/peddler/api/shipment_invoicing_v0.rb | 6 +- lib/peddler/api/shipping_v1.rb | 16 ++-- lib/peddler/api/shipping_v2.rb | 34 ++++---- lib/peddler/api/uploads_2020_11_01.rb | 2 +- .../vendor_direct_fulfillment_inventory_v1.rb | 2 +- ...or_direct_fulfillment_orders_2021_12_28.rb | 6 +- .../vendor_direct_fulfillment_orders_v1.rb | 6 +- .../vendor_direct_fulfillment_payments_v1.rb | 2 +- ..._direct_fulfillment_shipping_2021_12_28.rb | 20 ++--- .../vendor_direct_fulfillment_shipping_v1.rb | 18 ++-- ...ect_fulfillment_transactions_2021_12_28.rb | 2 +- ...ndor_direct_fulfillment_transactions_v1.rb | 2 +- lib/peddler/api/vendor_invoices_v1.rb | 2 +- lib/peddler/api/vendor_orders_v1.rb | 8 +- lib/peddler/api/vendor_shipments_v1.rb | 6 +- .../api/vendor_transaction_status_v1.rb | 2 +- 44 files changed, 237 insertions(+), 247 deletions(-) diff --git a/bin/generate-code b/bin/generate-code index 453a463f..5f1fe6c6 100755 --- a/bin/generate-code +++ b/bin/generate-code @@ -90,7 +90,7 @@ module Generator operation.merge( "path" => path, "method" => method.upcase, - "retriable_delay" => extract_retriable_delay(operation), + "rate_limit" => extract_rate_limit(operation), "parameters" => parameters, "body_param" => parameters&.find { |p| p["in"] == "body" }, "query_params" => parameters&.select { |p| p["in"] == "query" }, @@ -222,7 +222,7 @@ module Generator end.join("\n") end - def extract_retriable_delay(operation) + def extract_rate_limit(operation) description = operation["description"] return unless description @@ -230,17 +230,7 @@ module Generator # Format 1: | Plan type | Rate (requests per second) | Burst | # Format 2: | Rate (requests per second) | Burst | table_match = description.match(/Burst \|\n\|(?: *---- *\|){2,3}\n(?:\|[^|]*){0,1}\| (\S+) \|[^|]*\|/) - return unless table_match - - rate_limit = table_match[1].to_f - retriable_delay = 1.0 / rate_limit - - # Round to nearest integer if more than 3 decimal places - if (retriable_delay * 1000).round != (retriable_delay * 1000) - retriable_delay.round.to_f - else - retriable_delay - end + table_match[1].to_f if table_match end end diff --git a/bin/templates/api.rb.erb b/bin/templates/api.rb.erb index 1a1f21c4..b6e7a19f 100644 --- a/bin/templates/api.rb.erb +++ b/bin/templates/api.rb.erb @@ -27,8 +27,8 @@ module Peddler <% method_args << "body:" if operation["body_param"] %> <% method_args << "params:" if operation["query_params"]&.any? %> - <% if operation["retriable_delay"] %> - rate_limit(<%= operation["retriable_delay"] %>).<%= http_method %>(<%= method_args.join(", ") %>) + <% if operation["rate_limit"] %> + rate_limit(<%= operation["rate_limit"] %>).<%= http_method %>(<%= method_args.join(", ") %>) <% else %> <%= http_method %>(<%= method_args.join(", ") %>) <% end %> diff --git a/lib/peddler/api.rb b/lib/peddler/api.rb index 8b1c6c51..30972413 100644 --- a/lib/peddler/api.rb +++ b/lib/peddler/api.rb @@ -48,9 +48,9 @@ def http # # @param [Float] delay The delay in seconds before retrying # @return [self] - def rate_limit(delay) - # TODO: Remove when HTTP 6.0 is released - @http = @http.retriable(delay: delay, retry_statuses: [429]) if @http.respond_to?(:retriable) + def rate_limit(rate) + # TODO: Remove guard when HTTP 6.0 is released + retriable(delay: 1.0 / rate, retry_statuses: [429]) if @http.respond_to?(:retriable) self end diff --git a/lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb b/lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb index 3870eed4..1cfc06e8 100644 --- a/lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb +++ b/lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb @@ -21,7 +21,7 @@ def get_inbound_shipment(shipment_id, sku_quantities: nil) "skuQuantities" => sku_quantities, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Retrieves a summary of all the inbound AWD shipments associated with a merchant, with the ability to apply @@ -73,7 +73,7 @@ def list_inventory(sku: nil, sort_order: nil, details: nil, next_token: nil, max "maxResults" => max_results, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end end end diff --git a/lib/peddler/api/aplus_content_2020_11_01.rb b/lib/peddler/api/aplus_content_2020_11_01.rb index 32494e48..4bcd1cf3 100644 --- a/lib/peddler/api/aplus_content_2020_11_01.rb +++ b/lib/peddler/api/aplus_content_2020_11_01.rb @@ -29,7 +29,7 @@ def search_content_documents(marketplace_id, page_token: nil) "pageToken" => page_token, }.compact - rate_limit(0.1).get(path, params:) + rate_limit(10.0).get(path, params:) end # Creates a new A+ Content document. @@ -44,7 +44,7 @@ def create_content_document(marketplace_id, post_content_document_request) "marketplaceId" => marketplace_id, }.compact - rate_limit(0.1).post(path, body:, params:) + rate_limit(10.0).post(path, body:, params:) end # Returns an A+ Content document, if available. @@ -62,7 +62,7 @@ def get_content_document(content_reference_key, marketplace_id, included_data_se "includedDataSet" => included_data_set, }.compact - rate_limit(0.1).get(path, params:) + rate_limit(10.0).get(path, params:) end # Updates an existing A+ Content document. @@ -80,7 +80,7 @@ def update_content_document(content_reference_key, marketplace_id, post_content_ "marketplaceId" => marketplace_id, }.compact - rate_limit(0.1).post(path, body:, params:) + rate_limit(10.0).post(path, body:, params:) end # Returns a list of ASINs related to the specified A+ Content document, if available. If you do not include the @@ -109,7 +109,7 @@ def list_content_document_asin_relations(content_reference_key, marketplace_id, "pageToken" => page_token, }.compact - rate_limit(0.1).get(path, params:) + rate_limit(10.0).get(path, params:) end # Replaces all ASINs related to the specified A+ Content document, if available. This may add or remove ASINs, @@ -130,7 +130,7 @@ def post_content_document_asin_relations(content_reference_key, marketplace_id, "marketplaceId" => marketplace_id, }.compact - rate_limit(0.1).post(path, body:, params:) + rate_limit(10.0).post(path, body:, params:) end # Checks if the A+ Content document is valid for use on a set of ASINs. @@ -147,7 +147,7 @@ def validate_content_document_asin_relations(marketplace_id, post_content_docume "asinSet" => asin_set, }.compact - rate_limit(0.1).post(path, body:, params:) + rate_limit(10.0).post(path, body:, params:) end # Searches for A+ Content publishing records, if available. @@ -168,7 +168,7 @@ def search_content_publish_records(marketplace_id, asin, page_token: nil) "pageToken" => page_token, }.compact - rate_limit(0.1).get(path, params:) + rate_limit(10.0).get(path, params:) end # Submits an A+ Content document for review, approval, and publishing. @@ -184,7 +184,7 @@ def post_content_document_approval_submission(content_reference_key, marketplace "marketplaceId" => marketplace_id, }.compact - rate_limit(0.1).post(path, params:) + rate_limit(10.0).post(path, params:) end # Submits a request to suspend visible A+ Content. This neither deletes the content document nor the ASIN @@ -201,7 +201,7 @@ def post_content_document_suspend_submission(content_reference_key, marketplace_ "marketplaceId" => marketplace_id, }.compact - rate_limit(0.1).post(path, params:) + rate_limit(10.0).post(path, params:) end end end diff --git a/lib/peddler/api/application_management_2023_11_30.rb b/lib/peddler/api/application_management_2023_11_30.rb index e0bfaa1f..eb878564 100644 --- a/lib/peddler/api/application_management_2023_11_30.rb +++ b/lib/peddler/api/application_management_2023_11_30.rb @@ -18,7 +18,7 @@ class ApplicationManagement20231130 < API def rotate_application_client_secret path = "/applications/2023-11-30/clientSecret" - rate_limit(60.0).post(path) + rate_limit(0.0167).post(path) end end end diff --git a/lib/peddler/api/catalog_items_2020_12_01.rb b/lib/peddler/api/catalog_items_2020_12_01.rb index 6f2a18f2..46ef71ef 100644 --- a/lib/peddler/api/catalog_items_2020_12_01.rb +++ b/lib/peddler/api/catalog_items_2020_12_01.rb @@ -42,7 +42,7 @@ def search_catalog_items(keywords, marketplace_ids, included_data: nil, brand_na "locale" => locale, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Retrieves details for an item in the Amazon catalog. @@ -63,7 +63,7 @@ def get_catalog_item(asin, marketplace_ids, included_data: nil, locale: nil) "locale" => locale, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end end end diff --git a/lib/peddler/api/catalog_items_2022_04_01.rb b/lib/peddler/api/catalog_items_2022_04_01.rb index 430aea56..5474b2f7 100644 --- a/lib/peddler/api/catalog_items_2022_04_01.rb +++ b/lib/peddler/api/catalog_items_2022_04_01.rb @@ -55,7 +55,7 @@ def search_catalog_items( "keywordsLocale" => keywords_locale, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Retrieves details for an item in the Amazon catalog. @@ -76,7 +76,7 @@ def get_catalog_item(asin, marketplace_ids, included_data: nil, locale: nil) "locale" => locale, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end end end diff --git a/lib/peddler/api/data_kiosk_2023_11_15.rb b/lib/peddler/api/data_kiosk_2023_11_15.rb index 7ce4be31..5aec0290 100644 --- a/lib/peddler/api/data_kiosk_2023_11_15.rb +++ b/lib/peddler/api/data_kiosk_2023_11_15.rb @@ -35,7 +35,7 @@ def get_queries(processing_statuses: nil, page_size: nil, created_since: nil, cr "paginationToken" => pagination_token, }.compact - rate_limit(45.0).get(path, params:) + rate_limit(0.0222).get(path, params:) end # Creates a Data Kiosk query request. @@ -50,7 +50,7 @@ def create_query(body) path = "/dataKiosk/2023-11-15/queries" body = body - rate_limit(60.0).post(path, body:) + rate_limit(0.0167).post(path, body:) end # Cancels the query specified by the `queryId` parameter. Only queries with a non-terminal `processingStatus` @@ -64,7 +64,7 @@ def create_query(body) def cancel_query(query_id) path = "/dataKiosk/2023-11-15/queries/#{query_id}" - rate_limit(45.0).delete(path) + rate_limit(0.0222).delete(path) end # Returns query details for the query specified by the `queryId` parameter. See the `createQuery` operation for @@ -75,7 +75,7 @@ def cancel_query(query_id) def get_query(query_id) path = "/dataKiosk/2023-11-15/queries/#{query_id}" - rate_limit(0.5).get(path) + rate_limit(2.0).get(path) end # Returns the information required for retrieving a Data Kiosk document's contents. See the `createQuery` @@ -86,7 +86,7 @@ def get_query(query_id) def get_document(document_id) path = "/dataKiosk/2023-11-15/documents/#{document_id}" - rate_limit(60.0).get(path) + rate_limit(0.0167).get(path) end end end diff --git a/lib/peddler/api/fba_inventory_v1.rb b/lib/peddler/api/fba_inventory_v1.rb index 0fa38714..70294b5e 100644 --- a/lib/peddler/api/fba_inventory_v1.rb +++ b/lib/peddler/api/fba_inventory_v1.rb @@ -55,7 +55,7 @@ def get_inventory_summaries(granularity_type, granularity_id, marketplace_ids, d "marketplaceIds" => marketplace_ids, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a diff --git a/lib/peddler/api/feeds_2021_06_30.rb b/lib/peddler/api/feeds_2021_06_30.rb index aaac4f26..249683d5 100644 --- a/lib/peddler/api/feeds_2021_06_30.rb +++ b/lib/peddler/api/feeds_2021_06_30.rb @@ -39,7 +39,7 @@ def get_feeds(feed_types: nil, marketplace_ids: nil, page_size: nil, processing_ "nextToken" => next_token, }.compact - rate_limit(45.0).get(path, params:) + rate_limit(0.0222).get(path, params:) end # Creates a feed. Upload the contents of the feed document before calling this operation. @@ -50,7 +50,7 @@ def create_feed(body) path = "/feeds/2021-06-30/feeds" body = body - rate_limit(120.0).post(path, body:) + rate_limit(0.0083).post(path, body:) end # Cancels the feed that you specify. Only feeds with `processingStatus=IN_QUEUE` can be cancelled. Cancelled feeds @@ -64,7 +64,7 @@ def create_feed(body) def cancel_feed(feed_id) path = "/feeds/2021-06-30/feeds/#{feed_id}" - rate_limit(0.5).delete(path) + rate_limit(2.0).delete(path) end # Returns feed details (including the `resultDocumentId`, if available) for the feed that you specify. @@ -75,7 +75,7 @@ def cancel_feed(feed_id) def get_feed(feed_id) path = "/feeds/2021-06-30/feeds/#{feed_id}" - rate_limit(0.5).get(path) + rate_limit(2.0).get(path) end # Creates a feed document for the feed type that you specify. This operation returns a presigned URL for uploading @@ -89,7 +89,7 @@ def create_feed_document(body) path = "/feeds/2021-06-30/documents" body = body - rate_limit(2.0).post(path, body:) + rate_limit(0.5).post(path, body:) end # Returns the information required for retrieving a feed document's contents. @@ -99,7 +99,7 @@ def create_feed_document(body) def get_feed_document(feed_document_id) path = "/feeds/2021-06-30/documents/#{feed_document_id}" - rate_limit(45.0).get(path) + rate_limit(0.0222).get(path) end end end diff --git a/lib/peddler/api/finances_v0.rb b/lib/peddler/api/finances_v0.rb index 8527f0c7..3ed66c89 100644 --- a/lib/peddler/api/finances_v0.rb +++ b/lib/peddler/api/finances_v0.rb @@ -36,7 +36,7 @@ def list_financial_event_groups(max_results_per_page: nil, financial_event_group "NextToken" => next_token, }.compact - rate_limit(2.0).get(path, params:) + rate_limit(0.5).get(path, params:) end # Returns all financial events for the specified financial event group. It may take up to 48 hours for orders to @@ -68,7 +68,7 @@ def list_financial_events_by_group_id(event_group_id, max_results_per_page: nil, "NextToken" => next_token, }.compact - rate_limit(2.0).get(path, params:) + rate_limit(0.5).get(path, params:) end # Returns all financial events for the specified order. It may take up to 48 hours for orders to appear in your @@ -86,7 +86,7 @@ def list_financial_events_by_order_id(order_id, max_results_per_page: nil, next_ "NextToken" => next_token, }.compact - rate_limit(2.0).get(path, params:) + rate_limit(0.5).get(path, params:) end # Returns financial events for the specified data range. It may take up to 48 hours for orders to appear in your @@ -114,7 +114,7 @@ def list_financial_events(max_results_per_page: nil, posted_after: nil, posted_b "NextToken" => next_token, }.compact - rate_limit(2.0).get(path, params:) + rate_limit(0.5).get(path, params:) end end end diff --git a/lib/peddler/api/fulfillment_inbound_2024_03_20.rb b/lib/peddler/api/fulfillment_inbound_2024_03_20.rb index cb980462..4022429f 100644 --- a/lib/peddler/api/fulfillment_inbound_2024_03_20.rb +++ b/lib/peddler/api/fulfillment_inbound_2024_03_20.rb @@ -30,7 +30,7 @@ def list_inbound_plans(page_size: nil, pagination_token: nil, status: nil, sort_ "sortOrder" => sort_order, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Creates an inbound plan. An inbound plan contains all the necessary information to send shipments into Amazon's @@ -42,7 +42,7 @@ def create_inbound_plan(body) path = "/inbound/fba/2024-03-20/inboundPlans" body = body - rate_limit(0.5).post(path, body:) + rate_limit(2.0).post(path, body:) end # Fetches the top level information about an inbound plan. @@ -52,7 +52,7 @@ def create_inbound_plan(body) def get_inbound_plan(inbound_plan_id) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}" - rate_limit(0.5).get(path) + rate_limit(2.0).get(path) end # Provides a paginated list of box packages in an inbound plan. @@ -70,7 +70,7 @@ def list_inbound_plan_boxes(inbound_plan_id, page_size: nil, pagination_token: n "paginationToken" => pagination_token, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Cancels an Inbound Plan. Charges may apply if the cancellation is performed outside of a void window. The window @@ -82,7 +82,7 @@ def list_inbound_plan_boxes(inbound_plan_id, page_size: nil, pagination_token: n def cancel_inbound_plan(inbound_plan_id) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/cancellation" - rate_limit(0.5).put(path) + rate_limit(2.0).put(path) end # Provides a paginated list of item packages in an inbound plan. @@ -100,7 +100,7 @@ def list_inbound_plan_items(inbound_plan_id, page_size: nil, pagination_token: n "paginationToken" => pagination_token, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Updates the name of an existing inbound plan. @@ -112,7 +112,7 @@ def update_inbound_plan_name(inbound_plan_id, body) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/name" body = body - rate_limit(0.5).put(path, body:) + rate_limit(2.0).put(path, body:) end # Retrieves a page of boxes from a given packing group. These boxes were previously provided through the @@ -133,7 +133,7 @@ def list_packing_group_boxes(inbound_plan_id, packing_group_id, page_size: nil, "paginationToken" => pagination_token, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Retrieves a page of items in a given packing group. Packing options must first be generated by the corresponding @@ -153,7 +153,7 @@ def list_packing_group_items(inbound_plan_id, packing_group_id, page_size: nil, "paginationToken" => pagination_token, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Sets packing information for an inbound plan. This should be called after an inbound plan is created to populate @@ -166,7 +166,7 @@ def set_packing_information(inbound_plan_id, body) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingInformation" body = body - rate_limit(0.5).post(path, body:) + rate_limit(2.0).post(path, body:) end # Retrieves a list of all packing options for an inbound plan. Packing options must first be generated by the @@ -185,7 +185,7 @@ def list_packing_options(inbound_plan_id, page_size: nil, pagination_token: nil) "paginationToken" => pagination_token, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Generates available packing options for the inbound plan. @@ -195,7 +195,7 @@ def list_packing_options(inbound_plan_id, page_size: nil, pagination_token: nil) def generate_packing_options(inbound_plan_id) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingOptions" - rate_limit(0.5).post(path) + rate_limit(2.0).post(path) end # Confirms the packing option for an inbound plan. @@ -206,7 +206,7 @@ def generate_packing_options(inbound_plan_id) def confirm_packing_option(inbound_plan_id, packing_option_id) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/packingOptions/#{packing_option_id}/confirmation" - rate_limit(0.5).post(path) + rate_limit(2.0).post(path) end # Provides a paginated list of pallet packages in an inbound plan. An inbound plan will have pallets when the @@ -225,7 +225,7 @@ def list_inbound_plan_pallets(inbound_plan_id, page_size: nil, pagination_token: "paginationToken" => pagination_token, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Provides a list of all placement options for an inbound plan. Placement options must first be generated by the @@ -244,7 +244,7 @@ def list_placement_options(inbound_plan_id, page_size: nil, pagination_token: ni "paginationToken" => pagination_token, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Generates placement options for the inbound plan. @@ -256,7 +256,7 @@ def generate_placement_options(inbound_plan_id, body) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/placementOptions" body = body - rate_limit(0.5).post(path, body:) + rate_limit(2.0).post(path, body:) end # Confirms the placement option for an inbound plan. Once confirmed, it cannot be changed for the Inbound Plan. @@ -268,7 +268,7 @@ def generate_placement_options(inbound_plan_id, body) def confirm_placement_option(inbound_plan_id, placement_option_id) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/placementOptions/#{placement_option_id}/confirmation" - rate_limit(0.5).post(path) + rate_limit(2.0).post(path) end # Provides the full details for a specific shipment within an inbound plan. The `transportationOptionId` inside @@ -280,7 +280,7 @@ def confirm_placement_option(inbound_plan_id, placement_option_id) def get_shipment(inbound_plan_id, shipment_id) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}" - rate_limit(0.5).get(path) + rate_limit(2.0).get(path) end # Provides a paginated list of box packages in a shipment. @@ -299,7 +299,7 @@ def list_shipment_boxes(inbound_plan_id, shipment_id, page_size: nil, pagination "paginationToken" => pagination_token, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Retrieve a paginated list of shipment content update previews for a given shipment. The shipment content update @@ -320,7 +320,7 @@ def list_shipment_content_update_previews(inbound_plan_id, shipment_id, page_siz "paginationToken" => pagination_token, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Generate a shipment content update preview given a set of intended boxes and/or items for a shipment with a @@ -335,7 +335,7 @@ def generate_shipment_content_update_previews(inbound_plan_id, shipment_id, body path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/contentUpdatePreviews" body = body - rate_limit(0.5).post(path, body:) + rate_limit(2.0).post(path, body:) end # Retrieve a shipment content update preview which provides a summary of the requested shipment content changes @@ -349,7 +349,7 @@ def generate_shipment_content_update_previews(inbound_plan_id, shipment_id, body def get_shipment_content_update_preview(inbound_plan_id, shipment_id, content_update_preview_id) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/contentUpdatePreviews/#{content_update_preview_id}" - rate_limit(0.5).get(path) + rate_limit(2.0).get(path) end # Confirm a shipment content update preview and accept the changes in transportation cost. @@ -361,7 +361,7 @@ def get_shipment_content_update_preview(inbound_plan_id, shipment_id, content_up def confirm_shipment_content_update_preview(inbound_plan_id, shipment_id, content_update_preview_id) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/contentUpdatePreviews/#{content_update_preview_id}/confirmation" - rate_limit(0.5).post(path) + rate_limit(2.0).post(path) end # Provide delivery challan document for PCP transportation in IN marketplace. @@ -372,7 +372,7 @@ def confirm_shipment_content_update_preview(inbound_plan_id, shipment_id, conten def get_delivery_challan_document(inbound_plan_id, shipment_id) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/deliveryChallanDocument" - rate_limit(0.5).get(path) + rate_limit(2.0).get(path) end # Retrieves all delivery window options for a shipment. Delivery window options must first be generated by the @@ -393,7 +393,7 @@ def list_delivery_window_options(inbound_plan_id, shipment_id, page_size: nil, p "paginationToken" => pagination_token, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Generates available delivery window options for a given shipment. @@ -404,7 +404,7 @@ def list_delivery_window_options(inbound_plan_id, shipment_id, page_size: nil, p def generate_delivery_window_options(inbound_plan_id, shipment_id) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/deliveryWindowOptions" - rate_limit(0.5).post(path) + rate_limit(2.0).post(path) end # Confirms the delivery window option for chosen shipment within an inbound plan. A placement option must be @@ -421,7 +421,7 @@ def generate_delivery_window_options(inbound_plan_id, shipment_id) def confirm_delivery_window_options(inbound_plan_id, shipment_id, delivery_window_option_id) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/deliveryWindowOptions/#{delivery_window_option_id}/confirmation" - rate_limit(0.5).post(path) + rate_limit(2.0).post(path) end # Provides a paginated list of item packages in a shipment. @@ -440,7 +440,7 @@ def list_shipment_items(inbound_plan_id, shipment_id, page_size: nil, pagination "paginationToken" => pagination_token, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Updates the name of an existing shipment. @@ -453,7 +453,7 @@ def update_shipment_name(inbound_plan_id, shipment_id, body) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/name" body = body - rate_limit(0.5).put(path, body:) + rate_limit(2.0).put(path, body:) end # Provides a paginated list of pallet packages in a shipment. A palletized shipment will have pallets when the @@ -473,7 +473,7 @@ def list_shipment_pallets(inbound_plan_id, shipment_id, page_size: nil, paginati "paginationToken" => pagination_token, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Cancels a self-ship appointment slot against a shipment. @@ -486,7 +486,7 @@ def cancel_self_ship_appointment(inbound_plan_id, shipment_id, body) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/selfShipAppointmentCancellation" body = body - rate_limit(0.5).put(path, body:) + rate_limit(2.0).put(path, body:) end # Retrieves a list of available self-ship appointment slots used to drop off a shipment at a warehouse. @@ -506,7 +506,7 @@ def get_self_ship_appointment_slots(inbound_plan_id, shipment_id, page_size: nil "paginationToken" => pagination_token, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Initiates the process of generating the appointment slots list. @@ -519,7 +519,7 @@ def generate_self_ship_appointment_slots(inbound_plan_id, shipment_id, body) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/selfShipAppointmentSlots" body = body - rate_limit(0.5).post(path, body:) + rate_limit(2.0).post(path, body:) end # Confirms or reschedules a self-ship appointment slot against a shipment. @@ -533,7 +533,7 @@ def schedule_self_ship_appointment(inbound_plan_id, shipment_id, slot_id, body) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/selfShipAppointmentSlots/#{slot_id}/schedule" body = body - rate_limit(0.5).post(path, body:) + rate_limit(2.0).post(path, body:) end # Updates the source address of an existing shipment. The shipment source address can only be updated prior to the @@ -549,7 +549,7 @@ def update_shipment_source_address(inbound_plan_id, shipment_id, body) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/sourceAddress" body = body - rate_limit(0.5).put(path, body:) + rate_limit(2.0).put(path, body:) end # Updates a shipment's tracking details. @@ -562,7 +562,7 @@ def update_shipment_tracking_details(inbound_plan_id, shipment_id, body) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/shipments/#{shipment_id}/trackingDetails" body = body - rate_limit(0.5).put(path, body:) + rate_limit(2.0).put(path, body:) end # Retrieves all transportation options for a shipment. Transportation options must first be generated by the @@ -589,7 +589,7 @@ def list_transportation_options(inbound_plan_id, page_size: nil, pagination_toke "shipmentId" => shipment_id, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Generates available transportation options for a given placement option. @@ -601,7 +601,7 @@ def generate_transportation_options(inbound_plan_id, body) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/transportationOptions" body = body - rate_limit(0.5).post(path, body:) + rate_limit(2.0).post(path, body:) end # Confirms all the transportation options for an inbound plan. A placement option must be confirmed prior to use @@ -614,7 +614,7 @@ def confirm_transportation_options(inbound_plan_id, body) path = "/inbound/fba/2024-03-20/inboundPlans/#{inbound_plan_id}/transportationOptions/confirmation" body = body - rate_limit(0.5).post(path, body:) + rate_limit(2.0).post(path, body:) end # List the inbound compliance details for MSKUs in a given marketplace. @@ -630,7 +630,7 @@ def list_item_compliance_details(mskus, marketplace_id) "marketplaceId" => marketplace_id, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Update compliance details for list of MSKUs. The details provided here are only used for the IN marketplace @@ -647,7 +647,7 @@ def update_item_compliance_details(marketplace_id, body) "marketplaceId" => marketplace_id, }.compact - rate_limit(0.5).put(path, body:, params:) + rate_limit(2.0).put(path, body:, params:) end # For a given marketplace - creates labels for a list of mskus. @@ -658,7 +658,7 @@ def create_marketplace_item_labels(body) path = "/inbound/fba/2024-03-20/items/labels" body = body - rate_limit(0.5).post(path, body:) + rate_limit(2.0).post(path, body:) end # Gets the status of the processing of an asynchronous API call. @@ -668,7 +668,7 @@ def create_marketplace_item_labels(body) def get_inbound_operation_status(operation_id) path = "/inbound/fba/2024-03-20/operations/#{operation_id}" - rate_limit(0.5).get(path) + rate_limit(2.0).get(path) end end end diff --git a/lib/peddler/api/fulfillment_inbound_v0.rb b/lib/peddler/api/fulfillment_inbound_v0.rb index 6ae43fdb..a3d5b62e 100644 --- a/lib/peddler/api/fulfillment_inbound_v0.rb +++ b/lib/peddler/api/fulfillment_inbound_v0.rb @@ -22,7 +22,7 @@ def create_inbound_shipment_plan(body) path = "/fba/inbound/v0/plans" body = body - rate_limit(0.5).post(path, body:) + rate_limit(2.0).post(path, body:) end # Returns a new inbound shipment based on the specified shipmentId that was returned by the @@ -36,7 +36,7 @@ def create_inbound_shipment(body, shipment_id) path = "/fba/inbound/v0/shipments/#{shipment_id}" body = body - rate_limit(0.5).post(path, body:) + rate_limit(2.0).post(path, body:) end # Updates or removes items from the inbound shipment identified by the specified shipment identifier. Adding new @@ -50,7 +50,7 @@ def update_inbound_shipment(body, shipment_id) path = "/fba/inbound/v0/shipments/#{shipment_id}" body = body - rate_limit(0.5).put(path, body:) + rate_limit(2.0).put(path, body:) end # Returns pre-order information, including dates, that a seller needs before confirming a shipment for pre-order. @@ -65,7 +65,7 @@ def get_preorder_info(shipment_id, marketplace_id) "MarketplaceId" => marketplace_id, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Returns information needed to confirm a shipment for pre-order. Call this operation after calling the @@ -85,7 +85,7 @@ def confirm_preorder(shipment_id, need_by_date, marketplace_id) "MarketplaceId" => marketplace_id, }.compact - rate_limit(0.5).put(path, params:) + rate_limit(2.0).put(path, params:) end # Returns labeling requirements and item preparation instructions to help prepare items for shipment to Amazon's @@ -114,7 +114,7 @@ def get_prep_instructions(ship_to_country_code, seller_sku_list: nil, asin_list: "ASINList" => asin_list, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Returns current transportation information about an inbound shipment. @@ -125,7 +125,7 @@ def get_prep_instructions(ship_to_country_code, seller_sku_list: nil, asin_list: def get_transport_details(shipment_id) path = "/fba/inbound/v0/shipments/#{shipment_id}/transport" - rate_limit(0.5).get(path) + rate_limit(2.0).get(path) end # Sends transportation information to Amazon about an inbound shipment. @@ -138,7 +138,7 @@ def put_transport_details(shipment_id, body) path = "/fba/inbound/v0/shipments/#{shipment_id}/transport" body = body - rate_limit(0.5).put(path, body:) + rate_limit(2.0).put(path, body:) end # Cancels a previously-confirmed request to ship an inbound shipment using an Amazon-partnered carrier. To be @@ -154,7 +154,7 @@ def put_transport_details(shipment_id, body) def void_transport(shipment_id) path = "/fba/inbound/v0/shipments/#{shipment_id}/transport/void" - rate_limit(0.5).post(path) + rate_limit(2.0).post(path) end # Initiates the process of estimating the shipping cost for an inbound shipment by an Amazon-partnered carrier. @@ -167,7 +167,7 @@ def void_transport(shipment_id) def estimate_transport(shipment_id) path = "/fba/inbound/v0/shipments/#{shipment_id}/transport/estimate" - rate_limit(0.5).post(path) + rate_limit(2.0).post(path) end # Confirms that the seller accepts the Amazon-partnered shipping estimate, agrees to allow Amazon to charge their @@ -186,7 +186,7 @@ def estimate_transport(shipment_id) def confirm_transport(shipment_id) path = "/fba/inbound/v0/shipments/#{shipment_id}/transport/confirm" - rate_limit(0.5).post(path) + rate_limit(2.0).post(path) end # Returns package/pallet labels for faster and more accurate shipment processing at the Amazon fulfillment center. @@ -220,7 +220,7 @@ def get_labels(shipment_id, page_type, label_type, number_of_packages: nil, pack "PageStartIndex" => page_start_index, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Returns a bill of lading for a Less Than Truckload/Full Truckload (LTL/FTL) shipment. The getBillOfLading @@ -233,7 +233,7 @@ def get_labels(shipment_id, page_type, label_type, number_of_packages: nil, pack def get_bill_of_lading(shipment_id) path = "/fba/inbound/v0/shipments/#{shipment_id}/billOfLading" - rate_limit(0.5).get(path) + rate_limit(2.0).get(path) end # Returns a list of inbound shipments based on criteria that you specify. @@ -268,7 +268,7 @@ def get_shipments(query_type, marketplace_id, shipment_status_list: nil, shipmen "MarketplaceId" => marketplace_id, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Returns a list of items in a specified inbound shipment. @@ -283,7 +283,7 @@ def get_shipment_items_by_shipment_id(shipment_id, marketplace_id) "MarketplaceId" => marketplace_id, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Returns a list of items in a specified inbound shipment, or a list of items that were updated within a specified @@ -311,7 +311,7 @@ def get_shipment_items(query_type, marketplace_id, last_updated_after: nil, last "MarketplaceId" => marketplace_id, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end end end diff --git a/lib/peddler/api/fulfillment_outbound_2020_07_01.rb b/lib/peddler/api/fulfillment_outbound_2020_07_01.rb index 8249d91c..0c664cc5 100644 --- a/lib/peddler/api/fulfillment_outbound_2020_07_01.rb +++ b/lib/peddler/api/fulfillment_outbound_2020_07_01.rb @@ -18,7 +18,7 @@ def get_fulfillment_preview(body) path = "/fba/outbound/2020-07-01/fulfillmentOrders/preview" body = body - rate_limit(0.5).post(path, body:) + rate_limit(2.0).post(path, body:) end # Returns delivery options that include an estimated delivery date and offer expiration, based on criteria that @@ -30,7 +30,7 @@ def delivery_offers(body) path = "/fba/outbound/2020-07-01/deliveryOffers" body = body - rate_limit(0.2).post(path, body:) + rate_limit(5.0).post(path, body:) end # Returns a list of fulfillment orders fulfilled after (or at) a specified date-time, or indicated by the next @@ -48,7 +48,7 @@ def list_all_fulfillment_orders(query_start_date: nil, next_token: nil) "nextToken" => next_token, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Requests that Amazon ship items from the seller's inventory in Amazon's fulfillment network to a destination @@ -60,7 +60,7 @@ def create_fulfillment_order(body) path = "/fba/outbound/2020-07-01/fulfillmentOrders" body = body - rate_limit(0.5).post(path, body:) + rate_limit(2.0).post(path, body:) end # Returns delivery tracking information for a package in an outbound shipment for a Multi-Channel Fulfillment @@ -75,7 +75,7 @@ def get_package_tracking_details(package_number) "packageNumber" => package_number, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Returns a list of return reason codes for a seller SKU in a given marketplace. The parameters for this operation @@ -99,7 +99,7 @@ def list_return_reason_codes(seller_sku, marketplace_id: nil, seller_fulfillment "language" => language, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Creates a fulfillment return. @@ -113,7 +113,7 @@ def create_fulfillment_return(body, seller_fulfillment_order_id) path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}/return" body = body - rate_limit(0.5).put(path, body:) + rate_limit(2.0).put(path, body:) end # Returns the fulfillment order indicated by the specified order identifier. @@ -124,7 +124,7 @@ def create_fulfillment_return(body, seller_fulfillment_order_id) def get_fulfillment_order(seller_fulfillment_order_id) path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}" - rate_limit(0.5).get(path) + rate_limit(2.0).get(path) end # Updates and/or requests shipment for a fulfillment order with an order hold on it. @@ -137,7 +137,7 @@ def update_fulfillment_order(body, seller_fulfillment_order_id) path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}" body = body - rate_limit(0.5).put(path, body:) + rate_limit(2.0).put(path, body:) end # Requests that Amazon stop attempting to fulfill the fulfillment order indicated by the specified order @@ -149,7 +149,7 @@ def update_fulfillment_order(body, seller_fulfillment_order_id) def cancel_fulfillment_order(seller_fulfillment_order_id) path = "/fba/outbound/2020-07-01/fulfillmentOrders/#{seller_fulfillment_order_id}/cancel" - rate_limit(0.5).put(path) + rate_limit(2.0).put(path) end # Requests that Amazon update the status of an order in the sandbox testing environment. This is a sandbox-only @@ -180,7 +180,7 @@ def get_features(marketplace_id) "marketplaceId" => marketplace_id, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Returns a list of inventory items that are eligible for the fulfillment feature you specify. @@ -198,7 +198,7 @@ def get_feature_inventory(marketplace_id, feature_name, next_token: nil) "nextToken" => next_token, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end # Returns the number of items with the sellerSKU you specify that can have orders fulfilled using the specified @@ -217,7 +217,7 @@ def get_feature_sku(marketplace_id, feature_name, seller_sku) "marketplaceId" => marketplace_id, }.compact - rate_limit(0.5).get(path, params:) + rate_limit(2.0).get(path, params:) end end end diff --git a/lib/peddler/api/listings_items_2020_09_01.rb b/lib/peddler/api/listings_items_2020_09_01.rb index 3de3f9cd..3cfdc223 100644 --- a/lib/peddler/api/listings_items_2020_09_01.rb +++ b/lib/peddler/api/listings_items_2020_09_01.rb @@ -30,7 +30,7 @@ def delete_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil) "issueLocale" => issue_locale, }.compact - rate_limit(0.2).delete(path, params:) + rate_limit(5.0).delete(path, params:) end # Partially update (patch) a listings item for a selling partner. Only top-level listings item attributes can be @@ -55,7 +55,7 @@ def patch_listings_item(seller_id, sku, marketplace_ids, body, issue_locale: nil "issueLocale" => issue_locale, }.compact - rate_limit(0.2).patch(path, body:, params:) + rate_limit(5.0).patch(path, body:, params:) end # Creates a new or fully-updates an existing listings item for a selling partner. @@ -79,7 +79,7 @@ def put_listings_item(seller_id, sku, marketplace_ids, body, issue_locale: nil) "issueLocale" => issue_locale, }.compact - rate_limit(0.2).put(path, body:, params:) + rate_limit(5.0).put(path, body:, params:) end end end diff --git a/lib/peddler/api/listings_items_2021_08_01.rb b/lib/peddler/api/listings_items_2021_08_01.rb index 771d2972..51c7ae0a 100644 --- a/lib/peddler/api/listings_items_2021_08_01.rb +++ b/lib/peddler/api/listings_items_2021_08_01.rb @@ -31,7 +31,7 @@ def delete_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil) "issueLocale" => issue_locale, }.compact - rate_limit(0.2).delete(path, params:) + rate_limit(5.0).delete(path, params:) end # Returns details about a listings item for a selling partner. @@ -56,7 +56,7 @@ def get_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil, includ "includedData" => included_data, }.compact - rate_limit(0.2).get(path, params:) + rate_limit(5.0).get(path, params:) end # Partially update (patch) a listings item for a selling partner. Only top-level listings item attributes can be @@ -87,7 +87,7 @@ def patch_listings_item(seller_id, sku, marketplace_ids, body, included_data: ni "issueLocale" => issue_locale, }.compact - rate_limit(0.2).patch(path, body:, params:) + rate_limit(5.0).patch(path, body:, params:) end # Creates or fully updates an existing listings item for a selling partner. @@ -117,7 +117,7 @@ def put_listings_item(seller_id, sku, marketplace_ids, body, included_data: nil, "issueLocale" => issue_locale, }.compact - rate_limit(0.2).put(path, body:, params:) + rate_limit(5.0).put(path, body:, params:) end end end diff --git a/lib/peddler/api/listings_restrictions_2021_08_01.rb b/lib/peddler/api/listings_restrictions_2021_08_01.rb index a4ed8a9a..05f927a3 100644 --- a/lib/peddler/api/listings_restrictions_2021_08_01.rb +++ b/lib/peddler/api/listings_restrictions_2021_08_01.rb @@ -30,7 +30,7 @@ def get_listings_restrictions(asin, seller_id, marketplace_ids, condition_type: "reasonLocale" => reason_locale, }.compact - rate_limit(0.2).get(path, params:) + rate_limit(5.0).get(path, params:) end end end diff --git a/lib/peddler/api/merchant_fulfillment_v0.rb b/lib/peddler/api/merchant_fulfillment_v0.rb index 968a4341..51bc3398 100644 --- a/lib/peddler/api/merchant_fulfillment_v0.rb +++ b/lib/peddler/api/merchant_fulfillment_v0.rb @@ -17,7 +17,7 @@ def get_eligible_shipment_services(body) path = "/mfn/v0/eligibleShippingServices" body = body - rate_limit(0.2).post(path, body:) + rate_limit(5.0).post(path, body:) end # Returns the shipment information for an existing shipment. diff --git a/lib/peddler/api/orders_v0.rb b/lib/peddler/api/orders_v0.rb index 746198ef..e0ac305b 100644 --- a/lib/peddler/api/orders_v0.rb +++ b/lib/peddler/api/orders_v0.rb @@ -138,7 +138,7 @@ def get_orders( "LatestDeliveryDateAfter" => latest_delivery_date_after, }.compact - rate_limit(60.0).get(path, params:) + rate_limit(0.0167).get(path, params:) end # Returns the order that you specify. @@ -148,7 +148,7 @@ def get_orders( def get_order(order_id) path = "/orders/v0/orders/#{order_id}" - rate_limit(2.0).get(path) + rate_limit(0.5).get(path) end # Returns buyer information for the order that you specify. @@ -158,7 +158,7 @@ def get_order(order_id) def get_order_buyer_info(order_id) path = "/orders/v0/orders/#{order_id}/buyerInfo" - rate_limit(2.0).get(path) + rate_limit(0.5).get(path) end # Returns the shipping address for the order that you specify. @@ -168,7 +168,7 @@ def get_order_buyer_info(order_id) def get_order_address(order_id) path = "/orders/v0/orders/#{order_id}/address" - rate_limit(2.0).get(path) + rate_limit(0.5).get(path) end # Returns detailed order item information for the order that you specify. If `NextToken` is provided, it's used to @@ -188,7 +188,7 @@ def get_order_items(order_id, next_token: nil) "NextToken" => next_token, }.compact - rate_limit(2.0).get(path, params:) + rate_limit(0.5).get(path, params:) end # Returns buyer information for the order items in the order that you specify. @@ -202,7 +202,7 @@ def get_order_items_buyer_info(order_id, next_token: nil) "NextToken" => next_token, }.compact - rate_limit(2.0).get(path, params:) + rate_limit(0.5).get(path, params:) end # Update the shipment status for an order that you specify. @@ -214,7 +214,7 @@ def update_shipment_status(order_id, payload) path = "/orders/v0/orders/#{order_id}/shipment" body = payload - rate_limit(0.2).post(path, body:) + rate_limit(5.0).post(path, body:) end # Returns regulated information for the order that you specify. @@ -224,7 +224,7 @@ def update_shipment_status(order_id, payload) def get_order_regulated_info(order_id) path = "/orders/v0/orders/#{order_id}/regulatedInfo" - rate_limit(2.0).get(path) + rate_limit(0.5).get(path) end # Updates (approves or rejects) the verification status of an order containing regulated products. @@ -236,7 +236,7 @@ def update_verification_status(order_id, payload) path = "/orders/v0/orders/#{order_id}/regulatedInfo" body = payload - rate_limit(2.0).patch(path, body:) + rate_limit(0.5).patch(path, body:) end # Updates the shipment confirmation status for a specified order. @@ -248,7 +248,7 @@ def confirm_shipment(order_id, payload) path = "/orders/v0/orders/#{order_id}/shipmentConfirmation" body = payload - rate_limit(0.5).post(path, body:) + rate_limit(2.0).post(path, body:) end end end diff --git a/lib/peddler/api/product_fees_v0.rb b/lib/peddler/api/product_fees_v0.rb index b3ac6e93..6084bca2 100644 --- a/lib/peddler/api/product_fees_v0.rb +++ b/lib/peddler/api/product_fees_v0.rb @@ -65,7 +65,7 @@ def get_my_fees_estimates(body) path = "/products/fees/v0/feesEstimate" body = body - rate_limit(2.0).post(path, body:) + rate_limit(0.5).post(path, body:) end end end diff --git a/lib/peddler/api/product_pricing_2022_05_01.rb b/lib/peddler/api/product_pricing_2022_05_01.rb index 4c610fc7..29b26d74 100644 --- a/lib/peddler/api/product_pricing_2022_05_01.rb +++ b/lib/peddler/api/product_pricing_2022_05_01.rb @@ -24,7 +24,7 @@ def get_featured_offer_expected_price_batch(get_featured_offer_expected_price_ba path = "/batches/products/pricing/2022-05-01/offer/featuredOfferExpectedPrice" body = get_featured_offer_expected_price_batch_request_body - rate_limit(30.0).post(path, body:) + rate_limit(0.033).post(path, body:) end # Returns the competitive summary response including featured buying options for the ASIN and `marketplaceId` @@ -36,7 +36,7 @@ def get_competitive_summary(requests) path = "/batches/products/pricing/2022-05-01/items/competitiveSummary" body = requests - rate_limit(30.0).post(path, body:) + rate_limit(0.033).post(path, body:) end end end diff --git a/lib/peddler/api/product_pricing_v0.rb b/lib/peddler/api/product_pricing_v0.rb index 084e1a13..24548044 100644 --- a/lib/peddler/api/product_pricing_v0.rb +++ b/lib/peddler/api/product_pricing_v0.rb @@ -40,7 +40,7 @@ def get_pricing(marketplace_id, item_type, asins: nil, skus: nil, item_condition "OfferType" => offer_type, }.compact - rate_limit(2.0).get(path, params:) + rate_limit(0.5).get(path, params:) end # Returns competitive pricing information for a seller's offer listings based on seller SKU or ASIN. @@ -71,7 +71,7 @@ def get_competitive_pricing(marketplace_id, item_type, asins: nil, skus: nil, cu "CustomerType" => customer_type, }.compact - rate_limit(2.0).get(path, params:) + rate_limit(0.5).get(path, params:) end # Returns the lowest priced offers for a single SKU listing. @@ -115,7 +115,7 @@ def get_item_offers(marketplace_id, item_condition, asin, customer_type: nil) "CustomerType" => customer_type, }.compact - rate_limit(2.0).get(path, params:) + rate_limit(0.5).get(path, params:) end # Returns the lowest priced offers for a batch of items based on ASIN. @@ -126,7 +126,7 @@ def get_item_offers_batch(get_item_offers_batch_request_body) path = "/batches/products/pricing/v0/itemOffers" body = get_item_offers_batch_request_body - rate_limit(10.0).post(path, body:) + rate_limit(0.1).post(path, body:) end # Returns the lowest priced offers for a batch of listings by SKU. @@ -137,7 +137,7 @@ def get_listing_offers_batch(get_listing_offers_batch_request_body) path = "/batches/products/pricing/v0/listingOffers" body = get_listing_offers_batch_request_body - rate_limit(2.0).post(path, body:) + rate_limit(0.5).post(path, body:) end end end diff --git a/lib/peddler/api/product_type_definitions_2020_09_01.rb b/lib/peddler/api/product_type_definitions_2020_09_01.rb index 59887a32..99382942 100644 --- a/lib/peddler/api/product_type_definitions_2020_09_01.rb +++ b/lib/peddler/api/product_type_definitions_2020_09_01.rb @@ -35,7 +35,7 @@ def search_definitions_product_types(marketplace_ids, keywords: nil, item_name: "searchLocale" => search_locale, }.compact - rate_limit(0.2).get(path, params:) + rate_limit(5.0).get(path, params:) end # Retrieve an Amazon product type definition. @@ -68,7 +68,7 @@ def get_definitions_product_type(product_type, marketplace_ids, seller_id: nil, "locale" => locale, }.compact - rate_limit(0.2).get(path, params:) + rate_limit(5.0).get(path, params:) end end end diff --git a/lib/peddler/api/reports_2021_06_30.rb b/lib/peddler/api/reports_2021_06_30.rb index f49a26f5..8e1016bc 100644 --- a/lib/peddler/api/reports_2021_06_30.rb +++ b/lib/peddler/api/reports_2021_06_30.rb @@ -42,7 +42,7 @@ def get_reports(report_types: nil, processing_statuses: nil, marketplace_ids: ni "nextToken" => next_token, }.compact - rate_limit(45.0).get(path, params:) + rate_limit(0.0222).get(path, params:) end # Creates a report. @@ -53,7 +53,7 @@ def create_report(body) path = "/reports/2021-06-30/reports" body = body - rate_limit(60.0).post(path, body:) + rate_limit(0.0167).post(path, body:) end # Cancels the report that you specify. Only reports with `processingStatus=IN_QUEUE` can be cancelled. Cancelled @@ -65,7 +65,7 @@ def create_report(body) def cancel_report(report_id) path = "/reports/2021-06-30/reports/#{report_id}" - rate_limit(45.0).delete(path) + rate_limit(0.0222).delete(path) end # Returns report details (including the `reportDocumentId`, if available) for the report that you specify. @@ -76,7 +76,7 @@ def cancel_report(report_id) def get_report(report_id) path = "/reports/2021-06-30/reports/#{report_id}" - rate_limit(0.5).get(path) + rate_limit(2.0).get(path) end # Returns report schedule details that match the filters that you specify. @@ -90,7 +90,7 @@ def get_report_schedules(report_types) "reportTypes" => report_types, }.compact - rate_limit(45.0).get(path, params:) + rate_limit(0.0222).get(path, params:) end # Creates a report schedule. If a report schedule with the same report type and marketplace IDs already exists, it @@ -102,7 +102,7 @@ def create_report_schedule(body) path = "/reports/2021-06-30/schedules" body = body - rate_limit(45.0).post(path, body:) + rate_limit(0.0222).post(path, body:) end # Cancels the report schedule that you specify. @@ -113,7 +113,7 @@ def create_report_schedule(body) def cancel_report_schedule(report_schedule_id) path = "/reports/2021-06-30/schedules/#{report_schedule_id}" - rate_limit(45.0).delete(path) + rate_limit(0.0222).delete(path) end # Returns report schedule details for the report schedule that you specify. @@ -124,7 +124,7 @@ def cancel_report_schedule(report_schedule_id) def get_report_schedule(report_schedule_id) path = "/reports/2021-06-30/schedules/#{report_schedule_id}" - rate_limit(45.0).get(path) + rate_limit(0.0222).get(path) end # Returns the information required for retrieving a report document's contents. @@ -134,7 +134,7 @@ def get_report_schedule(report_schedule_id) def get_report_document(report_document_id) path = "/reports/2021-06-30/documents/#{report_document_id}" - rate_limit(60.0).get(path) + rate_limit(0.0167).get(path) end end end diff --git a/lib/peddler/api/sales_v1.rb b/lib/peddler/api/sales_v1.rb index dfd16d97..c9f03496 100644 --- a/lib/peddler/api/sales_v1.rb +++ b/lib/peddler/api/sales_v1.rb @@ -62,7 +62,7 @@ def get_order_metrics(marketplace_ids, interval, granularity, granularity_time_z "sku" => sku, }.compact - rate_limit(2.0).get(path, params:) + rate_limit(0.5).get(path, params:) end end end diff --git a/lib/peddler/api/sellers_v1.rb b/lib/peddler/api/sellers_v1.rb index 7e9734ed..5eb9d8f7 100644 --- a/lib/peddler/api/sellers_v1.rb +++ b/lib/peddler/api/sellers_v1.rb @@ -18,7 +18,7 @@ class SellersV1 < API def get_marketplace_participations path = "/sellers/v1/marketplaceParticipations" - rate_limit(62.5).get(path) + rate_limit(0.016).get(path) end # Returns information about a seller account and its marketplaces. @@ -26,7 +26,7 @@ def get_marketplace_participations def get_account path = "/sellers/v1/account" - rate_limit(62.5).get(path) + rate_limit(0.016).get(path) end end end diff --git a/lib/peddler/api/services_v1.rb b/lib/peddler/api/services_v1.rb index 4abc130e..e56ebc31 100644 --- a/lib/peddler/api/services_v1.rb +++ b/lib/peddler/api/services_v1.rb @@ -16,7 +16,7 @@ class ServicesV1 < API def get_service_job_by_service_job_id(service_job_id) path = "/service/v1/serviceJobs/#{service_job_id}" - rate_limit(0.05).get(path) + rate_limit(20.0).get(path) end # Cancels the service job indicated by the service job identifier specified. @@ -31,7 +31,7 @@ def cancel_service_job_by_service_job_id(service_job_id, cancellation_reason_cod "cancellationReasonCode" => cancellation_reason_code, }.compact - rate_limit(0.2).put(path, params:) + rate_limit(5.0).put(path, params:) end # Completes the service job indicated by the service job identifier specified. @@ -41,7 +41,7 @@ def cancel_service_job_by_service_job_id(service_job_id, cancellation_reason_cod def complete_service_job_by_service_job_id(service_job_id) path = "/service/v1/serviceJobs/#{service_job_id}/completions" - rate_limit(0.2).put(path) + rate_limit(5.0).put(path) end # Gets service job details for the specified filter query. @@ -103,7 +103,7 @@ def get_service_jobs( "storeIds" => store_ids, }.compact - rate_limit(0.1).get(path, params:) + rate_limit(10.0).get(path, params:) end # Adds an appointment to the service job indicated by the service job identifier specified. @@ -115,7 +115,7 @@ def add_appointment_for_service_job_by_service_job_id(service_job_id, body) path = "/service/v1/serviceJobs/#{service_job_id}/appointments" body = body - rate_limit(0.2).post(path, body:) + rate_limit(5.0).post(path, body:) end # Reschedules an appointment for the service job indicated by the service job identifier specified. @@ -128,7 +128,7 @@ def reschedule_appointment_for_service_job_by_service_job_id(service_job_id, app path = "/service/v1/serviceJobs/#{service_job_id}/appointments/#{appointment_id}" body = body - rate_limit(0.2).post(path, body:) + rate_limit(5.0).post(path, body:) end # Assigns new resource(s) or overwrite/update the existing one(s) to a service job appointment. @@ -156,7 +156,7 @@ def set_appointment_fulfillment_data(service_job_id, appointment_id, body) path = "/service/v1/serviceJobs/#{service_job_id}/appointments/#{appointment_id}/fulfillment" body = body - rate_limit(0.2).put(path, body:) + rate_limit(5.0).put(path, body:) end # Provides capacity slots in a format similar to availability records. @@ -174,7 +174,7 @@ def get_range_slot_capacity(resource_id, body, marketplace_ids, next_page_token: "nextPageToken" => next_page_token, }.compact - rate_limit(0.2).post(path, body:, params:) + rate_limit(5.0).post(path, body:, params:) end # Provides capacity in fixed-size slots. @@ -192,7 +192,7 @@ def get_fixed_slot_capacity(resource_id, body, marketplace_ids, next_page_token: "nextPageToken" => next_page_token, }.compact - rate_limit(0.2).post(path, body:, params:) + rate_limit(5.0).post(path, body:, params:) end # Update the schedule of the given resource. @@ -208,7 +208,7 @@ def update_schedule(resource_id, body, marketplace_ids) "marketplaceIds" => marketplace_ids, }.compact - rate_limit(0.2).put(path, body:, params:) + rate_limit(5.0).put(path, body:, params:) end # Create a reservation. @@ -223,7 +223,7 @@ def create_reservation(body, marketplace_ids) "marketplaceIds" => marketplace_ids, }.compact - rate_limit(0.2).post(path, body:, params:) + rate_limit(5.0).post(path, body:, params:) end # Update a reservation. @@ -239,7 +239,7 @@ def update_reservation(reservation_id, body, marketplace_ids) "marketplaceIds" => marketplace_ids, }.compact - rate_limit(0.2).put(path, body:, params:) + rate_limit(5.0).put(path, body:, params:) end # Cancel a reservation. @@ -253,7 +253,7 @@ def cancel_reservation(reservation_id, marketplace_ids) "marketplaceIds" => marketplace_ids, }.compact - rate_limit(0.2).delete(path, params:) + rate_limit(5.0).delete(path, params:) end # Gets appointment slots for the service associated with the service job id specified. @@ -275,7 +275,7 @@ def get_appointmment_slots_by_job_id(service_job_id, marketplace_ids, start_time "endTime" => end_time, }.compact - rate_limit(0.2).get(path, params:) + rate_limit(5.0).get(path, params:) end # Gets appointment slots as per the service context specified. @@ -300,7 +300,7 @@ def get_appointment_slots(asin, store_id, marketplace_ids, start_time: nil, end_ "endTime" => end_time, }.compact - rate_limit(0.05).get(path, params:) + rate_limit(20.0).get(path, params:) end # Creates an upload destination. @@ -311,7 +311,7 @@ def create_service_document_upload_destination(body) path = "/service/v1/documents" body = body - rate_limit(0.2).post(path, body:) + rate_limit(5.0).post(path, body:) end end end diff --git a/lib/peddler/api/shipment_invoicing_v0.rb b/lib/peddler/api/shipment_invoicing_v0.rb index 8090905a..69195695 100644 --- a/lib/peddler/api/shipment_invoicing_v0.rb +++ b/lib/peddler/api/shipment_invoicing_v0.rb @@ -18,7 +18,7 @@ class ShipmentInvoicingV0 < API def get_shipment_details(shipment_id) path = "/fba/outbound/brazil/v0/shipments/#{shipment_id}" - rate_limit(1.0).get(path) + rate_limit(1.133).get(path) end # Submits a shipment invoice document for a given shipment. @@ -30,7 +30,7 @@ def submit_invoice(shipment_id, body) path = "/fba/outbound/brazil/v0/shipments/#{shipment_id}/invoice" body = body - rate_limit(1.0).post(path, body:) + rate_limit(1.133).post(path, body:) end # Returns the invoice status for the shipment you specify. @@ -40,7 +40,7 @@ def submit_invoice(shipment_id, body) def get_invoice_status(shipment_id) path = "/fba/outbound/brazil/v0/shipments/#{shipment_id}/invoice/status" - rate_limit(1.0).get(path) + rate_limit(1.133).get(path) end end end diff --git a/lib/peddler/api/shipping_v1.rb b/lib/peddler/api/shipping_v1.rb index 7b5dcba2..a82ff955 100644 --- a/lib/peddler/api/shipping_v1.rb +++ b/lib/peddler/api/shipping_v1.rb @@ -20,7 +20,7 @@ def create_shipment(body) path = "/shipping/v1/shipments" body = body - rate_limit(0.2).post(path, body:) + rate_limit(5.0).post(path, body:) end # Return the entire shipment object for the shipmentId. @@ -30,7 +30,7 @@ def create_shipment(body) def get_shipment(shipment_id) path = "/shipping/v1/shipments/#{shipment_id}" - rate_limit(0.2).get(path) + rate_limit(5.0).get(path) end # Cancel a shipment by the given shipmentId. @@ -40,7 +40,7 @@ def get_shipment(shipment_id) def cancel_shipment(shipment_id) path = "/shipping/v1/shipments/#{shipment_id}/cancel" - rate_limit(0.2).post(path) + rate_limit(5.0).post(path) end # Purchase shipping labels based on a given rate. @@ -52,7 +52,7 @@ def purchase_labels(shipment_id, body) path = "/shipping/v1/shipments/#{shipment_id}/purchaseLabels" body = body - rate_limit(0.2).post(path, body:) + rate_limit(5.0).post(path, body:) end # Retrieve shipping label based on the shipment id and tracking id. @@ -65,7 +65,7 @@ def retrieve_shipping_label(shipment_id, tracking_id, body) path = "/shipping/v1/shipments/#{shipment_id}/containers/#{tracking_id}/label" body = body - rate_limit(0.2).post(path, body:) + rate_limit(5.0).post(path, body:) end # Purchase shipping labels. @@ -76,7 +76,7 @@ def purchase_shipment(body) path = "/shipping/v1/purchaseShipment" body = body - rate_limit(0.2).post(path, body:) + rate_limit(5.0).post(path, body:) end # Get service rates. @@ -87,7 +87,7 @@ def get_rates(body) path = "/shipping/v1/rates" body = body - rate_limit(0.2).post(path, body:) + rate_limit(5.0).post(path, body:) end # Verify if the current account is valid. @@ -95,7 +95,7 @@ def get_rates(body) def get_account path = "/shipping/v1/account" - rate_limit(0.2).get(path) + rate_limit(5.0).get(path) end # Return the tracking information of a shipment. diff --git a/lib/peddler/api/shipping_v2.rb b/lib/peddler/api/shipping_v2.rb index b4b69b04..ad3f1e98 100644 --- a/lib/peddler/api/shipping_v2.rb +++ b/lib/peddler/api/shipping_v2.rb @@ -20,7 +20,7 @@ def get_rates(body, x_amzn_shipping_business_id: nil) path = "/shipping/v2/shipments/rates" body = body - rate_limit(0.0).post(path, body:) + rate_limit(80.0).post(path, body:) end # Purchases the shipping service for a shipment using the best fit service offering. Returns purchase related @@ -39,7 +39,7 @@ def direct_purchase_shipment(body, x_amzn_idempotency_key: nil, locale: nil, x_a path = "/shipping/v2/shipments/directPurchase" body = body - rate_limit(0.0).post(path, body:) + rate_limit(80.0).post(path, body:) end # Purchases a shipping service and returns purchase related details and documents. Note: You must complete the @@ -57,7 +57,7 @@ def purchase_shipment(body, x_amzn_idempotency_key: nil, x_amzn_shipping_busines path = "/shipping/v2/shipments" body = body - rate_limit(0.0).post(path, body:) + rate_limit(80.0).post(path, body:) end # Purchases a shipping service identifier and returns purchase-related details and documents. @@ -70,7 +70,7 @@ def one_click_shipment(body, x_amzn_shipping_business_id: nil) path = "/shipping/v2/oneClickShipment" body = body - rate_limit(0.0).post(path, body:) + rate_limit(80.0).post(path, body:) end # Returns tracking information for a purchased shipment. @@ -89,7 +89,7 @@ def get_tracking(tracking_id, carrier_id, x_amzn_shipping_business_id: nil) "carrierId" => carrier_id, }.compact - rate_limit(0.0).get(path, params:) + rate_limit(80.0).get(path, params:) end # Returns the shipping documents associated with a package in a shipment. @@ -113,7 +113,7 @@ def get_shipment_documents(shipment_id, package_client_reference_id, format: nil "dpi" => dpi, }.compact - rate_limit(0.0).get(path, params:) + rate_limit(80.0).get(path, params:) end # Cancels a purchased shipment. Returns an empty object if the shipment is successfully cancelled. @@ -125,7 +125,7 @@ def get_shipment_documents(shipment_id, package_client_reference_id, format: nil def cancel_shipment(shipment_id, x_amzn_shipping_business_id: nil) path = "/shipping/v2/shipments/#{shipment_id}/cancel" - rate_limit(0.0).put(path) + rate_limit(80.0).put(path) end # Returns the JSON schema to use for providing additional inputs when needed to purchase a shipping offering. Call @@ -145,7 +145,7 @@ def get_additional_inputs(request_token, rate_id, x_amzn_shipping_business_id: n "rateId" => rate_id, }.compact - rate_limit(0.0).get(path, params:) + rate_limit(80.0).get(path, params:) end # This API will return a list of input schema required to register a shipper account with the carrier. @@ -156,7 +156,7 @@ def get_additional_inputs(request_token, rate_id, x_amzn_shipping_business_id: n def get_carrier_account_form_inputs(x_amzn_shipping_business_id: nil) path = "/shipping/v2/carrierAccountFormInputs" - rate_limit(0.0).get(path) + rate_limit(80.0).get(path) end # This API will return Get all carrier accounts for a merchant. @@ -169,7 +169,7 @@ def get_carrier_accounts(body, x_amzn_shipping_business_id: nil) path = "/shipping/v2/carrierAccounts" body = body - rate_limit(0.0).put(path, body:) + rate_limit(80.0).put(path, body:) end # This API associates/links the specified carrier account with the merchant. @@ -183,7 +183,7 @@ def link_carrier_account(carrier_id, body, x_amzn_shipping_business_id: nil) path = "/shipping/v2/carrierAccounts/#{carrier_id}" body = body - rate_limit(0.0).put(path, body:) + rate_limit(80.0).put(path, body:) end # This API Unlink the specified carrier account with the merchant. @@ -197,7 +197,7 @@ def unlink_carrier_account(carrier_id, body, x_amzn_shipping_business_id: nil) path = "/shipping/v2/carrierAccounts/#{carrier_id}/unlink" body = body - rate_limit(0.0).put(path, body:) + rate_limit(80.0).put(path, body:) end # This API Call to generate the collection form. @@ -212,7 +212,7 @@ def generate_collection_form(body, x_amzn_idempotency_key: nil, x_amzn_shipping_ path = "/shipping/v2/collectionForms" body = body - rate_limit(0.0).post(path, body:) + rate_limit(80.0).post(path, body:) end # This API Call to get the history of the previously generated collection forms. @@ -225,7 +225,7 @@ def get_collection_form_history(body, x_amzn_shipping_business_id: nil) path = "/shipping/v2/collectionForms/history" body = body - rate_limit(0.0).put(path, body:) + rate_limit(80.0).put(path, body:) end # This API Get all unmanifested carriers with shipment locations. Any locations which has unmanifested shipments @@ -239,7 +239,7 @@ def get_unmanifested_shipments(body, x_amzn_shipping_business_id: nil) path = "/shipping/v2/unmanifestedShipments" body = body - rate_limit(0.0).put(path, body:) + rate_limit(80.0).put(path, body:) end # This API reprint a collection form. @@ -251,7 +251,7 @@ def get_unmanifested_shipments(body, x_amzn_shipping_business_id: nil) def get_collection_form(collection_form_id, x_amzn_shipping_business_id: nil) path = "/shipping/v2/collectionForms/#{collection_form_id}" - rate_limit(0.0).get(path) + rate_limit(80.0).get(path) end # Returns a list of access points in proximity of input postal code. @@ -270,7 +270,7 @@ def get_access_points(access_point_types, country_code, postal_code, x_amzn_ship "postalCode" => postal_code, }.compact - rate_limit(0.0).get(path, params:) + rate_limit(80.0).get(path, params:) end end end diff --git a/lib/peddler/api/uploads_2020_11_01.rb b/lib/peddler/api/uploads_2020_11_01.rb index dd5f19d5..ba840062 100644 --- a/lib/peddler/api/uploads_2020_11_01.rb +++ b/lib/peddler/api/uploads_2020_11_01.rb @@ -33,7 +33,7 @@ def create_upload_destination_for_resource(marketplace_ids, content_md5, resourc "contentType" => content_type, }.compact - rate_limit(0.1).post(path, params:) + rate_limit(10.0).post(path, params:) end end end diff --git a/lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb b/lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb index b5fcd173..faca041e 100644 --- a/lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb +++ b/lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb @@ -18,7 +18,7 @@ def submit_inventory_update(body, warehouse_id) path = "/vendor/directFulfillment/inventory/v1/warehouses/#{warehouse_id}/items" body = body - rate_limit(0.1).post(path, body:) + rate_limit(10.0).post(path, body:) end end end diff --git a/lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb b/lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb index daf6064f..0e645a5f 100644 --- a/lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb +++ b/lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb @@ -44,7 +44,7 @@ def get_orders(created_after, created_before, ship_from_party_id: nil, status: n "includeDetails" => include_details, }.compact - rate_limit(0.1).get(path, params:) + rate_limit(10.0).get(path, params:) end # Returns purchase order information for the purchaseOrderNumber that you specify. @@ -55,7 +55,7 @@ def get_orders(created_after, created_before, ship_from_party_id: nil, status: n def get_order(purchase_order_number) path = "/vendor/directFulfillment/orders/2021-12-28/purchaseOrders/#{purchase_order_number}" - rate_limit(0.1).get(path) + rate_limit(10.0).get(path) end # Submits acknowledgements for one or more purchase orders. @@ -66,7 +66,7 @@ def submit_acknowledgement(body) path = "/vendor/directFulfillment/orders/2021-12-28/acknowledgements" body = body - rate_limit(0.1).post(path, body:) + rate_limit(10.0).post(path, body:) end end end diff --git a/lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb b/lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb index adf674c6..d7b541bb 100644 --- a/lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb +++ b/lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb @@ -44,7 +44,7 @@ def get_orders(created_after, created_before, ship_from_party_id: nil, status: n "includeDetails" => include_details, }.compact - rate_limit(0.1).get(path, params:) + rate_limit(10.0).get(path, params:) end # Returns purchase order information for the purchaseOrderNumber that you specify. @@ -55,7 +55,7 @@ def get_orders(created_after, created_before, ship_from_party_id: nil, status: n def get_order(purchase_order_number) path = "/vendor/directFulfillment/orders/v1/purchaseOrders/#{purchase_order_number}" - rate_limit(0.1).get(path) + rate_limit(10.0).get(path) end # Submits acknowledgements for one or more purchase orders. @@ -66,7 +66,7 @@ def submit_acknowledgement(body) path = "/vendor/directFulfillment/orders/v1/acknowledgements" body = body - rate_limit(0.1).post(path, body:) + rate_limit(10.0).post(path, body:) end end end diff --git a/lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb b/lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb index 2b927874..1906cfbf 100644 --- a/lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb +++ b/lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb @@ -17,7 +17,7 @@ def submit_invoice(body) path = "/vendor/directFulfillment/payments/v1/invoices" body = body - rate_limit(0.1).post(path, body:) + rate_limit(10.0).post(path, body:) end end end diff --git a/lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb b/lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb index 3854826e..73dcf50d 100644 --- a/lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb +++ b/lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb @@ -36,7 +36,7 @@ def get_shipping_labels(created_after, created_before, ship_from_party_id: nil, "nextToken" => next_token, }.compact - rate_limit(0.1).get(path, params:) + rate_limit(10.0).get(path, params:) end # Creates a shipping label for a purchase order and returns a transactionId for reference. @@ -47,7 +47,7 @@ def submit_shipping_label_request(body) path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels" body = body - rate_limit(0.1).post(path, body:) + rate_limit(10.0).post(path, body:) end # Returns a shipping label for the purchaseOrderNumber that you specify. @@ -58,7 +58,7 @@ def submit_shipping_label_request(body) def get_shipping_label(purchase_order_number) path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels/#{purchase_order_number}" - rate_limit(0.1).get(path) + rate_limit(10.0).get(path) end # Creates shipping labels for a purchase order and returns the labels. @@ -71,7 +71,7 @@ def create_shipping_labels(purchase_order_number, body) path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels/#{purchase_order_number}" body = body - rate_limit(0.1).post(path, body:) + rate_limit(10.0).post(path, body:) end # Submits one or more shipment confirmations for vendor orders. @@ -82,7 +82,7 @@ def submit_shipment_confirmations(body) path = "/vendor/directFulfillment/shipping/2021-12-28/shipmentConfirmations" body = body - rate_limit(0.1).post(path, body:) + rate_limit(10.0).post(path, body:) end # This operation is only to be used by Vendor-Own-Carrier (VOC) vendors. Calling this API submits a shipment @@ -95,7 +95,7 @@ def submit_shipment_status_updates(body) path = "/vendor/directFulfillment/shipping/2021-12-28/shipmentStatusUpdates" body = body - rate_limit(0.1).post(path, body:) + rate_limit(10.0).post(path, body:) end # Returns a list of customer invoices created during a time frame that you specify. You define the time frame @@ -125,7 +125,7 @@ def get_customer_invoices(created_after, created_before, ship_from_party_id: nil "nextToken" => next_token, }.compact - rate_limit(0.1).get(path, params:) + rate_limit(10.0).get(path, params:) end # Returns a customer invoice based on the purchaseOrderNumber that you specify. @@ -135,7 +135,7 @@ def get_customer_invoices(created_after, created_before, ship_from_party_id: nil def get_customer_invoice(purchase_order_number) path = "/vendor/directFulfillment/shipping/2021-12-28/customerInvoices/#{purchase_order_number}" - rate_limit(0.1).get(path) + rate_limit(10.0).get(path) end # Returns a list of packing slips for the purchase orders that match the criteria specified. Date range to search @@ -164,7 +164,7 @@ def get_packing_slips(created_after, created_before, ship_from_party_id: nil, li "nextToken" => next_token, }.compact - rate_limit(0.1).get(path, params:) + rate_limit(10.0).get(path, params:) end # Returns a packing slip based on the purchaseOrderNumber that you specify. @@ -174,7 +174,7 @@ def get_packing_slips(created_after, created_before, ship_from_party_id: nil, li def get_packing_slip(purchase_order_number) path = "/vendor/directFulfillment/shipping/2021-12-28/packingSlips/#{purchase_order_number}" - rate_limit(0.1).get(path) + rate_limit(10.0).get(path) end end end diff --git a/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb b/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb index 42b83750..9bcfce01 100644 --- a/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +++ b/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb @@ -36,7 +36,7 @@ def get_shipping_labels(created_after, created_before, ship_from_party_id: nil, "nextToken" => next_token, }.compact - rate_limit(0.1).get(path, params:) + rate_limit(10.0).get(path, params:) end # Creates a shipping label for a purchase order and returns a `transactionId` for reference. @@ -47,7 +47,7 @@ def submit_shipping_label_request(body) path = "/vendor/directFulfillment/shipping/v1/shippingLabels" body = body - rate_limit(0.1).post(path, body:) + rate_limit(10.0).post(path, body:) end # Returns a shipping label for the `purchaseOrderNumber` that you specify. @@ -58,7 +58,7 @@ def submit_shipping_label_request(body) def get_shipping_label(purchase_order_number) path = "/vendor/directFulfillment/shipping/v1/shippingLabels/#{purchase_order_number}" - rate_limit(0.1).get(path) + rate_limit(10.0).get(path) end # Submits one or more shipment confirmations for vendor orders. @@ -69,7 +69,7 @@ def submit_shipment_confirmations(body) path = "/vendor/directFulfillment/shipping/v1/shipmentConfirmations" body = body - rate_limit(0.1).post(path, body:) + rate_limit(10.0).post(path, body:) end # This API call is only to be used by Vendor-Own-Carrier (VOC) vendors. Calling this API will submit a shipment @@ -82,7 +82,7 @@ def submit_shipment_status_updates(body) path = "/vendor/directFulfillment/shipping/v1/shipmentStatusUpdates" body = body - rate_limit(0.1).post(path, body:) + rate_limit(10.0).post(path, body:) end # Returns a list of customer invoices created during a time frame that you specify. You define the time frame @@ -112,7 +112,7 @@ def get_customer_invoices(created_after, created_before, ship_from_party_id: nil "nextToken" => next_token, }.compact - rate_limit(0.1).get(path, params:) + rate_limit(10.0).get(path, params:) end # Returns a customer invoice based on the `purchaseOrderNumber` that you specify. @@ -122,7 +122,7 @@ def get_customer_invoices(created_after, created_before, ship_from_party_id: nil def get_customer_invoice(purchase_order_number) path = "/vendor/directFulfillment/shipping/v1/customerInvoices/#{purchase_order_number}" - rate_limit(0.1).get(path) + rate_limit(10.0).get(path) end # Returns a list of packing slips for the purchase orders that match the criteria specified. Date range to search @@ -151,7 +151,7 @@ def get_packing_slips(created_after, created_before, ship_from_party_id: nil, li "nextToken" => next_token, }.compact - rate_limit(0.1).get(path, params:) + rate_limit(10.0).get(path, params:) end # Returns a packing slip based on the `purchaseOrderNumber` that you specify. @@ -161,7 +161,7 @@ def get_packing_slips(created_after, created_before, ship_from_party_id: nil, li def get_packing_slip(purchase_order_number) path = "/vendor/directFulfillment/shipping/v1/packingSlips/#{purchase_order_number}" - rate_limit(0.1).get(path) + rate_limit(10.0).get(path) end end end diff --git a/lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb b/lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb index b74df375..8bc2147d 100644 --- a/lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb +++ b/lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb @@ -17,7 +17,7 @@ class VendorDirectFulfillmentTransactions20211228 < API def get_transaction_status(transaction_id) path = "/vendor/directFulfillment/transactions/2021-12-28/transactions/#{transaction_id}" - rate_limit(0.1).get(path) + rate_limit(10.0).get(path) end end end diff --git a/lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb b/lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb index 6089cdd4..ec01ddc3 100644 --- a/lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb +++ b/lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb @@ -17,7 +17,7 @@ class VendorDirectFulfillmentTransactionsV1 < API def get_transaction_status(transaction_id) path = "/vendor/directFulfillment/transactions/v1/transactions/#{transaction_id}" - rate_limit(0.1).get(path) + rate_limit(10.0).get(path) end end end diff --git a/lib/peddler/api/vendor_invoices_v1.rb b/lib/peddler/api/vendor_invoices_v1.rb index a580978c..97badd91 100644 --- a/lib/peddler/api/vendor_invoices_v1.rb +++ b/lib/peddler/api/vendor_invoices_v1.rb @@ -16,7 +16,7 @@ def submit_invoices(body) path = "/vendor/payments/v1/invoices" body = body - rate_limit(0.1).post(path, body:) + rate_limit(10.0).post(path, body:) end end end diff --git a/lib/peddler/api/vendor_orders_v1.rb b/lib/peddler/api/vendor_orders_v1.rb index 6b078b7e..177a48a0 100644 --- a/lib/peddler/api/vendor_orders_v1.rb +++ b/lib/peddler/api/vendor_orders_v1.rb @@ -61,7 +61,7 @@ def get_purchase_orders( "orderingVendorCode" => ordering_vendor_code, }.compact - rate_limit(0.1).get(path, params:) + rate_limit(10.0).get(path, params:) end # Returns a purchase order based on the `purchaseOrderNumber` value that you specify. @@ -72,7 +72,7 @@ def get_purchase_orders( def get_purchase_order(purchase_order_number) path = "/vendor/orders/v1/purchaseOrders/#{purchase_order_number}" - rate_limit(0.1).get(path) + rate_limit(10.0).get(path) end # Submits acknowledgements for one or more purchase orders. @@ -83,7 +83,7 @@ def submit_acknowledgement(body) path = "/vendor/orders/v1/acknowledgements" body = body - rate_limit(0.1).post(path, body:) + rate_limit(10.0).post(path, body:) end # Returns purchase order statuses based on the filters that you specify. Date range to search must not be more @@ -142,7 +142,7 @@ def get_purchase_orders_status( "shipToPartyId" => ship_to_party_id, }.compact - rate_limit(0.1).get(path, params:) + rate_limit(10.0).get(path, params:) end end end diff --git a/lib/peddler/api/vendor_shipments_v1.rb b/lib/peddler/api/vendor_shipments_v1.rb index 825c9a74..26991bf1 100644 --- a/lib/peddler/api/vendor_shipments_v1.rb +++ b/lib/peddler/api/vendor_shipments_v1.rb @@ -17,7 +17,7 @@ def submit_shipment_confirmations(body) path = "/vendor/shipping/v1/shipmentConfirmations" body = body - rate_limit(0.1).post(path, body:) + rate_limit(10.0).post(path, body:) end # Submits one or more shipment request for vendor Orders. @@ -28,7 +28,7 @@ def submit_shipments(body) path = "/vendor/shipping/v1/shipments" body = body - rate_limit(0.1).post(path, body:) + rate_limit(10.0).post(path, body:) end # Returns the Details about Shipment, Carrier Details, status of the shipment, container details and other details @@ -115,7 +115,7 @@ def get_shipment_details( "sellerWarehouseCode" => seller_warehouse_code, }.compact - rate_limit(0.1).get(path, params:) + rate_limit(10.0).get(path, params:) end end end diff --git a/lib/peddler/api/vendor_transaction_status_v1.rb b/lib/peddler/api/vendor_transaction_status_v1.rb index a4fb8c89..3be511b3 100644 --- a/lib/peddler/api/vendor_transaction_status_v1.rb +++ b/lib/peddler/api/vendor_transaction_status_v1.rb @@ -17,7 +17,7 @@ class VendorTransactionStatusV1 < API def get_transaction(transaction_id) path = "/vendor/transactions/v1/transactions/#{transaction_id}" - rate_limit(0.1).get(path) + rate_limit(10.0).get(path) end end end