Skip to content

Commit f48a193

Browse files
authored
Add repos function for teams (#182)
1 parent 64b91c0 commit f48a193

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,10 @@ GitHub.jl implements a bunch of methods that make REST requests to GitHub's API.
8484

8585

8686
#### Teams
87-
| method | return type | documentation |
88-
|-----------------|------------------------------|----------------------------------------------------------------------------------------------|
89-
| `members(team)` | `Tuple{Vector{Owner}, Dict}` | get team members as [users](https://developer.github.com/v3/orgs/teams/#get-team-membership) |
87+
| method | return type | documentation |
88+
|----------------------|------------------------------|----------------------------------------------------------------------------------------------------------|
89+
| `members(team)` | `Tuple{Vector{Owner}, Dict}` | get team members as [users](https://developer.github.com/v3/orgs/teams/#get-team-membership) |
90+
| `repos(owner, team)` | `Tuple{Vector{Repo}, Dict}` | get team repositories as [users](https://docs.github.com/en/rest/reference/teams#list-team-repositories) |
9091

9192

9293
#### Repositories

src/owners/teams.jl

+5
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ namefield(t::Team) = t.id
1414
results, page_data = gh_get_paged_json(api, "/teams/$(name(team))/members"; options...)
1515
return map(Owner, results), page_data
1616
end
17+
18+
@api_default function repos(api::GitHubAPI, owner::Owner, team::Team; options...)
19+
results, page_data = gh_get_paged_json(api, "/orgs/$(owner.login)/teams/$(team.slug)/repos"; options...)
20+
return map(Repo, results), page_data
21+
end

0 commit comments

Comments
 (0)