pagure-0.1.2: Pagure REST client library
Copyright(c) 2020 Jens Petersen
LicenseGPL-2.0-only
MaintainerJens Petersen <petersen@redhat.com>
Safe HaskellSafe-Inferred
LanguageHaskell2010

Fedora.Pagure

Description

Pagure REST client library

Synopsis

Documentation

pagureProjectInfo :: String -> String -> IO (Either String Object) Source #

Project info

@ pagureProjectInfo server "repo" pagureProjectInfo server "namespace/repo" @

https://pagure.io/api/0/#projects-tab

pagureListProjectIssues :: String -> String -> Query -> IO (Either String Object) Source #

data IssueTitleStatus Source #

Constructors

IssueTitleStatus 

Fields

pagureListProjectIssueTitlesStatus :: String -> String -> Query -> IO (Either String [IssueTitleStatus]) Source #

List project issue titles

https://pagure.io/api/0/#issues-tab

pagureProjectIssueInfo :: String -> String -> Int -> IO (Either String Object) Source #

pagureListGitBranches :: String -> String -> IO (Either String [String]) Source #

pagureListGitBranchesWithCommits :: String -> String -> IO (Either String Object) Source #

List repo branches with commits

https://pagure.io/api/0/#projects-tab

pagureListUsers :: String -> String -> IO Object Source #

pagureUserForks :: String -> String -> IO [Text] Source #

list user's forks

pagureUserInfo :: String -> String -> Query -> IO (Either String Object) Source #

pagureUserRepos :: String -> String -> IO [Text] Source #

list user's repos

pagureListGroups :: String -> Maybe String -> Query -> IO Object Source #

pagureGroupInfo :: String -> String -> Query -> IO (Either String Object) Source #

pagureProjectGitURLs :: String -> String -> IO (Either String Object) Source #

queryPagure :: String -> String -> Query -> IO Object Source #

low-level query

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

queryPagureSingle :: String -> String -> Query -> IO (Either String Object) Source #

single query

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

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 #