#wallaby
A Clojure library designed to simplify working with the Walmart Open API
Add the following dependency to your project.clj
file:
[wallaby "0.2.0"]
(ns my-walmart.app
(:require [wallaby.core :refer :all]))
;; Product Lookup Operation
(def result (product-lookup {:apiKey "my-api-key"
:upc "035000521019"}))
;; results are futures containing response as a map
(def realized @result);
The main function is request
. All functions are a specialization of this function.
(defn request
([api params config] ,,,)
([api params] (request api params {})))
api
is a string representing the Walmart API of interest - i.e "items"params
is a map that will be converted straight to query paramsconfig
is an optional map that gets fed right to http-kit
There is currently one specialized function product-lookup
which fills in the "items" api in the request
function
(defn product-lookup
([params config] (request "items" params config))
([params] (requeset "items" params)))
request
has a single pre-condition defined to ensure the presence of the :apiKey
key on the params
map.
Copyright © 2016 Brian Scaturro
Distributed under the Eclipse Public License, the same as Clojure