8000 List deployments · buiduyhieu1/github3.py@908b79d · GitHub
[go: up one dir, main page]

Skip to content

Commit 908b79d

Browse files
committed
List deployments
- TODO: Find a repo to test against
1 parent 5f3b44e commit 908b79d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

github3/repos/repo.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from github3.repos.commit import RepoCommit
2727
from github3.repos.comparison import Comparison
2828
from github3.repos.contents import Contents, validate_commmitter
29+
from github3.repos.deployment import Deployment
2930
from github3.repos.hook import Hook
3031
from github3.repos.status import Status
3132
from github3.repos.stats import ContributorStats
@@ -1185,6 +1186,19 @@ def iter_contributor_statistics(self, number=-1, etag=None):
11851186
url = self._build_url('stats', 'contributors', base_url=self._api)
11861187
return self._iter(int(number), url, ContributorStats, etag=etag)
11871188

1189+
def iter_deployments(self, number=-1, etag=None):
1190+
"""Iterate over deployments for this repository.
1191+
1192+
:param int number: (optional), number of deployments to return.
1193+
Default: -1, returns all available deployments
1194+
:param str etag: (optional), ETag from a previous request for all
1195+
deployments
1196+
:returns: generator of
1197+
:class:`Deployment <github3.repos.deployment.Deployment>`\ s
1198+
"""
1199+
url = self._build_url('deployments', base_url=self._api)
1200+
return self._iter(int(number), url, Deployment, etag=etag)
1201+
11881202
def iter_events(self, number=-1, etag=None):
11891203
"""Iterate over events on this repository.
11901204

0 commit comments

Comments
 (0)
0