ReviewBoard-0.2.2: Haskell bindings to ReviewBoardSource codeContentsIndex
ReviewBoard.Request
Portabilityportable
Stabilityexperimental
Maintaineradam.smyczek@gmail.com
Contents
URL path elements
Types
Request methods
Util types and functions
Description

This module provides util functions to build ReviewBoard requests. The current implementation is maybe an overkill for a project of this size, but it provides some constants for URL path elements and definitely simplifies building API calls.

The request format is method (path1 . path2 . path3) [form var] , for example the API GET call to /api/json/reviewrequests/5/delete/ can be executed by calling

 apiGet (reviewrequests (Just 5) . delete) []

The supported methods are apiGet, apiPost, httpGet and httpPost. Http methods may be used to perform direct requests to ReviewBoard web UI that are not supported by the API. As an example see rbpatch command line tool in examples. Http methods, same as API methods return RBResponse object with a JSValue result of the form:

 { "head": [
     { "name" : <header name>,
       "value": <header value> }
   ]
   "body" : <content>
 }

The current approach to handle requests may change if I find a way to automatically generate API calls from ReviewBoard code.

Synopsis
data RRField
= STATUS
| PUBLIC
| SUMMARY
| DESCRIPTION
| TESTING_DONE
| BUGS_CLOSED
| BRANCH
| TARGET_GROUPS
| TARGET_PEOPLE
apiGet :: (UrlPath -> UrlPath) -> [FormVar] -> RBAction RBResponse
apiPost :: (UrlPath -> UrlPath) -> [FormVar] -> RBAction RBResponse
httpGet :: String -> [FormVar] -> RBAction RBResponse
httpPost :: String -> [FormVar] -> RBAction RBResponse
type UrlPath = String
mkup :: String -> UrlPath -> UrlPath
mkpup :: Show a => String -> Maybe a -> UrlPath -> UrlPath
URL path elements
Types
data RRField Source
Review request field type.
Constructors
STATUS
PUBLIC
SUMMARY
DESCRIPTION
TESTING_DONE
BUGS_CLOSED
BRANCH
TARGET_GROUPS
TARGET_PEOPLE
show/hide Instances
Request methods
apiGet :: (UrlPath -> UrlPath) -> [FormVar] -> RBAction RBResponseSource
API GET request method
apiPost :: (UrlPath -> UrlPath) -> [FormVar] -> RBAction RBResponseSource
API POST request method
httpGet :: String -> [FormVar] -> RBAction RBResponseSource
Fall back to default http request for the case an action is not supported by the ReviewBoard WebAPI (HTTP GET)
httpPost :: String -> [FormVar] -> RBAction RBResponseSource
Same as httpGet for HTTP POST requests
Util types and functions
type UrlPath = StringSource
Synonym for URL path element
mkup :: String -> UrlPath -> UrlPathSource
(MaKe UrlPath) Default URL element path maker
mkpup :: Show a => String -> Maybe a -> UrlPath -> UrlPathSource
Make path element with a parameter of type a e.g. reviewrequests (Just 5) => "reviewrequests/5/"
Produced by Haddock version 2.3.0