Safe Haskell | None |
---|
- data Response responseType
- responseStatus :: forall responseType. Lens' (Response responseType) Status
- responseBody :: forall responseType responseType. Lens (Response responseType) (Response responseType) responseType responseType
- responseHeaders :: forall responseType. Lens' (Response responseType) ResponseHeaders
- data WithCursor cursorKey wrapped
- previousCursor :: forall cursorKey wrapped cursorKey. Lens (WithCursor cursorKey wrapped) (WithCursor cursorKey wrapped) Integer Integer
- nextCursor :: forall cursorKey wrapped cursorKey. Lens (WithCursor cursorKey wrapped) (WithCursor cursorKey wrapped) Integer Integer
- contents :: forall cursorKey wrapped cursorKey wrapped. Lens (WithCursor cursorKey wrapped) (WithCursor cursorKey wrapped) [wrapped] [wrapped]
- data ImageSizeType
- imageWidth :: Lens' ImageSizeType Int
- imageHeight :: Lens' ImageSizeType Int
- imageType :: Lens' ImageSizeType Text
- data UploadedMedia
- mediaId :: Lens' UploadedMedia Integer
- mediaSize :: Lens' UploadedMedia Integer
- mediaImage :: Lens' UploadedMedia ImageSizeType
- data TwitterErrorMessage
- twitterErrorMessage :: Lens' TwitterErrorMessage Text
- twitterErrorCode :: Lens' TwitterErrorMessage Int
Documentation
responseStatus :: forall responseType. Lens' (Response responseType) StatusSource
responseBody :: forall responseType responseType. Lens (Response responseType) (Response responseType) responseType responseTypeSource
responseHeaders :: forall responseType. Lens' (Response responseType) ResponseHeadersSource
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]
Show wrapped => Show (WithCursor cursorKey wrapped) | |
(FromJSON wrapped, CursorKey c) => FromJSON (WithCursor c wrapped) |
previousCursor :: forall cursorKey wrapped cursorKey. Lens (WithCursor cursorKey wrapped) (WithCursor cursorKey wrapped) Integer IntegerSource
nextCursor :: forall cursorKey wrapped cursorKey. Lens (WithCursor cursorKey wrapped) (WithCursor cursorKey wrapped) Integer IntegerSource
contents :: forall cursorKey wrapped cursorKey wrapped. Lens (WithCursor cursorKey wrapped) (WithCursor cursorKey wrapped) [wrapped] [wrapped]Source
data TwitterErrorMessage Source
Twitter Error Messages
see detail: https://dev.twitter.com/docs/error-codes-responses