mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Generate some repetitive doc files
This commit is contained in:
@@ -19,52 +19,87 @@ import github.AuthorizationApplication
|
||||
|
||||
|
||||
class Authorization(github.GithubObject.GithubObject):
|
||||
"""
|
||||
This class represents Authorizations as returned for example by http://developer.github.com/v3/todo
|
||||
"""
|
||||
|
||||
@property
|
||||
def app(self):
|
||||
"""
|
||||
:type: :class:`github.AuthorizationApplication.AuthorizationApplication`
|
||||
"""
|
||||
self._completeIfNotSet(self._app)
|
||||
return self._NoneIfNotSet(self._app)
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._created_at)
|
||||
return self._NoneIfNotSet(self._created_at)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
self._completeIfNotSet(self._id)
|
||||
return self._NoneIfNotSet(self._id)
|
||||
|
||||
@property
|
||||
def note(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._note)
|
||||
return self._NoneIfNotSet(self._note)
|
||||
|
||||
@property
|
||||
def note_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._note_url)
|
||||
return self._NoneIfNotSet(self._note_url)
|
||||
|
||||
@property
|
||||
def scopes(self):
|
||||
"""
|
||||
:type: list of string
|
||||
"""
|
||||
self._completeIfNotSet(self._scopes)
|
||||
return self._NoneIfNotSet(self._scopes)
|
||||
|
||||
@property
|
||||
def token(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._token)
|
||||
return self._NoneIfNotSet(self._token)
|
||||
|
||||
@property
|
||||
def updated_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
self._completeIfNotSet(self._updated_at)
|
||||
return self._NoneIfNotSet(self._updated_at)
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._NoneIfNotSet(self._url)
|
||||
|
||||
def delete(self):
|
||||
"""
|
||||
:calls: `DELETE /authorizations/:id <http://developer.github.com/v3/todo>`_
|
||||
:rtype: None
|
||||
"""
|
||||
headers, data = self._requester.requestAndCheck(
|
||||
"DELETE",
|
||||
self.url,
|
||||
@@ -73,6 +108,15 @@ class Authorization(github.GithubObject.GithubObject):
|
||||
)
|
||||
|
||||
def edit(self, scopes=github.GithubObject.NotSet, add_scopes=github.GithubObject.NotSet, remove_scopes=github.GithubObject.NotSet, note=github.GithubObject.NotSet, note_url=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `PATCH /authorizations/:id <http://developer.github.com/v3/todo>`_
|
||||
:param scopes: list of string
|
||||
:param add_scopes: list of string
|
||||
:param remove_scopes: list of string
|
||||
:param note: string
|
||||
:param note_url: string
|
||||
:rtype: None
|
||||
"""
|
||||
assert scopes is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in scopes), scopes
|
||||
assert add_scopes is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in add_scopes), add_scopes
|
||||
assert remove_scopes is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in remove_scopes), remove_scopes
|
||||
|
||||
Reference in New Issue
Block a user