Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Response responseType
- responseStatus :: forall responseType. Lens' (Response responseType) Status
- responseBody :: forall a b. Lens (Response a) (Response b) a b
- responseHeaders :: forall responseType. Lens' (Response responseType) ResponseHeaders
- data TwitterErrorMessage
- twitterErrorMessage :: Lens' TwitterErrorMessage Text
- twitterErrorCode :: Lens' TwitterErrorMessage Int
- data WithCursor cursorKey wrapped
- previousCursor :: forall cursorKey wrapped. Lens' (WithCursor cursorKey wrapped) Integer
- nextCursor :: forall cursorKey wrapped. Lens' (WithCursor cursorKey wrapped) Integer
- contents :: forall cursorKey a b. Lens (WithCursor cursorKey a) (WithCursor cursorKey b) [a] [b]
- data TwitterError
- class CursorKey a where
- data IdsCursorKey
- data UsersCursorKey
- data ListsCursorKey
Response
responseHeaders :: forall responseType. Lens' (Response responseType) ResponseHeaders Source #
TwitterErrorMessage
data TwitterErrorMessage Source #
Twitter Error Messages
see detail: https://dev.twitter.com/docs/error-codes-responses
WithCursor
data WithCursor cursorKey wrapped Source #
A wrapper for API responses which have "next_cursor" field.
The first type parameter of WithCursor
specifies the field name of contents.
>>>
let Just res = decode "{\"previous_cursor\": 0, \"next_cursor\": 1234567890, \"ids\": [1111111111]}" :: Maybe (WithCursor IdsCursorKey UserId)
>>>
nextCursor res
1234567890>>>
contents res
[1111111111]
>>>
let Just res = decode "{\"previous_cursor\": 0, \"next_cursor\": 0, \"users\": [1000]}" :: Maybe (WithCursor UsersCursorKey UserId)
>>>
nextCursor res
0>>>
contents res
[1000]
previousCursor :: forall cursorKey wrapped. Lens' (WithCursor cursorKey wrapped) Integer Source #
nextCursor :: forall cursorKey wrapped. Lens' (WithCursor cursorKey wrapped) Integer Source #
contents :: forall cursorKey a b. Lens (WithCursor cursorKey a) (WithCursor cursorKey b) [a] [b] Source #
Re-exports
data TwitterError Source #
data IdsCursorKey Source #
Phantom type to specify the key which point out the content in the response.
data UsersCursorKey Source #
Phantom type to specify the key which point out the content in the response.
data ListsCursorKey Source #
Phantom type to specify the key which point out the content in the response.