1
1
"""This module contains the classes related to Events."""
2
+
2
3
import copy
3
4
4
5
from . import models
@@ -41,7 +42,7 @@ def _update_attributes(self, user):
41
42
self .login = user ["login" ]
42
43
self ._api = self .url = user ["url" ]
43
44
44
- def to_user (self ) :
45
+ def to_user (self , conditional : bool = False ) -> models . GitHubCore :
45
46
"""Retrieve a full User object for this EventUser.
46
47
47
48
:returns:
@@ -93,7 +94,7 @@ def _update_attributes(self, org):
93
94
self .login = org ["login" ]
94
95
self ._api = self .url = org ["url" ]
95
96
96
- def to_org (self ) :
97
+ def to_org (self , conditional : bool = False ) -> models . GitHubCore :
97
98
"""Retrieve a full Organization object for this EventOrganization.
98
99
99
100
:returns:
@@ -148,7 +149,7 @@ def _update_attributes(self, pull):
148
149
self .locked = pull ["locked" ]
149
150
self ._api = self .url = pull ["url" ]
150
151
151
- def to_pull (self ) :
152
+ def to_pull (self , conditional : bool = False ) -> models . GitHubCore :
152
153
"""Retrieve a full PullRequest object for this EventPullRequest.
153
154
154
155
:returns:
@@ -258,7 +259,9 @@ def _update_attributes(self, comment):
258
259
self .updated_at = self ._strptime (comment ["updated_at" ])
259
260
self .user = users .ShortUser (comment ["user" ], self )
260
261
261
- def to_review_comment (self ):
262
+ def to_review_comment (
263
+ self , conditional : bool = False
264
+ ) -> models .GitHubCore :
262
265
"""Retrieve a full ReviewComment object for this EventReviewComment.
263
266
264
267
:returns:
@@ -269,7 +272,7 @@ def to_review_comment(self):
269
272
from . import pulls
270
273
271
274
comment = self ._json (self ._get (self ._api ), 200 )
272
- return pulls .ReviewComment (comment , self )
275
+ return pulls .ReviewComment (comment , self . session )
273
276
274
277
refresh = to_review_comment
275
278
@@ -285,7 +288,7 @@ def _update_attributes(self, issue):
285
288
self .locked = issue ["locked" ]
286
289
self ._api = self .url = issue ["url" ]
287
290
288
- def to_issue (self ) :
291
+ def to_issue (self , conditional : bool = False ) -> models . GitHubCore :
289
292
"""Retrieve a full Issue object for this EventIssue."""
290
293
from . import issues
291
294
@@ -352,7 +355,9 @@ def _update_attributes(self, comment):
352
355
self .updated_at = self ._strptime (comment ["updated_at" ])
353
356
self .user = users .ShortUser (comment ["user" ], self )
354
357
355
- def to_issue_comment (self ):
358
+ def to_issue_comment (
359
+ self , conditional : bool = False
360
+ ) -> models .GitHubCore :
356
361
"""Retrieve the full IssueComment object for this comment.
357
362
358
363
:returns:
0 commit comments