pagure-0.1.1: Pagure REST client library
Copyright(c) 2020 Jens Petersen
LicenseGPL-2.0-only
MaintainerJens Petersen <petersen@redhat.com>
Safe HaskellNone
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

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

list user's forks

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

list user's repos

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

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 #

Make a singleton key-value Query

makeItem :: String -> String -> QueryItem #

Make a key-value QueryItem

maybeKey :: String -> Maybe String -> Query #

Maybe create a query key

type Query = [QueryItem] #

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 -> Maybe a #

Look up key in object

lookupKey' :: FromJSON a => Text -> Object -> a #

Like lookupKey but raises an error if no key found