-
-
Notifications
You must be signed in to change notification settings - Fork 198
/
typing.py
47 lines (37 loc) · 1.32 KB
/
typing.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from udsoncan.common.DidCodec import DidCodec
from typing import Dict, Optional, Any, Callable, Union, Type
import sys
if sys.version_info < (3, 8):
class TypedDict:
def __init_subclass__(cls, *args, **kwargs):
pass
else:
from typing import TypedDict
SecurityAlgoType = Callable[[int, bytes, Any], bytes]
CodecDefinition = Union[str, DidCodec, Type[DidCodec]]
DIDConfig = Dict[int, CodecDefinition]
class IOConfigEntry(TypedDict, total=False):
codec: CodecDefinition
mask: Optional[Dict[str, int]]
mask_size: Optional[int]
IOConfig = Dict[int, Union[IOConfigEntry, CodecDefinition]]
class ClientConfig(TypedDict, total=False):
exception_on_negative_response: bool
exception_on_invalid_response: bool
exception_on_unexpected_response: bool
security_algo: Optional[SecurityAlgoType]
security_algo_params: Optional[Any]
tolerate_zero_padding: bool
ignore_all_zero_dtc: bool
dtc_snapshot_did_size: int
server_address_format: Optional[int]
server_memorysize_format: Optional[int]
data_identifiers: Dict[int, CodecDefinition]
input_output: IOConfig
request_timeout: float
p2_timeout: float
p2_star_timeout: float
standard_version: int
use_server_timing: bool
logger_name: str
extended_data_size: Optional[Union[int, Dict[int, int]]]