mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 11:21:16 +00:00
Enable mypy check_untyped_defs (#2607)
This commit is contained in:
@@ -19,18 +19,29 @@
|
||||
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
||||
# #
|
||||
################################################################################
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import List
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import github.EnvironmentProtectionRuleReviewer
|
||||
import github.GithubObject
|
||||
from github.GithubObject import Attribute, NonCompletableGithubObject, NotSet
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from github.EnvironmentProtectionRuleReviewer import EnvironmentProtectionRuleReviewer
|
||||
|
||||
|
||||
class EnvironmentProtectionRule(github.GithubObject.NonCompletableGithubObject):
|
||||
class EnvironmentProtectionRule(NonCompletableGithubObject):
|
||||
"""
|
||||
This class represents a protection rule for an environment. The reference can be found here https://docs.github.com/en/rest/reference/deployments#environments
|
||||
"""
|
||||
|
||||
def _initAttributes(self):
|
||||
self._id: Attribute[int] = NotSet
|
||||
self._node_id: Attribute[str] = NotSet
|
||||
self._type: Attribute[str] = NotSet
|
||||
self._reviewers: Attribute[list[EnvironmentProtectionRuleReviewer]] = NotSet
|
||||
self._wait_timer: Attribute[int] = NotSet
|
||||
|
||||
def __repr__(self):
|
||||
return self.get__repr__({"id": self._id.value})
|
||||
|
||||
@@ -49,20 +60,13 @@ class EnvironmentProtectionRule(github.GithubObject.NonCompletableGithubObject):
|
||||
@property
|
||||
def reviewers(
|
||||
self,
|
||||
) -> List[github.EnvironmentProtectionRuleReviewer.EnvironmentProtectionRuleReviewer]:
|
||||
) -> list[EnvironmentProtectionRuleReviewer]:
|
||||
return self._reviewers.value
|
||||
|
||||
@property
|
||||
def wait_timer(self) -> int:
|
||||
return self._wait_timer.value
|
||||
|
||||
def _initAttributes(self):
|
||||
self._id = github.GithubObject.NotSet
|
||||
self._node_id = github.GithubObject.NotSet
|
||||
self._type = github.GithubObject.NotSet
|
||||
self._reviewers = github.GithubObject.NotSet
|
||||
self._wait_timer = github.GithubObject.NotSet
|
||||
|
||||
def _useAttributes(self, attributes):
|
||||
if "id" in attributes: # pragma no branch
|
||||
self._id = self._makeIntAttribute(attributes["id"])
|
||||
|
||||
Reference in New Issue
Block a user