| 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
- 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 |
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 #
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 # (/=) :: SimpleRequest k a -> SimpleRequest k a -> Bool # | |
| Ord a => Ord (SimpleRequest k a) Source # | |
Defined in GitHub.Data.Request Methods compare :: SimpleRequest k a -> SimpleRequest k a -> Ordering # (<) :: SimpleRequest k a -> SimpleRequest k a -> Bool # (<=) :: SimpleRequest k a -> SimpleRequest k a -> Bool # (>) :: SimpleRequest k a -> SimpleRequest k a -> Bool # (>=) :: SimpleRequest k a -> SimpleRequest k a -> Bool # max :: SimpleRequest k a -> SimpleRequest k a -> SimpleRequest k a # min :: SimpleRequest k a -> SimpleRequest k a -> SimpleRequest k a # | |
| Show (SimpleRequest k a) Source # | |
Defined in GitHub.Data.Request Methods showsPrec :: Int -> SimpleRequest k a -> ShowS # show :: SimpleRequest k a -> String # showList :: [SimpleRequest k a] -> ShowS # | |
| Hashable (SimpleRequest k a) Source # | |
Defined in GitHub.Data.Request | |
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 # | |
| 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 # 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.
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 # (/=) :: CommandMethod a -> CommandMethod a -> Bool # | |
| Ord (CommandMethod a) Source # | |
Defined in GitHub.Data.Request Methods 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 Methods showsPrec :: Int -> CommandMethod a -> ShowS # show :: CommandMethod a -> String # showList :: [CommandMethod a] -> ShowS # | |
| Hashable (CommandMethod a) Source # | |
Defined in GitHub.Data.Request | |
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 #
Minimal complete definition
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