Merge PullRequestMergeStatus type stub back to source (#2646)

This commit is contained in:
Trim21
2023-08-18 07:40:33 +02:00
committed by GitHub
parent 36d55aaaf4
commit c13395ab1a
2 changed files with 10 additions and 34 deletions
+10 -20
View File
@@ -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"])
-14
View File
@@ -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: ...