-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.py
More file actions
58 lines (43 loc) · 1.63 KB
/
types.py
File metadata and controls
58 lines (43 loc) · 1.63 KB
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
48
49
50
51
52
53
54
55
56
57
58
"""Public data types returned by the OpenDecree SDK.
All types are frozen, slotted dataclasses — immutable and fast.
"""
from __future__ import annotations
from dataclasses import dataclass
@dataclass(frozen=True, slots=True)
class Change:
"""A configuration change event from a subscription.
Attributes:
field_path: Dot-separated field path that changed.
old_value: Previous value as a string, or ``None`` if newly created.
new_value: New value as a string, or ``None`` if set to null.
version: Config version number after this change.
changed_by: Identity of who made the change.
"""
field_path: str
old_value: str | None
new_value: str | None
version: int
changed_by: str = ""
@dataclass(frozen=True, slots=True)
class FieldUpdate:
"""A single field update for use with :meth:`ConfigClient.set_many`.
Attributes:
field_path: Dot-separated field path (e.g., ``"payments.fee"``).
value: The value as a string.
expected_checksum: When set, the server rejects the write if the
current value's checksum does not match (optimistic concurrency).
value_description: Optional description stored with this specific value.
"""
field_path: str
value: str
expected_checksum: str | None = None
value_description: str | None = None
@dataclass(frozen=True, slots=True)
class ServerVersion:
"""Server version information from the ServerService.
Attributes:
version: Semantic version string (e.g., ``"0.3.1"``).
commit: Git commit hash of the server build.
"""
version: str
commit: str