Add ability to access github Release Asset API. (#525)

* Add ability to access github Release Asset API.
See: https://developer.github.com/v3/repos/releases
This commit is contained in:
Chris McBride
2017-11-27 10:01:03 -06:00
committed by Nhomar Hernández [Vauxoo]
parent ebe7277a7f
commit 52449649a4
14 changed files with 733 additions and 8 deletions
+10
View File
@@ -46,6 +46,7 @@ import github.GitBlob
import github.Organization
import github.GitRef
import github.GitRelease
import github.GitReleaseAsset
import github.Issue
import github.Repository
import github.PullRequest
@@ -2299,6 +2300,15 @@ class Repository(github.GithubObject.CompletableGithubObject):
def _identity(self):
return self.owner.login + "/" + self.name
def get_release_asset(self, id):
assert isinstance(id, (int)), id
resp_headers, data = self._requester.requestJsonAndCheck(
"GET",
self.url + "/releases/assets/" + str(id)
)
return github.GitReleaseAsset.GitReleaseAsset(self._requester, resp_headers, data, completed=True)
def _initAttributes(self):
self._archive_url = github.GithubObject.NotSet
self._assignees_url = github.GithubObject.NotSet