massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / third_party / 2and3 / pynamodb / attributes.pyi
1 from typing import Any, Callable, Dict, Generic, Iterable, List, Mapping, Optional, Text, Type, TypeVar, Union, Set\r
2 \r
3 from datetime import datetime\r
4 \r
5 _T = TypeVar('_T')\r
6 _KT = TypeVar('_KT')\r
7 _VT = TypeVar('_VT')\r
8 _MT = TypeVar('_MT', bound='MapAttribute')\r
9 \r
10 class Attribute(Generic[_T]):\r
11     attr_name: Optional[Text]\r
12     attr_type: Text\r
13     null: bool\r
14     default: Any\r
15     is_hash_key: bool\r
16     is_range_key: bool\r
17     def __init__(self, hash_key: bool = ..., range_key: bool = ..., null: Optional[bool] = ..., default: Optional[Union[_T, Callable[..., _T]]] = ..., attr_name: Optional[Text] = ...) -> None: ...\r
18     def __set__(self, instance: Any, value: Optional[_T]) -> None: ...\r
19     def serialize(self, value: Any) -> Any: ...\r
20     def deserialize(self, value: Any) -> Any: ...\r
21     def get_value(self, value: Any) -> Any: ...\r
22     def between(self, lower: Any, upper: Any) -> Any: ...\r
23     def is_in(self, *values: Any) -> Any: ...\r
24     def exists(self) -> Any: ...\r
25     def does_not_exist(self) -> Any: ...\r
26     def is_type(self) -> Any: ...\r
27     def startswith(self, prefix: str) -> Any: ...\r
28     def contains(self, item: Any) -> Any: ...\r
29     def append(self, other: Any) -> Any: ...\r
30     def prepend(self, other: Any) -> Any: ...\r
31     def set(self, value: Any) -> Any: ...\r
32     def remove(self) -> Any: ...\r
33     def add(self, *values: Any) -> Any: ...\r
34     def delete(self, *values: Any) -> Any: ...\r
35 \r
36 class SetMixin(object):\r
37     def serialize(self, value): ...\r
38     def deserialize(self, value): ...\r
39 \r
40 class BinaryAttribute(Attribute[bytes]):\r
41     def __get__(self, instance: Any, owner: Any) -> bytes: ...\r
42 \r
43 class BinarySetAttribute(SetMixin, Attribute[Set[bytes]]):\r
44     def __get__(self, instance: Any, owner: Any) -> Set[bytes]: ...\r
45 \r
46 class UnicodeSetAttribute(SetMixin, Attribute[Set[Text]]):\r
47     def element_serialize(self, value: Any) -> Any: ...\r
48     def element_deserialize(self, value: Any) -> Any: ...\r
49     def __get__(self, instance: Any, owner: Any) -> Set[Text]: ...\r
50 \r
51 class UnicodeAttribute(Attribute[Text]):\r
52     def __get__(self, instance: Any, owner: Any) -> Text: ...\r
53 \r
54 class JSONAttribute(Attribute[Any]):\r
55     def __get__(self, instance: Any, owner: Any) -> Any: ...\r
56 \r
57 class LegacyBooleanAttribute(Attribute[bool]):\r
58     def __get__(self, instance: Any, owner: Any) -> bool: ...\r
59 \r
60 class BooleanAttribute(Attribute[bool]):\r
61     def __get__(self, instance: Any, owner: Any) -> bool: ...\r
62 \r
63 class NumberSetAttribute(SetMixin, Attribute[Set[float]]):\r
64     def __get__(self, instance: Any, owner: Any) -> Set[float]: ...\r
65 \r
66 class NumberAttribute(Attribute[float]):\r
67     def __get__(self, instance: Any, owner: Any) -> float: ...\r
68 \r
69 class UTCDateTimeAttribute(Attribute[datetime]):\r
70     def __get__(self, instance: Any, owner: Any) -> datetime: ...\r
71 \r
72 class NullAttribute(Attribute[None]):\r
73     def __get__(self, instance: Any, owner: Any) -> None: ...\r
74 \r
75 class MapAttributeMeta(type):\r
76     def __init__(cls, name, bases, attrs) -> None: ...\r
77 \r
78 class MapAttribute(Generic[_KT, _VT], Attribute[Mapping[_KT, _VT]], metaclass=MapAttributeMeta):\r
79     attribute_values: Any\r
80     def __init__(self, hash_key: bool = ..., range_key: bool = ..., null: Optional[bool] = ..., default: Optional[Union[Any, Callable[..., Any]]] = ..., attr_name: Optional[Text] = ..., **attrs) -> None: ...\r
81     def __iter__(self) -> Iterable[_VT]: ...\r
82     def __getattr__(self, attr: str) -> _VT: ...\r
83     def __getitem__(self, item: _KT) -> _VT: ...\r
84     def __set__(self, instance: Any, value: Union[None, MapAttribute[_KT, _VT], Mapping[_KT, _VT]]) -> None: ...\r
85     def __get__(self: _MT, instance: Any, owner: Any) -> _MT: ...\r
86     def is_type_safe(self, key: Any, value: Any) -> bool: ...\r
87     def validate(self) -> bool: ...\r
88 \r
89 class ListAttribute(Generic[_T], Attribute[List[_T]]):\r
90     element_type: Any\r
91     def __init__(self, hash_key: bool = ..., range_key: bool = ..., null: Optional[bool] = ..., default: Optional[Union[Any, Callable[..., Any]]] = ..., attr_name: Optional[Text] = ..., of: Optional[Type[_T]] = ...) -> None: ...\r
92     def __get__(self, instance: Any, owner: Any) -> List[_T]: ...\r
93 \r
94 DESERIALIZE_CLASS_MAP: Dict[Text, Attribute]\r
95 SERIALIZE_CLASS_MAP: Dict[Type, Attribute]\r
96 SERIALIZE_KEY_MAP: Dict[Type, Text]\r