8000 Retrieve a deployment by id · adrianmoisey/github3.py@a6f48e7 · GitHub
[go: up one dir, main page]

Skip to content 10000

Commit a6f48e7

Browse files
committed
Retrieve a deployment by id
1 parent 28f2db8 commit a6f48e7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

github3/repos/repo.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,17 @@ def delete_subscription(self):
10521052
url = self._build_url('subscription', base_url=self._api)
10531053
return self._boolean(self._delete(url), 204, 404)
10541054

1055+
def deployment(self, id):
1056+
"""Retrieve the deployment identified by ``id``.
1057+
1058+
:param int id: (required), id for deployments.
1059+
:returns: :class:`~github3.repos.deployment.Deployment`
1060+
"""
1061+
if int(id) > 0:
1062+
url = self._build_url('deployments', str(id), base_url=self._api)
1063+
json = self._json(self._get(url), 200)
1064+
return self._instance_or_null(Deployment, json)
1065+
10551066
def deployments(self, number=-1, etag=None):
10561067
r"""Iterate over deployments for this repository.
10571068

0 commit comments

Comments
 (0)
0