mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 10:51:14 +00:00
Merge PullRequestMergeStatus type stub back to source (#2646)
This commit is contained in:
@@ -28,46 +28,36 @@
|
||||
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
||||
# #
|
||||
################################################################################
|
||||
|
||||
from typing import Any, Dict
|
||||
|
||||
import github.GithubObject
|
||||
from github.GithubObject import Attribute, NonCompletableGithubObject, NotSet
|
||||
|
||||
|
||||
class PullRequestMergeStatus(github.GithubObject.NonCompletableGithubObject):
|
||||
class PullRequestMergeStatus(NonCompletableGithubObject):
|
||||
"""
|
||||
This class represents PullRequestMergeStatuses. The reference can be found here https://docs.github.com/en/rest/reference/pulls#check-if-a-pull-request-has-been-merged
|
||||
"""
|
||||
|
||||
def _initAttributes(self) -> None:
|
||||
self._merged: Attribute[bool] = NotSet
|
||||
self._message: Attribute[str] = NotSet
|
||||
self._sha: Attribute[str] = NotSet
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return self.get__repr__({"sha": self._sha.value, "merged": self._merged.value})
|
||||
|
||||
@property
|
||||
def merged(self):
|
||||
"""
|
||||
:type: bool
|
||||
"""
|
||||
def merged(self) -> bool:
|
||||
return self._merged.value
|
||||
|
||||
@property
|
||||
def message(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
def message(self) -> str:
|
||||
return self._message.value
|
||||
|
||||
@property
|
||||
def sha(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
def sha(self) -> str:
|
||||
return self._sha.value
|
||||
|
||||
def _initAttributes(self) -> None:
|
||||
self._merged = github.GithubObject.NotSet
|
||||
self._message = github.GithubObject.NotSet
|
||||
self._sha = github.GithubObject.NotSet
|
||||
|
||||
def _useAttributes(self, attributes: Dict[str, Any]) -> None:
|
||||
if "merged" in attributes: # pragma no branch
|
||||
self._merged = self._makeBoolAttribute(attributes["merged"])
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
from github.GithubObject import NonCompletableGithubObject
|
||||
|
||||
class PullRequestMergeStatus(NonCompletableGithubObject):
|
||||
def __repr__(self) -> str: ...
|
||||
def _initAttributes(self) -> None: ...
|
||||
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
|
||||
@property
|
||||
def merged(self) -> bool: ...
|
||||
@property
|
||||
def message(self) -> str: ...
|
||||
@property
|
||||
def sha(self) -> str: ...
|
||||
Reference in New Issue
Block a user