-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added support for new domain functionality api methods refs #12
- Loading branch information
1 parent
8fbe088
commit a02d0c4
Showing
3 changed files
with
175 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"]), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from dataclasses import dataclass | ||
from enum import Enum | ||
|
||
|
||
class URLForwardingType(str, Enum): | ||
temporary = "temporary" | ||
permanent = "permanent" | ||
|
||
|
||
@dataclass | ||
class URLForwarding: | ||
id: str | ||
subdomain: str | ||
location: str | ||
type: URLForwardingType | ||
include_path: bool | ||
wildcard: bool | ||
|
||
@staticmethod | ||
def from_dict(d): | ||
return URLForwarding( | ||
id=d["id"], | ||
subdomain=d["subdomain"], | ||
location=d["location"], | ||
type=URLForwardingType[d["type"]], | ||
include_path=d["includePath"] == "yes", | ||
wildcard=d["wildcard"] == "yes", | ||
) |