lib/peddler/apis/vendor_orders_v1.rb in peddler-4.0.1 vs lib/peddler/apis/vendor_orders_v1.rb in peddler-4.1.0

- old
+ new

@@ -45,14 +45,15 @@ # @param ordering_vendor_code [String] Filters purchase orders based on the specified ordering vendor code. This # value should be same as 'sellingParty.partyId' in the purchase order. If not included in the filter, all # purchase orders for all of the vendor codes that exist in the vendor group used to authorize the API client # application are returned. # @param rate_limit [Float] Requests per second + # @param tries [Integer] Total request attempts, including retries # @return [Peddler::Response] The API response def get_purchase_orders(limit: nil, created_after: nil, created_before: nil, sort_order: nil, next_token: nil, include_details: nil, changed_after: nil, changed_before: nil, po_item_state: nil, is_po_changed: nil, - purchase_order_state: nil, ordering_vendor_code: nil, rate_limit: 10.0) + purchase_order_state: nil, ordering_vendor_code: nil, rate_limit: 10.0, tries: 2) path = "/vendor/orders/v1/purchaseOrders" params = { "limit" => limit, "createdAfter" => created_after, "createdBefore" => created_before, @@ -65,36 +66,38 @@ "isPOChanged" => is_po_changed, "purchaseOrderState" => purchase_order_state, "orderingVendorCode" => ordering_vendor_code, }.compact - meter(rate_limit).get(path, params:) + meter(rate_limit, tries:).get(path, params:) end # Returns a purchase order based on the `purchaseOrderNumber` value that you specify. # # @note This operation can make a static sandbox call. # @param purchase_order_number [String] The purchase order identifier for the order that you want. Formatting # Notes: 8-character alpha-numeric code. # @param rate_limit [Float] Requests per second + # @param tries [Integer] Total request attempts, including retries # @return [Peddler::Response] The API response - def get_purchase_order(purchase_order_number, rate_limit: 10.0) + def get_purchase_order(purchase_order_number, rate_limit: 10.0, tries: 2) path = "/vendor/orders/v1/purchaseOrders/#{purchase_order_number}" - meter(rate_limit).get(path) + meter(rate_limit, tries:).get(path) end # Submits acknowledgements for one or more purchase orders. # # @note This operation can make a static sandbox call. # @param body [Hash] Submits acknowledgements for one or more purchase orders from a vendor. # @param rate_limit [Float] Requests per second + # @param tries [Integer] Total request attempts, including retries # @return [Peddler::Response] The API response - def submit_acknowledgement(body, rate_limit: 10.0) + def submit_acknowledgement(body, rate_limit: 10.0, tries: 2) path = "/vendor/orders/v1/acknowledgements" - meter(rate_limit).post(path, body:) + meter(rate_limit, tries:).post(path, body:) end # Returns purchase order statuses based on the filters that you specify. Date range to search must not be more # than 7 days. You can return a list of purchase order statuses using the available filters, or a single purchase # order status by providing the purchase order number. @@ -128,15 +131,16 @@ # @param ship_to_party_id [String] Filters purchase orders for a specific buyer's Fulfillment Center/warehouse by # providing ship to location id here. This value should be same as 'shipToParty.partyId' in the purchase order. # If not included in filter, this will return purchase orders for all the buyer's warehouses used for vendor # group purchase orders. # @param rate_limit [Float] Requests per second + # @param tries [Integer] Total request attempts, including retries # @return [Peddler::Response] The API response def get_purchase_orders_status(limit: nil, sort_order: nil, next_token: nil, created_after: nil, created_before: nil, updated_after: nil, updated_before: nil, purchase_order_number: nil, purchase_order_status: nil, item_confirmation_status: nil, item_receive_status: nil, ordering_vendor_code: nil, - ship_to_party_id: nil, rate_limit: 10.0) + ship_to_party_id: nil, rate_limit: 10.0, tries: 2) path = "/vendor/orders/v1/purchaseOrdersStatus" params = { "limit" => limit, "sortOrder" => sort_order, "nextToken" => next_token, @@ -150,10 +154,10 @@ "itemReceiveStatus" => item_receive_status, "orderingVendorCode" => ordering_vendor_code, "shipToPartyId" => ship_to_party_id, }.compact - meter(rate_limit).get(path, params:) + meter(rate_limit, tries:).get(path, params:) end end end end