License | BSD-3-Clause |
---|---|
Maintainer | Oleg Grenrus <oleg.grenrus@iki.fi> |
Safe Haskell | None |
Language | Haskell2010 |
GitHub.Data.Request
Description
Synopsis
- type Request = GenRequest 'MtJSON
- data GenRequest (mt :: MediaType *) (rw :: RW) a where
- Query :: Paths -> QueryString -> GenRequest mt rw a
- PagedQuery :: Paths -> QueryString -> FetchCount -> GenRequest mt rw (Vector a)
- Command :: CommandMethod -> Paths -> ByteString -> GenRequest mt 'RW a
- query :: Paths -> QueryString -> Request mt a
- pagedQuery :: FromJSON a => Paths -> QueryString -> FetchCount -> Request mt (Vector a)
- command :: CommandMethod -> Paths -> ByteString -> Request 'RW a
- data RW
- data CommandMethod
- toMethod :: CommandMethod -> Method
- data FetchCount
- = FetchAtLeast !Word
- | FetchAll
- data MediaType a
- type Paths = [Text]
- class IsPathPart a where
- toPathPart :: a -> Text
- type QueryString = [(ByteString, Maybe ByteString)]
- type Count = Int
Request
type Request = GenRequest 'MtJSON Source #
Most requests ask for JSON
.
data GenRequest (mt :: MediaType *) (rw :: RW) a where Source #
Github request data type.
rw
describes whether authentication is required. It's required for non-GET
requests.mt
describes the media type, i.e. how the response should be interpreted.a
is the result type
Constructors
Query :: Paths -> QueryString -> GenRequest mt rw a | |
PagedQuery :: Paths -> QueryString -> FetchCount -> GenRequest mt rw (Vector a) | |
Command | Command |
Fields
|
Instances
Eq (GenRequest rw mt a) Source # | |
Defined in GitHub.Data.Request Methods (==) :: GenRequest rw mt a -> GenRequest rw mt a -> Bool (/=) :: GenRequest rw mt a -> GenRequest rw mt a -> Bool | |
Ord (GenRequest rw mt a) Source # | |
Defined in GitHub.Data.Request Methods compare :: GenRequest rw mt a -> GenRequest rw mt a -> Ordering (<) :: GenRequest rw mt a -> GenRequest rw mt a -> Bool (<=) :: GenRequest rw mt a -> GenRequest rw mt a -> Bool (>) :: GenRequest rw mt a -> GenRequest rw mt a -> Bool (>=) :: GenRequest rw mt a -> GenRequest rw mt a -> Bool max :: GenRequest rw mt a -> GenRequest rw mt a -> GenRequest rw mt a min :: GenRequest rw mt a -> GenRequest rw mt a -> GenRequest rw mt a | |
Show (GenRequest rw mt a) Source # | |
Defined in GitHub.Data.Request Methods showsPrec :: Int -> GenRequest rw mt a -> ShowS show :: GenRequest rw mt a -> String showList :: [GenRequest rw mt a] -> ShowS | |
Hashable (GenRequest rw mt a) Source # | |
Defined in GitHub.Data.Request |
Smart constructors
pagedQuery :: FromJSON a => Paths -> QueryString -> FetchCount -> Request mt (Vector 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 authenticated |
RW | Read-write, requires authentication |
Instances
Bounded RW Source # | |
Defined in GitHub.Data.Request | |
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 :: forall r r'. (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 # | |
Defined in GitHub.Data.Request type Rep RW = D1 ('MetaData "RW" "GitHub.Data.Request" "github-0.23-K3uQMQDn7B7DXfUjYtDWP8" 'False) (C1 ('MetaCons "RO" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "RA" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RW" 'PrefixI 'False) (U1 :: Type -> Type))) |
data CommandMethod Source #
Http method of requests with body.
Instances
Bounded CommandMethod Source # | |
Defined in GitHub.Data.Request | |
Enum CommandMethod Source # | |
Defined in GitHub.Data.Request Methods succ :: CommandMethod -> CommandMethod pred :: CommandMethod -> CommandMethod toEnum :: Int -> CommandMethod fromEnum :: CommandMethod -> Int enumFrom :: CommandMethod -> [CommandMethod] enumFromThen :: CommandMethod -> CommandMethod -> [CommandMethod] enumFromTo :: CommandMethod -> CommandMethod -> [CommandMethod] enumFromThenTo :: CommandMethod -> CommandMethod -> CommandMethod -> [CommandMethod] | |
Eq CommandMethod Source # | |
Defined in GitHub.Data.Request | |
Data CommandMethod Source # | |
Defined in GitHub.Data.Request Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CommandMethod -> c CommandMethod gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CommandMethod toConstr :: CommandMethod -> Constr dataTypeOf :: CommandMethod -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CommandMethod) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CommandMethod) gmapT :: (forall b. Data b => b -> b) -> CommandMethod -> CommandMethod gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CommandMethod -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CommandMethod -> r gmapQ :: (forall d. Data d => d -> u) -> CommandMethod -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> CommandMethod -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> CommandMethod -> m CommandMethod gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CommandMethod -> m CommandMethod gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CommandMethod -> m CommandMethod | |
Ord CommandMethod Source # | |
Defined in GitHub.Data.Request Methods compare :: CommandMethod -> CommandMethod -> Ordering (<) :: CommandMethod -> CommandMethod -> Bool (<=) :: CommandMethod -> CommandMethod -> Bool (>) :: CommandMethod -> CommandMethod -> Bool (>=) :: CommandMethod -> CommandMethod -> Bool max :: CommandMethod -> CommandMethod -> CommandMethod min :: CommandMethod -> CommandMethod -> CommandMethod | |
Read CommandMethod Source # | |
Defined in GitHub.Data.Request Methods readsPrec :: Int -> ReadS CommandMethod # readList :: ReadS [CommandMethod] # readPrec :: ReadPrec CommandMethod # readListPrec :: ReadPrec [CommandMethod] # | |
Show CommandMethod Source # | |
Defined in GitHub.Data.Request Methods showsPrec :: Int -> CommandMethod -> ShowS show :: CommandMethod -> String showList :: [CommandMethod] -> ShowS | |
Generic CommandMethod Source # | |
Defined in GitHub.Data.Request Associated Types type Rep CommandMethod :: Type -> Type | |
Hashable CommandMethod Source # | |
Defined in GitHub.Data.Request | |
type Rep CommandMethod Source # | |
Defined in GitHub.Data.Request type Rep CommandMethod = D1 ('MetaData "CommandMethod" "GitHub.Data.Request" "github-0.23-K3uQMQDn7B7DXfUjYtDWP8" 'False) ((C1 ('MetaCons "Post" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Patch" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Put" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Delete" 'PrefixI 'False) (U1 :: Type -> Type))) |
toMethod :: CommandMethod -> 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
Constructors
MtJSON | application/vnd.github.v3+json |
MtRaw |
|
MtDiff |
|
MtPatch |
|
MtSha |
|
MtStar |
|
MtRedirect | https://developer.github.com/v3/repos/contents/#get-archive-link |
MtStatus | Parse status |
MtUnit | Always succeeds |
MtPreview a | Some other (preview) type; this is an extension point. |
Instances
Eq a => Eq (MediaType a) Source # | |
Data a => Data (MediaType a) Source # | |
Defined in GitHub.Data.Request Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MediaType a -> c (MediaType a) gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (MediaType a) toConstr :: MediaType a -> Constr dataTypeOf :: MediaType a -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (MediaType a)) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (MediaType a)) gmapT :: (forall b. Data b => b -> b) -> MediaType a -> MediaType a gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MediaType a -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MediaType a -> r gmapQ :: (forall d. Data d => d -> u) -> MediaType a -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> MediaType a -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> MediaType a -> m (MediaType a) gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MediaType a -> m (MediaType a) gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MediaType a -> m (MediaType a) | |
Ord a => Ord (MediaType a) Source # | |
Defined in GitHub.Data.Request | |
Read a => Read (MediaType a) Source # | |
Show a => Show (MediaType a) Source # | |
Generic (MediaType a) Source # | |
type Rep (MediaType a) Source # | |
Defined in GitHub.Data.Request type Rep (MediaType a) = D1 ('MetaData "MediaType" "GitHub.Data.Request" "github-0.23-K3uQMQDn7B7DXfUjYtDWP8" 'False) (((C1 ('MetaCons "MtJSON" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MtRaw" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MtDiff" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MtPatch" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MtSha" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "MtStar" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MtRedirect" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MtStatus" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MtUnit" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MtPreview" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))))) |
class IsPathPart a where Source #
Methods
toPathPart :: a -> Text Source #
Instances
IsPathPart IssueNumber Source # | |
Defined in GitHub.Data.Request Methods toPathPart :: IssueNumber -> Text Source # | |
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