module GitHub.Endpoints.Repos (
currentUserRepos,
currentUserReposR,
userRepos,
userRepos',
userReposR,
organizationRepos,
organizationRepos',
organizationReposR,
repository,
repository',
repositoryR,
contributors,
contributors',
contributorsR,
contributorsWithAnonymous,
contributorsWithAnonymous',
languagesFor,
languagesFor',
languagesForR,
tagsFor,
tagsFor',
tagsForR,
branchesFor,
branchesFor',
branchesForR,
createRepo',
createRepoR,
createOrganizationRepo',
createOrganizationRepoR,
forkExistingRepo',
forkExistingRepoR,
editRepo,
editRepoR,
deleteRepo,
deleteRepoR,
module GitHub.Data,
) where
import GitHub.Data
import GitHub.Internal.Prelude
import GitHub.Request
import Prelude ()
repoPublicityQueryString :: RepoPublicity -> QueryString
repoPublicityQueryString :: RepoPublicity -> QueryString
repoPublicityQueryString RepoPublicityAll = [("type", ByteString -> Maybe ByteString
forall a. a -> Maybe a
Just "all")]
repoPublicityQueryString RepoPublicityOwner = [("type", ByteString -> Maybe ByteString
forall a. a -> Maybe a
Just "owner")]
repoPublicityQueryString RepoPublicityMember = [("type", ByteString -> Maybe ByteString
forall a. a -> Maybe a
Just "member")]
repoPublicityQueryString RepoPublicityPublic = [("type", ByteString -> Maybe ByteString
forall a. a -> Maybe a
Just "public")]
repoPublicityQueryString RepoPublicityPrivate = [("type", ByteString -> Maybe ByteString
forall a. a -> Maybe a
Just "private")]
currentUserRepos :: Auth -> RepoPublicity -> IO (Either Error (Vector Repo))
currentUserRepos :: Auth -> RepoPublicity -> IO (Either Error (Vector Repo))
currentUserRepos auth :: Auth
auth publicity :: RepoPublicity
publicity =
Auth
-> GenRequest 'MtJSON Any (Vector Repo)
-> IO (Either Error (Vector Repo))
forall am (mt :: MediaType *) a (rw :: RW).
(AuthMethod am, ParseResponse mt a) =>
am -> GenRequest mt rw a -> IO (Either Error a)
executeRequest Auth
auth (GenRequest 'MtJSON Any (Vector Repo)
-> IO (Either Error (Vector Repo)))
-> GenRequest 'MtJSON Any (Vector Repo)
-> IO (Either Error (Vector Repo))
forall a b. (a -> b) -> a -> b
$ RepoPublicity -> FetchCount -> GenRequest 'MtJSON Any (Vector Repo)
forall (k :: RW).
RepoPublicity -> FetchCount -> Request k (Vector Repo)
currentUserReposR RepoPublicity
publicity FetchCount
FetchAll
currentUserReposR :: RepoPublicity -> FetchCount -> Request k (Vector Repo)
currentUserReposR :: RepoPublicity -> FetchCount -> Request k (Vector Repo)
currentUserReposR publicity :: RepoPublicity
publicity =
Paths -> QueryString -> FetchCount -> Request k (Vector Repo)
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery ["user", "repos"] QueryString
qs
where
qs :: QueryString
qs = RepoPublicity -> QueryString
repoPublicityQueryString RepoPublicity
publicity
userRepos :: Name Owner -> RepoPublicity -> IO (Either Error (Vector Repo))
userRepos :: Name Owner -> RepoPublicity -> IO (Either Error (Vector Repo))
userRepos = Maybe Auth
-> Name Owner -> RepoPublicity -> IO (Either Error (Vector Repo))
userRepos' Maybe Auth
forall a. Maybe a
Nothing
userRepos'
:: Maybe Auth
-> Name Owner
-> RepoPublicity
-> IO (Either Error (Vector Repo))
userRepos' :: Maybe Auth
-> Name Owner -> RepoPublicity -> IO (Either Error (Vector Repo))
userRepos' auth :: Maybe Auth
auth user :: Name Owner
user publicity :: RepoPublicity
publicity =
Maybe Auth
-> GenRequest 'MtJSON 'RO (Vector Repo)
-> IO (Either Error (Vector Repo))
forall am (mt :: MediaType *) a.
(AuthMethod am, ParseResponse mt a) =>
Maybe am -> GenRequest mt 'RO a -> IO (Either Error a)
executeRequestMaybe Maybe Auth
auth (GenRequest 'MtJSON 'RO (Vector Repo)
-> IO (Either Error (Vector Repo)))
-> GenRequest 'MtJSON 'RO (Vector Repo)
-> IO (Either Error (Vector Repo))
forall a b. (a -> b) -> a -> b
$ Name Owner
-> RepoPublicity
-> FetchCount
-> GenRequest 'MtJSON 'RO (Vector Repo)
forall (k :: RW).
Name Owner
-> RepoPublicity -> FetchCount -> Request k (Vector Repo)
userReposR Name Owner
user RepoPublicity
publicity FetchCount
FetchAll
userReposR :: Name Owner -> RepoPublicity -> FetchCount -> Request k(Vector Repo)
userReposR :: Name Owner
-> RepoPublicity -> FetchCount -> Request k (Vector Repo)
userReposR user :: Name Owner
user publicity :: RepoPublicity
publicity =
Paths -> QueryString -> FetchCount -> Request k (Vector Repo)
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery ["users", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, "repos"] QueryString
qs
where
qs :: QueryString
qs = RepoPublicity -> QueryString
repoPublicityQueryString RepoPublicity
publicity
organizationRepos :: Name Organization -> IO (Either Error (Vector Repo))
organizationRepos :: Name Organization -> IO (Either Error (Vector Repo))
organizationRepos org :: Name Organization
org = Maybe Auth
-> Name Organization
-> RepoPublicity
-> IO (Either Error (Vector Repo))
organizationRepos' Maybe Auth
forall a. Maybe a
Nothing Name Organization
org RepoPublicity
RepoPublicityAll
organizationRepos'
:: Maybe Auth
-> Name Organization
-> RepoPublicity
-> IO (Either Error (Vector Repo))
organizationRepos' :: Maybe Auth
-> Name Organization
-> RepoPublicity
-> IO (Either Error (Vector Repo))
organizationRepos' auth :: Maybe Auth
auth org :: Name Organization
org publicity :: RepoPublicity
publicity =
Maybe Auth
-> GenRequest 'MtJSON 'RO (Vector Repo)
-> IO (Either Error (Vector Repo))
forall am (mt :: MediaType *) a.
(AuthMethod am, ParseResponse mt a) =>
Maybe am -> GenRequest mt 'RO a -> IO (Either Error a)
executeRequestMaybe Maybe Auth
auth (GenRequest 'MtJSON 'RO (Vector Repo)
-> IO (Either Error (Vector Repo)))
-> GenRequest 'MtJSON 'RO (Vector Repo)
-> IO (Either Error (Vector Repo))
forall a b. (a -> b) -> a -> b
$ Name Organization
-> RepoPublicity
-> FetchCount
-> GenRequest 'MtJSON 'RO (Vector Repo)
forall (k :: RW).
Name Organization
-> RepoPublicity -> FetchCount -> Request k (Vector Repo)
organizationReposR Name Organization
org RepoPublicity
publicity FetchCount
FetchAll
organizationReposR
:: Name Organization
-> RepoPublicity
-> FetchCount
-> Request k (Vector Repo)
organizationReposR :: Name Organization
-> RepoPublicity -> FetchCount -> Request k (Vector Repo)
organizationReposR org :: Name Organization
org publicity :: RepoPublicity
publicity =
Paths -> QueryString -> FetchCount -> Request k (Vector Repo)
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery ["orgs", Name Organization -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Organization
org, "repos"] QueryString
qs
where
qs :: QueryString
qs = RepoPublicity -> QueryString
repoPublicityQueryString RepoPublicity
publicity
repository :: Name Owner -> Name Repo -> IO (Either Error Repo)
repository :: Name Owner -> Name Repo -> IO (Either Error Repo)
repository = Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error Repo)
repository' Maybe Auth
forall a. Maybe a
Nothing
repository' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error Repo)
repository' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error Repo)
repository' auth :: Maybe Auth
auth user :: Name Owner
user repo :: Name Repo
repo =
Maybe Auth -> GenRequest 'MtJSON 'RO Repo -> IO (Either Error Repo)
forall am (mt :: MediaType *) a.
(AuthMethod am, ParseResponse mt a) =>
Maybe am -> GenRequest mt 'RO a -> IO (Either Error a)
executeRequestMaybe Maybe Auth
auth (GenRequest 'MtJSON 'RO Repo -> IO (Either Error Repo))
-> GenRequest 'MtJSON 'RO Repo -> IO (Either Error Repo)
forall a b. (a -> b) -> a -> b
$ Name Owner -> Name Repo -> GenRequest 'MtJSON 'RO Repo
forall (k :: RW). Name Owner -> Name Repo -> Request k Repo
repositoryR Name Owner
user Name Repo
repo
repositoryR :: Name Owner -> Name Repo -> Request k Repo
repositoryR :: Name Owner -> Name Repo -> Request k Repo
repositoryR user :: Name Owner
user repo :: Name Repo
repo =
Paths -> QueryString -> Request k Repo
forall (mt :: RW) a. Paths -> QueryString -> Request mt a
query ["repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo] []
createRepo' :: Auth -> NewRepo -> IO (Either Error Repo)
createRepo' :: Auth -> NewRepo -> IO (Either Error Repo)
createRepo' auth :: Auth
auth nrepo :: NewRepo
nrepo =
Auth -> GenRequest 'MtJSON 'RW Repo -> IO (Either Error Repo)
forall am (mt :: MediaType *) a (rw :: RW).
(AuthMethod am, ParseResponse mt a) =>
am -> GenRequest mt rw a -> IO (Either Error a)
executeRequest Auth
auth (GenRequest 'MtJSON 'RW Repo -> IO (Either Error Repo))
-> GenRequest 'MtJSON 'RW Repo -> IO (Either Error Repo)
forall a b. (a -> b) -> a -> b
$ NewRepo -> GenRequest 'MtJSON 'RW Repo
createRepoR NewRepo
nrepo
createRepoR :: NewRepo -> Request 'RW Repo
createRepoR :: NewRepo -> GenRequest 'MtJSON 'RW Repo
createRepoR nrepo :: NewRepo
nrepo =
CommandMethod -> Paths -> ByteString -> GenRequest 'MtJSON 'RW Repo
forall a. CommandMethod -> Paths -> ByteString -> Request 'RW a
command CommandMethod
Post ["user", "repos"] (NewRepo -> ByteString
forall a. ToJSON a => a -> ByteString
encode NewRepo
nrepo)
forkExistingRepo' :: Auth -> Name Owner -> Name Repo -> Maybe (Name Owner) -> IO (Either Error Repo)
forkExistingRepo' :: Auth
-> Name Owner
-> Name Repo
-> Maybe (Name Owner)
-> IO (Either Error Repo)
forkExistingRepo' auth :: Auth
auth owner :: Name Owner
owner repo :: Name Repo
repo morg :: Maybe (Name Owner)
morg =
Auth -> GenRequest 'MtJSON 'RW Repo -> IO (Either Error Repo)
forall am (mt :: MediaType *) a (rw :: RW).
(AuthMethod am, ParseResponse mt a) =>
am -> GenRequest mt rw a -> IO (Either Error a)
executeRequest Auth
auth (GenRequest 'MtJSON 'RW Repo -> IO (Either Error Repo))
-> GenRequest 'MtJSON 'RW Repo -> IO (Either Error Repo)
forall a b. (a -> b) -> a -> b
$ Name Owner
-> Name Repo -> Maybe (Name Owner) -> GenRequest 'MtJSON 'RW Repo
forkExistingRepoR Name Owner
owner Name Repo
repo Maybe (Name Owner)
morg
forkExistingRepoR :: Name Owner -> Name Repo -> Maybe (Name Owner) -> Request 'RW Repo
forkExistingRepoR :: Name Owner
-> Name Repo -> Maybe (Name Owner) -> GenRequest 'MtJSON 'RW Repo
forkExistingRepoR owner :: Name Owner
owner repo :: Name Repo
repo _morg :: Maybe (Name Owner)
_morg =
CommandMethod -> Paths -> ByteString -> GenRequest 'MtJSON 'RW Repo
forall a. CommandMethod -> Paths -> ByteString -> Request 'RW a
command CommandMethod
Post ["repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
owner, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, "forks" ] ByteString
forall a. Monoid a => a
mempty
createOrganizationRepo' :: Auth -> Name Organization -> NewRepo -> IO (Either Error Repo)
createOrganizationRepo' :: Auth -> Name Organization -> NewRepo -> IO (Either Error Repo)
createOrganizationRepo' auth :: Auth
auth org :: Name Organization
org nrepo :: NewRepo
nrepo =
Auth -> GenRequest 'MtJSON 'RW Repo -> IO (Either Error Repo)
forall am (mt :: MediaType *) a (rw :: RW).
(AuthMethod am, ParseResponse mt a) =>
am -> GenRequest mt rw a -> IO (Either Error a)
executeRequest Auth
auth (GenRequest 'MtJSON 'RW Repo -> IO (Either Error Repo))
-> GenRequest 'MtJSON 'RW Repo -> IO (Either Error Repo)
forall a b. (a -> b) -> a -> b
$ Name Organization -> NewRepo -> GenRequest 'MtJSON 'RW Repo
createOrganizationRepoR Name Organization
org NewRepo
nrepo
createOrganizationRepoR :: Name Organization -> NewRepo -> Request 'RW Repo
createOrganizationRepoR :: Name Organization -> NewRepo -> GenRequest 'MtJSON 'RW Repo
createOrganizationRepoR org :: Name Organization
org nrepo :: NewRepo
nrepo =
CommandMethod -> Paths -> ByteString -> GenRequest 'MtJSON 'RW Repo
forall a. CommandMethod -> Paths -> ByteString -> Request 'RW a
command CommandMethod
Post ["orgs", Name Organization -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Organization
org, "repos"] (NewRepo -> ByteString
forall a. ToJSON a => a -> ByteString
encode NewRepo
nrepo)
editRepo
:: Auth
-> Name Owner
-> Name Repo
-> EditRepo
-> IO (Either Error Repo)
editRepo :: Auth
-> Name Owner -> Name Repo -> EditRepo -> IO (Either Error Repo)
editRepo auth :: Auth
auth user :: Name Owner
user repo :: Name Repo
repo body :: EditRepo
body =
Auth -> GenRequest 'MtJSON 'RW Repo -> IO (Either Error Repo)
forall am (mt :: MediaType *) a (rw :: RW).
(AuthMethod am, ParseResponse mt a) =>
am -> GenRequest mt rw a -> IO (Either Error a)
executeRequest Auth
auth (GenRequest 'MtJSON 'RW Repo -> IO (Either Error Repo))
-> GenRequest 'MtJSON 'RW Repo -> IO (Either Error Repo)
forall a b. (a -> b) -> a -> b
$ Name Owner -> Name Repo -> EditRepo -> GenRequest 'MtJSON 'RW Repo
editRepoR Name Owner
user Name Repo
repo EditRepo
body
editRepoR :: Name Owner -> Name Repo -> EditRepo -> Request 'RW Repo
editRepoR :: Name Owner -> Name Repo -> EditRepo -> GenRequest 'MtJSON 'RW Repo
editRepoR user :: Name Owner
user repo :: Name Repo
repo body :: EditRepo
body =
CommandMethod -> Paths -> ByteString -> GenRequest 'MtJSON 'RW Repo
forall a. CommandMethod -> Paths -> ByteString -> Request 'RW a
command CommandMethod
Patch ["repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo] (EditRepo -> ByteString
forall a. ToJSON a => a -> ByteString
encode EditRepo
b)
where
b :: EditRepo
b = EditRepo
body {editName :: Maybe (Name Repo)
editName = EditRepo -> Maybe (Name Repo)
editName EditRepo
body Maybe (Name Repo) -> Maybe (Name Repo) -> Maybe (Name Repo)
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> Name Repo -> Maybe (Name Repo)
forall a. a -> Maybe a
Just Name Repo
repo}
contributors :: Name Owner -> Name Repo -> IO (Either Error (Vector Contributor))
contributors :: Name Owner -> Name Repo -> IO (Either Error (Vector Contributor))
contributors = Maybe Auth
-> Name Owner
-> Name Repo
-> IO (Either Error (Vector Contributor))
contributors' Maybe Auth
forall a. Maybe a
Nothing
contributors' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Contributor))
contributors' :: Maybe Auth
-> Name Owner
-> Name Repo
-> IO (Either Error (Vector Contributor))
contributors' auth :: Maybe Auth
auth user :: Name Owner
user repo :: Name Repo
repo =
Maybe Auth
-> GenRequest 'MtJSON 'RO (Vector Contributor)
-> IO (Either Error (Vector Contributor))
forall am (mt :: MediaType *) a.
(AuthMethod am, ParseResponse mt a) =>
Maybe am -> GenRequest mt 'RO a -> IO (Either Error a)
executeRequestMaybe Maybe Auth
auth (GenRequest 'MtJSON 'RO (Vector Contributor)
-> IO (Either Error (Vector Contributor)))
-> GenRequest 'MtJSON 'RO (Vector Contributor)
-> IO (Either Error (Vector Contributor))
forall a b. (a -> b) -> a -> b
$ Name Owner
-> Name Repo
-> Bool
-> FetchCount
-> GenRequest 'MtJSON 'RO (Vector Contributor)
forall (k :: RW).
Name Owner
-> Name Repo
-> Bool
-> FetchCount
-> Request k (Vector Contributor)
contributorsR Name Owner
user Name Repo
repo Bool
False FetchCount
FetchAll
contributorsR
:: Name Owner
-> Name Repo
-> Bool
-> FetchCount
-> Request k (Vector Contributor)
contributorsR :: Name Owner
-> Name Repo
-> Bool
-> FetchCount
-> Request k (Vector Contributor)
contributorsR user :: Name Owner
user repo :: Name Repo
repo anon :: Bool
anon =
Paths
-> QueryString -> FetchCount -> Request k (Vector Contributor)
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery ["repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, "contributors"] QueryString
qs
where
qs :: QueryString
qs | Bool
anon = [("anon", ByteString -> Maybe ByteString
forall a. a -> Maybe a
Just "true")]
| Bool
otherwise = []
contributorsWithAnonymous :: Name Owner -> Name Repo -> IO (Either Error (Vector Contributor))
contributorsWithAnonymous :: Name Owner -> Name Repo -> IO (Either Error (Vector Contributor))
contributorsWithAnonymous = Maybe Auth
-> Name Owner
-> Name Repo
-> IO (Either Error (Vector Contributor))
contributorsWithAnonymous' Maybe Auth
forall a. Maybe a
Nothing
contributorsWithAnonymous' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Contributor))
contributorsWithAnonymous' :: Maybe Auth
-> Name Owner
-> Name Repo
-> IO (Either Error (Vector Contributor))
contributorsWithAnonymous' auth :: Maybe Auth
auth user :: Name Owner
user repo :: Name Repo
repo =
Maybe Auth
-> GenRequest 'MtJSON 'RO (Vector Contributor)
-> IO (Either Error (Vector Contributor))
forall am (mt :: MediaType *) a.
(AuthMethod am, ParseResponse mt a) =>
Maybe am -> GenRequest mt 'RO a -> IO (Either Error a)
executeRequestMaybe Maybe Auth
auth (GenRequest 'MtJSON 'RO (Vector Contributor)
-> IO (Either Error (Vector Contributor)))
-> GenRequest 'MtJSON 'RO (Vector Contributor)
-> IO (Either Error (Vector Contributor))
forall a b. (a -> b) -> a -> b
$ Name Owner
-> Name Repo
-> Bool
-> FetchCount
-> GenRequest 'MtJSON 'RO (Vector Contributor)
forall (k :: RW).
Name Owner
-> Name Repo
-> Bool
-> FetchCount
-> Request k (Vector Contributor)
contributorsR Name Owner
user Name Repo
repo Bool
True FetchCount
FetchAll
languagesFor :: Name Owner -> Name Repo -> IO (Either Error Languages)
languagesFor :: Name Owner -> Name Repo -> IO (Either Error Languages)
languagesFor = Maybe Auth
-> Name Owner -> Name Repo -> IO (Either Error Languages)
languagesFor' Maybe Auth
forall a. Maybe a
Nothing
languagesFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error Languages)
languagesFor' :: Maybe Auth
-> Name Owner -> Name Repo -> IO (Either Error Languages)
languagesFor' auth :: Maybe Auth
auth user :: Name Owner
user repo :: Name Repo
repo =
Maybe Auth
-> GenRequest 'MtJSON 'RO Languages -> IO (Either Error Languages)
forall am (mt :: MediaType *) a.
(AuthMethod am, ParseResponse mt a) =>
Maybe am -> GenRequest mt 'RO a -> IO (Either Error a)
executeRequestMaybe Maybe Auth
auth (GenRequest 'MtJSON 'RO Languages -> IO (Either Error Languages))
-> GenRequest 'MtJSON 'RO Languages -> IO (Either Error Languages)
forall a b. (a -> b) -> a -> b
$ Name Owner -> Name Repo -> GenRequest 'MtJSON 'RO Languages
forall (k :: RW). Name Owner -> Name Repo -> Request k Languages
languagesForR Name Owner
user Name Repo
repo
languagesForR :: Name Owner -> Name Repo -> Request k Languages
languagesForR :: Name Owner -> Name Repo -> Request k Languages
languagesForR user :: Name Owner
user repo :: Name Repo
repo =
Paths -> QueryString -> Request k Languages
forall (mt :: RW) a. Paths -> QueryString -> Request mt a
query ["repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, "languages"] []
tagsFor :: Name Owner -> Name Repo -> IO (Either Error (Vector Tag))
tagsFor :: Name Owner -> Name Repo -> IO (Either Error (Vector Tag))
tagsFor = Maybe Auth
-> Name Owner -> Name Repo -> IO (Either Error (Vector Tag))
tagsFor' Maybe Auth
forall a. Maybe a
Nothing
tagsFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Tag))
tagsFor' :: Maybe Auth
-> Name Owner -> Name Repo -> IO (Either Error (Vector Tag))
tagsFor' auth :: Maybe Auth
auth user :: Name Owner
user repo :: Name Repo
repo =
Maybe Auth
-> GenRequest 'MtJSON 'RO (Vector Tag)
-> IO (Either Error (Vector Tag))
forall am (mt :: MediaType *) a.
(AuthMethod am, ParseResponse mt a) =>
Maybe am -> GenRequest mt 'RO a -> IO (Either Error a)
executeRequestMaybe Maybe Auth
auth (GenRequest 'MtJSON 'RO (Vector Tag)
-> IO (Either Error (Vector Tag)))
-> GenRequest 'MtJSON 'RO (Vector Tag)
-> IO (Either Error (Vector Tag))
forall a b. (a -> b) -> a -> b
$ Name Owner
-> Name Repo -> FetchCount -> GenRequest 'MtJSON 'RO (Vector Tag)
forall (k :: RW).
Name Owner -> Name Repo -> FetchCount -> Request k (Vector Tag)
tagsForR Name Owner
user Name Repo
repo FetchCount
FetchAll
tagsForR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector Tag)
tagsForR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector Tag)
tagsForR user :: Name Owner
user repo :: Name Repo
repo =
Paths -> QueryString -> FetchCount -> Request k (Vector Tag)
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery ["repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, "tags"] []
branchesFor :: Name Owner -> Name Repo -> IO (Either Error (Vector Branch))
branchesFor :: Name Owner -> Name Repo -> IO (Either Error (Vector Branch))
branchesFor = Maybe Auth
-> Name Owner -> Name Repo -> IO (Either Error (Vector Branch))
branchesFor' Maybe Auth
forall a. Maybe a
Nothing
branchesFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Branch))
branchesFor' :: Maybe Auth
-> Name Owner -> Name Repo -> IO (Either Error (Vector Branch))
branchesFor' auth :: Maybe Auth
auth user :: Name Owner
user repo :: Name Repo
repo =
Maybe Auth
-> GenRequest 'MtJSON 'RO (Vector Branch)
-> IO (Either Error (Vector Branch))
forall am (mt :: MediaType *) a.
(AuthMethod am, ParseResponse mt a) =>
Maybe am -> GenRequest mt 'RO a -> IO (Either Error a)
executeRequestMaybe Maybe Auth
auth (GenRequest 'MtJSON 'RO (Vector Branch)
-> IO (Either Error (Vector Branch)))
-> GenRequest 'MtJSON 'RO (Vector Branch)
-> IO (Either Error (Vector Branch))
forall a b. (a -> b) -> a -> b
$ Name Owner
-> Name Repo
-> FetchCount
-> GenRequest 'MtJSON 'RO (Vector Branch)
forall (k :: RW).
Name Owner -> Name Repo -> FetchCount -> Request k (Vector Branch)
branchesForR Name Owner
user Name Repo
repo FetchCount
FetchAll
branchesForR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector Branch)
branchesForR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector Branch)
branchesForR user :: Name Owner
user repo :: Name Repo
repo =
Paths -> QueryString -> FetchCount -> Request k (Vector Branch)
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery ["repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, "branches"] []
deleteRepo :: Auth -> Name Owner -> Name Repo -> IO (Either Error ())
deleteRepo :: Auth -> Name Owner -> Name Repo -> IO (Either Error ())
deleteRepo auth :: Auth
auth user :: Name Owner
user repo :: Name Repo
repo =
Auth -> GenRequest 'MtUnit 'RW () -> IO (Either Error ())
forall am (mt :: MediaType *) a (rw :: RW).
(AuthMethod am, ParseResponse mt a) =>
am -> GenRequest mt rw a -> IO (Either Error a)
executeRequest Auth
auth (GenRequest 'MtUnit 'RW () -> IO (Either Error ()))
-> GenRequest 'MtUnit 'RW () -> IO (Either Error ())
forall a b. (a -> b) -> a -> b
$ Name Owner -> Name Repo -> GenRequest 'MtUnit 'RW ()
deleteRepoR Name Owner
user Name Repo
repo
deleteRepoR :: Name Owner -> Name Repo -> GenRequest 'MtUnit 'RW ()
deleteRepoR :: Name Owner -> Name Repo -> GenRequest 'MtUnit 'RW ()
deleteRepoR user :: Name Owner
user repo :: Name Repo
repo =
CommandMethod -> Paths -> ByteString -> GenRequest 'MtUnit 'RW ()
forall (mt :: MediaType *) a.
CommandMethod -> Paths -> ByteString -> GenRequest mt 'RW a
Command CommandMethod
Delete ["repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo] ByteString
forall a. Monoid a => a
mempty