mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 10:51:14 +00:00
Merge IssueEvent type stub back to source (#2684)
This commit is contained in:
+46
-95
@@ -28,187 +28,138 @@
|
||||
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
||||
# #
|
||||
################################################################################
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict
|
||||
from datetime import datetime
|
||||
from typing import Any
|
||||
|
||||
import github.GithubObject
|
||||
import github.Issue
|
||||
import github.Label
|
||||
import github.Milestone
|
||||
import github.NamedUser
|
||||
from github.GithubObject import Attribute, CompletableGithubObject, NotSet
|
||||
|
||||
|
||||
class IssueEvent(github.GithubObject.CompletableGithubObject):
|
||||
class IssueEvent(CompletableGithubObject):
|
||||
"""
|
||||
This class represents IssueEvents. The reference can be found here https://docs.github.com/en/rest/reference/issues#events
|
||||
"""
|
||||
|
||||
def _initAttributes(self) -> None:
|
||||
self._actor: Attribute[github.NamedUser.NamedUser] = NotSet
|
||||
self._commit_id: Attribute[str] = NotSet
|
||||
self._created_at: Attribute[datetime] = NotSet
|
||||
self._event: Attribute[str] = NotSet
|
||||
self._id: Attribute[int] = NotSet
|
||||
self._issue: Attribute[github.Issue.Issue] = NotSet
|
||||
self._url: Attribute[str] = NotSet
|
||||
self._node_id: Attribute[str] = NotSet
|
||||
self._commit_url: Attribute[str] = NotSet
|
||||
self._label: Attribute[github.Label.Label] = NotSet
|
||||
self._assignee: Attribute[github.NamedUser.NamedUser] = NotSet
|
||||
self._assigner: Attribute[github.NamedUser.NamedUser] = NotSet
|
||||
self._review_requester: Attribute[github.NamedUser.NamedUser] = NotSet
|
||||
self._requested_reviewer: Attribute[github.NamedUser.NamedUser] = NotSet
|
||||
self._milestone: Attribute[github.Milestone.Milestone] = NotSet
|
||||
self._rename: Attribute[dict] = NotSet
|
||||
self._dismissed_review: Attribute[dict] = NotSet
|
||||
self._lock_reason: Attribute[str] = NotSet
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return self.get__repr__({"id": self._id.value})
|
||||
|
||||
@property
|
||||
def actor(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
def actor(self) -> github.NamedUser.NamedUser:
|
||||
self._completeIfNotSet(self._actor)
|
||||
return self._actor.value
|
||||
|
||||
@property
|
||||
def commit_id(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
def commit_id(self) -> str:
|
||||
self._completeIfNotSet(self._commit_id)
|
||||
return self._commit_id.value
|
||||
|
||||
@property
|
||||
def created_at(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
def created_at(self) -> datetime:
|
||||
self._completeIfNotSet(self._created_at)
|
||||
return self._created_at.value
|
||||
|
||||
@property
|
||||
def event(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
def event(self) -> str:
|
||||
self._completeIfNotSet(self._event)
|
||||
return self._event.value
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
"""
|
||||
:type: integer
|
||||
"""
|
||||
def id(self) -> int:
|
||||
self._completeIfNotSet(self._id)
|
||||
return self._id.value
|
||||
|
||||
@property
|
||||
def issue(self):
|
||||
"""
|
||||
:type: :class:`github.Issue.Issue`
|
||||
"""
|
||||
def issue(self) -> github.Issue.Issue:
|
||||
self._completeIfNotSet(self._issue)
|
||||
return self._issue.value
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
def url(self) -> str:
|
||||
self._completeIfNotSet(self._url)
|
||||
return self._url.value
|
||||
|
||||
@property
|
||||
def node_id(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
def node_id(self) -> str:
|
||||
self._completeIfNotSet(self._node_id)
|
||||
return self._node_id.value
|
||||
|
||||
@property
|
||||
def commit_url(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
def commit_url(self) -> str:
|
||||
self._completeIfNotSet(self._commit_url)
|
||||
return self._commit_url.value
|
||||
|
||||
@property
|
||||
def label(self):
|
||||
"""
|
||||
:type: :class:`github.Label.Label`
|
||||
"""
|
||||
def label(self) -> github.Label.Label:
|
||||
self._completeIfNotSet(self._label)
|
||||
return self._label.value
|
||||
|
||||
@property
|
||||
def assignee(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
def assignee(self) -> github.NamedUser.NamedUser:
|
||||
self._completeIfNotSet(self._assignee)
|
||||
return self._assignee.value
|
||||
|
||||
@property
|
||||
def assigner(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
def assigner(self) -> github.NamedUser.NamedUser:
|
||||
self._completeIfNotSet(self._assigner)
|
||||
return self._assigner.value
|
||||
|
||||
@property
|
||||
def review_requester(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
def review_requester(self) -> github.NamedUser.NamedUser:
|
||||
self._completeIfNotSet(self._review_requester)
|
||||
return self._review_requester.value
|
||||
|
||||
@property
|
||||
def requested_reviewer(self):
|
||||
"""
|
||||
:type: :class:`github.NamedUser.NamedUser`
|
||||
"""
|
||||
def requested_reviewer(self) -> github.NamedUser.NamedUser:
|
||||
self._completeIfNotSet(self._requested_reviewer)
|
||||
return self._requested_reviewer.value
|
||||
|
||||
@property
|
||||
def milestone(self):
|
||||
"""
|
||||
:type: :class:`github.Milestone.Milestone`
|
||||
"""
|
||||
def milestone(self) -> github.Milestone.Milestone:
|
||||
self._completeIfNotSet(self._milestone)
|
||||
return self._milestone.value
|
||||
|
||||
@property
|
||||
def rename(self):
|
||||
"""
|
||||
:type: dict
|
||||
"""
|
||||
def rename(self) -> dict:
|
||||
self._completeIfNotSet(self._rename)
|
||||
return self._rename.value
|
||||
|
||||
@property
|
||||
def dismissed_review(self):
|
||||
"""
|
||||
:type: dict
|
||||
"""
|
||||
def dismissed_review(self) -> dict:
|
||||
self._completeIfNotSet(self._dismissed_review)
|
||||
return self._dismissed_review.value
|
||||
|
||||
@property
|
||||
def lock_reason(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
def lock_reason(self) -> str:
|
||||
self._completeIfNotSet(self._lock_reason)
|
||||
return self._lock_reason.value
|
||||
|
||||
def _initAttributes(self) -> None:
|
||||
self._actor = github.GithubObject.NotSet
|
||||
self._commit_id = github.GithubObject.NotSet
|
||||
self._created_at = github.GithubObject.NotSet
|
||||
self._event = github.GithubObject.NotSet
|
||||
self._id = github.GithubObject.NotSet
|
||||
self._issue = github.GithubObject.NotSet
|
||||
self._url = github.GithubObject.NotSet
|
||||
self._node_id = github.GithubObject.NotSet
|
||||
self._commit_url = github.GithubObject.NotSet
|
||||
self._label = github.GithubObject.NotSet
|
||||
self._assignee = github.GithubObject.NotSet
|
||||
self._assigner = github.GithubObject.NotSet
|
||||
self._review_requester = github.GithubObject.NotSet
|
||||
self._requested_reviewer = github.GithubObject.NotSet
|
||||
self._milestone = github.GithubObject.NotSet
|
||||
self._rename = github.GithubObject.NotSet
|
||||
self._dismissed_review = github.GithubObject.NotSet
|
||||
self._lock_reason = github.GithubObject.NotSet
|
||||
|
||||
def _useAttributes(self, attributes: Dict[str, Any]) -> None:
|
||||
def _useAttributes(self, attributes: dict[str, Any]) -> None:
|
||||
if "actor" in attributes: # pragma no branch
|
||||
self._actor = self._makeClassAttribute(github.NamedUser.NamedUser, attributes["actor"])
|
||||
if "commit_id" in attributes: # pragma no branch
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
from github.GithubObject import CompletableGithubObject
|
||||
from github.Issue import Issue
|
||||
from github.Label import Label
|
||||
from github.Milestone import Milestone
|
||||
from github.NamedUser import NamedUser
|
||||
|
||||
class IssueEvent(CompletableGithubObject):
|
||||
def __repr__(self) -> str: ...
|
||||
def _initAttributes(self) -> None: ...
|
||||
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
|
||||
@property
|
||||
def actor(self) -> NamedUser: ...
|
||||
@property
|
||||
def assignee(self) -> Optional[NamedUser]: ...
|
||||
@property
|
||||
def assigner(self) -> Optional[NamedUser]: ...
|
||||
@property
|
||||
def commit_id(self) -> Optional[str]: ...
|
||||
@property
|
||||
def commit_url(self) -> Optional[str]: ...
|
||||
@property
|
||||
def created_at(self) -> datetime: ...
|
||||
@property
|
||||
def dismissed_review(self) -> Optional[Dict[str, Union[str, int]]]: ...
|
||||
@property
|
||||
def event(self) -> str: ...
|
||||
@property
|
||||
def id(self) -> int: ...
|
||||
@property
|
||||
def issue(self) -> Issue: ...
|
||||
@property
|
||||
def label(self) -> Optional[Label]: ...
|
||||
@property
|
||||
def lock_reason(self) -> Optional[str]: ...
|
||||
@property
|
||||
def milestone(self) -> Optional[Milestone]: ...
|
||||
@property
|
||||
def node_id(self) -> str: ...
|
||||
@property
|
||||
def rename(self) -> Optional[Dict[str, str]]: ...
|
||||
@property
|
||||
def requested_reviewer(self) -> Optional[NamedUser]: ...
|
||||
@property
|
||||
def review_requester(self) -> Optional[NamedUser]: ...
|
||||
@property
|
||||
def url(self) -> str: ...
|
||||
Reference in New Issue
Block a user