Merge some simple class' type stubs back to source (#2570)

This commit is contained in:
Trim21
2023-07-11 15:57:16 +02:00
committed by GitHub
parent 61f9ae6c4b
commit 8bdfc3a0d7
38 changed files with 302 additions and 711 deletions
+16 -15
View File
@@ -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