| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
GitHub.Data.Request
Synopsis
- type Request = GenRequest ('MtJSON :: MediaType Type)
- data GenRequest (mt :: MediaType Type) (rw :: RW) a where
- Query :: forall (mt :: MediaType Type) (rw :: RW) a. Paths -> QueryString -> GenRequest mt rw a
- PagedQuery :: forall a (t :: Type -> Type) b (mt :: MediaType Type) (rw :: RW). (a ~ t b, Foldable t, Semigroup a) => Paths -> QueryString -> FetchCount -> GenRequest mt rw a
- Command :: forall (mt :: MediaType Type) a. CommandMethod -> Paths -> ByteString -> GenRequest mt 'RW a
- query :: forall (mt :: RW) a. Paths -> QueryString -> Request mt a
- pagedQuery :: forall a (mt :: RW). 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
- data PageParams = PageParams {}
- data PageLinks = PageLinks {
- pageLinksPrev :: Maybe URI
- pageLinksNext :: Maybe URI
- pageLinksLast :: Maybe URI
- pageLinksFirst :: Maybe URI
- data MediaType a
- type Paths = [Text]
- class IsPathPart a where
- toPathPart :: a -> Text
- type QueryString = [(ByteString, Maybe ByteString)]
- type Count = Int
Request
data GenRequest (mt :: MediaType Type) (rw :: RW) a where Source #
Github request data type.
rwdescribes whether authentication is required. It's required for non-GETrequests.mtdescribes the media type, i.e. how the response should be interpreted.ais the result type
Constructors
| Query :: forall (mt :: MediaType Type) (rw :: RW) a. Paths -> QueryString -> GenRequest mt rw a | |
| PagedQuery :: forall a (t :: Type -> Type) b (mt :: MediaType Type) (rw :: RW). (a ~ t b, Foldable t, Semigroup a) => Paths -> QueryString -> FetchCount -> GenRequest mt rw a | |
| Command | Command |
Fields
| |
Instances
Smart constructors
pagedQuery :: forall a (mt :: RW). FromJSON a => Paths -> QueryString -> FetchCount -> Request mt (Vector a) Source #
command :: CommandMethod -> 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 authenticated |
| RW | Read-write, requires authentication |
Instances
| Eq RW Source # | |||||
| Ord 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 # | |||||
| Bounded RW Source # | |||||
| Enum RW Source # | |||||
| Generic RW Source # | |||||
Defined in GitHub.Data.Request Associated Types
| |||||
| Read RW Source # | |||||
| Show RW Source # | |||||
| type Rep RW Source # | |||||
Defined in GitHub.Data.Request | |||||
data CommandMethod Source #
Http method of requests with body.
Instances
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 | |
| FetchPage PageParams |
Instances
| Binary FetchCount Source # | |||||
Defined in GitHub.Data.Request | |||||
| NFData FetchCount Source # | |||||
Defined in GitHub.Data.Request Methods rnf :: FetchCount -> () # | |||||
| Eq FetchCount Source # | |||||
Defined in GitHub.Data.Request | |||||
| Ord FetchCount Source # | |||||
Defined in GitHub.Data.Request Methods compare :: FetchCount -> FetchCount -> Ordering # (<) :: FetchCount -> FetchCount -> Bool # (<=) :: FetchCount -> FetchCount -> Bool # (>) :: FetchCount -> FetchCount -> Bool # (>=) :: FetchCount -> FetchCount -> Bool # max :: FetchCount -> FetchCount -> FetchCount # min :: FetchCount -> FetchCount -> FetchCount # | |||||
| Generic FetchCount Source # | |||||
Defined in GitHub.Data.Request Associated Types
| |||||
| Num FetchCount Source # | This instance is there mostly for | ||||
Defined in GitHub.Data.Request Methods (+) :: FetchCount -> FetchCount -> FetchCount # (-) :: FetchCount -> FetchCount -> FetchCount # (*) :: FetchCount -> FetchCount -> FetchCount # negate :: FetchCount -> FetchCount # abs :: FetchCount -> FetchCount # signum :: FetchCount -> FetchCount # fromInteger :: Integer -> FetchCount # | |||||
| Read FetchCount Source # | |||||
Defined in GitHub.Data.Request Methods readsPrec :: Int -> ReadS FetchCount # readList :: ReadS [FetchCount] # readPrec :: ReadPrec FetchCount # readListPrec :: ReadPrec [FetchCount] # | |||||
| Show FetchCount Source # | |||||
Defined in GitHub.Data.Request Methods showsPrec :: Int -> FetchCount -> ShowS # show :: FetchCount -> String # showList :: [FetchCount] -> ShowS # | |||||
| Hashable FetchCount Source # | |||||
Defined in GitHub.Data.Request | |||||
| type Rep FetchCount Source # | |||||
Defined in GitHub.Data.Request type Rep FetchCount = D1 ('MetaData "FetchCount" "GitHub.Data.Request" "github-0.30.0.1-inplace" 'False) (C1 ('MetaCons "FetchAtLeast" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word)) :+: (C1 ('MetaCons "FetchAll" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FetchPage" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PageParams)))) | |||||
data PageParams Source #
Params for specifying the precise page and items per page.
Constructors
| PageParams | |
Fields | |
Instances
| Binary PageParams Source # | |||||
Defined in GitHub.Data.Request | |||||
| NFData PageParams Source # | |||||
Defined in GitHub.Data.Request Methods rnf :: PageParams -> () # | |||||
| Eq PageParams Source # | |||||
Defined in GitHub.Data.Request | |||||
| Ord PageParams Source # | |||||
Defined in GitHub.Data.Request Methods compare :: PageParams -> PageParams -> Ordering # (<) :: PageParams -> PageParams -> Bool # (<=) :: PageParams -> PageParams -> Bool # (>) :: PageParams -> PageParams -> Bool # (>=) :: PageParams -> PageParams -> Bool # max :: PageParams -> PageParams -> PageParams # min :: PageParams -> PageParams -> PageParams # | |||||
| Generic PageParams Source # | |||||
Defined in GitHub.Data.Request Associated Types
| |||||
| Read PageParams Source # | |||||
Defined in GitHub.Data.Request Methods readsPrec :: Int -> ReadS PageParams # readList :: ReadS [PageParams] # readPrec :: ReadPrec PageParams # readListPrec :: ReadPrec [PageParams] # | |||||
| Show PageParams Source # | |||||
Defined in GitHub.Data.Request Methods showsPrec :: Int -> PageParams -> ShowS # show :: PageParams -> String # showList :: [PageParams] -> ShowS # | |||||
| Hashable PageParams Source # | |||||
Defined in GitHub.Data.Request | |||||
| type Rep PageParams Source # | |||||
Defined in GitHub.Data.Request type Rep PageParams = D1 ('MetaData "PageParams" "GitHub.Data.Request" "github-0.30.0.1-inplace" 'False) (C1 ('MetaCons "PageParams" 'PrefixI 'True) (S1 ('MetaSel ('Just "pageParamsPerPage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)) :*: S1 ('MetaSel ('Just "pageParamsPage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)))) | |||||
PagedQuery returns just some results, using this data we can specify how
many pages we want to fetch.
Constructors
| PageLinks | |
Fields
| |
Instances
| NFData PageLinks Source # | |||||
Defined in GitHub.Data.Request | |||||
| Eq PageLinks Source # | |||||
| Ord PageLinks Source # | |||||
| Generic PageLinks Source # | |||||
Defined in GitHub.Data.Request Associated Types
| |||||
| Show PageLinks Source # | |||||
| type Rep PageLinks Source # | |||||
Defined in GitHub.Data.Request type Rep PageLinks = D1 ('MetaData "PageLinks" "GitHub.Data.Request" "github-0.30.0.1-inplace" 'False) (C1 ('MetaCons "PageLinks" 'PrefixI 'True) ((S1 ('MetaSel ('Just "pageLinksPrev") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe URI)) :*: S1 ('MetaSel ('Just "pageLinksNext") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe URI))) :*: (S1 ('MetaSel ('Just "pageLinksLast") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe URI)) :*: S1 ('MetaSel ('Just "pageLinksFirst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe URI))))) | |||||
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 # | |||||
| Ord a => Ord (MediaType a) Source # | |||||
Defined in GitHub.Data.Request | |||||
| 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) # | |||||
| Generic (MediaType a) Source # | |||||
Defined in GitHub.Data.Request Associated Types
| |||||
| Read a => Read (MediaType a) Source # | |||||
| Show a => Show (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.30.0.1-inplace" '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 (Id a) Source # | |
Defined in GitHub.Data.Request Methods toPathPart :: Id a -> Text Source # | |
| IsPathPart (Name a) Source # | |
Defined in GitHub.Data.Request Methods toPathPart :: Name a -> Text Source # | |
type QueryString = [(ByteString, Maybe ByteString)] Source #
Request query string