;;;; DO NOT EDIT! THIS FILE HAS BEEN GENERATED BY LAZYBONES-CLIENT (defpackage #:ONELINERS.API-CLIENT (:use :cl) (:export #:get-oneliners #:get-oneliners/all-flagged #:get-oneliners/newest #:put-oneliner/entry/flag #:get-oneliner/entry #:patch-oneliner/entry/edit #:put-oneliner/oneliner/locked #:post-oneliner #:delete-oneliner/oneliner #:post-invite #:delete-access/access #:post-access #:post-invite/redeem/code #:put-contributor/who/signature #:put-contributor/who/password #:put-contributor/who/locked #:get-contributor/who #:post-snapshot)) (in-package :ONELINERS.API-CLIENT) (defun get-oneliners (TAGS LIMIT NOTFLAGGED %host &key %headers %cookies) "A search endpoint returning a JSON encoded array of Oneliner Entries. TAGS cannot be empty. Returns a [Search Result](#search-result) object." (dexador:get (format nil "~a/api/oneliners?~@[TAGS=~a~]~@[&LIMIT=~a~]~@[&NOTFLAGGED=~a~]" %host TAGS LIMIT NOTFLAGGED) :cookie-jar %cookies :headers %headers)) (defun get-oneliners/all-flagged (LIMIT %host &key %headers %cookies) "A search endpoint returning all of the flagged oneliners. If LIMIT is present, only that many are returned." (dexador:get (format nil "~a/api/oneliners/all-flagged?~@[LIMIT=~a~]" %host LIMIT) :cookie-jar %cookies :headers %headers)) (defun get-oneliners/newest (LIMIT %host &key %headers %cookies) "A search endpoint returning the LIMIT newest oneliners." (dexador:get (format nil "~a/api/oneliners/newest?~@[LIMIT=~a~]" %host LIMIT) :cookie-jar %cookies :headers %headers)) (defun put-oneliner/entry/flag (ENTRY TOKEN VALUE %host &key %content-type %body %headers %cookies) "Flag / Unflag the oneliner for review." (dexador:put (format nil "~a/api/oneliner/~a/flag?~@[TOKEN=~a~]~@[&VALUE=~a~]" %host ENTRY TOKEN VALUE) :content %body :cookie-jar %cookies :headers (if %content-type (cons (cons "Content-Type" %content-type) %headers) %headers))) (defun get-oneliner/entry (ENTRY %host &key %headers %cookies) "Gets a oneliner by id." (dexador:get (format nil "~a/api/oneliner/~a?" %host ENTRY ) :cookie-jar %cookies :headers %headers)) (defun patch-oneliner/entry/edit (ENTRY TOKEN %host &key %content-type %body %headers %cookies) "Edit the fields of a oneliner." (dexador:patch (format nil "~a/api/oneliner/~a/edit?~@[TOKEN=~a~]" %host ENTRY TOKEN) :content %body :cookie-jar %cookies :headers (if %content-type (cons (cons "Content-Type" %content-type) %headers) %headers))) (defun put-oneliner/oneliner/locked (ONELINER TOKEN VALUE %host &key %content-type %body %headers %cookies) "Sets the locked value of the specified oneliner" (dexador:put (format nil "~a/api/oneliner/~a/locked?~@[TOKEN=~a~]~@[&VALUE=~a~]" %host ONELINER TOKEN VALUE) :content %body :cookie-jar %cookies :headers (if %content-type (cons (cons "Content-Type" %content-type) %headers) %headers))) (defun post-oneliner (TOKEN %host &key %content-type %body %headers %cookies) "Make a new [oneliner](#oneliner)." (dexador:post (format nil "~a/api/oneliner?~@[TOKEN=~a~]" %host TOKEN) :content %body :cookie-jar %cookies :headers (if %content-type (cons (cons "Content-Type" %content-type) %headers) %headers))) (defun delete-oneliner/oneliner (ONELINER TOKEN %host &key %headers %cookies) "Delete a oneliner." (dexador:delete (format nil "~a/api/oneliner/~a?~@[TOKEN=~a~]" %host ONELINER TOKEN) :cookie-jar %cookies :headers %headers)) (defun post-invite (TOKEN %host &key %content-type %body %headers %cookies) "On success, return an object containing a new [invite token](#invite-token)." (dexador:post (format nil "~a/api/invite?~@[TOKEN=~a~]" %host TOKEN) :content %body :cookie-jar %cookies :headers (if %content-type (cons (cons "Content-Type" %content-type) %headers) %headers))) (defun delete-access/access (ACCESS TOKEN %host &key %headers %cookies) "Revoke access of CONTRIBUTOR" (dexador:delete (format nil "~a/api/access/~a?~@[TOKEN=~a~]" %host ACCESS TOKEN) :cookie-jar %cookies :headers %headers)) (defun post-access ( %host &key %content-type %body %headers %cookies) "Authenticate a contributor and reply with an [API token](#access-token)" (dexador:post (format nil "~a/api/access?" %host ) :content %body :cookie-jar %cookies :headers (if %content-type (cons (cons "Content-Type" %content-type) %headers) %headers))) (defun post-invite/redeem/code (CODE %host &key %content-type %body %headers %cookies) "Redeem an [invite code](#invite-code) and create a new [contributor](#new-contributor-post-body)" (dexador:post (format nil "~a/api/invite/redeem/~a?" %host CODE ) :content %body :cookie-jar %cookies :headers (if %content-type (cons (cons "Content-Type" %content-type) %headers) %headers))) (defun put-contributor/who/signature (WHO TOKEN %host &key %content-type %body %headers %cookies) "Update a [contributor's](#contributor) signature." (dexador:put (format nil "~a/api/contributor/~a/signature?~@[TOKEN=~a~]" %host WHO TOKEN) :content %body :cookie-jar %cookies :headers (if %content-type (cons (cons "Content-Type" %content-type) %headers) %headers))) (defun put-contributor/who/password (WHO VALUE REPEATED CURRENT TOKEN %host &key %content-type %body %headers %cookies) "Change a contributor's password. CURRENT is the current password. VALUE is the new password. REPEATED must match VALUE. TOKEN is an API Access token." (dexador:put (format nil "~a/api/contributor/~a/password?~@[VALUE=~a~]~@[&REPEATED=~a~]~@[&CURRENT=~a~]~@[&TOKEN=~a~]" %host WHO VALUE REPEATED CURRENT TOKEN) :content %body :cookie-jar %cookies :headers (if %content-type (cons (cons "Content-Type" %content-type) %headers) %headers))) (defun put-contributor/who/locked (WHO VALUE TOKEN %host &key %content-type %body %headers %cookies) "Admin users may lock a particular contributor, preventing that contributor for making edits or adding new oneliners." (dexador:put (format nil "~a/api/contributor/~a/locked?~@[VALUE=~a~]~@[&TOKEN=~a~]" %host WHO VALUE TOKEN) :content %body :cookie-jar %cookies :headers (if %content-type (cons (cons "Content-Type" %content-type) %headers) %headers))) (defun get-contributor/who (WHO %host &key %headers %cookies) "Return a [contributor](#contributor) data object." (dexador:get (format nil "~a/api/contributor/~a?" %host WHO ) :cookie-jar %cookies :headers %headers)) (defun post-snapshot (TOKEN %host &key %content-type %body %headers %cookies) "Snapshot the datastore. Do this after upgrade" (dexador:post (format nil "~a/api/snapshot?~@[TOKEN=~a~]" %host TOKEN) :content %body :cookie-jar %cookies :headers (if %content-type (cons (cons "Content-Type" %content-type) %headers) %headers)))