Class: MuffinMan::VendorDirectFulfillmentShipping::V20211228

Inherits:
SpApiClient
  • Object
show all
Defined in:
lib/muffin_man/vendor_direct_fulfillment_shipping/v20211228.rb

Constant Summary collapse

VENDOR_DIRECT_FULFILLMENT_SHIPPING_PARAMS =
%w[
  shipFromPartyId
  limit
  sortOrder
  nextToken
].freeze

Constants inherited from SpApiClient

SpApiClient::ACCESS_TOKEN_URL, SpApiClient::AWS_REGION_MAP, SpApiClient::SERVICE_NAME, SpApiClient::UNPROCESSABLE_ENTITY_STATUS_CODE

Instance Attribute Summary

Attributes inherited from SpApiClient

#access_token_cache_key, #aws_access_key_id, #aws_secret_access_key, #client_id, #client_secret, #config, #credentials, #local_var_path, #pii_data_elements, #query_params, #refresh_token, #region, #request_body, #request_type, #sandbox, #scope, #sts_iam_role_arn

Instance Method Summary collapse

Methods inherited from SpApiClient

#initialize

Constructor Details

This class inherits a constructor from MuffinMan::SpApiClient

Instance Method Details

#create_shipping_labels(purchase_order_number, selling_party, ship_from_party, containers: nil) ⇒ Object



37
38
39
40
41
42
43
44
45
46
# File 'lib/muffin_man/vendor_direct_fulfillment_shipping/v20211228.rb', line 37

def create_shipping_labels(purchase_order_number, selling_party, ship_from_party, containers: nil)
  @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels/#{purchase_order_number}"
  @request_body = {
    "sellingParty" => selling_party,
    "shipFromParty" => ship_from_party
  }
  @request_body["containers"] = containers if containers
  @request_type = "POST"
  call_api
end

#get_customer_invoice(purchase_order_number) ⇒ Object



73
74
75
76
77
# File 'lib/muffin_man/vendor_direct_fulfillment_shipping/v20211228.rb', line 73

def get_customer_invoice(purchase_order_number)
  @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/customerInvoices/#{purchase_order_number}"
  @request_type = "GET"
  call_api
end

#get_customer_invoices(created_after, created_before, params = {}) ⇒ Object



62
63
64
65
66
67
68
69
70
71
# File 'lib/muffin_man/vendor_direct_fulfillment_shipping/v20211228.rb', line 62

def get_customer_invoices(created_after, created_before, params = {})
  @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/customerInvoices"
  @query_params = {
    "createdAfter" => created_after,
    "createdBefore" => created_before
  }
  @query_params.merge!(params.slice(*VENDOR_DIRECT_FULFILLMENT_SHIPPING_PARAMS))
  @request_type = "GET"
  call_api
end

#get_packing_slip(purchase_order_number) ⇒ Object



90
91
92
93
94
# File 'lib/muffin_man/vendor_direct_fulfillment_shipping/v20211228.rb', line 90

def get_packing_slip(purchase_order_number)
  @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/packingSlips/#{purchase_order_number}"
  @request_type = "GET"
  call_api
end

#get_packing_slips(created_after, created_before, params = {}) ⇒ Object



79
80
81
82
83
84
85
86
87
88
# File 'lib/muffin_man/vendor_direct_fulfillment_shipping/v20211228.rb', line 79

def get_packing_slips(created_after, created_before, params = {})
  @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/packingSlips"
  @query_params = {
    "createdAfter" => created_after,
    "createdBefore" => created_before
  }
  @query_params.merge!(params.slice(*VENDOR_DIRECT_FULFILLMENT_SHIPPING_PARAMS))
  @request_type = "GET"
  call_api
end

#get_shipping_label(purchase_order_number) ⇒ Object



31
32
33
34
35
# File 'lib/muffin_man/vendor_direct_fulfillment_shipping/v20211228.rb', line 31

def get_shipping_label(purchase_order_number)
  @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels/#{purchase_order_number}"
  @request_type = "GET"
  call_api
end

#get_shipping_labels(created_after, created_before, params = {}) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/muffin_man/vendor_direct_fulfillment_shipping/v20211228.rb', line 13

def get_shipping_labels(created_after, created_before, params = {})
  @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels"
  @query_params = {
    "createdAfter" => created_after,
    "createdBefore" => created_before
  }
  @query_params.merge!(params.slice(*VENDOR_DIRECT_FULFILLMENT_SHIPPING_PARAMS))
  @request_type = "GET"
  call_api
end

#submit_shipment_confirmations(shipment_confirmations) ⇒ Object



48
49
50
51
52
53
# File 'lib/muffin_man/vendor_direct_fulfillment_shipping/v20211228.rb', line 48

def submit_shipment_confirmations(shipment_confirmations)
  @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/shipmentConfirmations"
  @request_body = { "shipmentConfirmations" => shipment_confirmations }
  @request_type = "POST"
  call_api
end

#submit_shipment_status_updates(shipment_status_updates) ⇒ Object



55
56
57
58
59
60
# File 'lib/muffin_man/vendor_direct_fulfillment_shipping/v20211228.rb', line 55

def submit_shipment_status_updates(shipment_status_updates)
  @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/shipmentStatusUpdates"
  @request_body = { "shipmentStatusUpdates" => shipment_status_updates }
  @request_type = "POST"
  call_api
end

#submit_shipping_label_request(shipping_label_requests) ⇒ Object



24
25
26
27
28
29
# File 'lib/muffin_man/vendor_direct_fulfillment_shipping/v20211228.rb', line 24

def submit_shipping_label_request(shipping_label_requests)
  @local_var_path = "/vendor/directFulfillment/shipping/2021-12-28/shippingLabels"
  @request_body = { "shippingLabelRequests" => shipping_label_requests }
  @request_type = "POST"
  call_api
end