Add 'submitted at' to PullRequestReview (#565)

This field is not currently listed in the Github documentation at
https://developer.github.com/v3/pulls/reviews/, but it's been included
since Github 2.9

(It even exists in the test data returned for the original
PullRequestReview PR)
This commit is contained in:
Mike Miller
2017-11-23 03:49:41 -08:00
committed by Jason White
parent 554c1ab124
commit ebe7277a7f
2 changed files with 14 additions and 0 deletions
+11
View File
@@ -95,6 +95,14 @@ class PullRequestReview(github.GithubObject.CompletableGithubObject):
self._completeIfNotSet(self._pull_request_url)
return self._pull_request_url.value
@property
def submitted_at(self):
"""
:type: datetime.datetime
"""
self._completeIfNotSet(self._submitted_at)
return self._submitted_at.value
def _initAttributes(self):
self._id = github.GithubObject.NotSet
self._user = github.GithubObject.NotSet
@@ -103,6 +111,7 @@ class PullRequestReview(github.GithubObject.CompletableGithubObject):
self._state = github.GithubObject.NotSet
self._html_url = github.GithubObject.NotSet
self._pull_request_url = github.GithubObject.NotSet
self._submitted_at = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "id" in attributes: # pragma no branch
@@ -119,3 +128,5 @@ class PullRequestReview(github.GithubObject.CompletableGithubObject):
self._html_url = self._makeStringAttribute(attributes["html_url"])
if "pull_request_url" in attributes: # pragma no branch
self._pull_request_url = self._makeStringAttribute(attributes["pull_request_url"])
if "submitted_at" in attributes: # pragma no branch
self._submitted_at = self._makeDatetimeAttribute(attributes["submitted_at"])