Skip to content

Commit

Permalink
Add documentation links to API endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
mschwager committed Sep 25, 2016
1 parent d4bed99 commit cd9ef41
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/gitem/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ def paginated_json_call(self, method, endpoint, params=None):
def get_users_organizations(self):
"""
Return organizations associated with an OAuth2 authenticated user
https://developer.github.com/v3/orgs/#list-your-organizations
"""
method = "GET"
endpoint = "/user/orgs"
Expand All @@ -123,6 +125,8 @@ def get_users_organizations(self):
def get_users_public_organizations(self, username):
"""
Return public organizations associated with a user
https://developer.github.com/v3/orgs/#list-user-organizations
"""
method = "GET"
endpoint = "/users/{}/orgs".format(username)
Expand All @@ -135,6 +139,8 @@ def get_users_public_organizations(self, username):
def get_users_public_repositories(self, username, type=None, sort=None, direction=None):
"""
Return public repositories associated with a given user
https://developer.github.com/v3/repos/#list-user-repositories
"""
assert type in ["all", "owner", "member", None]
assert sort in ["created", "updated", "pushed", "full_name", None]
Expand All @@ -158,6 +164,8 @@ def get_users_public_repositories(self, username, type=None, sort=None, directio
def get_public_organization(self, organization):
"""
Return public information associated with an organization
https://developer.github.com/v3/orgs/#get-an-organization
"""
method = "GET"
endpoint = "/orgs/{}".format(organization)
Expand All @@ -172,12 +180,16 @@ def get_organization(self, organization):
"""
Return information associated with an organization, OAuth2
authenticated user must be an owner
https://developer.github.com/v3/orgs/#get-an-organization
"""
return self.get_public_organization(organization)

def get_organizations_public_repositories(self, organization, type=None):
"""
Return public repositories associated with a given organization
https://developer.github.com/v3/repos/#list-organization-repositories
"""
assert type in ["all", "owner", "member", None]

Expand All @@ -195,6 +207,8 @@ def get_organizations_public_repositories(self, organization, type=None):
def get_organizations_public_members(self, organization):
"""
Return public members associated with a given organization
https://developer.github.com/v3/orgs/members/
"""
method = "GET"
endpoint = "/orgs/{}/public_members".format(organization)
Expand All @@ -207,6 +221,8 @@ def get_organizations_public_members(self, organization):
def get_repository_contributors(self, owner, repository, anon=None):
"""
Return contributor information associated with a given repository
https://developer.github.com/v3/repos/#list-contributors
"""
assert anon in [1, "true", None]

Expand All @@ -224,6 +240,8 @@ def get_repository_contributors(self, owner, repository, anon=None):
def get_repository_contributors_stats(self, owner, repository):
"""
Return contributor stats information associated with a given repository
https://developer.github.com/v3/repos/statistics/#get-contributors-list-with-additions-deletions-and-commit-counts
"""
method = "GET"
endpoint = "/repos/{}/{}/stats/contributors".format(owner, repository)
Expand Down

0 comments on commit cd9ef41

Please sign in to comment.