Repository: PyGithub/PyGithub

Issue:
Is suspended_users for github enterprise implemented in NamedUser?
on github enterprise if you have a curl request as follows https://github/api/v3/users/MYUSER

one of the elements returned is either null or dateformat if they have been suspended:

"suspended_at": "2014-04-22T10:21:42-07:00",

Is this object implemented currently in the NamedUser section or any plans to?  

Thanks


Discussion:
Don't think so. Understand that enterprise API may not be updated as ofter as Github.com due to the volume of users. I am open for any PRs.

Resolving patch:
diff --git a/github/NamedUser.py b/github/NamedUser.py
--- a/github/NamedUser.py
+++ b/github/NamedUser.py
@@ -337,6 +337,14 @@ def subscriptions_url(self):
         self._completeIfNotSet(self._subscriptions_url)
         return self._subscriptions_url.value
 
+    @property
+    def suspended_at(self):
+        """
+        :type: datetime.datetime
+        """
+        self._completeIfNotSet(self._suspended_at)
+        return self._suspended_at.value
+
     @property
     def total_private_repos(self):
         """
@@ -609,6 +617,7 @@ def _initAttributes(self):
         self._site_admin = github.GithubObject.NotSet
         self._starred_url = github.GithubObject.NotSet
         self._subscriptions_url = github.GithubObject.NotSet
+        self._suspended_at = github.GithubObject.NotSet
         self._total_private_repos = github.GithubObject.NotSet
         self._type = github.GithubObject.NotSet
         self._updated_at = github.GithubObject.NotSet
@@ -683,6 +692,8 @@ def _useAttributes(self, attributes):
             self._starred_url = self._makeStringAttribute(attributes["starred_url"])
         if "subscriptions_url" in attributes:  # pragma no branch
             self._subscriptions_url = self._makeStringAttribute(attributes["subscriptions_url"])
+        if "suspended_at" in attributes:  # pragma no branch
+            self._suspended_at = self._makeDatetimeAttribute(attributes["suspended_at"])
         if "total_private_repos" in attributes:  # pragma no branch
             self._total_private_repos = self._makeIntAttribute(attributes["total_private_repos"])
         if "type" in attributes:  # pragma no branch


Test patch:
diff --git a/github/tests/NamedUser.py b/github/tests/NamedUser.py
--- a/github/tests/NamedUser.py
+++ b/github/tests/NamedUser.py
@@ -66,6 +66,7 @@ def testAttributesOfOtherUser(self):
         self.assertEqual(self.user.private_gists, None)
         self.assertEqual(self.user.public_gists, 16)
         self.assertEqual(self.user.public_repos, 61)
+        self.assertEqual(self.user.suspended_at, None)
         self.assertEqual(self.user.total_private_repos, None)
         self.assertEqual(self.user.type, "User")
         self.assertEqual(self.user.url, "https://api.github.com/users/nvie")
@@ -99,6 +100,7 @@ def testAttributesOfSelf(self):
         self.assertEqual(self.user.private_gists, 5)
         self.assertEqual(self.user.public_gists, 2)
         self.assertEqual(self.user.public_repos, 11)
+        self.assertEqual(self.user.suspended_at, datetime.datetime(2013, 8, 10, 7, 11, 7))
         self.assertEqual(self.user.total_private_repos, 5)
         self.assertEqual(self.user.type, "User")
         self.assertEqual(self.user.url, "https://api.github.com/users/jacquev6")
diff --git a/github/tests/ReplayData/NamedUser.setUp.txt b/github/tests/ReplayData/NamedUser.setUp.txt
--- a/github/tests/ReplayData/NamedUser.setUp.txt
+++ b/github/tests/ReplayData/NamedUser.setUp.txt
@@ -7,5 +7,5 @@ None
 None
 200
 [('status', '200 OK'), ('x-ratelimit-remaining', '4960'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"2b9d2167029cc33666d02e0b0e95f2b9"'), ('date', 'Sat, 26 May 2012 11:08:21 GMT'), ('content-type', 'application/json; charset=utf-8')]
-{"type":"User","disk_usage":17080,"public_gists":2,"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","public_repos":11,"hireable":false,"private_gists":5,"plan":{"private_repos":5,"collaborators":1,"name":"micro","space":614400},"bio":"","company":"Criteo","blog":"http://vincent-jacques.net","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","total_private_repos":5,"email":"vincent@vincent-jacques.net","collaborators":0,"followers":13,"name":"Vincent Jacques","owned_private_repos":5,"created_at":"2010-07-09T06:10:06Z","location":"Paris, France","id":327146,"following":24,"html_url":"https://github.com/jacquev6"}
+{"type":"User","disk_usage":17080,"public_gists":2,"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","public_repos":11,"hireable":false,"private_gists":5,"plan":{"private_repos":5,"collaborators":1,"name":"micro","space":614400},"bio":"","company":"Criteo","blog":"http://vincent-jacques.net","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","total_private_repos":5,"email":"vincent@vincent-jacques.net","collaborators":0,"followers":13,"name":"Vincent Jacques","owned_private_repos":5,"created_at":"2010-07-09T06:10:06Z","suspended_at":"2013-08-10T07:11:07Z","location":"Paris, France","id":327146,"following":24,"html_url":"https://github.com/jacquev6"}