Skip to content

Commit

Permalink
Support for the list organization repositories endpoint (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenFradet authored Sep 13, 2017
1 parent fdea87a commit d233edc
Show file tree
Hide file tree
Showing 11 changed files with 192 additions and 72 deletions.
27 changes: 27 additions & 0 deletions docs/src/main/tut/repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ with Github4s, you can interact with:

- [Repositories](#repositories)
- [Get a repository](#get-a-repository)
- [List organization repositories](#list-organization-repositories)
- [List contributors](#list-contributors)
- [Commits](#commits)
- [List commits on a repository](#list-commits-on-a-repository)
Expand Down Expand Up @@ -66,6 +67,32 @@ The `result` on the right is the get [Repository][repository-scala].
See [the API doc](https://developer.github.com/v3/repos/#get) for full
reference.

### List organization repositories

You can retrieve the list of repositories for a particular organization using `listOrgRepos`; it
takes as arguments:

- `org`: The organization name.
- `type`: The optional type of the returned repositories, can be "all", "public", "private",
"forks", "sources" or "member", defaults to "all".
- `pagination`: Limit and Offset for pagination.

To list the repositories for an organization:

```tut:silent
val listOrgRepos = Github(accessToken).repos.listOrgRepos("47deg")
listOrgRepos.exec[cats.Id, HttpResponse[String]]() match {
case Left(e) => println(s"Something went wrong: ${e.getMessage}")
case Right(r) => println(r.result)
}
```

The `result` on the right is the corresponding [List[Repository]][repository-scala].

See [the API doc](https://developer.github.com/v3/repos/#list-organization-repositories) for full
reference.

### List contributors

List contributors to the specified repository,
Expand Down
Loading

0 comments on commit d233edc

Please sign in to comment.