Mercurial > repos > bcclaywell > argo_navis
comparison venv/lib/python2.7/site-packages/github/Notification.py @ 0:d67268158946 draft
planemo upload commit a3f181f5f126803c654b3a66dd4e83a48f7e203b
| author | bcclaywell |
|---|---|
| date | Mon, 12 Oct 2015 17:43:33 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:d67268158946 |
|---|---|
| 1 # -*- coding: utf-8 -*- | |
| 2 | |
| 3 # ########################## Copyrights and license ############################ | |
| 4 # # | |
| 5 # Copyright 2013 AKFish <akfish@gmail.com> # | |
| 6 # Copyright 2013 Peter Golm <golm.peter@gmail.com> # | |
| 7 # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> # | |
| 8 # Copyright 2013 martinqt <m.ki2@laposte.net> # | |
| 9 # # | |
| 10 # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # | |
| 11 # # | |
| 12 # PyGithub is free software: you can redistribute it and/or modify it under # | |
| 13 # the terms of the GNU Lesser General Public License as published by the Free # | |
| 14 # Software Foundation, either version 3 of the License, or (at your option) # | |
| 15 # any later version. # | |
| 16 # # | |
| 17 # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY # | |
| 18 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # | |
| 19 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # | |
| 20 # details. # | |
| 21 # # | |
| 22 # You should have received a copy of the GNU Lesser General Public License # | |
| 23 # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. # | |
| 24 # # | |
| 25 # ############################################################################## | |
| 26 | |
| 27 import github.GithubObject | |
| 28 | |
| 29 import github.Repository | |
| 30 import github.NotificationSubject | |
| 31 | |
| 32 | |
| 33 class Notification(github.GithubObject.CompletableGithubObject): | |
| 34 """ | |
| 35 This class represents Notifications. The reference can be found here http://developer.github.com/v3/activity/notifications/ | |
| 36 """ | |
| 37 | |
| 38 @property | |
| 39 def id(self): | |
| 40 """ | |
| 41 :type: string | |
| 42 """ | |
| 43 self._completeIfNotSet(self._id) | |
| 44 return self._id.value | |
| 45 | |
| 46 @property | |
| 47 def last_read_at(self): | |
| 48 """ | |
| 49 :type: datetime.datetime | |
| 50 """ | |
| 51 self._completeIfNotSet(self._last_read_at) | |
| 52 return self._last_read_at.value | |
| 53 | |
| 54 @property | |
| 55 def repository(self): | |
| 56 """ | |
| 57 :type: :class:`github.Repository.Repository` | |
| 58 """ | |
| 59 self._completeIfNotSet(self._repository) | |
| 60 return self._repository.value | |
| 61 | |
| 62 @property | |
| 63 def subject(self): | |
| 64 """ | |
| 65 :type: :class:`github.NotificationSubject.NotificationSubject` | |
| 66 """ | |
| 67 self._completeIfNotSet(self._subject) | |
| 68 return self._subject.value | |
| 69 | |
| 70 @property | |
| 71 def reason(self): | |
| 72 """ | |
| 73 :type: string | |
| 74 """ | |
| 75 self._completeIfNotSet(self._reason) | |
| 76 return self._reason.value | |
| 77 | |
| 78 @property | |
| 79 def subscription_url(self): | |
| 80 """ | |
| 81 :type: string | |
| 82 """ | |
| 83 self._completeIfNotSet(self._subscription_url) | |
| 84 return self._subscription_url.value | |
| 85 | |
| 86 @property | |
| 87 def unread(self): | |
| 88 """ | |
| 89 :type: bool | |
| 90 """ | |
| 91 self._completeIfNotSet(self._unread) | |
| 92 return self._unread.value | |
| 93 | |
| 94 @property | |
| 95 def updated_at(self): | |
| 96 """ | |
| 97 :type: datetime.datetime | |
| 98 """ | |
| 99 self._completeIfNotSet(self._updated_at) | |
| 100 return self._updated_at.value | |
| 101 | |
| 102 @property | |
| 103 def url(self): | |
| 104 """ | |
| 105 :type: string | |
| 106 """ | |
| 107 self._completeIfNotSet(self._url) | |
| 108 return self._url.value | |
| 109 | |
| 110 def _initAttributes(self): | |
| 111 self._id = github.GithubObject.NotSet | |
| 112 self._last_read_at = github.GithubObject.NotSet | |
| 113 self._repository = github.GithubObject.NotSet | |
| 114 self._reason = github.GithubObject.NotSet | |
| 115 self._subscription_url = github.GithubObject.NotSet | |
| 116 self._unread = github.GithubObject.NotSet | |
| 117 self._updated_at = github.GithubObject.NotSet | |
| 118 self._url = github.GithubObject.NotSet | |
| 119 | |
| 120 def _useAttributes(self, attributes): | |
| 121 if "id" in attributes: # pragma no branch | |
| 122 self._id = self._makeStringAttribute(attributes["id"]) | |
| 123 if "last_read_at" in attributes: # pragma no branch | |
| 124 self._last_read_at = self._makeDatetimeAttribute(attributes["last_read_at"]) | |
| 125 if "repository" in attributes: # pragma no branch | |
| 126 self._repository = self._makeClassAttribute(github.Repository.Repository, attributes["repository"]) | |
| 127 if "subject" in attributes: # pragma no branch | |
| 128 self._subject = self._makeClassAttribute(github.NotificationSubject.NotificationSubject, attributes["subject"]) | |
| 129 if "reason" in attributes: # pragma no branch | |
| 130 self._reason = self._makeStringAttribute(attributes["reason"]) | |
| 131 if "subscription_url" in attributes: # pragma no branch | |
| 132 self._subscription_url = self._makeStringAttribute(attributes["subscription_url"]) | |
| 133 if "unread" in attributes: # pragma no branch | |
| 134 self._unread = self._makeBoolAttribute(attributes["unread"]) | |
| 135 if "updated_at" in attributes: # pragma no branch | |
| 136 self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"]) | |
| 137 if "url" in attributes: # pragma no branch | |
| 138 self._url = self._makeStringAttribute(attributes["url"]) |
