License | BSD-3-Clause |
---|---|
Maintainer | Oleg Grenrus <oleg.grenrus@iki.fi> |
Safe Haskell | None |
Language | Haskell2010 |
- data Request k a where
- SimpleQuery :: FromJSON a => SimpleRequest k a -> Request k a
- StatusQuery :: StatusMap a -> SimpleRequest k () -> Request k a
- HeaderQuery :: FromJSON a => RequestHeaders -> SimpleRequest k a -> Request k a
- data SimpleRequest k a where
- Query :: Paths -> QueryString -> SimpleRequest k a
- PagedQuery :: Paths -> QueryString -> FetchCount -> SimpleRequest k (Vector a)
- Command :: CommandMethod a -> Paths -> ByteString -> SimpleRequest RW a
- query :: FromJSON a => Paths -> QueryString -> Request k a
- pagedQuery :: FromJSON a => Paths -> QueryString -> FetchCount -> Request k (Vector a)
- command :: FromJSON a => CommandMethod a -> Paths -> ByteString -> Request RW a
- data RW
- type StatusMap a = [(Int, a)]
- statusOnlyOk :: StatusMap Bool
- data CommandMethod a where
- Post :: CommandMethod a
- Patch :: CommandMethod a
- Put :: CommandMethod a
- Put' :: CommandMethod ()
- Delete :: CommandMethod ()
- toMethod :: CommandMethod a -> Method
- data FetchCount
- = FetchAtLeast !Word
- | FetchAll
- type Paths = [Text]
- class IsPathPart a where
- type QueryString = [(ByteString, Maybe ByteString)]
- type Count = Int
Request
data Request k a where Source #
Github request data type.
k
describes whether authentication is required. It's required for non-GET
requests.a
is the result type
SimpleQuery :: FromJSON a => SimpleRequest k a -> Request k a | |
StatusQuery :: StatusMap a -> SimpleRequest k () -> Request k a | |
HeaderQuery :: FromJSON a => RequestHeaders -> SimpleRequest k a -> Request k a |
data SimpleRequest k a where Source #
Query :: Paths -> QueryString -> SimpleRequest k a | |
PagedQuery :: Paths -> QueryString -> FetchCount -> SimpleRequest k (Vector a) | |
Command :: CommandMethod a -> Paths -> ByteString -> SimpleRequest RW a |
Eq a => Eq (SimpleRequest k a) Source # | |
Show (SimpleRequest k a) Source # | |
Hashable (SimpleRequest k a) Source # | |
Smart constructors
pagedQuery :: FromJSON a => Paths -> QueryString -> FetchCount -> Request k (Vector a) Source #
command :: FromJSON a => CommandMethod a -> Paths -> ByteString -> Request RW a Source #
Auxiliary types
Type used as with DataKinds
to tag whether requests need authentication
or aren't read-only.
data CommandMethod a where Source #
Http method of requests with body.
Post :: CommandMethod a | |
Patch :: CommandMethod a | |
Put :: CommandMethod a | |
Put' :: CommandMethod () | |
Delete :: CommandMethod () |
Eq (CommandMethod a) Source # | |
Show (CommandMethod a) Source # | |
Hashable (CommandMethod a) Source # | |
toMethod :: CommandMethod a -> Method Source #
data FetchCount Source #
PagedQuery
returns just some results, using this data we can specify how
many pages we want to fetch.
Eq FetchCount Source # | |
Num FetchCount Source # | This instance is there mostly for |
Ord FetchCount Source # | |
Read FetchCount Source # | |
Show FetchCount Source # | |
Generic FetchCount Source # | |
Hashable FetchCount Source # | |
Binary FetchCount Source # | |
NFData FetchCount Source # | |
type Rep FetchCount Source # | |
class IsPathPart a where Source #
toPathPart :: a -> Text Source #
IsPathPart (Name a) Source # | |
IsPathPart (Id a) Source # | |
type QueryString = [(ByteString, Maybe ByteString)] Source #
Request query string