forked from edgurgel/tentacat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
defmodule Tentacat.Repositories do | ||
import Tentacat | ||
alias Tentacat.Client | ||
@moduledoc """ | ||
The Repository Webhooks API allows repository admins to manage the post-receive hooks for a repository. | ||
""" | ||
|
||
@doc """ | ||
List current user's Repositories. | ||
## Example | ||
Tentacat.Repositories.list_mine(client) | ||
More info at: https://developer.github.com/v3/repos/#list-your-repositories | ||
""" | ||
@spec list_mine(Client.t) :: Tentacat.response | ||
def list_mine(client) do | ||
get "user/repos", client.auth | ||
end | ||
|
||
@doc """ | ||
List users Repositories. | ||
## Example | ||
Tentacat.Repositories.list_users("steve", client) | ||
More info at: https://developer.github.com/v3/repos/#list-user-repositories | ||
""" | ||
@spec list_users(binary, Client.t) :: Tentacat.response | ||
def list_users(owner, client \\ %Client{}) do | ||
get "users/#{owner}/repos", client.auth | ||
end | ||
|
||
@doc """ | ||
List organizations Repositories. | ||
## Example | ||
Tentacat.Repositories.list_orgs("elixir-lang", client) | ||
More info at: https://developer.github.com/v3/repos/#list-organization-repositories | ||
""" | ||
@spec list_orgs(binary, Client.t) :: Tentacat.response | ||
def list_orgs(org, client \\ %Client{}) do | ||
get "orgs/#{org}/repos", client.auth | ||
end | ||
|
||
|
||
end |