Copyright | (c) 2020 Jens Petersen |
---|---|
License | GPL-2.0-only |
Maintainer | Jens Petersen <petersen@redhat.com> |
Safe Haskell | None |
Language | Haskell2010 |
Pagure REST client library
Synopsis
- pagureProjectInfo :: String -> String -> IO (Either String Object)
- pagureListProjects :: String -> Query -> IO Object
- pagureListProjectIssues :: String -> String -> Query -> IO (Either String Object)
- data IssueTitleStatus = IssueTitleStatus {}
- pagureListProjectIssueTitlesStatus :: String -> String -> Query -> IO (Either String [IssueTitleStatus])
- pagureProjectIssueInfo :: String -> String -> Int -> IO (Either String Object)
- pagureListGitBranches :: String -> String -> IO (Either String [String])
- pagureListGitBranchesWithCommits :: String -> String -> IO (Either String Object)
- pagureListUsers :: String -> String -> IO Object
- pagureUserForks :: String -> String -> IO [Text]
- pagureUserInfo :: String -> String -> Query -> IO (Either String Object)
- pagureUserRepos :: String -> String -> IO [Text]
- pagureListGroups :: String -> Maybe String -> Query -> IO Object
- pagureProjectGitURLs :: String -> String -> IO (Either String Object)
- queryPagure :: String -> String -> Query -> IO Object
- queryPagure' :: String -> String -> Query -> IO Object
- queryPagureSingle :: String -> String -> Query -> IO (Either String Object)
- queryPagurePaged :: String -> String -> Query -> (String, String) -> IO [Object]
- queryPagureCount :: String -> String -> Query -> String -> IO (Maybe Integer)
- makeKey :: String -> String -> Query
- makeItem :: String -> String -> QueryItem
- maybeKey :: String -> Maybe String -> Query
- type Query = [QueryItem]
- type QueryItem = (ByteString, Maybe ByteString)
- lookupKey :: FromJSON a => Text -> Object -> Maybe a
- lookupKey' :: FromJSON a => Text -> Object -> a
Documentation
pagureProjectInfo :: String -> String -> IO (Either String Object) Source #
pagureListProjectIssues :: String -> String -> Query -> IO (Either String Object) Source #
List project issues
data IssueTitleStatus Source #
pagureListProjectIssueTitlesStatus :: String -> String -> Query -> IO (Either String [IssueTitleStatus]) Source #
List project issue titles
pagureProjectIssueInfo :: String -> String -> Int -> IO (Either String Object) Source #
Issue information
pagureListGitBranchesWithCommits :: String -> String -> IO (Either String Object) Source #
List repo branches with commits
queryPagure' :: String -> String -> Query -> IO Object Source #
low-level query Like queryPagure but errors if JSON has "error" field: eg for a non-existent API query path
queryPagurePaged :: String -> String -> Query -> (String, String) -> IO [Object] Source #
get all pages of results
Warning: this can potentially download very large amounts of data. For potentially large queries, it is a good idea to queryPagureCount first.
Errors for a non-existent API path
queryPagureCount :: String -> String -> Query -> String -> IO (Maybe Integer) Source #
count total number of hits FIXME: errors if the query fails
Query.
General form: a=b&c=d
, but if the value is Nothing, it becomes
a&c=d
.
type QueryItem = (ByteString, Maybe ByteString) #
Query item
lookupKey' :: FromJSON a => Text -> Object -> a #
Like lookupKey but raises an error if no key found