Files
PyGithub/github/GithubException.pyi
T
Emily 6eba4506d4 Improve type stubs (#1489)
* Add type stubs for GithubException subclasses

* Install type stubs per PEP 561

See https://mypy.readthedocs.io/en/stable/installed_packages.html#making-pep-561-compatible-packages.

* Make PaginatedList a generic type

* Add type stubs for __init__.py

* Add type stub for NamedUser.get_projects

* Add GithubObject superclasses to type stubs

Fixes #1490
2020-05-01 12:00:00 +10:00

43 lines
1.4 KiB
Python

from typing import Any, Dict, List, Optional, Tuple, Type, Union
class GithubException(Exception):
def __init__(self, status: Union[int, str], data: Any,) -> None: ...
def __str__(self) -> str: ...
@property
def data(self) -> Dict[str, Union[str, List[str], List[Dict[str, str]]]]: ...
@property
def status(self) -> int: ...
class BadAttributeException(GithubException):
def __init__(
self,
actualValue: Any,
expectedType: Union[
Dict[Tuple[Type[str], Type[str]], Type[dict]],
Tuple[Type[str], Type[str]],
List[Type[dict]],
List[Tuple[Type[str], Type[str]]],
],
transformationException: Optional[ValueError],
) -> None: ...
@property
def actual_value(self) -> Any: ...
@property
def expected_type(
self,
) -> Union[
List[Type[dict]],
Tuple[Type[str], Type[str]],
Dict[Tuple[Type[str], Type[str]], Type[dict]],
List[Tuple[Type[str], Type[str]]],
]: ...
@property
def transformation_exception(self) -> Optional[ValueError]: ...
class BadCredentialsException(GithubException): ...
class UnknownObjectException(GithubException): ...
class BadUserAgentException(GithubException): ...
class RateLimitExceededException(GithubException): ...
class TwoFactorException(GithubException): ...
class IncompletableObject(GithubException): ...