blob: a44a904d9a0122904c841af7ab03442825f399a6 (
plain) (
blame)
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
|
from dataclasses import dataclass
from datetime import datetime
@dataclass
class DomainInfo:
domain: str
status: str
tld: str
create_date: datetime
expire_date: datetime
security_lock: bool
whois_privacy: bool
auto_renew: bool
not_local: bool
@staticmethod
def from_dict(d):
return DomainInfo(
domain=d["domain"],
status=d["status"],
tld=d["tld"],
create_date=datetime.fromisoformat(d["createDate"]),
expire_date=datetime.fromisoformat(d["expireDate"]),
security_lock=bool(d["securityLock"]),
whois_privacy=bool(d["whoisPrivacy"]),
auto_renew=bool(d["autoRenew"]),
not_local=bool(d["notLocal"]),
)
|