Skip to content

Commit 2b80e2b

Browse files
committed
Add iter_statuses and DeploymentStatus
1 parent 191e09b commit 2b80e2b

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

github3/repos/deployment.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,22 @@ def __init__(self, deployment, session=None):
4444

4545
def __repr__(self):
4646
return '<Deployment [{0} @ {1}]>'.format(self.id, self.sha)
47+
48+
def iter_statuses(self, number=-1, etag=None):
49+
"""Iterate over the deployment statuses for this deployment.
50+
51+
:param int number: (optional), the number of statuses to return.
52+
Default: -1, returns all statuses.
53+
:param str etag: (optional), the ETag header value from the last time
54+
you iterated over the statuses.
55+
:returns: generator of :class:`DeploymentStatus`\ es
56+
"""
57+
i = self._iter(int(number), self.statuses_url, DeploymentStatus,
58+
etag=etag)
59+
i.headers = Deployment.CUSTOM_HEADERS
60+
return i
61+
62+
63+
class DeploymentStatus(GitHubCore):
64+
def __init__(self, status, session=None):
65+
pass

0 commit comments

Comments
 (0)