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