| License | BSD-3-Clause |
|---|---|
| Maintainer | Oleg Grenrus <oleg.grenrus@iki.fi> |
| Safe Haskell | None |
| Language | Haskell2010 |
GitHub.Data.Request
Description
- data Request (k :: RW) 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
- RedirectQuery :: SimpleRequest k () -> Request k URI
- data SimpleRequest (k :: RW) 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 :: RW) a where Source #
Github request data type.
kdescribes whether authentication is required. It's required for non-GETrequests.ais the result type
Constructors
| 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 | |
| RedirectQuery :: SimpleRequest k () -> Request k URI |
data SimpleRequest (k :: RW) a where Source #
Constructors
| Query :: Paths -> QueryString -> SimpleRequest k a | |
| PagedQuery :: Paths -> QueryString -> FetchCount -> SimpleRequest k (Vector a) | |
| Command :: CommandMethod a -> Paths -> ByteString -> SimpleRequest RW a |
Instances
| Eq a => Eq (SimpleRequest k a) Source # | |
| Ord a => Ord (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.
Constructors
| Post :: CommandMethod a | |
| Patch :: CommandMethod a | |
| Put :: CommandMethod a | |
| Put' :: CommandMethod () | |
| Delete :: CommandMethod () |
Instances
| Eq (CommandMethod a) Source # | |
| Ord (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.
Constructors
| FetchAtLeast !Word | |
| FetchAll |
Instances
| 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 #
Minimal complete definition
Methods
toPathPart :: a -> Text Source #
Instances
| IsPathPart ArchiveFormat Source # | |
| IsPathPart (Name a) Source # | |
| IsPathPart (Id a) Source # | |
type QueryString = [(ByteString, Maybe ByteString)] Source #
Request query string