Safe Haskell | None |
---|---|
Language | Haskell2010 |
- getResponse :: MonadResource m => TWInfo -> Manager -> Request -> m (Response (ResumableSource m ByteString))
- call :: FromJSON responseType => TWInfo -> Manager -> APIRequest apiName responseType -> IO responseType
- call' :: FromJSON value => TWInfo -> Manager -> APIRequest apiName responseType -> IO value
- callWithResponse :: FromJSON responseType => TWInfo -> Manager -> APIRequest apiName responseType -> IO (Response responseType)
- callWithResponse' :: FromJSON value => TWInfo -> Manager -> APIRequest apiName responseType -> IO (Response value)
- checkResponse :: Response Value -> Either TwitterError Value
- sourceWithMaxId :: (MonadBase IO m, FromJSON responseType, AsStatus responseType, HasMaxIdParam (APIRequest apiName [responseType])) => TWInfo -> Manager -> APIRequest apiName [responseType] -> Source m responseType
- sourceWithMaxId' :: (MonadBase IO m, HasMaxIdParam (APIRequest apiName [responseType])) => TWInfo -> Manager -> APIRequest apiName [responseType] -> Source m Value
- sourceWithCursor :: (MonadBase IO m, FromJSON responseType, CursorKey ck, HasCursorParam (APIRequest apiName (WithCursor ck responseType))) => TWInfo -> Manager -> APIRequest apiName (WithCursor ck responseType) -> Source m responseType
- sourceWithCursor' :: (MonadBase IO m, CursorKey ck, HasCursorParam (APIRequest apiName (WithCursor ck responseType))) => TWInfo -> Manager -> APIRequest apiName (WithCursor ck responseType) -> Source m Value
- sourceWithSearchResult :: (MonadBase IO m, FromJSON responseType) => TWInfo -> Manager -> APIRequest apiName (SearchResult [responseType]) -> m (SearchResult (Source m responseType))
- sourceWithSearchResult' :: MonadBase IO m => TWInfo -> Manager -> APIRequest apiName (SearchResult [responseType]) -> m (SearchResult (Source m Value))
- endpoint :: String
- makeRequest :: APIRequest apiName responseType -> IO Request
- sinkJSON :: MonadThrow m => Consumer ByteString m Value
- sinkFromJSON :: (FromJSON a, MonadThrow m) => Consumer ByteString m a
Documentation
getResponse :: MonadResource m => TWInfo -> Manager -> Request -> m (Response (ResumableSource m ByteString)) Source #
:: FromJSON responseType | |
=> TWInfo | Twitter Setting |
-> Manager | |
-> APIRequest apiName responseType | |
-> IO responseType |
Perform an APIRequest
and then provide the response which is mapped to a suitable type of
twitter-types.
Example:
user <-call
twInfo mgr $accountVerifyCredentials
print user
If you need raw JSON value which is parsed by aeson,
use call'
to obtain it.
:: FromJSON value | |
=> TWInfo | Twitter Setting |
-> Manager | |
-> APIRequest apiName responseType | |
-> IO value |
Perform an APIRequest
and then provide the response.
The response of this function is not restrict to responseType
,
so you can choose an arbitrarily type of FromJSON instances.
:: FromJSON responseType | |
=> TWInfo | Twitter Setting |
-> Manager | |
-> APIRequest apiName responseType | |
-> IO (Response responseType) |
Perform an APIRequest
and then provide the Response
.
Example:
res <-callWithResponse
twInfo mgr $accountVerifyCredentials
responseStatus
resresponseHeaders
resresponseBody
res
callWithResponse' :: FromJSON value => TWInfo -> Manager -> APIRequest apiName responseType -> IO (Response value) Source #
Perform an APIRequest
and then provide the Response
.
The response of this function is not restrict to responseType
,
so you can choose an arbitrarily type of FromJSON instances.
Example:
res <-callWithResponse'
twInfo mgr $accountVerifyCredentials
responseStatus
resresponseHeaders
resresponseBody
(res :: Value)
:: (MonadBase IO m, FromJSON responseType, AsStatus responseType, HasMaxIdParam (APIRequest apiName [responseType])) | |
=> TWInfo | Twitter Setting |
-> Manager | |
-> APIRequest apiName [responseType] | |
-> Source m responseType |
A wrapper function to perform multiple API request with changing max_id
parameter.
This function cooperate with instances of HasMaxIdParam
.
:: (MonadBase IO m, HasMaxIdParam (APIRequest apiName [responseType])) | |
=> TWInfo | Twitter Setting |
-> Manager | |
-> APIRequest apiName [responseType] | |
-> Source m Value |
A wrapper function to perform multiple API request with changing max_id
parameter.
The response of this function is not restrict to responseType
,
so you can choose an arbitrarily type of FromJSON instances.
This function cooperate with instances of HasMaxIdParam
.
:: (MonadBase IO m, FromJSON responseType, CursorKey ck, HasCursorParam (APIRequest apiName (WithCursor ck responseType))) | |
=> TWInfo | Twitter Setting |
-> Manager | |
-> APIRequest apiName (WithCursor ck responseType) | |
-> Source m responseType |
A wrapper function to perform multiple API request with changing cursor
parameter.
This function cooperate with instances of HasCursorParam
.
:: (MonadBase IO m, CursorKey ck, HasCursorParam (APIRequest apiName (WithCursor ck responseType))) | |
=> TWInfo | Twitter Setting |
-> Manager | |
-> APIRequest apiName (WithCursor ck responseType) | |
-> Source m Value |
A wrapper function to perform multiple API request with changing cursor
parameter.
The response of this function is not restrict to responseType
,
so you can choose an arbitrarily type of FromJSON instances.
This function cooperate with instances of HasCursorParam
.
sourceWithSearchResult Source #
:: (MonadBase IO m, FromJSON responseType) | |
=> TWInfo | Twitter Setting |
-> Manager | |
-> APIRequest apiName (SearchResult [responseType]) | |
-> m (SearchResult (Source m responseType)) |
A wrapper function to perform multiple API request with SearchResult
.
sourceWithSearchResult' Source #
:: MonadBase IO m | |
=> TWInfo | Twitter Setting |
-> Manager | |
-> APIRequest apiName (SearchResult [responseType]) | |
-> m (SearchResult (Source m Value)) |
A wrapper function to perform multiple API request with SearchResult
.
makeRequest :: APIRequest apiName responseType -> IO Request Source #
sinkJSON :: MonadThrow m => Consumer ByteString m Value Source #
sinkFromJSON :: (FromJSON a, MonadThrow m) => Consumer ByteString m a Source #