diff options
| author | 2024-11-20 01:17:40 -0500 | |
|---|---|---|
| committer | 2024-11-20 01:17:40 -0500 | |
| commit | 3e3ebe586385a83b10c8f1d0b9ba9b67c8b56d2f (patch) | |
| tree | 5682f748fc9867166043734aad44e1734d16abeb /pkb_client/client/domain.py | |
| parent | fa197fe27b8a03bbf4504476f842956ece2c76c9 (diff) | |
New upstream version 2.0.0.upstream/2.0.0
Diffstat (limited to 'pkb_client/client/domain.py')
| -rw-r--r-- | pkb_client/client/domain.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/pkb_client/client/domain.py b/pkb_client/client/domain.py new file mode 100644 index 0000000..a44a904 --- /dev/null +++ b/pkb_client/client/domain.py @@ -0,0 +1,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"]), + ) |
