mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 19:31:10 +00:00
Merge some simple class' type stubs back to source (#2570)
This commit is contained in:
@@ -20,35 +20,36 @@
|
||||
# #
|
||||
################################################################################
|
||||
|
||||
import github.GithubObject
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import github.Repository
|
||||
from github.GithubObject import Attribute, NonCompletableGithubObject, NotSet
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from github.Repository import Repository
|
||||
|
||||
|
||||
class RepositoryPreferences(github.GithubObject.NonCompletableGithubObject):
|
||||
class RepositoryPreferences(NonCompletableGithubObject):
|
||||
"""
|
||||
This class represents repository preferences.
|
||||
The reference can be found here https://docs.github.com/en/free-pro-team@latest/rest/reference/checks#update-repository-preferences-for-check-suites
|
||||
"""
|
||||
|
||||
def _initAttributes(self) -> None:
|
||||
self._preferences: Attribute[dict[str, list[dict[str, bool | int]]]] = NotSet
|
||||
self._repository: Attribute[Repository] = NotSet
|
||||
|
||||
@property
|
||||
def preferences(self):
|
||||
"""
|
||||
:type: dict
|
||||
"""
|
||||
def preferences(self) -> dict[str, list[dict[str, bool | int]]]:
|
||||
return self._preferences.value
|
||||
|
||||
@property
|
||||
def repository(self):
|
||||
"""
|
||||
:type: :class:`github.Repository.Repository`
|
||||
"""
|
||||
def repository(self) -> Repository:
|
||||
return self._repository.value
|
||||
|
||||
def _initAttributes(self):
|
||||
self._preferences = github.GithubObject.NotSet
|
||||
self._repository = github.GithubObject.NotSet
|
||||
|
||||
def _useAttributes(self, attributes):
|
||||
def _useAttributes(self, attributes) -> None:
|
||||
if "preferences" in attributes: # pragma no branch
|
||||
self._preferences = self._makeDictAttribute(attributes["preferences"])
|
||||
if "repository" in attributes: # pragma no branch
|
||||
|
||||
Reference in New Issue
Block a user