massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / Werkzeug / werkzeug / exceptions.pyi
1 import datetime
2 from _typeshed.wsgi import StartResponse, WSGIEnvironment
3 from typing import Any, Iterable, NoReturn, Protocol, Text, Tuple, Type
4
5 from werkzeug.wrappers import Response
6
7 class _EnvironContainer(Protocol):
8     @property
9     def environ(self) -> WSGIEnvironment: ...
10
11 class HTTPException(Exception):
12     code: int | None
13     description: Text | None
14     response: Response | None
15     def __init__(self, description: Text | None = ..., response: Response | None = ...) -> None: ...
16     @classmethod
17     def wrap(cls, exception: Type[Exception], name: str | None = ...) -> Any: ...
18     @property
19     def name(self) -> str: ...
20     def get_description(self, environ: WSGIEnvironment | None = ...) -> Text: ...
21     def get_body(self, environ: WSGIEnvironment | None = ...) -> Text: ...
22     def get_headers(self, environ: WSGIEnvironment | None = ...) -> list[tuple[str, str]]: ...
23     def get_response(self, environ: WSGIEnvironment | _EnvironContainer | None = ...) -> Response: ...
24     def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ...
25
26 default_exceptions: dict[int, Type[HTTPException]]
27
28 class BadRequest(HTTPException):
29     code: int
30     description: Text
31
32 class ClientDisconnected(BadRequest): ...
33 class SecurityError(BadRequest): ...
34 class BadHost(BadRequest): ...
35
36 class Unauthorized(HTTPException):
37     code: int
38     description: Text
39     www_authenticate: Iterable[object] | None
40     def __init__(
41         self,
42         description: Text | None = ...,
43         response: Response | None = ...,
44         www_authenticate: None | Tuple[object, ...] | list[object] | object = ...,
45     ) -> None: ...
46
47 class Forbidden(HTTPException):
48     code: int
49     description: Text
50
51 class NotFound(HTTPException):
52     code: int
53     description: Text
54
55 class MethodNotAllowed(HTTPException):
56     code: int
57     description: Text
58     valid_methods: Any
59     def __init__(self, valid_methods: Any | None = ..., description: Any | None = ...): ...
60
61 class NotAcceptable(HTTPException):
62     code: int
63     description: Text
64
65 class RequestTimeout(HTTPException):
66     code: int
67     description: Text
68
69 class Conflict(HTTPException):
70     code: int
71     description: Text
72
73 class Gone(HTTPException):
74     code: int
75     description: Text
76
77 class LengthRequired(HTTPException):
78     code: int
79     description: Text
80
81 class PreconditionFailed(HTTPException):
82     code: int
83     description: Text
84
85 class RequestEntityTooLarge(HTTPException):
86     code: int
87     description: Text
88
89 class RequestURITooLarge(HTTPException):
90     code: int
91     description: Text
92
93 class UnsupportedMediaType(HTTPException):
94     code: int
95     description: Text
96
97 class RequestedRangeNotSatisfiable(HTTPException):
98     code: int
99     description: Text
100     length: Any
101     units: str
102     def __init__(self, length: Any | None = ..., units: str = ..., description: Any | None = ...): ...
103
104 class ExpectationFailed(HTTPException):
105     code: int
106     description: Text
107
108 class ImATeapot(HTTPException):
109     code: int
110     description: Text
111
112 class UnprocessableEntity(HTTPException):
113     code: int
114     description: Text
115
116 class Locked(HTTPException):
117     code: int
118     description: Text
119
120 class FailedDependency(HTTPException):
121     code: int
122     description: Text
123
124 class PreconditionRequired(HTTPException):
125     code: int
126     description: Text
127
128 class _RetryAfter(HTTPException):
129     retry_after: None | int | datetime.datetime
130     def __init__(
131         self, description: Text | None = ..., response: Response | None = ..., retry_after: None | int | datetime.datetime = ...
132     ) -> None: ...
133
134 class TooManyRequests(_RetryAfter):
135     code: int
136     description: Text
137
138 class RequestHeaderFieldsTooLarge(HTTPException):
139     code: int
140     description: Text
141
142 class UnavailableForLegalReasons(HTTPException):
143     code: int
144     description: Text
145
146 class InternalServerError(HTTPException):
147     def __init__(
148         self, description: Text | None = ..., response: Response | None = ..., original_exception: Exception | None = ...
149     ) -> None: ...
150     code: int
151     description: Text
152
153 class NotImplemented(HTTPException):
154     code: int
155     description: Text
156
157 class BadGateway(HTTPException):
158     code: int
159     description: Text
160
161 class ServiceUnavailable(_RetryAfter):
162     code: int
163     description: Text
164
165 class GatewayTimeout(HTTPException):
166     code: int
167     description: Text
168
169 class HTTPVersionNotSupported(HTTPException):
170     code: int
171     description: Text
172
173 class Aborter:
174     mapping: Any
175     def __init__(self, mapping: Any | None = ..., extra: Any | None = ...) -> None: ...
176     def __call__(self, code: int | Response, *args: Any, **kwargs: Any) -> NoReturn: ...
177
178 def abort(status: int | Response, *args: Any, **kwargs: Any) -> NoReturn: ...
179
180 class BadRequestKeyError(BadRequest, KeyError): ...