forked from PyGithub/PyGithub
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvent.py
More file actions
90 lines (73 loc) · 4.13 KB
/
Copy pathEvent.py
File metadata and controls
90 lines (73 loc) · 4.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# WARNING: this file is generated automaticaly.
# Do not modify it manually, your work would be lost.
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import GithubObject
import Organization
import Repository
import NamedUser
class Event( GithubObject.BasicGithubObject ):
@property
def actor( self ):
return self._NoneIfNotSet( self._actor )
@property
def created_at( self ):
return self._NoneIfNotSet( self._created_at )
@property
def id( self ):
return self._NoneIfNotSet( self._id )
@property
def org( self ):
return self._NoneIfNotSet( self._org )
@property
def payload( self ):
return self._NoneIfNotSet( self._payload )
@property
def public( self ):
return self._NoneIfNotSet( self._public )
@property
def repo( self ):
return self._NoneIfNotSet( self._repo )
@property
def type( self ):
return self._NoneIfNotSet( self._type )
def _initAttributes( self ):
self._actor = GithubObject.NotSet
self._created_at = GithubObject.NotSet
self._id = GithubObject.NotSet
self._org = GithubObject.NotSet
self._payload = GithubObject.NotSet
self._public = GithubObject.NotSet
self._repo = GithubObject.NotSet
self._type = GithubObject.NotSet
def _useAttributes( self, attributes ):
if "actor" in attributes: # pragma no branch
assert attributes[ "actor" ] is None or isinstance( attributes[ "actor" ], dict ), attributes[ "actor" ]
self._actor = None if attributes[ "actor" ] is None else NamedUser.NamedUser( self._requester, attributes[ "actor" ], completed = False )
if "created_at" in attributes: # pragma no branch
assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ]
self._created_at = self._parseDatetime( attributes[ "created_at" ] )
if "id" in attributes: # pragma no branch
assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], ( str, unicode ) ), attributes[ "id" ]
self._id = attributes[ "id" ]
if "org" in attributes: # pragma no branch
assert attributes[ "org" ] is None or isinstance( attributes[ "org" ], dict ), attributes[ "org" ]
self._org = None if attributes[ "org" ] is None else Organization.Organization( self._requester, attributes[ "org" ], completed = False )
if "payload" in attributes: # pragma no branch
assert attributes[ "payload" ] is None or isinstance( attributes[ "payload" ], dict ), attributes[ "payload" ]
self._payload = attributes[ "payload" ]
if "public" in attributes: # pragma no branch
assert attributes[ "public" ] is None or isinstance( attributes[ "public" ], bool ), attributes[ "public" ]
self._public = attributes[ "public" ]
if "repo" in attributes: # pragma no branch
assert attributes[ "repo" ] is None or isinstance( attributes[ "repo" ], dict ), attributes[ "repo" ]
self._repo = None if attributes[ "repo" ] is None else Repository.Repository( self._requester, attributes[ "repo" ], completed = False )
if "type" in attributes: # pragma no branch
assert attributes[ "type" ] is None or isinstance( attributes[ "type" ], ( str, unicode ) ), attributes[ "type" ]
self._type = attributes[ "type" ]