mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 03:41:08 +00:00
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:
committed by
Nhomar Hernández [Vauxoo]
parent
ebe7277a7f
commit
52449649a4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user