Class: MuffinMan::Orders::V0
- Inherits:
-
SpApiClient
- Object
- SpApiClient
- MuffinMan::Orders::V0
- Defined in:
- lib/muffin_man/orders/v0.rb
Constant Summary collapse
- GET_ORDERS_PARAMS =
%w[ CreatedAfter CreatedBefore LastUpdatedAfter LastUpdatedBefore OrderStatuses FulfillmentChannels PaymentMethods BuyerEmail SellerOrderId MaxResultsPerPage EasyShipShipmentStatuses NextToken AmazonOrderIds ActualFulfillmentSupplySourceId IsISPU StoreChainStoreId ].freeze
- GET_ORDER_ITEMS_PARAMS =
%w[ NextToken ].freeze
- PII_DATA_ELEMENTS =
%w[ buyerInfo shippingAddress buyerTaxInformation ]
Constants inherited from SpApiClient
SpApiClient::ACCESS_TOKEN_URL, SpApiClient::AWS_REGION_MAP, SpApiClient::SERVICE_NAME
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
- #get_order_address(order_id) ⇒ Object
- #get_order_items(order_id, params = {}) ⇒ Object
- #get_orders(marketplace_ids, params = {}, pii_data_elements: []) ⇒ Object
Methods inherited from SpApiClient
Constructor Details
This class inherits a constructor from MuffinMan::SpApiClient
Instance Method Details
#get_order_address(order_id) ⇒ Object
48 49 50 51 52 |
# File 'lib/muffin_man/orders/v0.rb', line 48 def get_order_address(order_id) @local_var_path = "/orders/v0/orders/#{order_id}/address" @request_type = "GET" call_api end |
#get_order_items(order_id, params = {}) ⇒ Object
41 42 43 44 45 46 |
# File 'lib/muffin_man/orders/v0.rb', line 41 def get_order_items(order_id, params = {}) @query_params = params.slice(*GET_ORDER_ITEMS_PARAMS) @local_var_path = "/orders/v0/orders/#{order_id}/orderItems" @request_type = "GET" call_api end |
#get_orders(marketplace_ids, params = {}, pii_data_elements: []) ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/muffin_man/orders/v0.rb', line 32 def get_orders(marketplace_ids, params = {}, pii_data_elements: []) @local_var_path = "/orders/v0/orders" @pii_data_elements = pii_data_elements & PII_DATA_ELEMENTS @query_params = params.slice(*GET_ORDERS_PARAMS) @query_params["MarketplaceIds"] = marketplace_ids @request_type = "GET" call_api end |