massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / caldav / caldav / davclient.pyi
1 from collections.abc import Iterable, Mapping
2 from typing import Any
3 from urllib.parse import ParseResult, SplitResult
4
5 from requests.auth import AuthBase
6 from requests.models import Response
7 from requests.structures import CaseInsensitiveDict
8
9 from .lib.url import URL
10 from .objects import Calendar, DAVObject, Principal
11
12 _Element = Any  # actually lxml.etree._Element
13
14 class DAVResponse:
15     reason: str
16     tree: _Element | None
17     status: int
18     headers: CaseInsensitiveDict[str]
19     objects: dict[str, dict[str, str]]  # only defined after call to find_objects_and_props()
20     def __init__(self, response: Response) -> None: ...
21     @property
22     def raw(self) -> str: ...
23     def validate_status(self, status: str) -> None: ...
24     def find_objects_and_props(self) -> None: ...
25     def expand_simple_props(
26         self, props: Iterable[Any] = ..., multi_value_props: Iterable[Any] = ..., xpath: str | None = ...
27     ) -> dict[str, dict[str, str]]: ...
28
29 class DAVClient:
30     proxy: str | None
31     url: URL
32     headers: dict[str, str]
33     username: str | None
34     password: str | None
35     auth: AuthBase | None
36     ssl_verify_cert: bool | str
37     ssl_cert: str | tuple[str, str] | None
38     def __init__(
39         self,
40         url: str,
41         proxy: str | None = ...,
42         username: str | None = ...,
43         password: str | None = ...,
44         auth: AuthBase | None = ...,
45         ssl_verify_cert: bool | str = ...,
46         ssl_cert: str | tuple[str, str] | None = ...,
47     ) -> None: ...
48     def principal(self, *, url: str | ParseResult | SplitResult | URL | None = ...) -> Principal: ...
49     def calendar(
50         self,
51         url: str | ParseResult | SplitResult | URL | None = ...,
52         parent: DAVObject | None = ...,
53         name: str | None = ...,
54         id: str | None = ...,
55         props: Mapping[Any, Any] = ...,
56         **extra: Any,
57     ) -> Calendar: ...
58     def check_dav_support(self) -> str | None: ...
59     def check_cdav_support(self) -> bool: ...
60     def check_scheduling_support(self) -> bool: ...
61     def propfind(self, url: str | None = ..., props: str = ..., depth: int = ...) -> DAVResponse: ...
62     def proppatch(self, url: str, body: str, dummy: None = ...) -> DAVResponse: ...
63     def report(self, url: str, query: str = ..., depth: int = ...) -> DAVResponse: ...
64     def mkcol(self, url: str, body: str, dummy: None = ...) -> DAVResponse: ...
65     def mkcalendar(self, url: str, body: str = ..., dummy: None = ...) -> DAVResponse: ...
66     def put(self, url: str, body: str, headers: Mapping[str, str] = ...) -> DAVResponse: ...
67     def post(self, url: str, body: str, headers: Mapping[str, str] = ...) -> DAVResponse: ...
68     def delete(self, url: str) -> DAVResponse: ...
69     def options(self, url: str) -> DAVResponse: ...
70     def request(self, url: str, method: str = ..., body: str = ..., headers: Mapping[str, str] = ...) -> DAVResponse: ...