@@ -15,6 +15,7 @@ Github4s supports the [Project API](https://developer.github.com/v3/projects/).
1515with Github4s, you can interact with:
1616
1717- [ Project] ( #project )
18+ - [ List repository projects] ( #list-repository-projects )
1819 - [ List projects] ( #list-projects )
1920 - [ Columns] ( #columns )
2021 - [ List project columns] ( #list-project-columns )
@@ -37,6 +38,36 @@ LiftIO syntax for `cats.Id` and `Future` are provided in `GithubIOSyntax`.
3738
3839## Project
3940
41+ ### List repository projects
42+
43+ You can list the projects for a particular repository with ` listProjectsRepository ` ; it takes as arguments:
44+
45+ - ` owner ` : name of the owner for which we want to retrieve the projects.
46+ - ` repo ` : name of the repository for which we want to retrieve the projects.
47+ - ` state ` : filter projects returned by their state. Can be either ` open ` , ` closed ` , ` all ` . Default: ` open ` , optional
48+ - ` pagination ` : Limit and Offset for pagination, optional.
49+ - ` header ` : headers to include in the request, optional.
50+
51+ To list the projects for owner ` 47deg ` and repository ` github4s ` :
52+
53+ ``` scala mdoc:compile-only
54+ val listProjectsRepository = Github [IO ](accessToken).projects.listProjectsRepository(
55+ owner = " 47deg" ,
56+ repo = " github4s" ,
57+ headers = Map (" Accept" -> " application/vnd.github.inertia-preview+json" ))
58+ listProjectsRepository.unsafeRunSync() match {
59+ case Left (e) => println(s " Something went wrong: ${e.getMessage}" )
60+ case Right (r) => println(r.result)
61+ }
62+ ```
63+
64+ The ` result ` on the right is the corresponding [ List[ Project]] [ project-scala ] .
65+
66+ See [ the API doc] ( https://developer.github.com/v3/projects/#list-repository-projects ) for full reference.
67+
68+ [ project-scala ] : https://github.com/47deg/github4s/blob/master/github4s/src/main/scala/github4s/domain/Project.scala
69+
70+
4071### List projects
4172
4273You can list the project for a particular organization with ` listProjects ` ; it takes as arguments:
0 commit comments