| Copyright | (c) Hardy Jones 2017 |
|---|---|
| License | BSD3 |
| Maintainer | jones3.hardy@gmail.com |
| Stability | experimental |
| Safe Haskell | None |
| Language | Haskell2010 |
Rollbar.API
Description
Provides functions for communicating with Rollbar through the public API.
See Rollbar's API for more details.
- itemsPOST :: (MonadIO f, RemoveHeaders b, ToJSON a) => Item a b -> f (Response (Either JSONException ItemsPOSTResponse))
- itemsPOST' :: (MonadIO f, RemoveHeaders b, ToJSON a) => Manager -> Item a b -> f (Response (Either JSONException ItemsPOSTResponse))
- itemsPOSTRaw :: (FromJSON c, MonadIO f, RemoveHeaders b, ToJSON a) => Item a b -> f (Response (Either JSONException c))
- itemsPOSTRaw' :: (FromJSON c, MonadIO f, RemoveHeaders b, ToJSON a) => Manager -> Item a b -> f (Response (Either JSONException c))
- makeRequest :: (RemoveHeaders headers, ToJSON a) => Item a headers -> Request
- data ItemsPOSTResponse
- newtype ItemsPOSTErrorMessage = ItemsPOSTErrorMessage Text
- newtype ItemsPOSTSuccessResult = ItemsPOSTSuccessResult {}
- itemsPOSTWithException :: (FromJSON c, MonadIO f, RemoveHeaders b, ToJSON a) => Item a b -> f (Response c)
Helpful functions
These functions are probably what you want most of the time.
itemsPOST :: (MonadIO f, RemoveHeaders b, ToJSON a) => Item a b -> f (Response (Either JSONException ItemsPOSTResponse)) Source #
itemsPOST' :: (MonadIO f, RemoveHeaders b, ToJSON a) => Manager -> Item a b -> f (Response (Either JSONException ItemsPOSTResponse)) Source #
Sends an Item off to Rollbar.
itemsPOSTRaw :: (FromJSON c, MonadIO f, RemoveHeaders b, ToJSON a) => Item a b -> f (Response (Either JSONException c)) Source #
itemsPOSTRaw' :: (FromJSON c, MonadIO f, RemoveHeaders b, ToJSON a) => Manager -> Item a b -> f (Response (Either JSONException c)) Source #
Sends an Item off to Rollbar.
Makes no claims about what you get back.
makeRequest :: (RemoveHeaders headers, ToJSON a) => Item a headers -> Request Source #
Converts an item into a request ready to send to Rollbar.
If you need a different scheme for sending items,
you'll probably want to use this along with a function like httpLbs
or httpLbs.
If you want the JSON back and already have a Manager,
you can use this function with setRequestManager.
Then send off the request with something like httpJSONEither.
Response data types
data ItemsPOSTResponse Source #
The response received from sending an Item to Rollbar.
Constructors
| ItemsPOSTSuccess | |
Fields
| |
| ItemsPOSTError | |
Fields
| |
newtype ItemsPOSTErrorMessage Source #
The human readable error message from sending an Item to Rollbar.
Constructors
| ItemsPOSTErrorMessage Text |
newtype ItemsPOSTSuccessResult Source #
The successful response from sending an Item to Rollbar.
Constructors
| ItemsPOSTSuccessResult | |
Impure functions
Use with caution.
itemsPOSTWithException :: (FromJSON c, MonadIO f, RemoveHeaders b, ToJSON a) => Item a b -> f (Response c) Source #
Sends an Item off to Rollbar.
Creates a new Manager to send off the request.
Makes no claims about what you get back.
Throws a JSONException if it cannot parse the response.
Yes, this name is annoying, so are exceptions.