Class: ExportoAPI::ShipmentResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/exporto_api/resources/shipment_resource.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from ExportoAPI::Resource

Instance Method Details

#find(shipment_id:) ⇒ Object



29
30
31
# File 'lib/exporto_api/resources/shipment_resource.rb', line 29

def find(shipment_id:)
  Objects::ShipmentResponse.new(get_request("shipment/#{shipment_id}"))
end

#search(foreign_outbound_tracking_id: nil, foreign_inbound_tracking_id: nil, processed_at: nil, carrier_received_at_updated_at: nil, carrier_delivered_at_updated_at: nil, page: nil, page_size: nil, type: nil) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/exporto_api/resources/shipment_resource.rb', line 5

def search(
  foreign_outbound_tracking_id: nil,
  foreign_inbound_tracking_id: nil,
  processed_at: nil,
  carrier_received_at_updated_at: nil,
  carrier_delivered_at_updated_at: nil,
  page: nil,
  page_size: nil,
  type: nil
)
  params = {
    "foreignOutboundTrackingId" => foreign_outbound_tracking_id,
    "foreignInboundTrackingId" => foreign_inbound_tracking_id,
    "processedAt" => processed_at,
    "carrierReceivedAtUpdatedAt" => carrier_received_at_updated_at,
    "carrierDeliveredAtUpdatedAt" => carrier_delivered_at_updated_at,
    "page" => page,
    "pageSize" => page_size,
    "type" => type
  }.compact

  Objects::ShipmentResponse.new(get_request("shipment/search", params: params))
end