comparison venv/lib/python2.7/site-packages/github/Event.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 2012 Vincent Jacques <vincent@vincent-jacques.net> #
6 # Copyright 2012 Zearin <zearin@gonk.net> #
7 # Copyright 2013 AKFish <akfish@gmail.com> #
8 # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
9 # Copyright 2013 martinqt <m.ki2@laposte.net> #
10 # #
11 # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ #
12 # #
13 # PyGithub is free software: you can redistribute it and/or modify it under #
14 # the terms of the GNU Lesser General Public License as published by the Free #
15 # Software Foundation, either version 3 of the License, or (at your option) #
16 # any later version. #
17 # #
18 # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
19 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
20 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
21 # details. #
22 # #
23 # You should have received a copy of the GNU Lesser General Public License #
24 # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
25 # #
26 # ##############################################################################
27
28 import github.GithubObject
29
30 import github.Organization
31 import github.Repository
32 import github.NamedUser
33
34
35 class Event(github.GithubObject.NonCompletableGithubObject):
36 """
37 This class represents Events. The reference can be found here http://developer.github.com/v3/activity/events/
38 """
39
40 @property
41 def actor(self):
42 """
43 :type: :class:`github.NamedUser.NamedUser`
44 """
45 return self._actor.value
46
47 @property
48 def created_at(self):
49 """
50 :type: datetime.datetime
51 """
52 return self._created_at.value
53
54 @property
55 def id(self):
56 """
57 :type: string
58 """
59 return self._id.value
60
61 @property
62 def org(self):
63 """
64 :type: :class:`github.Organization.Organization`
65 """
66 return self._org.value
67
68 @property
69 def payload(self):
70 """
71 :type: dict
72 """
73 return self._payload.value
74
75 @property
76 def public(self):
77 """
78 :type: bool
79 """
80 return self._public.value
81
82 @property
83 def repo(self):
84 """
85 :type: :class:`github.Repository.Repository`
86 """
87 return self._repo.value
88
89 @property
90 def type(self):
91 """
92 :type: string
93 """
94 return self._type.value
95
96 def _initAttributes(self):
97 self._actor = github.GithubObject.NotSet
98 self._created_at = github.GithubObject.NotSet
99 self._id = github.GithubObject.NotSet
100 self._org = github.GithubObject.NotSet
101 self._payload = github.GithubObject.NotSet
102 self._public = github.GithubObject.NotSet
103 self._repo = github.GithubObject.NotSet
104 self._type = github.GithubObject.NotSet
105
106 def _useAttributes(self, attributes):
107 if "actor" in attributes: # pragma no branch
108 self._actor = self._makeClassAttribute(github.NamedUser.NamedUser, attributes["actor"])
109 if "created_at" in attributes: # pragma no branch
110 self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
111 if "id" in attributes: # pragma no branch
112 self._id = self._makeStringAttribute(attributes["id"])
113 if "org" in attributes: # pragma no branch
114 self._org = self._makeClassAttribute(github.Organization.Organization, attributes["org"])
115 if "payload" in attributes: # pragma no branch
116 self._payload = self._makeDictAttribute(attributes["payload"])
117 if "public" in attributes: # pragma no branch
118 self._public = self._makeBoolAttribute(attributes["public"])
119 if "repo" in attributes: # pragma no branch
120 self._repo = self._makeClassAttribute(github.Repository.Repository, attributes["repo"])
121 if "type" in attributes: # pragma no branch
122 self._type = self._makeStringAttribute(attributes["type"])