Liking cljdoc? Tell your friends :D

shopify.resources

Functions for making requests against a shop's authenticated API.

Functions for making requests against a shop's authenticated API.
raw docstring

create-requestcljmultimethod

Takes a keyword resource-type and a map of attrs, and returns a partial request map for creating a resource member.

Takes a keyword `resource-type` and a map of `attrs`, and returns a partial request map for creating a resource member.
sourceraw docstring

delete!clj

source

delete-requestcljmultimethod

Returns a partial request map to delete a resource member.

Returns a partial request map to delete a resource member.
sourceraw docstring

extract-kicker-argsclj

(extract-kicker-args args)

Used by the kicker functions to parse argument lists. The most verbose form takes a resource type keyword, a map of either params or attributes, and a map of request options:

(def auth {:shop "foo.myshopify.com"
           :access-token "70bc2f19efa5129f202e661ac6fd38f3"})
(get-list :products {:limit 2} auth)

If you only provide one map, it's assumed to be the params/attributes, so you'll need to provide authentication with with-opts:

(with-opts auth
  (get-list :products {:limit 2}))

If you don't give a keyword as the first argument, the function will look for the resource type under a :shopify.resources/type key in the params/attributes map. This key is present in all resource attribute maps returned by the library, so you can chain together reading and writing operations conveniently like so:

(with-opts auth
  (-> (get-one :page {:id 99})
      (update-in [:title]
                 clojure.string/upper-case)
      (update-in [:body-html]
                 #(clojure.string/replace % "." "!"))
      save!))
Used by the kicker functions to parse argument lists. The most verbose form takes a resource type keyword, a map of either params or attributes, and a map of request options:
  
    (def auth {:shop "foo.myshopify.com"
               :access-token "70bc2f19efa5129f202e661ac6fd38f3"})
    (get-list :products {:limit 2} auth)

If you only provide one map, it's assumed to be the params/attributes, so you'll need to provide authentication with `with-opts`:

    (with-opts auth
      (get-list :products {:limit 2}))

If you don't give a keyword as the first argument, the function will look for the resource type under a `:shopify.resources/type` key in the params/attributes map. This key is present in all resource attribute maps returned by the library, so you can chain together reading and writing operations conveniently like so:

    (with-opts auth
      (-> (get-one :page {:id 99})
          (update-in [:title]
                     clojure.string/upper-case)
          (update-in [:body-html]
                     #(clojure.string/replace % "." "!"))
          save!))
sourceraw docstring

get-allclj

(get-all & args)

Eagerly gets all the resources described by the arguments in parallel. Returns a sequence which is a lazy concatenation of all pages.

Eagerly gets _all_ the resources described by the arguments in parallel. Returns a sequence which is a lazy concatenation of all pages.
sourceraw docstring

get-countclj

source

get-count-requestclj

(get-count-request resource-type params)

Returns a partial request map to get the count of the given resource/params.

Returns a partial request map to get the count of the given resource/params.
sourceraw docstring

get-listclj

source

get-list-requestcljmultimethod

Returns a partial request map to get a collection of the given resource type with the given params.

Returns a partial request map to get a collection of the given resource type with the given params.
sourceraw docstring

get-oneclj

source

get-one-requestcljmultimethod

Returns a partial request map to get a member of the given resource with the given attributes.

Returns a partial request map to get a member of the given resource with the given attributes.
sourceraw docstring

get-shopclj

(get-shop & [request-opts])

A convenience function to get the singleton shop resource.

A convenience function to get the singleton shop resource.
sourceraw docstring

new?clj

source

persisted?cljmultimethod

Returns true if the given attributes appear to refer to a member which already exists on the server.

Returns true if the given attributes appear to refer to a member which already exists on the server.
sourceraw docstring

requestclj

source

save!clj

source

save-requestcljmultimethod

Delegates to create-request if the attributes are new, or update-request if they're persisted.

Delegates to `create-request` if the attributes are new, or `update-request` if they're persisted.
sourceraw docstring

update-requestcljmultimethod

Returns a partial request map to update a member of the given resource with the given attributes.

Returns a partial request map to update a member of the given resource with the given attributes.
sourceraw docstring

with-optscljmacro

(with-opts opts & exprs)

A convenience macro to define the same base request options for any request to the Shopify API. opts would most often be an auth map, but it could include any default options for the request.

A convenience macro to define the same base request options for any request to the Shopify API. `opts` would most often be an auth map, but it could include any default options for the request.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close