lib/peddler/apis/fba_inventory_v1.rb in peddler-4.0.1 vs lib/peddler/apis/fba_inventory_v1.rb in peddler-4.1.0
- old
+ new
@@ -42,13 +42,14 @@
# @param next_token [String] String token returned in the response of your previous request. The string token will
# expire 30 seconds after being created.
# @param marketplace_ids [Array<String>] The marketplace ID for the marketplace for which to return inventory
# summaries.
# @param rate_limit [Float] Requests per second
+ # @param tries [Integer] Total request attempts, including retries
# @return [Peddler::Response] The API response
def get_inventory_summaries(granularity_type, granularity_id, marketplace_ids, details: nil, start_date_time: nil,
- seller_skus: nil, seller_sku: nil, next_token: nil, rate_limit: 2.0)
+ seller_skus: nil, seller_sku: nil, next_token: nil, rate_limit: 2.0, tries: 2)
path = "/fba/inventory/v1/summaries"
params = {
"details" => details,
"granularityType" => granularity_type,
"granularityId" => granularity_id,
@@ -57,22 +58,21 @@
"sellerSku" => seller_sku,
"nextToken" => next_token,
"marketplaceIds" => marketplace_ids,
}.compact
- meter(rate_limit).get(path, params:)
+ meter(rate_limit, tries:).get(path, params:)
end
# Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a
# sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API
# sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
#
# @note This operation can make a dynamic sandbox call.
# @param create_inventory_item_request_body [Hash] CreateInventoryItem Request Body Parameter.
- # @param rate_limit [Float] Requests per second
# @return [Peddler::Response] The API response
- def create_inventory_item(create_inventory_item_request_body, rate_limit: nil)
+ def create_inventory_item(create_inventory_item_request_body)
must_sandbox!
path = "/fba/inventory/v1/items"
body = create_inventory_item_request_body
@@ -84,13 +84,12 @@
# sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
#
# @note This operation can make a dynamic sandbox call.
# @param seller_sku [String] A single seller SKU used for querying the specified seller SKU inventory summaries.
# @param marketplace_id [String] The marketplace ID for the marketplace for which the sellerSku is to be deleted.
- # @param rate_limit [Float] Requests per second
# @return [Peddler::Response] The API response
- def delete_inventory_item(seller_sku, marketplace_id, rate_limit: nil)
+ def delete_inventory_item(seller_sku, marketplace_id)
must_sandbox!
path = "/fba/inventory/v1/items/#{seller_sku}"
params = {
"marketplaceId" => marketplace_id,
@@ -105,12 +104,11 @@
# information.
#
# @note This operation can make a dynamic sandbox call.
# @param x_amzn_idempotency_token [String] A unique token/requestId provided with each call to ensure idempotency.
# @param add_inventory_request_body [Hash] List of items to add to Sandbox inventory.
- # @param rate_limit [Float] Requests per second
# @return [Peddler::Response] The API response
- def add_inventory(x_amzn_idempotency_token, add_inventory_request_body, rate_limit: nil)
+ def add_inventory(x_amzn_idempotency_token, add_inventory_request_body)
must_sandbox!
path = "/fba/inventory/v1/items/inventory"
body = add_inventory_request_body