Safe Haskell | None |
---|
StackExchange API request manipulation routines
- type Request a n r = Dual (Endo (R a n r))
- data R a n r = R {}
- data Auth
- = RequireToken
- | Ready
- newtype SE a = SE {}
- data Object
- = AccessToken
- | AccountMerge
- | Answer
- | Badge
- | Comment
- | Error
- | Event
- | Filter
- | InboxItem
- | Info
- | NetworkUser
- | Notification
- | Post
- | Privilege
- | Question
- | QuestionTimeline
- | Reputation
- | ReputationHistory
- | Revision
- | Site
- | SuggestedEdit
- | Tag
- | TagScore
- | TagSynonym
- | TagWiki
- | TopTag
- | User
- | UserTimeline
- | WritePermission
- host :: Text -> Request a n r
- path :: Text -> Request a n r
- method :: Text -> Request a n r
- parse :: (ByteString -> r) -> Request a n r
- query :: [(Text, Text)] -> Request a n r
- token :: Text -> Request RequireToken n r -> Request Ready n r
- key :: Text -> Request a n r
- site :: Text -> Request a n r
- filter :: Text -> Request a n r
- state :: Text -> Request a n r
- data Scope
- = ReadInbox
- | NoExpiry
- | WriteAccess
- | PrivateInfo
- scope :: [Scope] -> Request a n r
- client :: Int -> Request a n r
- redirectURI :: Text -> Request a n r
- secret :: Text -> Request a n r
- code :: Text -> Request a n r
- wrap :: (R a n r -> R a n r) -> Request a n r
- unwrap :: Request a n r -> R a n r -> R a n r
- render :: Request a n r -> String
Type
StackExchange API Request data type.
a
is a phantom type showing whether authentication is enabled
n
is a phantom type dissallowing combination of
different API calls in one request
r
is a type of parsed API call result
Authentication
RequireToken | Request requires auth_token |
Ready | Request may be sent without auth_token |
SE response type
Constructing requests
host :: Text -> Request a n rSource
Request defining only API call host
Primarily used in Auth, not intended for usage by library user
path :: Text -> Request a n rSource
Request defining only API call path
Primarily used in API call wrappers, not intended for usage by library user
method :: Text -> Request a n rSource
Request defining only call method
Primarily used in API call wrappers, not intended for usage by library user
parse :: (ByteString -> r) -> Request a n rSource
Request defining only API call result parsing function
Primarily used in API call wrappers, not intended for usage by library user
token :: Text -> Request RequireToken n r -> Request Ready n rSource
Convert token requiring Request into ready one
Scope defines permission granted for application by user
client :: Int -> Request a n rSource
Request defining only Authentication API call application id
Primarily used in Authentication API call wrappers, not intended for usage by library user
redirectURI :: Text -> Request a n rSource
Request defining only Authentication API call redirect url
Primarily used in Authentication API call wrappers, not intended for usage by library user
secret :: Text -> Request a n rSource
Request defining only Authentication API call application secret
Primarily used in Authentication API call wrappers, not intended for usage by library user
code :: Text -> Request a n rSource
Request defining only Authentication API call code
Primarily used in Authentication API call wrappers, not intended for usage by library user