@@ -3,7 +3,7 @@ layout: docs
33title : Project API
44permalink : project
55---
6-
6+
77# Project API
88
99Note: The Projects API is currently available for developers to preview. During the preview period,
@@ -19,6 +19,8 @@ with Github4s, you can interact with:
1919 - [ List projects] ( #list-projects )
2020 - [ Columns] ( #columns )
2121 - [ List project columns] ( #list-project-columns )
22+ - [ Cards] ( #cards )
23+ - [ List project cards] ( #list-project-cards-by-column )
2224
2325The following examples assume the following imports and token:
2426
@@ -124,4 +126,35 @@ The `result` on the right is the corresponding [List[Column]][column-scala].
124126
125127See [ the API doc] ( https://developer.github.com/v3/projects/columns/#list-project-columns ) for full reference.
126128
127- [ column-scala ] : https://github.com/47deg/github4s/blob/master/github4s/src/main/scala/github4s/domain/Column.scala
129+ [ column-scala ] : https://github.com/47deg/github4s/blob/master/github4s/src/main/scala/github4s/domain/Project.scala
130+
131+ ### Cards
132+
133+ #### List project cards by column
134+
135+ You can list the cards for a particular column with ` listCards ` ; it takes as arguments:
136+
137+ - ` column_id ` : column id for which we want to retrieve the cards.
138+ - ` archived_state ` : filters the project cards that are returned by the card's state.
139+ Can be one of ` all ` ,` archived ` , or ` not_archived ` . Default: ` not_archived ` , optional.
140+ - ` pagination ` : Limit and Offset for pagination, optional.
141+ - ` header ` : headers to include in the request, optional.
142+
143+ To list the columns for project_id ` 8271018 ` :
144+
145+ ``` scala mdoc:compile-only
146+ val listCards = Github [IO ](accessToken).projects.listCards(
147+ column_id = 8271018 ,
148+ headers = Map (" Accept" -> " application/vnd.github.inertia-preview+json" ))
149+ val response = listCards.unsafeRunSync()
150+ response.result match {
151+ case Left (e) => println(s " Something went wrong: ${e.getMessage}" )
152+ case Right (r) => println(r)
153+ }
154+ ```
155+
156+ The ` result ` on the right is the corresponding [ List[ Card]] [ card-scala ] .
157+
158+ See [ the API doc] ( https://developer.github.com/v3/projects/cards/#list-project-cards ) for full reference.
159+
160+ [ card-scala ] : https://github.com/47deg/github4s/blob/master/github4s/src/main/scala/github4s/domain/Project.scala
0 commit comments