Class: MuffinMan::VendorOrders::V1

Inherits:
SpApiClient show all
Defined in:
lib/muffin_man/vendor_orders/v1.rb

Constant Summary collapse

GET_PURCHASE_ORDERS_PARAMS =
%w[
  limit
  createdAfter
  createdBefore
  sortOrder
  nextToken
  includeDetails
  changedAfter
  changedBefore
  poItemState
  isPOChanged
  purchaseOrderState
  orderingVendorCode
].freeze
GET_PURCHASE_ORDERS_STATUS_PARAMS =
%w[
  limit
  sortOrder
  nextToken
  createdAfter
  createdBefore
  updatedAfter
  updatedBefore
  purchaseOrderNumber
  purchaseOrderStatus
  itemConfirmationStatus
  itemReceiveStatus
  orderingVendorCode
  shipToPartyId
].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

#get_purchase_order(purchase_order_number) ⇒ Object



44
45
46
47
48
# File 'lib/muffin_man/vendor_orders/v1.rb', line 44

def get_purchase_order(purchase_order_number)
  @local_var_path = "/vendor/orders/v1/purchaseOrders/#{purchase_order_number}"
  @request_type = "GET"
  call_api
end

#get_purchase_orders(params = {}) ⇒ Object



37
38
39
40
41
42
# File 'lib/muffin_man/vendor_orders/v1.rb', line 37

def get_purchase_orders(params = {})
  @local_var_path = "/vendor/orders/v1/purchaseOrders"
  @query_params = params.slice(*GET_PURCHASE_ORDERS_PARAMS)
  @request_type = "GET"
  call_api
end

#get_purchase_orders_status(params = {}) ⇒ Object



57
58
59
60
61
62
# File 'lib/muffin_man/vendor_orders/v1.rb', line 57

def get_purchase_orders_status(params = {})
  @local_var_path = "/vendor/orders/v1/purchaseOrdersStatus"
  @query_params = params.slice(*GET_PURCHASE_ORDERS_STATUS_PARAMS)
  @request_type = "GET"
  call_api
end

#submit_acknowledgement(acknowledgements) ⇒ Object



50
51
52
53
54
55
# File 'lib/muffin_man/vendor_orders/v1.rb', line 50

def submit_acknowledgement(acknowledgements)
  @local_var_path = "/vendor/orders/v1/acknowledgements"
  @request_body = { "acknowledgements" => acknowledgements }
  @request_type = "POST"
  call_api
end