-
-
Notifications
You must be signed in to change notification settings - Fork 449
Expand file tree
/
Copy pathconstructs.py
More file actions
76 lines (57 loc) · 1.59 KB
/
Copy pathconstructs.py
File metadata and controls
76 lines (57 loc) · 1.59 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# generated by datamodel-codegen:
# filename: constructs.avsc
# timestamp: 2019-07-26T00:00:00+00:00
from __future__ import annotations
from datetime import date, time, timedelta
from decimal import Decimal
from enum import Enum
from uuid import UUID
from pydantic import AwareDatetime, BaseModel, Field, NaiveDatetime, RootModel, conbytes
class Status(Enum):
ACTIVE = 'ACTIVE'
INACTIVE = 'INACTIVE'
class Address(BaseModel):
street: str
zip: str | None
class MD5(RootModel[conbytes(min_length=16, max_length=16)]):
root: conbytes(min_length=16, max_length=16) = Field(..., title='MD5')
class TraceId(RootModel[UUID]):
root: UUID = Field(..., title='TraceId')
class TaxDecimal(RootModel[Decimal]):
root: Decimal = Field(..., title='TaxDecimal')
class Duration(RootModel[timedelta]):
root: timedelta = Field(..., title='Duration')
class User(BaseModel):
id: UUID
"""
Stable identifier
"""
active: bool
age: int
visits: int
score: float
rating: float
payload: bytes
status: Status
tags: list[str]
attributes: dict[str, str]
address: Address
previous: User | None
hash: MD5
traceId: TraceId
price: Decimal
tax: TaxDecimal
flexibleAmount: Decimal
birthDate: date
startTime: time
endTime: time
createdAt: AwareDatetime
updatedAt: AwareDatetime
processedAt: AwareDatetime
localCreatedAt: NaiveDatetime
localUpdatedAt: NaiveDatetime
localProcessedAt: NaiveDatetime
duration: Duration
choice: str | int | None
rawDecimalText: str
User.model_rebuild()