License | BSD-3-Clause |
---|---|
Maintainer | Oleg Grenrus <oleg.grenrus@iki.fi> |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- 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.
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 | |
RedirectQuery :: SimpleRequest k () -> Request k URI |
Instances
Eq a => Eq (Request k a) Source # | |
Ord a => Ord (Request k a) Source # | |
Defined in GitHub.Data.Request | |
Show (Request k a) Source # | |
Hashable (Request k a) Source # | |
Defined in GitHub.Data.Request |
data SimpleRequest (k :: RW) 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 |
Instances
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.
RO | Read-only, doesn't necessarily requires authentication |
RA | Read autenticated |
RW | Read-write, requires authentication |
Instances
Bounded RW Source # | |
Enum RW Source # | |
Eq RW Source # | |
Data RW Source # | |
Defined in GitHub.Data.Request gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RW -> c RW # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RW # dataTypeOf :: RW -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RW) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RW) # gmapT :: (forall b. Data b => b -> b) -> RW -> RW # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RW -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RW -> r # gmapQ :: (forall d. Data d => d -> u) -> RW -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> RW -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> RW -> m RW # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RW -> m RW # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RW -> m RW # | |
Ord RW Source # | |
Read RW Source # | |
Show RW Source # | |
Generic RW Source # | |
type Rep RW Source # | |
data CommandMethod a where Source #
Http method of requests with body.
Post :: CommandMethod a | |
Patch :: CommandMethod a | |
Put :: CommandMethod a | |
Put' :: CommandMethod () | |
Delete :: CommandMethod () |
Instances
Eq (CommandMethod a) Source # | |
Defined in GitHub.Data.Request (==) :: CommandMethod a -> CommandMethod a -> Bool # (/=) :: CommandMethod a -> CommandMethod a -> Bool # | |
Ord (CommandMethod a) Source # | |
Defined in GitHub.Data.Request compare :: CommandMethod a -> CommandMethod a -> Ordering # (<) :: CommandMethod a -> CommandMethod a -> Bool # (<=) :: CommandMethod a -> CommandMethod a -> Bool # (>) :: CommandMethod a -> CommandMethod a -> Bool # (>=) :: CommandMethod a -> CommandMethod a -> Bool # max :: CommandMethod a -> CommandMethod a -> CommandMethod a # min :: CommandMethod a -> CommandMethod a -> CommandMethod a # | |
Show (CommandMethod a) Source # | |
Defined in GitHub.Data.Request showsPrec :: Int -> CommandMethod a -> ShowS # show :: CommandMethod a -> String # showList :: [CommandMethod a] -> ShowS # | |
Hashable (CommandMethod a) Source # | |
Defined in GitHub.Data.Request hashWithSalt :: Int -> CommandMethod a -> Int # hash :: CommandMethod a -> Int # |
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.
Instances
class IsPathPart a where Source #
toPathPart :: a -> Text Source #
Instances
IsPathPart ArchiveFormat Source # | |
Defined in GitHub.Data.Repos toPathPart :: ArchiveFormat -> Text Source # | |
IsPathPart (Name a) Source # | |
Defined in GitHub.Data.Request toPathPart :: Name a -> Text Source # | |
IsPathPart (Id a) Source # | |
Defined in GitHub.Data.Request toPathPart :: Id a -> Text Source # |
type QueryString = [(ByteString, Maybe ByteString)] Source #
Request query string