Sha256: 8a01580aa427a9795d9f0aa9d33eff5525cc30038a36447e5ab23141e7ccb56c

Contents?: true

Size: 1.5 KB

Versions: 7

Compression:

Stored size: 1.5 KB

Contents

# frozen_string_literal: true

module MuffinMan
  module VendorShipments
    class V1 < SpApiClient
      GET_SHIPMENT_DETAILS_PARAMS = %w[
        limit
        sortOrder
        nextToken
        createdAfter
        createdBefore
        shipmentConfirmedBefore
        shipmentConfirmedAfter
        packageLabelCreatedBefore
        packageLabelCreatedAfter
        shippedBefore
        shippedAfter
        estimatedDeliveryBefore
        estimatedDeliveryAfter
        shipmentDeliveryBefore
        shipmentDeliveryAfter
        requestedPickUpBefore
        requestedPickUpAfter
        scheduledPickUpBefore
        scheduledPickUpAfter
        currentShipmentStatus
        vendorShipmentIdentifier
        buyerReferenceNumber
        buyerWarehouseCode
        sellerWarehouseCode
      ].freeze

      def submit_shipment_confirmations(shipment_confirmations)
        @local_var_path = "/vendor/shipping/v1/shipmentConfirmations"
        @request_body = { "shipmentConfirmations" => shipment_confirmations }
        @request_type = "POST"
        call_api
      end

      def get_shipment_details(params = {})
        @local_var_path = "/vendor/shipping/v1/shipments"
        @query_params = params.slice(*GET_SHIPMENT_DETAILS_PARAMS)
        @request_type = "GET"
        call_api
      end

      def submit_shipments(shipments)
        @local_var_path = "/vendor/shipping/v1/shipments"
        @request_body = { "shipments" => shipments }
        @request_type = "POST"
        call_api
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
muffin_man-2.4.8 lib/muffin_man/vendor_shipments/v1.rb
muffin_man-2.4.7 lib/muffin_man/vendor_shipments/v1.rb
muffin_man-2.4.6 lib/muffin_man/vendor_shipments/v1.rb
muffin_man-2.4.5 lib/muffin_man/vendor_shipments/v1.rb
muffin_man-2.4.4 lib/muffin_man/vendor_shipments/v1.rb
muffin_man-2.4.3 lib/muffin_man/vendor_shipments/v1.rb
muffin_man-2.4.2 lib/muffin_man/vendor_shipments/v1.rb