-
Notifications
You must be signed in to change notification settings - Fork 1
/
models.py
54 lines (45 loc) · 1.15 KB
/
models.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
48
49
50
51
52
53
54
from datetime import datetime, timezone
from fastapi import Query
from pydantic import BaseModel
class CreateDomain(BaseModel):
wallet: str = Query(...)
domain: str = Query(...)
cf_token: str = Query(...)
cf_zone_id: str = Query(...)
webhook: str = Query("")
description: str = Query(..., min_length=0)
cost: int = Query(..., ge=0)
allowed_record_types: str = Query(...)
class CreateSubdomain(BaseModel):
domain: str = Query(...)
subdomain: str = Query(...)
email: str = Query(...)
ip: str = Query(...)
sats: int = Query(..., ge=0)
duration: int = Query(...)
record_type: str = Query(...)
class Domain(BaseModel):
id: str
wallet: str
domain: str
cf_token: str
cf_zone_id: str
webhook: str
description: str
cost: int
allowed_record_types: str
amountmade: int = 0
time: datetime = datetime.now(timezone.utc)
class Subdomain(BaseModel):
id: str
wallet: str
domain: str
domain_name: str
subdomain: str
email: str
ip: str
sats: int
duration: int
record_type: str
paid: bool = False
time: datetime = datetime.now(timezone.utc)